archive_acl_clear:
  129|   793k|{
  130|   793k|	struct archive_acl_entry *ap;
  131|       |
  132|   794k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 1.05k, False: 793k]
  ------------------
  133|  1.05k|		ap = acl->acl_head->next;
  134|  1.05k|		archive_mstring_clean(&acl->acl_head->name);
  135|  1.05k|		free(acl->acl_head);
  136|  1.05k|		acl->acl_head = ap;
  137|  1.05k|	}
  138|   793k|	free(acl->acl_text_w);
  139|   793k|	acl->acl_text_w = NULL;
  140|   793k|	free(acl->acl_text);
  141|   793k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   793k|	acl->acl_types = 0;
  144|   793k|	acl->acl_state = 0; /* Not counting. */
  145|   793k|}
archive_acl_count:
  380|    549|{
  381|    549|	int count;
  382|    549|	struct archive_acl_entry *ap;
  383|       |
  384|    549|	count = 0;
  385|    549|	ap = acl->acl_head;
  386|  1.60k|	while (ap != NULL) {
  ------------------
  |  Branch (386:9): [True: 1.05k, False: 549]
  ------------------
  387|  1.05k|		if ((ap->type & want_type) != 0)
  ------------------
  |  Branch (387:7): [True: 1.05k, False: 0]
  ------------------
  388|  1.05k|			count++;
  389|  1.05k|		ap = ap->next;
  390|  1.05k|	}
  391|       |
  392|    549|	if (count > 0 && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0))
  ------------------
  |  |  534|    173|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (392:6): [True: 173, False: 376]
  |  Branch (392:19): [True: 94, False: 79]
  ------------------
  393|     94|		count += 3;
  394|    549|	return (count);
  395|    549|}
archive_acl_reset:
  413|    549|{
  414|    549|	int count, cutoff;
  415|       |
  416|    549|	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|    549|	if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
  ------------------
  |  |  534|    549|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (423:6): [True: 160, False: 389]
  ------------------
  424|    160|		cutoff = 3;
  425|    389|	else
  426|    389|		cutoff = 0;
  427|       |
  428|    549|	if (count > cutoff)
  ------------------
  |  Branch (428:6): [True: 173, False: 376]
  ------------------
  429|    173|		acl->acl_state = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    173|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  430|    376|	else
  431|    376|		acl->acl_state = 0;
  432|    549|	acl->acl_p = acl->acl_head;
  433|    549|	return (count);
  434|    549|}
archive_acl_from_text_l:
 1506|    517|{
 1507|    517|	return archive_acl_from_text_nl(acl, text, strlen(text), want_type, sc);
 1508|    517|}
archive_acl_from_text_nl:
 1513|    551|{
 1514|    551|	struct {
 1515|    551|		const char *start;
 1516|    551|		const char *end;
 1517|    551|	} field[6], name;
 1518|       |
 1519|    551|	const char *s, *st, *text_end;
 1520|    551|	int numfields, fields, n, r, sol, ret;
 1521|    551|	int type, types, tag, permset, id;
 1522|    551|	size_t len;
 1523|    551|	char sep;
 1524|       |
 1525|    551|	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: 551]
  ------------------
 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|    295|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|    295|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (1529:2): [True: 295, False: 256]
  ------------------
 1530|    313|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|    313|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (1530:2): [True: 18, False: 533]
  ------------------
 1531|    313|		numfields = 5;
 1532|    313|		break;
 1533|    238|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  542|    238|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    238|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    238|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    238|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    238|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    238|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    238|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    238|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1533:2): [True: 238, False: 313]
  ------------------
 1534|    238|		numfields = 6;
 1535|    238|		break;
 1536|      0|	default:
  ------------------
  |  Branch (1536:2): [True: 0, False: 551]
  ------------------
 1537|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|    551|	}
 1539|       |
 1540|    551|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    551|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1541|    551|	types = 0;
 1542|    551|	text_end = (text == NULL) ? text : text + length;
  ------------------
  |  Branch (1542:13): [True: 0, False: 551]
  ------------------
 1543|       |
 1544|  26.6k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1544:9): [True: 26.6k, False: 0]
  |  Branch (1544:25): [True: 26.0k, False: 531]
  |  Branch (1544:39): [True: 26.0k, False: 18]
  ------------------
 1545|       |		/*
 1546|       |		 * Parse the fields out of the next entry,
 1547|       |		 * advance 'text' to start of next entry.
 1548|       |		 */
 1549|  26.0k|		fields = 0;
 1550|  48.5k|		do {
 1551|  48.5k|			const char *start, *end;
 1552|  48.5k|			next_field(&text, &length, &start, &end, &sep);
 1553|  48.5k|			if (fields < numfields) {
  ------------------
  |  Branch (1553:8): [True: 46.8k, False: 1.75k]
  ------------------
 1554|  46.8k|				field[fields].start = start;
 1555|  46.8k|				field[fields].end = end;
 1556|  46.8k|			}
 1557|  48.5k|			++fields;
 1558|  48.5k|		} while (sep == ':');
  ------------------
  |  Branch (1558:12): [True: 22.5k, False: 26.0k]
  ------------------
 1559|       |
 1560|       |		/* Set remaining fields to blank. */
 1561|   116k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1561:20): [True: 90.8k, False: 26.0k]
  ------------------
 1562|  90.8k|			field[n].start = field[n].end = NULL;
 1563|       |
 1564|  26.0k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1564:7): [True: 0, False: 26.0k]
  |  Branch (1564:33): [True: 0, False: 26.0k]
  ------------------
 1565|       |			/* This should never happen */
 1566|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1567|      0|		}
 1568|       |
 1569|  26.0k|		if (field[0].start == text_end) {
  ------------------
  |  Branch (1569:7): [True: 26, False: 26.0k]
  ------------------
 1570|       |			/*
 1571|       |			 * Empty entry: next_field() consumed the rest of the
 1572|       |			 * buffer as separators or whitespace, leaving
 1573|       |			 * field[0].start one past the end.  'text' is not
 1574|       |			 * guaranteed to be NUL terminated, so the byte after it
 1575|       |			 * must not be dereferenced.
 1576|       |			 */
 1577|     26|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     26|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|     26|			continue;
 1579|     26|		}
 1580|       |
 1581|  26.0k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1581:7): [True: 236, False: 25.8k]
  ------------------
 1582|       |			/* Comment, skip entry */
 1583|    236|			continue;
 1584|    236|		}
 1585|       |
 1586|  25.8k|		n = 0;
 1587|  25.8k|		sol = 0;
 1588|  25.8k|		id = -1;
 1589|  25.8k|		permset = 0;
 1590|  25.8k|		name.start = name.end = NULL;
 1591|       |
 1592|  25.8k|		if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  25.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  25.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  25.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  25.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  25.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  25.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  25.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  25.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1592:7): [True: 18.6k, False: 7.11k]
  ------------------
 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|  18.6k|			s = field[0].start;
 1603|  18.6k|			len = field[0].end - field[0].start;
 1604|  18.6k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1604:8): [True: 2.54k, False: 16.1k]
  |  Branch (1604:22): [True: 1.86k, False: 682]
  |  Branch (1604:35): [True: 218, False: 464]
  ------------------
 1605|  1.97k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1605:11): [True: 108, False: 110]
  ------------------
 1606|  1.97k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  535|  1.97k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1607|  1.97k|				if (len > 7)
  ------------------
  |  Branch (1607:9): [True: 108, False: 1.86k]
  ------------------
 1608|    108|					field[0].start += 7;
 1609|  1.86k|				else
 1610|  1.86k|					n = 1;
 1611|  1.97k|			} else
 1612|  16.7k|				type = want_type;
 1613|       |
 1614|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1615|  18.6k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1615:8): [True: 188, False: 18.5k]
  ------------------
 1616|  18.6k|			    &id) < 0) {
 1617|    188|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    188|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|    188|				continue;
 1619|    188|			}
 1620|       |			/* Field n+3 is optional. */
 1621|  18.5k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1621:8): [True: 18.2k, False: 276]
  |  Branch (1621:20): [True: 1.49k, False: 16.7k]
  ------------------
 1622|  1.49k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1622:8): [True: 117, False: 1.37k]
  ------------------
 1623|  1.49k|			    &id) < 0) {
 1624|    117|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    117|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1625|    117|				continue;
 1626|    117|			}
 1627|       |
 1628|  18.3k|			tag = 0;
 1629|  18.3k|			s = field[n].start;
 1630|  18.3k|			len = field[n].end - field[n].start;
 1631|       |
 1632|  18.3k|			if (len == 0) {
  ------------------
  |  Branch (1632:8): [True: 3.30k, False: 15.0k]
  ------------------
 1633|  3.30k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  3.30k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1634|  3.30k|				continue;
 1635|  3.30k|			}
 1636|       |
 1637|  15.0k|			st = s + 1; 
 1638|       |
 1639|  15.0k|			switch (*s) {
 1640|  1.45k|			case 'u':
  ------------------
  |  Branch (1640:4): [True: 1.45k, False: 13.6k]
  ------------------
 1641|  1.45k|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1641:9): [True: 846, False: 608]
  |  Branch (1641:22): [True: 264, False: 344]
  ------------------
 1642|    264|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1642:12): [True: 174, False: 90]
  ------------------
 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.45k|				break;
 1645|  1.91k|			case 'g':
  ------------------
  |  Branch (1645:4): [True: 1.91k, False: 13.1k]
  ------------------
 1646|  1.91k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1646:9): [True: 1.14k, False: 766]
  |  Branch (1646:22): [True: 314, False: 452]
  ------------------
 1647|    314|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1647:12): [True: 142, False: 172]
  ------------------
 1648|  1.29k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|  1.29k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1649|  1.91k|				break;
 1650|  1.38k|			case 'o':
  ------------------
  |  Branch (1650:4): [True: 1.38k, False: 13.7k]
  ------------------
 1651|  1.38k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1651:9): [True: 726, False: 655]
  |  Branch (1651:22): [True: 475, False: 180]
  ------------------
 1652|    475|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1652:12): [True: 336, False: 139]
  ------------------
 1653|  1.06k|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  553|  1.06k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1654|  1.38k|				break;
 1655|    738|			case 'm':
  ------------------
  |  Branch (1655:4): [True: 738, False: 14.3k]
  ------------------
 1656|    738|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1656:9): [True: 406, False: 332]
  |  Branch (1656:22): [True: 192, False: 140]
  ------------------
 1657|    192|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1657:12): [True: 42, False: 150]
  ------------------
 1658|    448|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  552|    448|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1659|    738|				break;
 1660|  9.60k|			default:
  ------------------
  |  Branch (1660:4): [True: 9.60k, False: 5.48k]
  ------------------
 1661|  9.60k|					break;
 1662|  15.0k|			}
 1663|       |
 1664|  15.0k|			switch (tag) {
 1665|  1.06k|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|  1.06k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1665:4): [True: 1.06k, False: 14.0k]
  ------------------
 1666|  1.51k|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|  1.51k|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1666:4): [True: 448, False: 14.6k]
  ------------------
 1667|  1.51k|				if (fields == (n + 2)
  ------------------
  |  Branch (1667:9): [True: 609, False: 901]
  ------------------
 1668|    609|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1668:12): [True: 607, False: 2]
  ------------------
 1669|    607|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1669:12): [True: 216, False: 391]
  ------------------
 1670|    607|				    field[n + 1].end, &permset)) {
 1671|       |					/* This is Solaris-style "other:rwx" */
 1672|    216|					sol = 1;
 1673|  1.29k|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1673:16): [True: 296, False: 998]
  ------------------
 1674|    296|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1674:9): [True: 88, False: 208]
  ------------------
 1675|       |					/* Invalid mask or other field */
 1676|     88|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     88|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1677|     88|					continue;
 1678|     88|				}
 1679|  1.42k|				break;
 1680|  1.42k|			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: 14.0k]
  ------------------
 1681|  2.31k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  2.31k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1681:4): [True: 1.29k, False: 13.8k]
  ------------------
 1682|  2.31k|				if (id != -1 ||
  ------------------
  |  Branch (1682:9): [True: 447, False: 1.86k]
  ------------------
 1683|  1.86k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1683:9): [True: 1.41k, False: 453]
  ------------------
 1684|  1.85k|					name = field[n + 1];
 1685|  1.85k|					if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
  ------------------
  |  |  549|  1.85k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1685:10): [True: 946, False: 911]
  ------------------
 1686|    946|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    946|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1687|    911|					else
 1688|    911|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    911|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1689|  1.85k|				}
 1690|  2.31k|				break;
 1691|  11.2k|			default:
  ------------------
  |  Branch (1691:4): [True: 11.2k, False: 3.82k]
  ------------------
 1692|       |				/* Invalid tag, skip entry */
 1693|  11.2k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  11.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1694|  11.2k|				continue;
 1695|  15.0k|			}
 1696|       |
 1697|       |			/*
 1698|       |			 * Without "default:" we expect mode in field 3
 1699|       |			 * Exception: Solaris other and mask fields
 1700|       |			 */
 1701|  3.73k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1701:8): [True: 3.44k, False: 292]
  |  Branch (1701:24): [True: 2.05k, False: 1.38k]
  ------------------
 1702|  3.44k|			    field[n + 2 - sol].end, &permset)) {
 1703|       |				/* Invalid mode, skip entry */
 1704|  2.05k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  2.05k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1705|  2.05k|				continue;
 1706|  2.05k|			}
 1707|  7.11k|		} else {
 1708|       |			/* NFS4 ACLs */
 1709|  7.11k|			s = field[0].start;
 1710|  7.11k|			len = field[0].end - field[0].start;
 1711|  7.11k|			tag = 0;
 1712|       |
 1713|  7.11k|			switch (len) {
 1714|    780|			case 4:
  ------------------
  |  Branch (1714:4): [True: 780, False: 6.33k]
  ------------------
 1715|    780|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1715:9): [True: 253, False: 527]
  ------------------
 1716|    253|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    253|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1717|    780|				break;
 1718|    726|			case 5:
  ------------------
  |  Branch (1718:4): [True: 726, False: 6.39k]
  ------------------
 1719|    726|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1719:9): [True: 249, False: 477]
  ------------------
 1720|    249|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    249|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1721|    726|				break;
 1722|  1.26k|			case 6:
  ------------------
  |  Branch (1722:4): [True: 1.26k, False: 5.85k]
  ------------------
 1723|  1.26k|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1723:9): [True: 432, False: 831]
  ------------------
 1724|    432|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    432|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1725|    831|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1725:14): [True: 320, False: 511]
  ------------------
 1726|    320|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|    320|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1727|  1.26k|				break;
 1728|    721|			case 9:
  ------------------
  |  Branch (1728:4): [True: 721, False: 6.39k]
  ------------------
 1729|    721|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1729:9): [True: 313, False: 408]
  ------------------
 1730|    313|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  554|    313|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1731|    721|				break;
 1732|  3.62k|			default:
  ------------------
  |  Branch (1732:4): [True: 3.62k, False: 3.49k]
  ------------------
 1733|  3.62k|				break;
 1734|  7.11k|			}
 1735|       |
 1736|  7.11k|			if (tag == 0) {
  ------------------
  |  Branch (1736:8): [True: 5.55k, False: 1.56k]
  ------------------
 1737|       |				/* Invalid tag, skip entry */
 1738|  5.55k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  5.55k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1739|  5.55k|				continue;
 1740|  5.55k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  548|  3.13k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1740:15): [True: 253, False: 1.31k]
  ------------------
 1741|  1.31k|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  550|  1.31k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1741:8): [True: 249, False: 1.06k]
  ------------------
 1742|    502|				n = 1;
 1743|    502|				name = field[1];
 1744|    502|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1744:9): [True: 73, False: 429]
  ------------------
 1745|     73|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     73|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1746|     73|					continue;
 1747|     73|				}
 1748|    502|			} else
 1749|  1.06k|				n = 0;
 1750|       |
 1751|  1.49k|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1751:8): [True: 184, False: 1.31k]
  ------------------
 1752|  1.49k|			    field[1 + n].end, &permset)) {
 1753|       |				/* Invalid NFSv4 perms, skip entry */
 1754|    184|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    184|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1755|    184|				continue;
 1756|    184|			}
 1757|  1.31k|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1757:8): [True: 287, False: 1.02k]
  ------------------
 1758|  1.31k|			    field[2 + n].end, &permset)) {
 1759|       |				/* Invalid NFSv4 flags, skip entry */
 1760|    287|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    287|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1761|    287|				continue;
 1762|    287|			}
 1763|  1.02k|			s = field[3 + n].start;
 1764|  1.02k|			len = field[3 + n].end - field[3 + n].start;
 1765|  1.02k|			type = 0;
 1766|  1.02k|			if (len == 4) {
  ------------------
  |  Branch (1766:8): [True: 298, False: 725]
  ------------------
 1767|    298|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1767:9): [True: 138, False: 160]
  ------------------
 1768|    138|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  537|    138|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1769|    725|			} else if (len == 5) {
  ------------------
  |  Branch (1769:15): [True: 366, False: 359]
  ------------------
 1770|    366|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1770:9): [True: 97, False: 269]
  ------------------
 1771|     97|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  536|     97|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1772|    269|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1772:14): [True: 34, False: 235]
  ------------------
 1773|     34|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  538|     34|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1774|    235|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1774:14): [True: 188, False: 47]
  ------------------
 1775|    188|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  539|    188|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1776|    366|			}
 1777|  1.02k|			if (type == 0) {
  ------------------
  |  Branch (1777:8): [True: 566, False: 457]
  ------------------
 1778|       |				/* Invalid entry type, skip entry */
 1779|    566|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    566|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1780|    566|				continue;
 1781|    566|			}
 1782|    457|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1782:8): [True: 90, False: 367]
  ------------------
 1783|    457|			    &id) < 0) {
 1784|     90|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     90|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1785|     90|				continue;
 1786|     90|			}
 1787|    457|		}
 1788|       |
 1789|       |		/* Add entry to the internal list. */
 1790|  2.04k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1791|  2.04k|		    tag, id, name.start, name.end - name.start, sc);
 1792|  2.04k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.04k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1792:7): [True: 2, False: 2.04k]
  ------------------
 1793|      2|			return (r);
 1794|  2.04k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 783, False: 1.25k]
  ------------------
 1795|    783|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    783|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1796|  2.04k|		types |= type;
 1797|  2.04k|	}
 1798|       |
 1799|       |	/* Reset ACL */
 1800|    549|	archive_acl_reset(acl, types);
 1801|       |
 1802|    549|	return (ret);
 1803|    551|}
archive_acl.c:acl_special:
  240|  2.04k|{
  241|  2.04k|	if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
  ------------------
  |  |  534|  4.08k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (241:6): [True: 1.53k, False: 513]
  ------------------
  242|  1.53k|	    && ((permset & ~007) == 0)) {
  ------------------
  |  Branch (242:9): [True: 1.53k, False: 0]
  ------------------
  243|  1.53k|		switch (tag) {
  ------------------
  |  Branch (243:11): [True: 497, False: 1.03k]
  ------------------
  244|     56|		case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|     56|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (244:3): [True: 56, False: 1.47k]
  ------------------
  245|     56|			acl->mode &= ~0700;
  246|     56|			acl->mode |= (permset & 7) << 6;
  247|     56|			return (0);
  248|     51|		case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|     51|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (248:3): [True: 51, False: 1.47k]
  ------------------
  249|     51|			acl->mode &= ~0070;
  250|     51|			acl->mode |= (permset & 7) << 3;
  251|     51|			return (0);
  252|    390|		case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    390|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (252:3): [True: 390, False: 1.14k]
  ------------------
  253|    390|			acl->mode &= ~0007;
  254|    390|			acl->mode |= permset & 7;
  255|    390|			return (0);
  256|  1.53k|		}
  257|  1.53k|	}
  258|  1.54k|	return (1);
  259|  2.04k|}
archive_acl.c:acl_new_entry:
  268|  1.54k|{
  269|  1.54k|	struct archive_acl_entry *ap, *aq;
  270|       |
  271|       |	/* Reject an invalid type */
  272|  1.54k|	switch (type) {
  273|  1.03k|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|  1.03k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (273:2): [True: 1.03k, False: 513]
  ------------------
  274|  1.17k|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (274:2): [True: 146, False: 1.40k]
  ------------------
  275|  1.25k|	case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
  ------------------
  |  |  536|  1.25k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
  |  Branch (275:2): [True: 80, False: 1.46k]
  ------------------
  276|  1.39k|	case ARCHIVE_ENTRY_ACL_TYPE_DENY:
  ------------------
  |  |  537|  1.39k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
  |  Branch (276:2): [True: 138, False: 1.40k]
  ------------------
  277|  1.42k|	case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
  ------------------
  |  |  538|  1.42k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
  |  Branch (277:2): [True: 26, False: 1.52k]
  ------------------
  278|  1.54k|	case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
  ------------------
  |  |  539|  1.54k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
  |  Branch (278:2): [True: 123, False: 1.42k]
  ------------------
  279|  1.54k|		break;
  280|      0|	default:
  ------------------
  |  Branch (280:2): [True: 0, False: 1.54k]
  ------------------
  281|      0|		return (NULL);
  282|  1.54k|	}
  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.54k|	if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  1.54k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  1.54k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  1.54k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  1.54k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  1.54k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  1.54k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  1.54k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  1.54k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (287:6): [True: 367, False: 1.17k]
  ------------------
  288|    367|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|    367|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    367|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    367|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    367|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    367|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    367|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    367|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    367|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (288:7): [True: 0, False: 367]
  ------------------
  289|      0|			return (NULL);
  290|      0|		}
  291|    367|		if (permset &
  ------------------
  |  Branch (291:7): [True: 0, False: 367]
  ------------------
  292|    367|		    ~(ARCHIVE_ENTRY_ACL_PERMS_NFS4
  ------------------
  |  |  495|    367|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|    367|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  496|    367|	    | ARCHIVE_ENTRY_ACL_READ_DATA		\
  |  |  ------------------
  |  |  |  |  472|    367|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  |  |  ------------------
  |  |  497|    367|	    | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 		\
  |  |  ------------------
  |  |  |  |  473|    367|#define	ARCHIVE_ENTRY_ACL_LIST_DIRECTORY      0x00000008
  |  |  ------------------
  |  |  498|    367|	    | ARCHIVE_ENTRY_ACL_WRITE_DATA		\
  |  |  ------------------
  |  |  |  |  474|    367|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  |  |  ------------------
  |  |  499|    367|	    | ARCHIVE_ENTRY_ACL_ADD_FILE		\
  |  |  ------------------
  |  |  |  |  475|    367|#define	ARCHIVE_ENTRY_ACL_ADD_FILE            0x00000010
  |  |  ------------------
  |  |  500|    367|	    | ARCHIVE_ENTRY_ACL_APPEND_DATA		\
  |  |  ------------------
  |  |  |  |  476|    367|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  |  |  ------------------
  |  |  501|    367|	    | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY	\
  |  |  ------------------
  |  |  |  |  477|    367|#define	ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY    0x00000020
  |  |  ------------------
  |  |  502|    367|	    | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  478|    367|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  |  |  ------------------
  |  |  503|    367|	    | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  479|    367|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  |  |  ------------------
  |  |  504|    367|	    | ARCHIVE_ENTRY_ACL_DELETE_CHILD		\
  |  |  ------------------
  |  |  |  |  480|    367|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  |  |  ------------------
  |  |  505|    367|	    | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES		\
  |  |  ------------------
  |  |  |  |  481|    367|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  |  |  ------------------
  |  |  506|    367|	    | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES	\
  |  |  ------------------
  |  |  |  |  482|    367|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  |  |  ------------------
  |  |  507|    367|	    | ARCHIVE_ENTRY_ACL_DELETE			\
  |  |  ------------------
  |  |  |  |  483|    367|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  |  |  ------------------
  |  |  508|    367|	    | ARCHIVE_ENTRY_ACL_READ_ACL		\
  |  |  ------------------
  |  |  |  |  484|    367|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  |  |  ------------------
  |  |  509|    367|	    | ARCHIVE_ENTRY_ACL_WRITE_ACL		\
  |  |  ------------------
  |  |  |  |  485|    367|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  |  |  ------------------
  |  |  510|    367|	    | ARCHIVE_ENTRY_ACL_WRITE_OWNER		\
  |  |  ------------------
  |  |  |  |  486|    367|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  |  |  ------------------
  |  |  511|    367|	    | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
  |  |  ------------------
  |  |  |  |  487|    367|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  |  |  ------------------
  ------------------
  293|    367|			| ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) {
  ------------------
  |  |  525|    367|	(ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT			\
  |  |  ------------------
  |  |  |  |  517|    367|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  |  |  ------------------
  |  |  526|    367|	    | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT		\
  |  |  ------------------
  |  |  |  |  518|    367|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  |  |  ------------------
  |  |  527|    367|	    | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT	\
  |  |  ------------------
  |  |  |  |  519|    367|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  |  |  ------------------
  |  |  528|    367|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY		\
  |  |  ------------------
  |  |  |  |  520|    367|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  |  |  ------------------
  |  |  529|    367|	    | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS		\
  |  |  ------------------
  |  |  |  |  521|    367|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  |  |  ------------------
  |  |  530|    367|	    | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS		\
  |  |  ------------------
  |  |  |  |  522|    367|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  |  |  ------------------
  |  |  531|    367|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
  |  |  ------------------
  |  |  |  |  516|    367|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  |  |  ------------------
  ------------------
  294|      0|			return (NULL);
  295|      0|		}
  296|  1.17k|	} else	if (type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.17k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (296:13): [True: 1.17k, False: 0]
  ------------------
  297|  1.17k|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.17k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (297:7): [True: 0, False: 1.17k]
  ------------------
  298|      0|			return (NULL);
  299|      0|		}
  300|  1.17k|		if (permset & ~ARCHIVE_ENTRY_ACL_PERMS_POSIX1E) {
  ------------------
  |  |  490|  1.17k|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|  1.17k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  491|  1.17k|	    | ARCHIVE_ENTRY_ACL_WRITE			\
  |  |  ------------------
  |  |  |  |  470|  1.17k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  |  |  ------------------
  |  |  492|  1.17k|	    | ARCHIVE_ENTRY_ACL_READ)
  |  |  ------------------
  |  |  |  |  471|  1.17k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  |  |  ------------------
  ------------------
  |  Branch (300:7): [True: 0, False: 1.17k]
  ------------------
  301|      0|			return (NULL);
  302|      0|		}
  303|  1.17k|	} else {
  304|      0|		return (NULL);
  305|      0|	}
  306|       |
  307|       |	/* Verify the tag is valid and compatible with NFS4 or POSIX.1e. */
  308|  1.54k|	switch (tag) {
  309|    347|	case ARCHIVE_ENTRY_ACL_USER:
  ------------------
  |  |  548|    347|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (309:2): [True: 347, False: 1.19k]
  ------------------
  310|    496|	case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    496|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (310:2): [True: 149, False: 1.39k]
  ------------------
  311|  1.22k|	case ARCHIVE_ENTRY_ACL_GROUP:
  ------------------
  |  |  550|  1.22k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (311:2): [True: 727, False: 819]
  ------------------
  312|  1.30k|	case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  1.30k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (312:2): [True: 78, False: 1.46k]
  ------------------
  313|       |		/* Tags valid in both NFS4 and POSIX.1e */
  314|  1.30k|		break;
  315|    139|	case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|    139|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (315:2): [True: 139, False: 1.40k]
  ------------------
  316|    191|	case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    191|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (316:2): [True: 52, False: 1.49k]
  ------------------
  317|       |		/* Tags valid only in POSIX.1e. */
  318|    191|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|    191|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (318:7): [True: 0, False: 191]
  ------------------
  319|      0|			return (NULL);
  320|      0|		}
  321|    191|		break;
  322|    191|	case ARCHIVE_ENTRY_ACL_EVERYONE:
  ------------------
  |  |  554|     54|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
  |  Branch (322:2): [True: 54, False: 1.49k]
  ------------------
  323|       |		/* Tags valid only in NFS4. */
  324|     54|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|     54|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|     54|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|     54|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|     54|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|     54|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|     54|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|     54|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|     54|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (324:7): [True: 0, False: 54]
  ------------------
  325|      0|			return (NULL);
  326|      0|		}
  327|     54|		break;
  328|     54|	default:
  ------------------
  |  Branch (328:2): [True: 0, False: 1.54k]
  ------------------
  329|       |		/* No other values are valid. */
  330|      0|		return (NULL);
  331|  1.54k|	}
  332|       |
  333|  1.54k|	free(acl->acl_text_w);
  334|  1.54k|	acl->acl_text_w = NULL;
  335|  1.54k|	free(acl->acl_text);
  336|  1.54k|	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.54k|	ap = acl->acl_head;
  345|  1.54k|	aq = NULL;
  346|  11.7k|	while (ap != NULL) {
  ------------------
  |  Branch (346:9): [True: 10.6k, False: 1.05k]
  ------------------
  347|  10.6k|		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
  ------------------
  |  |  542|  10.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  10.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  10.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  10.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  10.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  10.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  10.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  10.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (347:7): [True: 8.55k, False: 2.14k]
  ------------------
  348|  8.55k|		    ap->type == type && ap->tag == tag && ap->id == id) {
  ------------------
  |  Branch (348:7): [True: 7.48k, False: 1.06k]
  |  Branch (348:27): [True: 6.47k, False: 1.01k]
  |  Branch (348:45): [True: 5.96k, False: 509]
  ------------------
  349|  5.96k|			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
  ------------------
  |  |  548|  11.2k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (349:8): [True: 337, False: 5.62k]
  |  Branch (349:21): [True: 3.50k, False: 2.11k]
  ------------------
  350|  3.50k|			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
  ------------------
  |  |  550|  3.50k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (350:8): [True: 150, False: 3.35k]
  ------------------
  351|    487|				ap->permset = permset;
  352|    487|				return (ap);
  353|    487|			}
  354|  5.96k|		}
  355|  10.2k|		aq = ap;
  356|  10.2k|		ap = ap->next;
  357|  10.2k|	}
  358|       |
  359|       |	/* Add a new entry to the end of the list. */
  360|  1.05k|	ap = calloc(1, sizeof(*ap));
  361|  1.05k|	if (ap == NULL)
  ------------------
  |  Branch (361:6): [True: 0, False: 1.05k]
  ------------------
  362|      0|		return (NULL);
  363|  1.05k|	if (aq == NULL)
  ------------------
  |  Branch (363:6): [True: 175, False: 884]
  ------------------
  364|    175|		acl->acl_head = ap;
  365|    884|	else
  366|    884|		aq->next = ap;
  367|  1.05k|	ap->type = type;
  368|  1.05k|	ap->tag = tag;
  369|  1.05k|	ap->id = id;
  370|  1.05k|	ap->permset = permset;
  371|  1.05k|	acl->acl_types |= type;
  372|  1.05k|	return (ap);
  373|  1.05k|}
archive_acl.c:archive_acl_add_entry_len_l:
  209|  2.04k|{
  210|  2.04k|	struct archive_acl_entry *ap;
  211|  2.04k|	int r;
  212|       |
  213|  2.04k|	if (acl_special(acl, type, permset, tag) == 0)
  ------------------
  |  Branch (213:6): [True: 497, False: 1.54k]
  ------------------
  214|    497|		return ARCHIVE_OK;
  ------------------
  |  |  233|    497|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  215|  1.54k|	ap = acl_new_entry(acl, type, permset, tag, id);
  216|  1.54k|	if (ap == NULL) {
  ------------------
  |  Branch (216:6): [True: 0, False: 1.54k]
  ------------------
  217|       |		/* XXX Error XXX */
  218|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  219|      0|	}
  220|  1.54k|	if (name != NULL  &&  *name != '\0' && len > 0) {
  ------------------
  |  Branch (220:6): [True: 1.07k, False: 472]
  |  Branch (220:24): [True: 1.07k, False: 0]
  |  Branch (220:41): [True: 953, False: 121]
  ------------------
  221|    953|		r = archive_mstring_copy_mbs_len_l(&ap->name, name, len, sc);
  222|    953|	} else {
  223|    593|		r = 0;
  224|    593|		archive_mstring_clean(&ap->name);
  225|    593|	}
  226|  1.54k|	if (r == 0)
  ------------------
  |  Branch (226:6): [True: 761, False: 785]
  ------------------
  227|    761|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    761|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  228|    785|	else if (errno == ENOMEM)
  ------------------
  |  Branch (228:11): [True: 2, False: 783]
  ------------------
  229|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|    783|	else
  231|    783|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    783|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  232|  1.54k|}
archive_acl.c:isint:
 1812|  21.1k|{
 1813|  21.1k|	int n = 0;
 1814|  21.1k|	if (start >= end)
  ------------------
  |  Branch (1814:6): [True: 14.0k, False: 7.08k]
  ------------------
 1815|  14.0k|		return (0);
 1816|  16.2k|	while (start < end) {
  ------------------
  |  Branch (1816:9): [True: 15.4k, False: 852]
  ------------------
 1817|  15.4k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1817:7): [True: 3.65k, False: 11.7k]
  |  Branch (1817:23): [True: 2.11k, False: 9.67k]
  ------------------
 1818|  5.76k|			return (0);
 1819|  9.67k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1819:7): [True: 281, False: 9.39k]
  ------------------
 1820|  9.39k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1820:8): [True: 201, False: 9.19k]
  |  Branch (1820:29): [True: 187, False: 14]
  ------------------
 1821|    468|			return (-1);
 1822|  9.20k|		} else {
 1823|  9.20k|			n *= 10;
 1824|  9.20k|			n += *start - '0';
 1825|  9.20k|		}
 1826|  9.20k|		start++;
 1827|  9.20k|	}
 1828|    852|	*result = n;
 1829|    852|	return (1);
 1830|  7.08k|}
archive_acl.c:ismode:
 1839|  4.04k|{
 1840|  4.04k|	const char *p;
 1841|       |
 1842|  4.04k|	if (start >= end)
  ------------------
  |  Branch (1842:6): [True: 1.61k, False: 2.43k]
  ------------------
 1843|  1.61k|		return (0);
 1844|  2.43k|	p = start;
 1845|  2.43k|	*permset = 0;
 1846|  9.74k|	while (p < end) {
  ------------------
  |  Branch (1846:9): [True: 8.14k, False: 1.60k]
  ------------------
 1847|  8.14k|		switch (*p++) {
 1848|  2.04k|		case 'r': case 'R':
  ------------------
  |  Branch (1848:3): [True: 977, False: 7.16k]
  |  Branch (1848:13): [True: 1.06k, False: 7.08k]
  ------------------
 1849|  2.04k|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  471|  2.04k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1850|  2.04k|			break;
 1851|  1.02k|		case 'w': case 'W':
  ------------------
  |  Branch (1851:3): [True: 587, False: 7.55k]
  |  Branch (1851:13): [True: 438, False: 7.70k]
  ------------------
 1852|  1.02k|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  470|  1.02k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1853|  1.02k|			break;
 1854|  1.63k|		case 'x': case 'X':
  ------------------
  |  Branch (1854:3): [True: 656, False: 7.48k]
  |  Branch (1854:13): [True: 983, False: 7.16k]
  ------------------
 1855|  1.63k|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|  1.63k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1856|  1.63k|			break;
 1857|  2.60k|		case '-':
  ------------------
  |  Branch (1857:3): [True: 2.60k, False: 5.54k]
  ------------------
 1858|  2.60k|			break;
 1859|    836|		default:
  ------------------
  |  Branch (1859:3): [True: 836, False: 7.30k]
  ------------------
 1860|    836|			return (0);
 1861|  8.14k|		}
 1862|  8.14k|	}
 1863|  1.60k|	return (1);
 1864|  2.43k|}
archive_acl.c:is_nfs4_perms:
 1873|  1.49k|{
 1874|  1.49k|	const char *p = start;
 1875|       |
 1876|  8.52k|	while (p < end) {
  ------------------
  |  Branch (1876:9): [True: 7.21k, False: 1.31k]
  ------------------
 1877|  7.21k|		switch (*p++) {
 1878|    448|		case 'r':
  ------------------
  |  Branch (1878:3): [True: 448, False: 6.76k]
  ------------------
 1879|    448|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  472|    448|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1880|    448|			break;
 1881|    371|		case 'w':
  ------------------
  |  Branch (1881:3): [True: 371, False: 6.84k]
  ------------------
 1882|    371|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  474|    371|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1883|    371|			break;
 1884|    530|		case 'x':
  ------------------
  |  Branch (1884:3): [True: 530, False: 6.68k]
  ------------------
 1885|    530|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|    530|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1886|    530|			break;
 1887|    308|		case 'p':
  ------------------
  |  Branch (1887:3): [True: 308, False: 6.90k]
  ------------------
 1888|    308|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  476|    308|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1889|    308|			break;
 1890|    587|		case 'D':
  ------------------
  |  Branch (1890:3): [True: 587, False: 6.63k]
  ------------------
 1891|    587|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  480|    587|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1892|    587|			break;
 1893|    415|		case 'd':
  ------------------
  |  Branch (1893:3): [True: 415, False: 6.80k]
  ------------------
 1894|    415|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  483|    415|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1895|    415|			break;
 1896|    431|		case 'a':
  ------------------
  |  Branch (1896:3): [True: 431, False: 6.78k]
  ------------------
 1897|    431|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  481|    431|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1898|    431|			break;
 1899|    720|		case 'A':
  ------------------
  |  Branch (1899:3): [True: 720, False: 6.49k]
  ------------------
 1900|    720|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  482|    720|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1901|    720|			break;
 1902|    269|		case 'R':
  ------------------
  |  Branch (1902:3): [True: 269, False: 6.94k]
  ------------------
 1903|    269|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  478|    269|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1904|    269|			break;
 1905|    394|		case 'W':
  ------------------
  |  Branch (1905:3): [True: 394, False: 6.82k]
  ------------------
 1906|    394|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  479|    394|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1907|    394|			break;
 1908|  1.10k|		case 'c':
  ------------------
  |  Branch (1908:3): [True: 1.10k, False: 6.11k]
  ------------------
 1909|  1.10k|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  484|  1.10k|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1910|  1.10k|			break;
 1911|    211|		case 'C':
  ------------------
  |  Branch (1911:3): [True: 211, False: 7.00k]
  ------------------
 1912|    211|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  485|    211|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1913|    211|			break;
 1914|    230|		case 'o':
  ------------------
  |  Branch (1914:3): [True: 230, False: 6.98k]
  ------------------
 1915|    230|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  486|    230|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1916|    230|			break;
 1917|    710|		case 's':
  ------------------
  |  Branch (1917:3): [True: 710, False: 6.50k]
  ------------------
 1918|    710|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  487|    710|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1919|    710|			break;
 1920|    303|		case '-':
  ------------------
  |  Branch (1920:3): [True: 303, False: 6.91k]
  ------------------
 1921|    303|			break;
 1922|    184|		default:
  ------------------
  |  Branch (1922:3): [True: 184, False: 7.03k]
  ------------------
 1923|    184|			return(0);
 1924|  7.21k|		}
 1925|  7.21k|	}
 1926|  1.31k|	return (1);
 1927|  1.49k|}
archive_acl.c:is_nfs4_flags:
 1936|  1.31k|{
 1937|  1.31k|	const char *p = start;
 1938|       |
 1939|  4.38k|	while (p < end) {
  ------------------
  |  Branch (1939:9): [True: 3.35k, False: 1.02k]
  ------------------
 1940|  3.35k|		switch(*p++) {
 1941|    337|		case 'f':
  ------------------
  |  Branch (1941:3): [True: 337, False: 3.02k]
  ------------------
 1942|    337|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  517|    337|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1943|    337|			break;
 1944|    589|		case 'd':
  ------------------
  |  Branch (1944:3): [True: 589, False: 2.77k]
  ------------------
 1945|    589|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  518|    589|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1946|    589|			break;
 1947|    364|		case 'i':
  ------------------
  |  Branch (1947:3): [True: 364, False: 2.99k]
  ------------------
 1948|    364|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  520|    364|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1949|    364|			break;
 1950|    254|		case 'n':
  ------------------
  |  Branch (1950:3): [True: 254, False: 3.10k]
  ------------------
 1951|    254|			*permset |=
 1952|    254|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  519|    254|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1953|    254|			break;
 1954|    301|		case 'S':
  ------------------
  |  Branch (1954:3): [True: 301, False: 3.05k]
  ------------------
 1955|    301|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  521|    301|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1956|    301|			break;
 1957|    589|		case 'F':
  ------------------
  |  Branch (1957:3): [True: 589, False: 2.77k]
  ------------------
 1958|    589|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  522|    589|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1959|    589|			break;
 1960|    359|		case 'I':
  ------------------
  |  Branch (1960:3): [True: 359, False: 3.00k]
  ------------------
 1961|    359|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  516|    359|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1962|    359|			break;
 1963|    279|		case '-':
  ------------------
  |  Branch (1963:3): [True: 279, False: 3.08k]
  ------------------
 1964|    279|			break;
 1965|    287|		default:
  ------------------
  |  Branch (1965:3): [True: 287, False: 3.07k]
  ------------------
 1966|    287|			return (0);
 1967|  3.35k|		}
 1968|  3.35k|	}
 1969|  1.02k|	return (1);
 1970|  1.31k|}
archive_acl.c:next_field:
 1983|  48.5k|{
 1984|       |	/* Skip leading whitespace to find start of field. */
 1985|  88.9k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1985:9): [True: 88.9k, False: 59]
  |  Branch (1985:20): [True: 1.31k, False: 87.5k]
  |  Branch (1985:34): [True: 1.68k, False: 85.9k]
  |  Branch (1985:49): [True: 37.3k, False: 48.5k]
  ------------------
 1986|  40.3k|		(*p)++;
 1987|  40.3k|		(*l)--;
 1988|  40.3k|	}
 1989|  48.5k|	*start = *p;
 1990|       |
 1991|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1992|   262k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1992:9): [True: 261k, False: 449]
  |  Branch (1992:19): [True: 259k, False: 1.82k]
  |  Branch (1992:33): [True: 259k, False: 586]
  |  Branch (1992:48): [True: 237k, False: 22.1k]
  |  Branch (1992:63): [True: 235k, False: 1.48k]
  |  Branch (1992:77): [True: 214k, False: 21.5k]
  |  Branch (1992:91): [True: 213k, False: 578]
  ------------------
 1993|   213k|		(*p)++;
 1994|   213k|		(*l)--;
 1995|   213k|	}
 1996|  48.5k|	*end = *p;
 1997|       |
 1998|       |	/* Scan for the separator. */
 1999|  72.6k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1999:9): [True: 72.2k, False: 488]
  |  Branch (1999:19): [True: 70.4k, False: 1.76k]
  |  Branch (1999:33): [True: 47.9k, False: 22.5k]
  |  Branch (1999:47): [True: 24.7k, False: 23.2k]
  |  Branch (1999:62): [True: 24.0k, False: 607]
  ------------------
 2000|  24.0k|		(*p)++;
 2001|  24.0k|		(*l)--;
 2002|  24.0k|	}
 2003|  48.5k|	if (*l > 0)
  ------------------
  |  Branch (2003:6): [True: 48.1k, False: 488]
  ------------------
 2004|  48.1k|		*sep = **p;
 2005|    488|	else
 2006|    488|		*sep = '\0';
 2007|       |
 2008|       |	/* Handle in-field comments */
 2009|  48.5k|	if (*sep == '#') {
  ------------------
  |  Branch (2009:6): [True: 607, False: 47.9k]
  ------------------
 2010|  10.9k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (2010:10): [True: 10.9k, False: 18]
  |  Branch (2010:20): [True: 10.8k, False: 116]
  |  Branch (2010:34): [True: 10.3k, False: 473]
  ------------------
 2011|  10.3k|			(*p)++;
 2012|  10.3k|			(*l)--;
 2013|  10.3k|		}
 2014|    607|		if (*l > 0)
  ------------------
  |  Branch (2014:7): [True: 589, False: 18]
  ------------------
 2015|    589|			*sep = **p;
 2016|     18|		else
 2017|     18|			*sep = '\0';
 2018|    607|	}
 2019|       |
 2020|       |	/* Skip separator. */
 2021|  48.5k|	if (*l > 0) {
  ------------------
  |  Branch (2021:6): [True: 48.0k, False: 506]
  ------------------
 2022|  48.0k|		(*p)++;
 2023|  48.0k|		(*l)--;
 2024|  48.0k|	}
 2025|  48.5k|}

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

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

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

__archive_check_magic:
  137|  2.17M|{
  138|  2.17M|	char states1[64];
  139|  2.17M|	char states2[64];
  140|  2.17M|	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.17M|	handle_type = archive_handle_type_name(a->magic);
  148|       |
  149|  2.17M|	if (!handle_type) {
  ------------------
  |  Branch (149:6): [True: 0, False: 2.17M]
  ------------------
  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.17M|	if (a->magic != magic) {
  ------------------
  |  Branch (156:6): [True: 0, False: 2.17M]
  ------------------
  157|      0|		archive_set_error(a, -1,
  158|      0|		    "PROGRAMMER ERROR: Function '%s' invoked"
  159|      0|		    " on '%s' archive object, which is not supported",
  160|      0|		    function,
  161|      0|		    handle_type);
  162|      0|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  163|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  164|      0|	}
  165|       |
  166|  2.17M|	if ((a->state & state) == 0) {
  ------------------
  |  Branch (166:6): [True: 11.7k, False: 2.16M]
  ------------------
  167|       |		/* If we're already FATAL, don't overwrite the error. */
  168|  11.7k|		if (a->state != ARCHIVE_STATE_FATAL) {
  ------------------
  |  |   94|  11.7k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (168:7): [True: 2.14k, False: 9.58k]
  ------------------
  169|  2.14k|			write_all_states(states1, a->state);
  170|  2.14k|			write_all_states(states2, state);
  171|  2.14k|			archive_set_error(a, -1,
  172|  2.14k|			    "INTERNAL ERROR: Function '%s' invoked with"
  173|  2.14k|			    " archive structure in state '%s',"
  174|  2.14k|			    " should be in state '%s'",
  175|  2.14k|			    function,
  176|  2.14k|			    states1,
  177|  2.14k|			    states2);
  178|  2.14k|		}
  179|  11.7k|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|  11.7k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  180|  11.7k|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  11.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  181|  11.7k|	}
  182|  2.16M|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.16M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  183|  2.17M|}
archive_check_magic.c:archive_handle_type_name:
   98|  2.17M|{
   99|  2.17M|	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.17M]
  ------------------
  101|  2.17M|	case ARCHIVE_READ_MAGIC:	return ("archive_read");
  ------------------
  |  |   59|  2.17M|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  |  Branch (101:2): [True: 2.17M, 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.17M]
  ------------------
  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.17M]
  ------------------
  104|      0|	case ARCHIVE_MATCH_MAGIC:	return ("archive_match");
  ------------------
  |  |   62|      0|#define	ARCHIVE_MATCH_MAGIC	(0xcad11c9U)
  ------------------
  |  Branch (104:2): [True: 0, False: 2.17M]
  ------------------
  105|      0|	default:			return NULL;
  ------------------
  |  Branch (105:2): [True: 0, False: 2.17M]
  ------------------
  106|  2.17M|	}
  107|  2.17M|}
archive_check_magic.c:write_all_states:
  111|  4.28k|{
  112|  4.28k|	unsigned int lowbit;
  113|       |
  114|  4.28k|	*buff = '\0';
  115|       |
  116|       |	/* A trick for computing the lowest set bit. */
  117|  8.56k|	while ((lowbit = states & (1 + ~states)) != 0) {
  ------------------
  |  Branch (117:9): [True: 4.28k, False: 4.28k]
  ------------------
  118|  4.28k|		states &= ~lowbit;		/* Clear the low bit. */
  119|  4.28k|		strcat(buff, state_name(lowbit));
  120|  4.28k|		if (states != 0)
  ------------------
  |  Branch (120:7): [True: 0, False: 4.28k]
  ------------------
  121|      0|			strcat(buff, "/");
  122|  4.28k|	}
  123|  4.28k|}
archive_check_magic.c:state_name:
   83|  4.28k|{
   84|  4.28k|	switch (s) {
   85|      0|	case ARCHIVE_STATE_NEW:		return ("new");
  ------------------
  |  |   76|      0|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  |  Branch (85:2): [True: 0, False: 4.28k]
  ------------------
   86|      0|	case ARCHIVE_STATE_HEADER:	return ("header");
  ------------------
  |  |   78|      0|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  |  Branch (86:2): [True: 0, False: 4.28k]
  ------------------
   87|  2.14k|	case ARCHIVE_STATE_DATA:	return ("data");
  ------------------
  |  |   82|  2.14k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (87:2): [True: 2.14k, False: 2.14k]
  ------------------
   88|     57|	case ARCHIVE_STATE_DATA_RECOVERY: return ("data_recovery");
  ------------------
  |  |   86|     57|#define	ARCHIVE_STATE_DATA_RECOVERY	8U
  ------------------
  |  Branch (88:2): [True: 57, False: 4.22k]
  ------------------
   89|  2.08k|	case ARCHIVE_STATE_EOF:		return ("eof");
  ------------------
  |  |   89|  2.08k|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  |  Branch (89:2): [True: 2.08k, False: 2.19k]
  ------------------
   90|      0|	case ARCHIVE_STATE_CLOSED:	return ("closed");
  ------------------
  |  |   91|      0|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (90:2): [True: 0, False: 4.28k]
  ------------------
   91|      0|	case ARCHIVE_STATE_FATAL:	return ("fatal");
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (91:2): [True: 0, False: 4.28k]
  ------------------
   92|      0|	default:			return ("??");
  ------------------
  |  Branch (92:2): [True: 0, False: 4.28k]
  ------------------
   93|  4.28k|	}
   94|  4.28k|}

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

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

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

archive_read_support_filter_gzip.c:archive_le32dec:
  144|  1.50k|{
  145|  1.50k|	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.50k|	unsigned int p3 = p[3];
  151|  1.50k|	unsigned int p2 = p[2];
  152|  1.50k|	unsigned int p1 = p[1];
  153|  1.50k|	unsigned int p0 = p[0];
  154|       |
  155|  1.50k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  1.50k|}
archive_read_support_filter_gzip.c:archive_le16dec:
  115|    230|{
  116|    230|	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|    230|	unsigned int p1 = p[1];
  122|    230|	unsigned int p0 = p[0];
  123|       |
  124|    230|	return ((p1 << 8) | p0);
  125|    230|}
archive_read_support_filter_lz4.c:archive_le32dec:
  144|  26.5k|{
  145|  26.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|  26.5k|	unsigned int p3 = p[3];
  151|  26.5k|	unsigned int p2 = p[2];
  152|  26.5k|	unsigned int p1 = p[1];
  153|  26.5k|	unsigned int p0 = p[0];
  154|       |
  155|  26.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  26.5k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   91|    496|{
   92|    496|	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|    496|	unsigned int p3 = p[3];
   98|    496|	unsigned int p2 = p[2];
   99|    496|	unsigned int p1 = p[1];
  100|    496|	unsigned int p0 = p[0];
  101|       |
  102|    496|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    496|}
archive_read_support_filter_xz.c:archive_le32enc:
  216|    108|{
  217|    108|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    108|	p[0] = u & 0xff;
  220|    108|	p[1] = (u >> 8) & 0xff;
  221|    108|	p[2] = (u >> 16) & 0xff;
  222|    108|	p[3] = (u >> 24) & 0xff;
  223|    108|}
archive_read_support_filter_xz.c:archive_le32dec:
  144|  40.9k|{
  145|  40.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|  40.9k|	unsigned int p3 = p[3];
  151|  40.9k|	unsigned int p2 = p[2];
  152|  40.9k|	unsigned int p1 = p[1];
  153|  40.9k|	unsigned int p0 = p[0];
  154|       |
  155|  40.9k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  40.9k|}
archive_read_support_filter_xz.c:archive_le64dec:
  160|  13.6k|{
  161|  13.6k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  13.6k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  13.6k|}
archive_read_support_filter_zstd.c:archive_le32dec:
  144|  14.0k|{
  145|  14.0k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  14.0k|	unsigned int p3 = p[3];
  151|  14.0k|	unsigned int p2 = p[2];
  152|  14.0k|	unsigned int p1 = p[1];
  153|  14.0k|	unsigned int p0 = p[0];
  154|       |
  155|  14.0k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  14.0k|}
archive_read_support_format_cab.c:archive_le32dec:
  144|   144k|{
  145|   144k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|   144k|	unsigned int p3 = p[3];
  151|   144k|	unsigned int p2 = p[2];
  152|   144k|	unsigned int p1 = p[1];
  153|   144k|	unsigned int p0 = p[0];
  154|       |
  155|   144k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   144k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  8.38k|{
  116|  8.38k|	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|  8.38k|	unsigned int p1 = p[1];
  122|  8.38k|	unsigned int p0 = p[0];
  123|       |
  124|  8.38k|	return ((p1 << 8) | p0);
  125|  8.38k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|  2.63k|{
  198|  2.63k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  2.63k|	p[0] = u & 0xff;
  201|  2.63k|	p[1] = (u >> 8) & 0xff;
  202|  2.63k|}
archive_read_support_format_cab.c:archive_le32enc:
  216|    205|{
  217|    205|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    205|	p[0] = u & 0xff;
  220|    205|	p[1] = (u >> 8) & 0xff;
  221|    205|	p[2] = (u >> 16) & 0xff;
  222|    205|	p[3] = (u >> 24) & 0xff;
  223|    205|}
archive_read_support_format_cpio.c:archive_be16dec:
   61|  18.2k|{
   62|  18.2k|	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|  18.2k|	unsigned int p1 = p[1];
   68|  18.2k|	unsigned int p0 = p[0];
   69|       |
   70|  18.2k|	return ((p0 << 8) | p1);
   71|  18.2k|}
archive_read_support_format_cpio.c:archive_le16dec:
  115|  16.5k|{
  116|  16.5k|	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|  16.5k|	unsigned int p1 = p[1];
  122|  16.5k|	unsigned int p0 = p[0];
  123|       |
  124|  16.5k|	return ((p1 << 8) | p0);
  125|  16.5k|}
archive_read_support_format_iso9660.c:archive_le32dec:
  144|  3.30k|{
  145|  3.30k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  3.30k|	unsigned int p3 = p[3];
  151|  3.30k|	unsigned int p2 = p[2];
  152|  3.30k|	unsigned int p1 = p[1];
  153|  3.30k|	unsigned int p0 = p[0];
  154|       |
  155|  3.30k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  3.30k|}
archive_read_support_format_iso9660.c:archive_le16dec:
  115|    495|{
  116|    495|	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|    495|	unsigned int p1 = p[1];
  122|    495|	unsigned int p0 = p[0];
  123|       |
  124|    495|	return ((p1 << 8) | p0);
  125|    495|}
archive_read_support_format_iso9660.c:archive_be32dec:
   91|    438|{
   92|    438|	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|    438|	unsigned int p3 = p[3];
   98|    438|	unsigned int p2 = p[2];
   99|    438|	unsigned int p1 = p[1];
  100|    438|	unsigned int p0 = p[0];
  101|       |
  102|    438|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    438|}
archive_read_support_format_lha.c:archive_le32dec:
  144|  20.2k|{
  145|  20.2k|	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|  20.2k|	unsigned int p3 = p[3];
  151|  20.2k|	unsigned int p2 = p[2];
  152|  20.2k|	unsigned int p1 = p[1];
  153|  20.2k|	unsigned int p0 = p[0];
  154|       |
  155|  20.2k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  20.2k|}
archive_read_support_format_lha.c:archive_le16dec:
  115|  45.2k|{
  116|  45.2k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  45.2k|	unsigned int p1 = p[1];
  122|  45.2k|	unsigned int p0 = p[0];
  123|       |
  124|  45.2k|	return ((p1 << 8) | p0);
  125|  45.2k|}
archive_read_support_format_lha.c:archive_be16dec:
   61|     17|{
   62|     17|	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|     17|	unsigned int p1 = p[1];
   68|     17|	unsigned int p0 = p[0];
   69|       |
   70|     17|	return ((p0 << 8) | p1);
   71|     17|}
archive_read_support_format_lha.c:archive_le64dec:
  160|    608|{
  161|    608|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    608|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    608|}
archive_read_support_format_rar.c:archive_le16dec:
  115|  49.4k|{
  116|  49.4k|	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.4k|	unsigned int p1 = p[1];
  122|  49.4k|	unsigned int p0 = p[0];
  123|       |
  124|  49.4k|	return ((p1 << 8) | p0);
  125|  49.4k|}
archive_read_support_format_rar.c:archive_le64dec:
  160|    848|{
  161|    848|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    848|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    848|}
archive_read_support_format_rar.c:archive_le32dec:
  144|  54.5k|{
  145|  54.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|  54.5k|	unsigned int p3 = p[3];
  151|  54.5k|	unsigned int p2 = p[2];
  152|  54.5k|	unsigned int p1 = p[1];
  153|  54.5k|	unsigned int p0 = p[0];
  154|       |
  155|  54.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  54.5k|}
archive_read_support_format_rar.c:archive_le32enc:
  216|   130k|{
  217|   130k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|   130k|	p[0] = u & 0xff;
  220|   130k|	p[1] = (u >> 8) & 0xff;
  221|   130k|	p[2] = (u >> 16) & 0xff;
  222|   130k|	p[3] = (u >> 24) & 0xff;
  223|   130k|}
archive_read_support_format_rar5.c:archive_le32dec:
  144|   157k|{
  145|   157k|	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|   157k|	unsigned int p3 = p[3];
  151|   157k|	unsigned int p2 = p[2];
  152|   157k|	unsigned int p1 = p[1];
  153|   157k|	unsigned int p0 = p[0];
  154|       |
  155|   157k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   157k|}
archive_read_support_format_rar5.c:archive_le64dec:
  160|    658|{
  161|    658|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    658|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    658|}
archive_read_support_format_rar5.c:archive_le16dec:
  115|    520|{
  116|    520|	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|    520|	unsigned int p1 = p[1];
  122|    520|	unsigned int p0 = p[0];
  123|       |
  124|    520|	return ((p1 << 8) | p0);
  125|    520|}
archive_read_support_format_rar5.c:archive_be24dec:
   75|  2.13M|{
   76|  2.13M|	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|  2.13M|	unsigned int p2 = p[2];
   82|  2.13M|	unsigned int p1 = p[1];
   83|  2.13M|	unsigned int p0 = p[0];
   84|       |
   85|  2.13M|	return ((p0 << 16) | (p1 << 8) | p2);
   86|  2.13M|}
archive_read_support_format_rar5.c:archive_be32dec:
   91|  14.8k|{
   92|  14.8k|	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|  14.8k|	unsigned int p3 = p[3];
   98|  14.8k|	unsigned int p2 = p[2];
   99|  14.8k|	unsigned int p1 = p[1];
  100|  14.8k|	unsigned int p0 = p[0];
  101|       |
  102|  14.8k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  14.8k|}
archive_read_support_format_rar5.c:archive_le32enc:
  216|  77.0k|{
  217|  77.0k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|  77.0k|	p[0] = u & 0xff;
  220|  77.0k|	p[1] = (u >> 8) & 0xff;
  221|  77.0k|	p[2] = (u >> 16) & 0xff;
  222|  77.0k|	p[3] = (u >> 24) & 0xff;
  223|  77.0k|}
archive_read_support_format_xar.c:archive_be32dec:
   91|  18.6k|{
   92|  18.6k|	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.6k|	unsigned int p3 = p[3];
   98|  18.6k|	unsigned int p2 = p[2];
   99|  18.6k|	unsigned int p1 = p[1];
  100|  18.6k|	unsigned int p0 = p[0];
  101|       |
  102|  18.6k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  18.6k|}
archive_read_support_format_xar.c:archive_be16dec:
   61|  3.02k|{
   62|  3.02k|	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.02k|	unsigned int p1 = p[1];
   68|  3.02k|	unsigned int p0 = p[0];
   69|       |
   70|  3.02k|	return ((p0 << 8) | p1);
   71|  3.02k|}
archive_read_support_format_xar.c:archive_be64dec:
  107|  2.00k|{
  108|  2.00k|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|  2.00k|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|  2.00k|}
archive_read_support_format_zip.c:archive_le16dec:
  115|   247k|{
  116|   247k|	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|   247k|	unsigned int p1 = p[1];
  122|   247k|	unsigned int p0 = p[0];
  123|       |
  124|   247k|	return ((p1 << 8) | p0);
  125|   247k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   409k|{
  145|   409k|	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|   409k|	unsigned int p3 = p[3];
  151|   409k|	unsigned int p2 = p[2];
  152|   409k|	unsigned int p1 = p[1];
  153|   409k|	unsigned int p0 = p[0];
  154|       |
  155|   409k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   409k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  41.5k|{
  161|  41.5k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  41.5k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  41.5k|}
archive_string.c:archive_be16enc:
  168|  12.0k|{
  169|  12.0k|	unsigned char *p = (unsigned char *)pp;
  170|       |
  171|  12.0k|	p[0] = (u >> 8) & 0xff;
  172|  12.0k|	p[1] = u & 0xff;
  173|  12.0k|}
archive_string.c:archive_le16enc:
  197|  4.43k|{
  198|  4.43k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  4.43k|	p[0] = u & 0xff;
  201|  4.43k|	p[1] = (u >> 8) & 0xff;
  202|  4.43k|}
archive_string.c:archive_be16dec:
   61|  42.2k|{
   62|  42.2k|	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|  42.2k|	unsigned int p1 = p[1];
   68|  42.2k|	unsigned int p0 = p[0];
   69|       |
   70|  42.2k|	return ((p0 << 8) | p1);
   71|  42.2k|}
archive_string.c:archive_le16dec:
  115|  30.3k|{
  116|  30.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|  30.3k|	unsigned int p1 = p[1];
  122|  30.3k|	unsigned int p0 = p[0];
  123|       |
  124|  30.3k|	return ((p1 << 8) | p0);
  125|  30.3k|}
archive_read_support_format_7zip.c:archive_le32dec:
  144|   179k|{
  145|   179k|	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|   179k|	unsigned int p3 = p[3];
  151|   179k|	unsigned int p2 = p[2];
  152|   179k|	unsigned int p1 = p[1];
  153|   179k|	unsigned int p0 = p[0];
  154|       |
  155|   179k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   179k|}
archive_read_support_format_7zip.c:archive_le16dec:
  115|    421|{
  116|    421|	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|    421|	unsigned int p1 = p[1];
  122|    421|	unsigned int p0 = p[0];
  123|       |
  124|    421|	return ((p1 << 8) | p0);
  125|    421|}
archive_read_support_format_7zip.c:archive_be16dec:
   61|    147|{
   62|    147|	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|    147|	unsigned int p1 = p[1];
   68|    147|	unsigned int p0 = p[0];
   69|       |
   70|    147|	return ((p0 << 8) | p1);
   71|    147|}
archive_read_support_format_7zip.c:archive_be32dec:
   91|    639|{
   92|    639|	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|    639|	unsigned int p3 = p[3];
   98|    639|	unsigned int p2 = p[2];
   99|    639|	unsigned int p1 = p[1];
  100|    639|	unsigned int p0 = p[0];
  101|       |
  102|    639|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    639|}
archive_read_support_format_7zip.c:archive_be64dec:
  107|    133|{
  108|    133|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|    133|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|    133|}
archive_read_support_format_7zip.c:archive_le64dec:
  160|  3.32k|{
  161|  3.32k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  3.32k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  3.32k|}
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|     40|{
  130|     40|	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|     40|	unsigned int p2 = p[2];
  136|     40|	unsigned int p1 = p[1];
  137|     40|	unsigned int p0 = p[0];
  138|       |
  139|     40|	return ((p2 << 16) | (p1 << 8) | p0);
  140|     40|}
archive_read_support_format_7zip.c:archive_le24enc:
  206|     40|{
  207|     40|	unsigned char *p = (unsigned char *)pp;
  208|       |
  209|     40|	p[0] = u & 0xff;
  210|     40|	p[1] = (u >> 8) & 0xff;
  211|     40|	p[2] = (u >> 16) & 0xff;
  212|     40|}
archive_read_support_format_7zip.c:archive_be32enc:
  177|     23|{
  178|     23|	unsigned char *p = (unsigned char *)pp;
  179|       |
  180|     23|	p[0] = (u >> 24) & 0xff;
  181|     23|	p[1] = (u >> 16) & 0xff;
  182|     23|	p[2] = (u >> 8) & 0xff;
  183|     23|	p[3] = u & 0xff;
  184|     23|}

archive_entry_clear:
  155|   793k|{
  156|   793k|	if (entry == NULL)
  ------------------
  |  Branch (156:6): [True: 0, False: 793k]
  ------------------
  157|      0|		return (NULL);
  158|   793k|	archive_mstring_clean(&entry->ae_fflags_text);
  159|   793k|	archive_mstring_clean(&entry->ae_gname);
  160|   793k|	archive_mstring_clean(&entry->ae_linkname);
  161|   793k|	archive_mstring_clean(&entry->ae_pathname);
  162|   793k|	archive_mstring_clean(&entry->ae_sourcepath);
  163|   793k|	archive_mstring_clean(&entry->ae_uname);
  164|   793k|	archive_entry_copy_mac_metadata(entry, NULL, 0);
  165|   793k|	archive_acl_clear(&entry->acl);
  166|   793k|	archive_entry_xattr_clear(entry);
  167|   793k|	archive_entry_sparse_clear(entry);
  168|   793k|	free(entry->stat);
  169|   793k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|   793k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  170|   793k|	memset(entry, 0, sizeof(*entry));
  171|   793k|	return entry;
  172|   793k|}
archive_entry_free:
  250|  33.8k|{
  251|  33.8k|	archive_entry_clear(entry);
  252|  33.8k|	free(entry);
  253|  33.8k|}
archive_entry_new:
  257|  21.9k|{
  258|       |	return archive_entry_new2(NULL);
  259|  21.9k|}
archive_entry_new2:
  263|  33.8k|{
  264|  33.8k|	struct archive_entry *entry;
  265|       |
  266|  33.8k|	entry = calloc(1, sizeof(*entry));
  267|  33.8k|	if (entry == NULL)
  ------------------
  |  Branch (267:6): [True: 0, False: 33.8k]
  ------------------
  268|      0|		return (NULL);
  269|  33.8k|	entry->archive = a;
  270|  33.8k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|  33.8k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  271|  33.8k|	return (entry);
  272|  33.8k|}
archive_entry_atime:
  280|   246k|{
  281|   246k|	return (entry->ae_stat.aest_atime);
  282|   246k|}
archive_entry_atime_is_set:
  292|  3.16k|{
  293|  3.16k|	return (entry->ae_set & AE_SET_ATIME);
  ------------------
  |  |  141|  3.16k|#define	AE_SET_ATIME	4
  ------------------
  294|  3.16k|}
archive_entry_birthtime:
  298|   246k|{
  299|   246k|	return (entry->ae_stat.aest_birthtime);
  300|   246k|}
archive_entry_ctime:
  316|   246k|{
  317|   246k|	return (entry->ae_stat.aest_ctime);
  318|   246k|}
archive_entry_ctime_is_set:
  322|  3.16k|{
  323|  3.16k|	return (entry->ae_set & AE_SET_CTIME);
  ------------------
  |  |  142|  3.16k|#define	AE_SET_CTIME	8
  ------------------
  324|  3.16k|}
archive_entry_dev:
  334|   251k|{
  335|   251k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (335:6): [True: 9.88k, False: 241k]
  ------------------
  336|  9.88k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  9.88k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  337|   241k|		    entry->ae_stat.aest_devminor);
  338|   241k|	else
  339|   241k|		return (entry->ae_stat.aest_dev);
  340|   251k|}
archive_entry_filetype:
  368|   416k|{
  369|   416k|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|   416k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  370|   416k|}
archive_entry_gid:
  427|   246k|{
  428|   246k|	return (entry->ae_stat.aest_gid);
  429|   246k|}
archive_entry_gid_is_set:
  433|   129k|{
  434|   129k|	return (entry->ae_set & AE_SET_GID);
  ------------------
  |  |  151|   129k|#define	AE_SET_GID	4096
  ------------------
  435|   129k|}
archive_entry_gname:
  439|  10.6k|{
  440|  10.6k|	const char *p;
  441|  10.6k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_gname, &p) == 0)
  ------------------
  |  Branch (441:6): [True: 10.6k, False: 0]
  ------------------
  442|  10.6k|		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|  7.98k|{
  481|  7.98k|	if ((entry->ae_set & AE_SET_SYMLINK) != 0) {
  ------------------
  |  |  140|  7.98k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (481:6): [True: 0, False: 7.98k]
  ------------------
  482|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  483|      0|	}
  484|  7.98k|	entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  7.98k|#define	AE_SET_HARDLINK	1
  ------------------
  485|  7.98k|}
archive_entry_hardlink:
  489|  7.98k|{
  490|  7.98k|	const char *p;
  491|  7.98k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  7.98k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (491:6): [True: 0, False: 7.98k]
  ------------------
  492|      0|		return (NULL);
  493|  7.98k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (493:6): [True: 7.98k, False: 0]
  ------------------
  494|  7.98k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  495|  7.98k|		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|  7.98k|{
  518|  7.98k|	const wchar_t *p;
  519|  7.98k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  7.98k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (519:6): [True: 0, False: 7.98k]
  ------------------
  520|      0|		return (NULL);
  521|  7.98k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (521:6): [True: 7.96k, False: 23]
  ------------------
  522|  7.98k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  523|  7.96k|		return (p);
  524|     23|	if (errno == ENOMEM)
  ------------------
  |  Branch (524:6): [True: 0, False: 23]
  ------------------
  525|      0|		__archive_errx(1, "No memory");
  526|     23|	return (NULL);
  527|     23|}
archive_entry_ino64:
  561|  5.65k|{
  562|  5.65k|	return (entry->ae_stat.aest_ino);
  563|  5.65k|}
archive_entry_mode:
  567|   246k|{
  568|   246k|	return (entry->acl.mode);
  569|   246k|}
archive_entry_mtime:
  573|   246k|{
  574|   246k|	return (entry->ae_stat.aest_mtime);
  575|   246k|}
archive_entry_mtime_is_set:
  585|   129k|{
  586|   129k|	return (entry->ae_set & AE_SET_MTIME);
  ------------------
  |  |  143|   129k|#define	AE_SET_MTIME	16
  ------------------
  587|   129k|}
archive_entry_nlink:
  591|  9.24k|{
  592|  9.24k|	return (entry->ae_stat.aest_nlink);
  593|  9.24k|}
archive_entry_pathname:
  604|   641k|{
  605|   641k|	const char *p;
  606|   641k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (606:6): [True: 640k, False: 728]
  ------------------
  607|   641k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  608|   640k|		return (p);
  609|       |#if HAVE_EILSEQ  /*{*/
  610|    728|    if (errno == EILSEQ) {
  ------------------
  |  Branch (610:9): [True: 728, False: 0]
  ------------------
  611|    728|	    if (archive_mstring_get_utf8(
  ------------------
  |  Branch (611:10): [True: 728, False: 0]
  ------------------
  612|    728|	        entry->archive, &entry->ae_pathname, &p) == 0)
  613|    728|		    return (p);
  614|    728|    }
  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|   274k|{
  624|   274k|	const char *p;
  625|   274k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (625:6): [True: 254k, False: 20.3k]
  ------------------
  626|   274k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  627|   254k|		return (p);
  628|  20.3k|	if (errno == ENOMEM)
  ------------------
  |  Branch (628:6): [True: 0, False: 20.3k]
  ------------------
  629|      0|		__archive_errx(1, "No memory");
  630|  20.3k|	return (NULL);
  631|  20.3k|}
archive_entry_pathname_w:
  635|   438k|{
  636|   438k|	const wchar_t *p;
  637|   438k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (637:6): [True: 404k, False: 34.4k]
  ------------------
  638|   438k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  639|   404k|		return (p);
  640|  34.4k|	if (errno == ENOMEM)
  ------------------
  |  Branch (640:6): [True: 0, False: 34.4k]
  ------------------
  641|      0|		__archive_errx(1, "No memory");
  642|  34.4k|	return (NULL);
  643|  34.4k|}
archive_entry_perm:
  654|    551|{
  655|    551|	return (~AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|    551|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  656|    551|}
archive_entry_perm_is_set:
  660|   129k|{
  661|   129k|	return (entry->ae_set & AE_SET_PERM);
  ------------------
  |  |  148|   129k|#define	AE_SET_PERM	512
  ------------------
  662|   129k|}
archive_entry_rdev_is_set:
  666|  2.15k|{
  667|  2.15k|	return (entry->ae_set & AE_SET_RDEV);
  ------------------
  |  |  152|  2.15k|#define	AE_SET_RDEV	8192
  ------------------
  668|  2.15k|}
archive_entry_size:
  712|   607k|{
  713|   607k|	return (entry->ae_stat.aest_size);
  714|   607k|}
archive_entry_size_is_set:
  718|   246k|{
  719|   246k|	return (entry->ae_set & AE_SET_SIZE);
  ------------------
  |  |  145|   246k|#define	AE_SET_SIZE	64
  ------------------
  720|   246k|}
archive_entry_symlink:
  746|  5.46k|{
  747|  5.46k|	const char *p;
  748|  5.46k|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|  5.46k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (748:6): [True: 5.13k, False: 323]
  ------------------
  749|  5.13k|		return (NULL);
  750|    323|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (750:6): [True: 323, False: 0]
  ------------------
  751|    323|	    entry->archive, &entry->ae_linkname, &p) == 0)
  752|    323|		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|    301|{
  761|    301|	if ((entry->ae_set & AE_SET_HARDLINK) != 0) {
  ------------------
  |  |  139|    301|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (761:6): [True: 42, False: 259]
  ------------------
  762|     42|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|     42|#define	AE_SET_HARDLINK	1
  ------------------
  763|     42|	}
  764|    301|	entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|    301|#define	AE_SET_SYMLINK	2
  ------------------
  765|    301|}
archive_entry_symlink_w:
  789|    571|{
  790|    571|	const wchar_t *p;
  791|    571|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|    571|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (791:6): [True: 270, False: 301]
  ------------------
  792|    270|		return (NULL);
  793|    301|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (793:6): [True: 281, False: 20]
  ------------------
  794|    301|	    entry->archive, &entry->ae_linkname, &p) == 0)
  795|    281|		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|   246k|{
  816|   246k|	return (entry->ae_stat.aest_uid);
  817|   246k|}
archive_entry_uid_is_set:
  821|   129k|{
  822|   129k|	return (entry->ae_set & AE_SET_UID);
  ------------------
  |  |  150|   129k|#define	AE_SET_UID	2048
  ------------------
  823|   129k|}
archive_entry_uname:
  827|  10.6k|{
  828|  10.6k|	const char *p;
  829|  10.6k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_uname, &p) == 0)
  ------------------
  |  Branch (829:6): [True: 10.6k, False: 0]
  ------------------
  830|  10.6k|		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|   246k|{
  868|   246k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|   246k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|   246k|#define AE_ENCRYPTION_DATA 1
  ------------------
  869|   246k|}
archive_entry_is_metadata_encrypted:
  873|   246k|{
  874|   246k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|   246k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|   246k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  875|   246k|}
archive_entry_is_encrypted:
  879|   246k|{
  880|   246k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  169|   246k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|   246k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  881|   246k|}
archive_entry_set_filetype:
  889|   319k|{
  890|   319k|	entry->stat_valid = 0;
  891|   319k|	entry->acl.mode &= ~AE_IFMT;
  ------------------
  |  |  215|   319k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  892|   319k|	entry->acl.mode |= AE_IFMT & type;
  ------------------
  |  |  215|   319k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  893|   319k|	entry->ae_set |= AE_SET_FILETYPE;
  ------------------
  |  |  149|   319k|#define	AE_SET_FILETYPE	1024
  ------------------
  894|   319k|}
archive_entry_copy_fflags_text:
  908|  10.5k|{
  909|  10.5k|	return archive_entry_copy_fflags_text_len(entry, flags, strlen(flags));
  910|  10.5k|}
archive_entry_copy_fflags_text_len:
  915|  10.6k|{
  916|  10.6k|	archive_mstring_copy_mbs_len(&entry->ae_fflags_text, flags, flags_length);
  917|  10.6k|	return (ae_strtofflags(flags, flags_length,
  918|  10.6k|		    &entry->ae_fflags_set, &entry->ae_fflags_clear));
  919|  10.6k|}
archive_entry_set_gid:
  932|   187k|{
  933|   187k|	if (g < 0) {
  ------------------
  |  Branch (933:6): [True: 702, False: 186k]
  ------------------
  934|    702|		g = 0;
  935|    702|	}
  936|   187k|	entry->stat_valid = 0;
  937|   187k|	entry->ae_stat.aest_gid = g;
  938|   187k|	entry->ae_set |= AE_SET_GID;
  ------------------
  |  |  151|   187k|#define	AE_SET_GID	4096
  ------------------
  939|   187k|}
archive_entry_set_gname:
  943|  1.62k|{
  944|  1.62k|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  945|  1.62k|}
archive_entry_copy_gname:
  955|    170|{
  956|    170|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  957|    170|}
_archive_entry_copy_gname_l:
  979|  10.6k|{
  980|  10.6k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_gname, name, len, sc));
  981|  10.6k|}
archive_entry_set_ino:
  985|   628k|{
  986|   628k|	if (ino < 0) {
  ------------------
  |  Branch (986:6): [True: 358, False: 628k]
  ------------------
  987|    358|		entry->stat_valid = 0;
  988|    358|		entry->ae_set &= ~AE_SET_INO;
  ------------------
  |  |  146|    358|#define	AE_SET_INO	128
  ------------------
  989|    358|		return;
  990|    358|	}
  991|   628k|	entry->stat_valid = 0;
  992|   628k|	entry->ae_set |= AE_SET_INO;
  ------------------
  |  |  146|   628k|#define	AE_SET_INO	128
  ------------------
  993|   628k|	entry->ae_stat.aest_ino = ino;
  994|   628k|}
archive_entry_set_hardlink:
 1011|     68|{
 1012|     68|	if (target == NULL) {
  ------------------
  |  Branch (1012:6): [True: 7, False: 61]
  ------------------
 1013|      7|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      7|#define	AE_SET_HARDLINK	1
  ------------------
 1014|      7|		if (entry->ae_set & AE_SET_SYMLINK) {
  ------------------
  |  |  140|      7|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1014:7): [True: 1, False: 6]
  ------------------
 1015|      1|			return;
 1016|      1|		}
 1017|     61|	} else {
 1018|     61|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|     61|#define	AE_SET_HARDLINK	1
  ------------------
 1019|     61|	}
 1020|     67|	entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|     67|#define	AE_SET_SYMLINK	2
  ------------------
 1021|     67|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1022|     67|}
archive_entry_copy_hardlink:
 1038|  3.81k|{
 1039|  3.81k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1039:6): [True: 0, False: 3.81k]
  |  Branch (1039:24): [True: 0, False: 0]
  ------------------
 1040|      0|		return;
 1041|  3.81k|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1042|  3.81k|	if (target != NULL)
  ------------------
  |  Branch (1042:6): [True: 3.81k, False: 0]
  ------------------
 1043|  3.81k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  3.81k|#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.81k|}
archive_entry_update_hardlink_utf8:
 1062|  1.76k|{
 1063|  1.76k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1063:6): [True: 0, False: 1.76k]
  |  Branch (1063:24): [True: 0, False: 0]
  ------------------
 1064|      0|		return (0);
 1065|  1.76k|	if (target != NULL)
  ------------------
  |  Branch (1065:6): [True: 1.76k, False: 0]
  ------------------
 1066|  1.76k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  1.76k|#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.76k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1069:6): [True: 480, False: 1.28k]
  ------------------
 1070|  1.76k|	    &entry->ae_linkname, target) == 0)
 1071|    480|		return (1);
 1072|  1.28k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1072:6): [True: 0, False: 1.28k]
  ------------------
 1073|      0|		__archive_errx(1, "No memory");
 1074|  1.28k|	return (0);
 1075|  1.28k|}
_archive_entry_copy_hardlink_l:
 1080|  7.96k|{
 1081|  7.96k|	int r;
 1082|       |
 1083|  7.96k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1083:6): [True: 0, False: 7.96k]
  |  Branch (1083:24): [True: 0, False: 0]
  ------------------
 1084|      0|		return (0);
 1085|  7.96k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1086|  7.96k|	    target, len, sc);
 1087|  7.96k|	if (target != NULL && r == 0)
  ------------------
  |  Branch (1087:6): [True: 7.96k, False: 0]
  |  Branch (1087:24): [True: 7.96k, False: 0]
  ------------------
 1088|  7.96k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  7.96k|#define	AE_SET_HARDLINK	1
  ------------------
 1089|      0|	else
 1090|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1091|  7.96k|	return (r);
 1092|  7.96k|}
archive_entry_set_atime:
 1096|  54.4k|{
 1097|  54.4k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  54.4k|	do {	\
  |  |  113|  54.4k|		t += ns / 1000000000; \
  |  |  114|  54.4k|		ns %= 1000000000; \
  |  |  115|  54.4k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 54.4k]
  |  |  ------------------
  |  |  116|  54.4k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 54.4k]
  |  |  ------------------
  ------------------
 1098|  54.4k|	entry->stat_valid = 0;
 1099|  54.4k|	entry->ae_set |= AE_SET_ATIME;
  ------------------
  |  |  141|  54.4k|#define	AE_SET_ATIME	4
  ------------------
 1100|  54.4k|	entry->ae_stat.aest_atime = t;
 1101|  54.4k|	entry->ae_stat.aest_atime_nsec = ns;
 1102|  54.4k|}
archive_entry_unset_atime:
 1106|  5.82k|{
 1107|  5.82k|	archive_entry_set_atime(entry, 0, 0);
 1108|  5.82k|	entry->ae_set &= ~AE_SET_ATIME;
  ------------------
  |  |  141|  5.82k|#define	AE_SET_ATIME	4
  ------------------
 1109|  5.82k|}
archive_entry_set_birthtime:
 1113|  6.03k|{
 1114|  6.03k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  6.03k|	do {	\
  |  |  113|  6.03k|		t += ns / 1000000000; \
  |  |  114|  6.03k|		ns %= 1000000000; \
  |  |  115|  6.03k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 6.03k]
  |  |  ------------------
  |  |  116|  6.03k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 6.03k]
  |  |  ------------------
  ------------------
 1115|  6.03k|	entry->stat_valid = 0;
 1116|  6.03k|	entry->ae_set |= AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  6.03k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1117|  6.03k|	entry->ae_stat.aest_birthtime = t;
 1118|  6.03k|	entry->ae_stat.aest_birthtime_nsec = ns;
 1119|  6.03k|}
archive_entry_unset_birthtime:
 1123|  6.03k|{
 1124|  6.03k|	archive_entry_set_birthtime(entry, 0, 0);
 1125|  6.03k|	entry->ae_set &= ~AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  6.03k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1126|  6.03k|}
archive_entry_set_ctime:
 1130|  62.3k|{
 1131|  62.3k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  62.3k|	do {	\
  |  |  113|  62.3k|		t += ns / 1000000000; \
  |  |  114|  62.3k|		ns %= 1000000000; \
  |  |  115|  62.3k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 62.3k]
  |  |  ------------------
  |  |  116|  62.3k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 62.3k]
  |  |  ------------------
  ------------------
 1132|  62.3k|	entry->stat_valid = 0;
 1133|  62.3k|	entry->ae_set |= AE_SET_CTIME;
  ------------------
  |  |  142|  62.3k|#define	AE_SET_CTIME	8
  ------------------
 1134|  62.3k|	entry->ae_stat.aest_ctime = t;
 1135|  62.3k|	entry->ae_stat.aest_ctime_nsec = ns;
 1136|  62.3k|}
archive_entry_unset_ctime:
 1140|  5.82k|{
 1141|  5.82k|	archive_entry_set_ctime(entry, 0, 0);
 1142|  5.82k|	entry->ae_set &= ~AE_SET_CTIME;
  ------------------
  |  |  142|  5.82k|#define	AE_SET_CTIME	8
  ------------------
 1143|  5.82k|}
archive_entry_set_dev:
 1147|   623k|{
 1148|   623k|	entry->stat_valid = 0;
 1149|   623k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|   623k|#define	AE_SET_DEV	256
  ------------------
 1150|   623k|	entry->ae_stat.aest_dev_is_broken_down = 0;
 1151|   623k|	entry->ae_stat.aest_dev = d;
 1152|   623k|}
archive_entry_set_devmajor:
 1156|  4.98k|{
 1157|  4.98k|	entry->stat_valid = 0;
 1158|  4.98k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  4.98k|#define	AE_SET_DEV	256
  ------------------
 1159|  4.98k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1160|  4.98k|	entry->ae_stat.aest_devmajor = m;
 1161|  4.98k|}
archive_entry_set_devminor:
 1165|  4.98k|{
 1166|  4.98k|	entry->stat_valid = 0;
 1167|  4.98k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  4.98k|#define	AE_SET_DEV	256
  ------------------
 1168|  4.98k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1169|  4.98k|	entry->ae_stat.aest_devminor = m;
 1170|  4.98k|}
archive_entry_set_link:
 1175|    756|{
 1176|    756|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1177|    756|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|    756|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1177:6): [True: 756, False: 0]
  ------------------
 1178|    756|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    756|#define	AE_SET_HARDLINK	1
  ------------------
 1179|    756|	}
 1180|    756|}
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|  82.9k|{
 1244|  82.9k|	entry->stat_valid = 0;
 1245|  82.9k|	entry->acl.mode = m;
 1246|  82.9k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|  82.9k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|  82.9k|#define	AE_SET_FILETYPE	1024
  ------------------
 1247|  82.9k|}
archive_entry_set_mtime:
 1251|   208k|{
 1252|   208k|	FIX_NS(t, ns);
  ------------------
  |  |  112|   208k|	do {	\
  |  |  113|   208k|		t += ns / 1000000000; \
  |  |  114|   208k|		ns %= 1000000000; \
  |  |  115|   208k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 208k]
  |  |  ------------------
  |  |  116|   208k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 208k]
  |  |  ------------------
  ------------------
 1253|   208k|	entry->stat_valid = 0;
 1254|   208k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|   208k|#define	AE_SET_MTIME	16
  ------------------
 1255|   208k|	entry->ae_stat.aest_mtime = t;
 1256|   208k|	entry->ae_stat.aest_mtime_nsec = ns;
 1257|   208k|}
archive_entry_unset_mtime:
 1261|    313|{
 1262|    313|	archive_entry_set_mtime(entry, 0, 0);
 1263|    313|	entry->ae_set &= ~AE_SET_MTIME;
  ------------------
  |  |  143|    313|#define	AE_SET_MTIME	16
  ------------------
 1264|    313|}
archive_entry_set_nlink:
 1268|  8.48k|{
 1269|  8.48k|	entry->stat_valid = 0;
 1270|  8.48k|	entry->ae_stat.aest_nlink = nlink;
 1271|  8.48k|}
archive_entry_set_pathname:
 1275|  1.08k|{
 1276|  1.08k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1277|  1.08k|}
archive_entry_copy_pathname:
 1287|  45.7k|{
 1288|  45.7k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1289|  45.7k|}
archive_entry_copy_pathname_w:
 1293|  6.79k|{
 1294|  6.79k|	archive_mstring_copy_wcs(&entry->ae_pathname, name);
 1295|  6.79k|}
archive_entry_update_pathname_utf8:
 1299|  41.4k|{
 1300|  41.4k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1300:6): [True: 10.2k, False: 31.2k]
  ------------------
 1301|  41.4k|	    &entry->ae_pathname, name) == 0)
 1302|  10.2k|		return (1);
 1303|  31.2k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1303:6): [True: 0, False: 31.2k]
  ------------------
 1304|      0|		__archive_errx(1, "No memory");
 1305|  31.2k|	return (0);
 1306|  31.2k|}
_archive_entry_copy_pathname_l:
 1311|   190k|{
 1312|   190k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_pathname,
 1313|   190k|	    name, len, sc));
 1314|   190k|}
archive_entry_set_perm:
 1318|   137k|{
 1319|   137k|	entry->stat_valid = 0;
 1320|   137k|	entry->acl.mode &= AE_IFMT;
  ------------------
  |  |  215|   137k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1321|   137k|	entry->acl.mode |= ~AE_IFMT & p;
  ------------------
  |  |  215|   137k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1322|   137k|	entry->ae_set |= AE_SET_PERM;
  ------------------
  |  |  148|   137k|#define	AE_SET_PERM	512
  ------------------
 1323|   137k|}
archive_entry_set_rdev:
 1327|  13.4k|{
 1328|  13.4k|	entry->stat_valid = 0;
 1329|  13.4k|	entry->ae_stat.aest_rdev = m;
 1330|  13.4k|	entry->ae_stat.aest_rdev_is_broken_down = 0;
 1331|  13.4k|	entry->ae_stat.aest_rdevmajor = 0;
 1332|  13.4k|	entry->ae_stat.aest_rdevminor = 0;
 1333|  13.4k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  13.4k|#define	AE_SET_RDEV	8192
  ------------------
 1334|  13.4k|}
archive_entry_set_rdevmajor:
 1338|  7.14k|{
 1339|  7.14k|	entry->stat_valid = 0;
 1340|  7.14k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1341|  7.14k|	entry->ae_stat.aest_rdev = 0;
 1342|  7.14k|	entry->ae_stat.aest_rdevmajor = m;
 1343|  7.14k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  7.14k|#define	AE_SET_RDEV	8192
  ------------------
 1344|  7.14k|}
archive_entry_set_rdevminor:
 1348|  7.14k|{
 1349|  7.14k|	entry->stat_valid = 0;
 1350|  7.14k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1351|  7.14k|	entry->ae_stat.aest_rdev = 0;
 1352|  7.14k|	entry->ae_stat.aest_rdevminor = m;
 1353|  7.14k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  7.14k|#define	AE_SET_RDEV	8192
  ------------------
 1354|  7.14k|}
archive_entry_set_size:
 1358|   251k|{
 1359|   251k|	if (s < 0) {
  ------------------
  |  Branch (1359:6): [True: 208, False: 250k]
  ------------------
 1360|    208|		s = 0;
 1361|    208|	}
 1362|   251k|	entry->stat_valid = 0;
 1363|   251k|	entry->ae_stat.aest_size = s;
 1364|   251k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|   251k|#define	AE_SET_SIZE	64
  ------------------
 1365|   251k|}
archive_entry_unset_size:
 1369|    444|{
 1370|    444|	archive_entry_set_size(entry, 0);
 1371|    444|	entry->ae_set &= ~AE_SET_SIZE;
  ------------------
  |  |  145|    444|#define	AE_SET_SIZE	64
  ------------------
 1372|    444|}
archive_entry_set_symlink:
 1388|  5.49k|{
 1389|  5.49k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|  5.49k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1389:6): [True: 5.49k, False: 0]
  |  Branch (1389:26): [True: 0, False: 5.49k]
  ------------------
 1390|      0|		return;
 1391|  5.49k|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1392|  5.49k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  5.49k|#define	AE_SET_HARDLINK	1
  ------------------
 1393|  5.49k|	if (linkname == NULL)
  ------------------
  |  Branch (1393:6): [True: 5.49k, False: 0]
  ------------------
 1394|  5.49k|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|  5.49k|#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.49k|}
archive_entry_set_symlink_type:
 1401|  1.86k|{
 1402|  1.86k|	entry->ae_symlink_type = type;
 1403|  1.86k|}
archive_entry_copy_symlink:
 1420|    153|{
 1421|    153|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1421:6): [True: 0, False: 153]
  |  Branch (1421:26): [True: 0, False: 0]
  ------------------
 1422|      0|		return;
 1423|    153|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1424|    153|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|    153|#define	AE_SET_HARDLINK	1
  ------------------
 1425|    153|	if (linkname == NULL)
  ------------------
  |  Branch (1425:6): [True: 0, False: 153]
  ------------------
 1426|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1427|    153|	else
 1428|    153|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|    153|#define	AE_SET_SYMLINK	2
  ------------------
 1429|    153|}
archive_entry_copy_symlink_w:
 1433|     22|{
 1434|     22|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1434:6): [True: 0, False: 22]
  |  Branch (1434:26): [True: 0, False: 0]
  ------------------
 1435|      0|		return;
 1436|     22|	archive_mstring_copy_wcs(&entry->ae_linkname, linkname);
 1437|     22|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|     22|#define	AE_SET_HARDLINK	1
  ------------------
 1438|     22|	if (linkname == NULL)
  ------------------
  |  Branch (1438:6): [True: 0, False: 22]
  ------------------
 1439|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1440|     22|	else
 1441|     22|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|     22|#define	AE_SET_SYMLINK	2
  ------------------
 1442|     22|}
archive_entry_update_symlink_utf8:
 1446|  1.86k|{
 1447|  1.86k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1447:6): [True: 0, False: 1.86k]
  |  Branch (1447:26): [True: 0, False: 0]
  ------------------
 1448|      0|		return (0);
 1449|  1.86k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  1.86k|#define	AE_SET_HARDLINK	1
  ------------------
 1450|  1.86k|	if (linkname == NULL)
  ------------------
  |  Branch (1450:6): [True: 0, False: 1.86k]
  ------------------
 1451|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1452|  1.86k|	else
 1453|  1.86k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  1.86k|#define	AE_SET_SYMLINK	2
  ------------------
 1454|  1.86k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1454:6): [True: 731, False: 1.13k]
  ------------------
 1455|  1.86k|	    &entry->ae_linkname, linkname) == 0)
 1456|    731|		return (1);
 1457|  1.13k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1457:6): [True: 0, False: 1.13k]
  ------------------
 1458|      0|		__archive_errx(1, "No memory");
 1459|  1.13k|	return (0);
 1460|  1.13k|}
_archive_entry_copy_symlink_l:
 1465|  2.70k|{
 1466|  2.70k|	int r;
 1467|       |
 1468|  2.70k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1468:6): [True: 0, False: 2.70k]
  |  Branch (1468:26): [True: 0, False: 0]
  ------------------
 1469|      0|		return (0);
 1470|  2.70k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.70k|#define	AE_SET_HARDLINK	1
  ------------------
 1471|  2.70k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1472|  2.70k|	    linkname, len, sc);
 1473|  2.70k|	if (linkname == NULL || r != 0)
  ------------------
  |  Branch (1473:6): [True: 0, False: 2.70k]
  |  Branch (1473:26): [True: 623, False: 2.08k]
  ------------------
 1474|    623|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|    623|#define	AE_SET_SYMLINK	2
  ------------------
 1475|  2.08k|	else
 1476|  2.08k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  2.08k|#define	AE_SET_SYMLINK	2
  ------------------
 1477|  2.70k|	return (r);
 1478|  2.70k|}
archive_entry_set_uid:
 1482|   187k|{
 1483|   187k|	if (u < 0) {
  ------------------
  |  Branch (1483:6): [True: 532, False: 187k]
  ------------------
 1484|    532|		u = 0;
 1485|    532|	}
 1486|   187k|	entry->stat_valid = 0;
 1487|   187k|	entry->ae_stat.aest_uid = u;
 1488|   187k|	entry->ae_set |= AE_SET_UID;
  ------------------
  |  |  150|   187k|#define	AE_SET_UID	2048
  ------------------
 1489|   187k|}
archive_entry_set_uname:
 1493|    749|{
 1494|    749|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1495|    749|}
archive_entry_copy_uname:
 1505|    562|{
 1506|    562|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1507|    562|}
archive_entry_set_is_data_encrypted:
 1528|  20.9k|{
 1529|  20.9k|	if (is_encrypted) {
  ------------------
  |  Branch (1529:6): [True: 20.9k, False: 0]
  ------------------
 1530|  20.9k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|  20.9k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1531|  20.9k|	} else {
 1532|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1533|      0|	}
 1534|  20.9k|}
archive_entry_set_is_metadata_encrypted:
 1538|     29|{
 1539|     29|	if (is_encrypted) {
  ------------------
  |  Branch (1539:6): [True: 29, False: 0]
  ------------------
 1540|     29|		entry->encryption |= AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|     29|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1541|     29|	} else {
 1542|      0|		entry->encryption &= ~AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|      0|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1543|      0|	}
 1544|     29|}
_archive_entry_copy_uname_l:
 1549|  10.6k|{
 1550|  10.6k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_uname,
 1551|  10.6k|	    name, len, sc));
 1552|  10.6k|}
archive_entry_copy_mac_metadata:
 1564|   793k|{
 1565|   793k|	void *metadata;
 1566|       |
 1567|   793k|	if (p == NULL || s == 0) {
  ------------------
  |  Branch (1567:6): [True: 793k, False: 15]
  |  Branch (1567:19): [True: 12, False: 3]
  ------------------
 1568|   793k|		free(entry->mac_metadata);
 1569|   793k|		entry->mac_metadata = NULL;
 1570|   793k|		entry->mac_metadata_size = 0;
 1571|   793k|	} 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|   793k|}
archive_entry_digest:
 1585|   246k|{
 1586|   246k|	switch (type) {
 1587|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1587:2): [True: 0, False: 246k]
  ------------------
 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: 246k]
  ------------------
 1590|      0|		return entry->digest.rmd160;
 1591|   246k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|   246k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1591:2): [True: 246k, False: 0]
  ------------------
 1592|   246k|		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: 246k]
  ------------------
 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: 246k]
  ------------------
 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: 246k]
  ------------------
 1598|      0|		return entry->digest.sha512;
 1599|      0|	default:
  ------------------
  |  Branch (1599:2): [True: 0, False: 246k]
  ------------------
 1600|       |		return NULL;
 1601|   246k|	}
 1602|   246k|}
archive_entry_set_digest:
 1607|    694|{
 1608|    694|#define copy_digest(_e, _t, _d)\
 1609|    694|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
 1610|       |
 1611|    694|	switch (type) {
 1612|    199|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|    199|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1612:2): [True: 199, False: 495]
  ------------------
 1613|    199|		copy_digest(entry, md5, digest);
  ------------------
  |  | 1609|    199|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1614|    199|		entry->mset_digest |= AE_MSET_DIGEST_MD5;
  ------------------
  |  |  177|    199|#define AE_MSET_DIGEST_MD5	 1
  ------------------
 1615|    199|		break;
 1616|     92|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|     92|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1616:2): [True: 92, False: 602]
  ------------------
 1617|     92|		copy_digest(entry, rmd160, digest);
  ------------------
  |  | 1609|     92|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1618|     92|		entry->mset_digest |= AE_MSET_DIGEST_RMD160;
  ------------------
  |  |  178|     92|#define AE_MSET_DIGEST_RMD160	 2
  ------------------
 1619|     92|		break;
 1620|    253|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|    253|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1620:2): [True: 253, False: 441]
  ------------------
 1621|    253|		copy_digest(entry, sha1, digest);
  ------------------
  |  | 1609|    253|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1622|    253|		entry->mset_digest |= AE_MSET_DIGEST_SHA1;
  ------------------
  |  |  179|    253|#define AE_MSET_DIGEST_SHA1	 4
  ------------------
 1623|    253|		break;
 1624|     73|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|     73|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1624:2): [True: 73, False: 621]
  ------------------
 1625|     73|		copy_digest(entry, sha256, digest);
  ------------------
  |  | 1609|     73|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1626|     73|		entry->mset_digest |= AE_MSET_DIGEST_SHA256;
  ------------------
  |  |  180|     73|#define AE_MSET_DIGEST_SHA256	 8
  ------------------
 1627|     73|		break;
 1628|      0|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1628:2): [True: 0, False: 694]
  ------------------
 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|     77|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|     77|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1632:2): [True: 77, False: 617]
  ------------------
 1633|     77|		copy_digest(entry, sha512, digest);
  ------------------
  |  | 1609|     77|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1634|     77|		entry->mset_digest |= AE_MSET_DIGEST_SHA512;
  ------------------
  |  |  182|     77|#define AE_MSET_DIGEST_SHA512	32
  ------------------
 1635|     77|		break;
 1636|      0|	default:
  ------------------
  |  Branch (1636:2): [True: 0, False: 694]
  ------------------
 1637|      0|		return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1638|    694|	}
 1639|       |
 1640|    694|	return ARCHIVE_OK;
  ------------------
  |  |  233|    694|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1641|    694|#undef copy_digest
 1642|    694|}
archive_entry_acl:
 1655|    551|{
 1656|    551|	return &entry->acl;
 1657|    551|}
archive_entry.c:ae_strtofflags:
 2149|  10.6k|{
 2150|  10.6k|	const char *start, *end;
 2151|  10.6k|	const struct flag *flag;
 2152|  10.6k|	unsigned long set, clear;
 2153|  10.6k|	const char *failed;
 2154|       |
 2155|  10.6k|	set = clear = 0;
 2156|  10.6k|	start = s;
 2157|  10.6k|	failed = NULL;
 2158|       |	/* Find start of first token. */
 2159|  14.7k|	while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2159:9): [True: 14.4k, False: 318]
  |  Branch (2159:19): [True: 139, False: 14.3k]
  |  Branch (2159:39): [True: 79, False: 14.2k]
  |  Branch (2159:58): [True: 3.94k, False: 10.2k]
  ------------------
 2160|  4.16k|		start++;
 2161|  4.16k|		l--;
 2162|  4.16k|	}
 2163|  29.5k|	while (l > 0) {
  ------------------
  |  Branch (2163:9): [True: 18.9k, False: 10.6k]
  ------------------
 2164|  18.9k|		size_t length;
 2165|       |		/* Locate end of token. */
 2166|  18.9k|		end = start;
 2167|   133k|		while (l > 0 && *end != '\t'  &&
  ------------------
  |  Branch (2167:10): [True: 123k, False: 10.0k]
  |  Branch (2167:19): [True: 122k, False: 48]
  ------------------
 2168|   122k|		    *end != ' '  &&  *end != ',') {
  ------------------
  |  Branch (2168:7): [True: 122k, False: 50]
  |  Branch (2168:24): [True: 114k, False: 8.77k]
  ------------------
 2169|   114k|			end++;
 2170|   114k|			l--;
 2171|   114k|		}
 2172|  18.9k|		length = end - start;
 2173|   377k|		for (flag = fileflags; flag->name != NULL; flag++) {
  ------------------
  |  Branch (2173:26): [True: 359k, False: 18.6k]
  ------------------
 2174|   359k|			size_t flag_length = strlen(flag->name);
 2175|   359k|			if (length == flag_length
  ------------------
  |  Branch (2175:8): [True: 70.3k, False: 288k]
  ------------------
 2176|  70.3k|			    && memcmp(start, flag->name, length) == 0) {
  ------------------
  |  Branch (2176:11): [True: 7, False: 70.3k]
  ------------------
 2177|       |				/* Matched "noXXXX", so reverse the sense. */
 2178|      7|				clear |= flag->set;
 2179|      7|				set |= flag->clear;
 2180|      7|				break;
 2181|   358k|			} else if (length == flag_length - 2
  ------------------
  |  Branch (2181:15): [True: 53.1k, False: 305k]
  ------------------
 2182|  53.1k|			    && memcmp(start, flag->name + 2, length) == 0) {
  ------------------
  |  Branch (2182:11): [True: 236, False: 52.9k]
  ------------------
 2183|       |				/* Matched "XXXX", so don't reverse. */
 2184|    236|				set |= flag->set;
 2185|    236|				clear |= flag->clear;
 2186|    236|				break;
 2187|    236|			}
 2188|   359k|		}
 2189|       |		/* Ignore unknown flag names. */
 2190|  18.9k|		if (flag->name == NULL  &&  failed == NULL)
  ------------------
  |  Branch (2190:7): [True: 18.6k, False: 243]
  |  Branch (2190:31): [True: 10.0k, False: 8.63k]
  ------------------
 2191|  10.0k|			failed = start;
 2192|       |
 2193|       |		/* Find start of next token. */
 2194|  18.9k|		start = end;
 2195|  28.3k|		while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2195:10): [True: 18.1k, False: 10.2k]
  |  Branch (2195:20): [True: 127, False: 17.9k]
  |  Branch (2195:40): [True: 116, False: 17.8k]
  |  Branch (2195:59): [True: 9.23k, False: 8.63k]
  ------------------
 2196|  9.47k|			start++;
 2197|  9.47k|			l--;
 2198|  9.47k|		}
 2199|       |
 2200|  18.9k|	}
 2201|       |
 2202|  10.6k|	if (setp)
  ------------------
  |  Branch (2202:6): [True: 10.6k, False: 0]
  ------------------
 2203|  10.6k|		*setp = set;
 2204|  10.6k|	if (clrp)
  ------------------
  |  Branch (2204:6): [True: 10.6k, False: 0]
  ------------------
 2205|  10.6k|		*clrp = clear;
 2206|       |
 2207|       |	/* Return location of first failure. */
 2208|  10.6k|	return (failed);
 2209|  10.6k|}

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

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

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

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

archive_read.c:archive_ckd_mul_size:
  187|  2.33k|{
  188|  2.33k|#if USE_STDCKDINT
  189|  2.33k|	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|  2.33k|}
archive_read_support_filter_lz4.c:archive_ckd_add_size:
  119|    258|{
  120|    258|#if USE_STDCKDINT
  121|    258|	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|    258|}
archive_read_support_filter_zstd.c:archive_ckd_add_size:
  119|    258|{
  120|    258|#if USE_STDCKDINT
  121|    258|	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|    258|}
archive_read_support_format_ar.c:archive_ckd_mul_u64:
  205|  16.1k|{
  206|  16.1k|#if USE_STDCKDINT
  207|  16.1k|	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|  16.1k|}
archive_read_support_format_ar.c:archive_ckd_add_u64:
  137|  16.1k|{
  138|  16.1k|#if USE_STDCKDINT
  139|  16.1k|	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|  16.1k|}
archive_read_support_format_mtree.c:archive_ckd_mul_i64:
  160|  72.5k|{
  161|  72.5k|#if USE_STDCKDINT
  162|  72.5k|	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|  72.5k|}
archive_read_support_format_mtree.c:archive_ckd_sub_i64:
  228|  39.0k|{
  229|  39.0k|#if USE_STDCKDINT
  230|  39.0k|	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|  39.0k|}
archive_read_support_format_mtree.c:archive_ckd_add_i64:
   94|  32.6k|{
   95|  32.6k|#if USE_STDCKDINT
   96|  32.6k|	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|  32.6k|}
archive_read_support_format_rar.c:archive_ckd_mul_size:
  187|  16.6k|{
  188|  16.6k|#if USE_STDCKDINT
  189|  16.6k|	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|  16.6k|}
archive_read_support_format_rar5.c:archive_ckd_mul_u64:
  205|   460k|{
  206|   460k|#if USE_STDCKDINT
  207|   460k|	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|   460k|}
archive_read_support_format_rar5.c:archive_ckd_add_u64:
  137|   458k|{
  138|   458k|#if USE_STDCKDINT
  139|   458k|	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|   458k|}
archive_read_support_format_raw.c:archive_ckd_add_i64:
   94|  27.3k|{
   95|  27.3k|#if USE_STDCKDINT
   96|  27.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|  27.3k|}
archive_read_support_format_tar.c:archive_ckd_mul_i64:
  160|  4.62M|{
  161|  4.62M|#if USE_STDCKDINT
  162|  4.62M|	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|  4.62M|}
archive_read_support_format_tar.c:archive_ckd_add_i64:
   94|  4.62M|{
   95|  4.62M|#if USE_STDCKDINT
   96|  4.62M|	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|  4.62M|}
archive_read_support_format_warc.c:archive_ckd_mul_i64:
  160|  28.2k|{
  161|  28.2k|#if USE_STDCKDINT
  162|  28.2k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  28.2k|}
archive_read_support_format_warc.c:archive_ckd_add_i64:
   94|  28.2k|{
   95|  28.2k|#if USE_STDCKDINT
   96|  28.2k|	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|  28.2k|}
archive_read_support_format_xar.c:archive_ckd_mul_size:
  187|     15|{
  188|     15|#if USE_STDCKDINT
  189|     15|	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|     15|}
archive_read_support_format_xar.c:archive_ckd_mul_u64:
  205|   109k|{
  206|   109k|#if USE_STDCKDINT
  207|   109k|	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|   109k|}
archive_read_support_format_xar.c:archive_ckd_add_u64:
  137|   109k|{
  138|   109k|#if USE_STDCKDINT
  139|   109k|	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|   109k|}
archive_read_support_format_7zip.c:archive_ckd_add_i64:
   94|  26.4k|{
   95|  26.4k|#if USE_STDCKDINT
   96|  26.4k|	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|  26.4k|}
archive_read_support_format_7zip.c:archive_ckd_add_size:
  119|  6.67k|{
  120|  6.67k|#if USE_STDCKDINT
  121|  6.67k|	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|  6.67k|}
archive_read_support_format_7zip.c:archive_ckd_mul_i64:
  160|  7.53k|{
  161|  7.53k|#if USE_STDCKDINT
  162|  7.53k|	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|  7.53k|}

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

pack_native:
  107|    650|{
  108|    650|	dev_t dev = 0;
  109|       |
  110|    650|	if (n == 2) {
  ------------------
  |  Branch (110:6): [True: 401, False: 249]
  ------------------
  111|    401|		dev = apd_makedev(numbers[0], numbers[1]);
  ------------------
  |  |   95|    401|#define apd_makedev(maj, min) makedev((maj), (min))
  ------------------
  112|    401|		if ((unsigned long)major(dev) != numbers[0])
  ------------------
  |  Branch (112:7): [True: 12, False: 389]
  ------------------
  113|     12|			*error = iMajorError;
  114|    389|		else if ((unsigned long)minor(dev) != numbers[1])
  ------------------
  |  Branch (114:12): [True: 132, False: 257]
  ------------------
  115|    132|			*error = iMinorError;
  116|    401|	} else
  117|    249|		*error = tooManyFields;
  118|    650|	return (dev);
  119|    650|}
pack_find:
  321|  7.88k|{
  322|  7.88k|	const struct format	*format;
  323|       |
  324|  7.88k|	format = bsearch(name, formats,
  325|  7.88k|	    sizeof(formats)/sizeof(formats[0]),
  326|  7.88k|	    sizeof(formats[0]), compare_format);
  327|  7.88k|	if (format == 0)
  ------------------
  |  Branch (327:6): [True: 449, False: 7.44k]
  ------------------
  328|    449|		return (NULL);
  329|  7.44k|	return (format->pack);
  330|  7.88k|}
archive_pack_dev.c:pack_8_8:
  168|    325|{
  169|    325|	dev_t dev = 0;
  170|       |
  171|    325|	if (n == 2) {
  ------------------
  |  Branch (171:6): [True: 280, False: 45]
  ------------------
  172|    280|		dev = makedev_8_8(numbers[0], numbers[1]);
  ------------------
  |  |  163|    280|#define	makedev_8_8(x,y)	((dev_t)((((x) << 8) & 0x0000ff00) | \
  |  |  164|    280|					 (((y) << 0) & 0x000000ff)))
  ------------------
  173|    280|		if ((unsigned long)major_8_8(dev) != numbers[0])
  ------------------
  |  |  161|    280|#define	major_8_8(x)		((int32_t)(((x) & 0x0000ff00) >> 8))
  ------------------
  |  Branch (173:7): [True: 248, False: 32]
  ------------------
  174|    248|			*error = iMajorError;
  175|    280|		if ((unsigned long)minor_8_8(dev) != numbers[1])
  ------------------
  |  |  162|    280|#define	minor_8_8(x)		((int32_t)(((x) & 0x000000ff) >> 0))
  ------------------
  |  Branch (175:7): [True: 0, False: 280]
  ------------------
  176|      0|			*error = iMinorError;
  177|    280|	} else
  178|     45|		*error = tooManyFields;
  179|    325|	return (dev);
  180|    325|}
archive_pack_dev.c:pack_bsdos:
  258|  1.80k|{
  259|  1.80k|	dev_t dev = 0;
  260|       |
  261|  1.80k|	if (n == 2) {
  ------------------
  |  Branch (261:6): [True: 777, False: 1.03k]
  ------------------
  262|    777|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  185|    777|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  186|    777|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  263|    777|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  183|    777|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (263:7): [True: 254, False: 523]
  ------------------
  264|    254|			*error = iMajorError;
  265|    777|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  184|    777|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (265:7): [True: 419, False: 358]
  ------------------
  266|    419|			*error = iMinorError;
  267|  1.03k|	} else if (n == 3) {
  ------------------
  |  Branch (267:13): [True: 1.03k, False: 0]
  ------------------
  268|  1.03k|		dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]);
  ------------------
  |  |  252|  1.03k|#define	makedev_12_12_8(x,y,z)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  253|  1.03k|					 (((y) <<  8) & 0x000fff00) | \
  |  |  254|  1.03k|					 (((z) <<  0) & 0x000000ff)))
  ------------------
  269|  1.03k|		if ((unsigned long)major_12_12_8(dev) != numbers[0])
  ------------------
  |  |  249|  1.03k|#define	major_12_12_8(x)	((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (269:7): [True: 785, False: 247]
  ------------------
  270|    785|			*error = iMajorError;
  271|  1.03k|		if ((unsigned long)unit_12_12_8(dev) != numbers[1])
  ------------------
  |  |  250|  1.03k|#define	unit_12_12_8(x)		((int32_t)(((x) & 0x000fff00) >>  8))
  ------------------
  |  Branch (271:7): [True: 643, False: 389]
  ------------------
  272|    643|			*error = "invalid unit number";
  273|  1.03k|		if ((unsigned long)subunit_12_12_8(dev) != numbers[2])
  ------------------
  |  |  251|  1.03k|#define	subunit_12_12_8(x)	((int32_t)(((x) & 0x000000ff) >>  0))
  ------------------
  |  Branch (273:7): [True: 279, False: 753]
  ------------------
  274|    279|			*error = "invalid subunit number";
  275|  1.03k|	} else
  276|      0|		*error = tooManyFields;
  277|  1.80k|	return (dev);
  278|  1.80k|}
archive_pack_dev.c:pack_8_24:
  234|    833|{
  235|    833|	dev_t dev = 0;
  236|       |
  237|    833|	if (n == 2) {
  ------------------
  |  Branch (237:6): [True: 501, False: 332]
  ------------------
  238|    501|		dev = makedev_8_24(numbers[0], numbers[1]);
  ------------------
  |  |  229|    501|#define	makedev_8_24(x,y)	((dev_t)((((x) << 24) & 0xff000000) | \
  |  |  230|    501|					 (((y) <<  0) & 0x00ffffff)))
  ------------------
  239|    501|		if ((unsigned long)major_8_24(dev) != numbers[0])
  ------------------
  |  |  227|    501|#define	major_8_24(x)		((int32_t)(((x) & 0xff000000) >> 24))
  ------------------
  |  Branch (239:7): [True: 196, False: 305]
  ------------------
  240|    196|			*error = iMajorError;
  241|    501|		if ((unsigned long)minor_8_24(dev) != numbers[1])
  ------------------
  |  |  228|    501|#define	minor_8_24(x)		((int32_t)(((x) & 0x00ffffff) >>  0))
  ------------------
  |  Branch (241:7): [True: 169, False: 332]
  ------------------
  242|    169|			*error = iMinorError;
  243|    501|	} else
  244|    332|		*error = tooManyFields;
  245|    833|	return (dev);
  246|    833|}
archive_pack_dev.c:pack_netbsd:
  124|    820|{
  125|    820|	dev_t dev = 0;
  126|       |
  127|    820|	if (n == 2) {
  ------------------
  |  Branch (127:6): [True: 594, False: 226]
  ------------------
  128|    594|		dev = makedev_netbsd(numbers[0], numbers[1]);
  ------------------
  |  |   45|    594|#define	makedev_netbsd(x,y)	((dev_t)((((x) <<  8) & 0x000fff00) | \
  |  |   46|    594|					 (((y) << 12) & 0xfff00000) | \
  |  |   47|    594|					 (((y) <<  0) & 0x000000ff)))
  ------------------
  129|    594|		if ((unsigned long)major_netbsd(dev) != numbers[0])
  ------------------
  |  |   42|    594|#define	major_netbsd(x)		((int32_t)((((x) & 0x000fff00) >>  8)))
  ------------------
  |  Branch (129:7): [True: 138, False: 456]
  ------------------
  130|    138|			*error = iMajorError;
  131|    456|		else if ((unsigned long)minor_netbsd(dev) != numbers[1])
  ------------------
  |  |   43|    456|#define	minor_netbsd(x)		((int32_t)((((x) & 0xfff00000) >> 12) | \
  |  |   44|    456|					   (((x) & 0x000000ff) >>  0)))
  ------------------
  |  Branch (131:12): [True: 264, False: 192]
  ------------------
  132|    264|			*error = iMinorError;
  133|    594|	} else
  134|    226|		*error = tooManyFields;
  135|    820|	return (dev);
  136|    820|}
archive_pack_dev.c:pack_12_20:
  190|    837|{
  191|    837|	dev_t dev = 0;
  192|       |
  193|    837|	if (n == 2) {
  ------------------
  |  Branch (193:6): [True: 645, False: 192]
  ------------------
  194|    645|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  185|    645|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  186|    645|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  195|    645|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  183|    645|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (195:7): [True: 175, False: 470]
  ------------------
  196|    175|			*error = iMajorError;
  197|    645|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  184|    645|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (197:7): [True: 270, False: 375]
  ------------------
  198|    270|			*error = iMinorError;
  199|    645|	} else
  200|    192|		*error = tooManyFields;
  201|    837|	return (dev);
  202|    837|}
archive_pack_dev.c:pack_14_18:
  212|    729|{
  213|    729|	dev_t dev = 0;
  214|       |
  215|    729|	if (n == 2) {
  ------------------
  |  Branch (215:6): [True: 689, False: 40]
  ------------------
  216|    689|		dev = makedev_14_18(numbers[0], numbers[1]);
  ------------------
  |  |  207|    689|#define	makedev_14_18(x,y)	((dev_t)((((x) << 18) & 0xfffc0000) | \
  |  |  208|    689|					 (((y) <<  0) & 0x0003ffff)))
  ------------------
  217|    689|		if ((unsigned long)major_14_18(dev) != numbers[0])
  ------------------
  |  |  205|    689|#define	major_14_18(x)		((int32_t)(((x) & 0xfffc0000) >> 18))
  ------------------
  |  Branch (217:7): [True: 209, False: 480]
  ------------------
  218|    209|			*error = iMajorError;
  219|    689|		if ((unsigned long)minor_14_18(dev) != numbers[1])
  ------------------
  |  |  206|    689|#define	minor_14_18(x)		((int32_t)(((x) & 0x0003ffff) >>  0))
  ------------------
  |  Branch (219:7): [True: 215, False: 474]
  ------------------
  220|    215|			*error = iMinorError;
  221|    689|	} else
  222|     40|		*error = tooManyFields;
  223|    729|	return (dev);
  224|    729|}
archive_pack_dev.c:compare_format:
  308|  24.8k|{
  309|  24.8k|	const char		*name;
  310|  24.8k|	const struct format	*format;
  311|       |
  312|  24.8k|	name = key;
  313|  24.8k|	format = element;
  314|       |
  315|  24.8k|	return (strcmp(name, format->name));
  316|  24.8k|}

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

archive_ppmd8.c:Ppmd8_Construct:
   65|  13.7k|{
   66|  13.7k|  unsigned i, k, m;
   67|       |
   68|  13.7k|  p->Base = 0;
   69|       |
   70|   536k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   536k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   536k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   536k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   536k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   536k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   536k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   536k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   536k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 523k, False: 13.7k]
  ------------------
   71|   523k|  {
   72|   523k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 357k, False: 165k]
  ------------------
   73|  1.76M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.23M, False: 523k]
  ------------------
   74|   523k|    p->Indx2Units[i] = (Byte)k;
   75|   523k|  }
   76|       |
   77|  13.7k|  p->NS2BSIndx[0] = (0 << 1);
   78|  13.7k|  p->NS2BSIndx[1] = (1 << 1);
   79|  13.7k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  13.7k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  82.5k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 68.8k, False: 13.7k]
  ------------------
   83|  68.8k|    p->NS2Indx[i] = (Byte)i;
   84|  3.52M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 3.51M, False: 13.7k]
  ------------------
   85|  3.51M|  {
   86|  3.51M|    p->NS2Indx[i] = (Byte)m;
   87|  3.51M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 302k, False: 3.20M]
  ------------------
   88|   302k|      k = (++m) - 4;
   89|  3.51M|  }
   90|  13.7k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  12.8k|{
  101|  12.8k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 12.8k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  12.8k|  {
  103|  12.8k|    Ppmd8_Free(p);
  104|  12.8k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  12.8k|        4 - (size & 3);
  109|  12.8k|      #endif
  110|  12.8k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 12.8k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  12.8k|    p->Size = size;
  113|  12.8k|  }
  114|  12.8k|  return True;
  ------------------
  |  |   55|  12.8k|#define True 1
  ------------------
  115|  12.8k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  25.6k|{
   94|  25.6k|  free(p->Base);
   95|  25.6k|  p->Size = 0;
   96|  25.6k|  p->Base = 0;
   97|  25.6k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  12.8k|{
  412|  12.8k|  p->MaxOrder = maxOrder;
  413|  12.8k|  p->RestoreMethod = restoreMethod;
  414|  12.8k|  RestartModel(p);
  415|  12.8k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  12.8k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  12.8k|  p->DummySee.Summ = 0; /* unused */
  417|  12.8k|  p->DummySee.Count = 64; /* unused */
  418|  12.8k|}
archive_ppmd8.c:RestartModel:
  354|  12.8k|{
  355|  12.8k|  unsigned i, k, m, r;
  356|       |
  357|  12.8k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  12.8k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  12.8k|  RESET_TEXT(0);
  ------------------
  |  |  349|  12.8k|#define RESET_TEXT(offs) do {						\
  |  |  350|  12.8k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  12.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 12.8k]
  |  |  ------------------
  ------------------
  360|  12.8k|  p->HiUnit = p->Text + p->Size;
  361|  12.8k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  12.8k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  12.8k|#define UNIT_SIZE 12
  ------------------
  362|  12.8k|  p->GlueCount = 0;
  363|       |
  364|  12.8k|  p->OrderFall = p->MaxOrder;
  365|  12.8k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 8.29k, False: 4.58k]
  ------------------
  366|  12.8k|  p->PrevSuccess = 0;
  367|       |
  368|  12.8k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  12.8k|#define UNIT_SIZE 12
  ------------------
  369|  12.8k|  p->MinContext->Suffix = 0;
  370|  12.8k|  p->MinContext->NumStats = 255;
  371|  12.8k|  p->MinContext->Flags = 0;
  372|  12.8k|  p->MinContext->SummFreq = 256 + 1;
  373|  12.8k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  12.8k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  12.8k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  12.8k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  12.8k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  12.8k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  3.31M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 3.29M, False: 12.8k]
  ------------------
  377|  3.29M|  {
  378|  3.29M|    CPpmd_State *s = &p->FoundState[i];
  379|  3.29M|    s->Symbol = (Byte)i;
  380|  3.29M|    s->Freq = 1;
  381|  3.29M|    SetSuccessor(s, 0);
  382|  3.29M|  }
  383|       |
  384|   334k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 322k, False: 12.8k]
  ------------------
  385|   322k|  {
  386|  3.09M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 2.77M, False: 322k]
  ------------------
  387|  2.77M|      i++;
  388|  2.89M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 2.57M, False: 322k]
  ------------------
  389|  2.57M|    {
  390|  2.57M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.57M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.57M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.57M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  2.57M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  23.1M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 20.6M, False: 2.57M]
  ------------------
  393|  20.6M|        dest[r] = val;
  394|  2.57M|    }
  395|   322k|  }
  396|       |
  397|   322k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 309k, False: 12.8k]
  ------------------
  398|   309k|  {
  399|  3.59M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 3.28M, False: 309k]
  ------------------
  400|  3.28M|      i++;
  401|  10.2M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 9.89M, False: 309k]
  ------------------
  402|  9.89M|    {
  403|  9.89M|      CPpmd_See *s = &p->See[m][k];
  404|  9.89M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  9.89M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  9.89M|      s->Count = 7;
  406|  9.89M|    }
  407|   309k|  }
  408|  12.8k|}
archive_ppmd8.c:SetSuccessor:
  344|   287M|{
  345|   287M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  346|   287M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  347|   287M|}
archive_ppmd8.c:Ppmd8_RangeDec_Init:
 1131|  12.8k|{
 1132|  12.8k|  unsigned i;
 1133|  12.8k|  p->Low = 0;
 1134|  12.8k|  p->Range = 0xFFFFFFFF;
 1135|  12.8k|  p->Code = 0;
 1136|  64.1k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 51.3k, False: 12.8k]
  ------------------
 1137|  51.3k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  12.8k|  return (p->Code < 0xFFFFFFFF);
 1139|  12.8k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|  85.8M|{
 1166|  85.8M|  size_t charMask[256 / sizeof(size_t)];
 1167|  85.8M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 14.2M, False: 71.6M]
  ------------------
 1168|  14.2M|  {
 1169|  14.2M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  14.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  14.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1170|  14.2M|    unsigned i;
 1171|  14.2M|    UInt32 count, hiCnt;
 1172|  14.2M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1172:9): [True: 5.26M, False: 8.95M]
  ------------------
 1173|  5.26M|    {
 1174|  5.26M|      Byte symbol;
 1175|  5.26M|      RangeDec_Decode(p, 0, s->Freq);
 1176|  5.26M|      p->FoundState = s;
 1177|  5.26M|      symbol = s->Symbol;
 1178|  5.26M|      Ppmd8_Update1_0(p);
 1179|  5.26M|      return symbol;
 1180|  5.26M|    }
 1181|  8.95M|    p->PrevSuccess = 0;
 1182|  8.95M|    i = p->MinContext->NumStats;
 1183|  8.95M|    do
 1184|  76.9M|    {
 1185|  76.9M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 5.17M, False: 71.7M]
  ------------------
 1186|  5.17M|      {
 1187|  5.17M|        Byte symbol;
 1188|  5.17M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  5.17M|        p->FoundState = s;
 1190|  5.17M|        symbol = s->Symbol;
 1191|  5.17M|        Ppmd8_Update1(p);
 1192|  5.17M|        return symbol;
 1193|  5.17M|      }
 1194|  76.9M|    }
 1195|  71.7M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 68.0M, False: 3.77M]
  ------------------
 1196|  3.77M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 5.39k, False: 3.77M]
  ------------------
 1197|  5.39k|      return -2;
 1198|  3.77M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1199|  3.77M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  3.77M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  3.77M|	unsigned j;							\
  |  |  153|  18.8M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 15.0M, False: 3.77M]
  |  |  ------------------
  |  |  154|  15.0M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  15.0M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  15.0M|	}								\
  |  |  157|  3.77M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 3.77M]
  |  |  ------------------
  ------------------
 1200|  3.77M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1162|  3.77M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1201|  3.77M|    i = p->MinContext->NumStats;
 1202|  11.1M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  | 1162|  11.1M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1202:44): [True: 7.35M, False: 3.77M]
  ------------------
 1203|  3.77M|  }
 1204|  71.6M|  else
 1205|  71.6M|  {
 1206|  71.6M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|  71.6M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|  71.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|  71.6M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|  71.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  71.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  71.6M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|  71.6M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 65.2M, False: 6.36M]
  ------------------
 1208|  65.2M|    {
 1209|  65.2M|      Byte symbol;
 1210|  65.2M|      RangeDec_Decode(p, 0, *prob);
 1211|  65.2M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  65.2M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  65.2M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  65.2M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  65.2M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|  65.2M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|  65.2M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|  65.2M|      Ppmd8_UpdateBin(p);
 1214|  65.2M|      return symbol;
 1215|  65.2M|    }
 1216|  6.36M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1217|  6.36M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  6.36M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  6.36M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.36M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  6.36M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1219|  6.36M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  6.36M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  6.36M|	unsigned j;							\
  |  |  153|  31.8M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 25.4M, False: 6.36M]
  |  |  ------------------
  |  |  154|  25.4M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  25.4M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  25.4M|	}								\
  |  |  157|  6.36M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 6.36M]
  |  |  ------------------
  ------------------
 1220|  6.36M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1162|  6.36M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1221|  6.36M|    p->PrevSuccess = 0;
 1222|  6.36M|  }
 1223|  10.1M|  for (;;)
 1224|  14.3M|  {
 1225|  14.3M|    CPpmd_State *ps[256], *s;
 1226|  14.3M|    UInt32 freqSum, count, hiCnt;
 1227|  14.3M|    CPpmd_See *see;
 1228|  14.3M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1229|  14.3M|    do
 1230|  39.6M|    {
 1231|  39.6M|      p->OrderFall++;
 1232|  39.6M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1232:11): [True: 950, False: 39.6M]
  ------------------
 1233|    950|        return -1;
 1234|  39.6M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   97|  39.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   96|  39.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1235|  39.6M|    }
 1236|  39.6M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1236:12): [True: 25.3M, False: 14.3M]
  ------------------
 1237|  14.3M|    hiCnt = 0;
 1238|  14.3M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  14.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  14.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1239|  14.3M|    i = 0;
 1240|  14.3M|    num = p->MinContext->NumStats - numMasked;
 1241|  14.3M|    do
 1242|   629M|    {
 1243|   629M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1162|   629M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1244|   629M|      hiCnt += (s->Freq & k);
 1245|   629M|      ps[i] = s++;
 1246|   629M|      i -= k;
 1247|   629M|    }
 1248|   629M|    while (i != num);
  ------------------
  |  Branch (1248:12): [True: 615M, False: 14.3M]
  ------------------
 1249|       |    
 1250|  14.3M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1251|  14.3M|    freqSum += hiCnt;
 1252|  14.3M|    count = RangeDec_GetThreshold(p, freqSum);
 1253|       |    
 1254|  14.3M|    if (count < hiCnt)
  ------------------
  |  Branch (1254:9): [True: 10.1M, False: 4.19M]
  ------------------
 1255|  10.1M|    {
 1256|  10.1M|      Byte symbol;
 1257|  10.1M|      CPpmd_State **pps = ps;
 1258|   180M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1258:23): [True: 170M, False: 10.1M]
  ------------------
 1259|  10.1M|      s = *pps;
 1260|  10.1M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1261|  10.1M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  10.1M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  10.1M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  20.2M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 6.24M, False: 3.88M]
  |  |  |  Branch (113:39): [True: 196k, False: 6.04M]
  |  |  ------------------
  |  |  114|   196k|		(p)->Summ <<= 1;					\
  |  |  115|   196k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|   196k|    	}								\
  |  |  117|  10.1M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 10.1M]
  |  |  ------------------
  ------------------
 1262|  10.1M|      p->FoundState = s;
 1263|  10.1M|      symbol = s->Symbol;
 1264|  10.1M|      Ppmd8_Update2(p);
 1265|  10.1M|      return symbol;
 1266|  10.1M|    }
 1267|  4.19M|    if (count >= freqSum)
  ------------------
  |  Branch (1267:9): [True: 6.12k, False: 4.19M]
  ------------------
 1268|  6.12k|      return -2;
 1269|  4.19M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1270|  4.19M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1271|  12.8M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1162|  12.8M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1271:46): [True: 8.63M, False: 4.19M]
  ------------------
 1272|  4.19M|  }
 1273|  10.1M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1142|  28.5M|{
 1143|  28.5M|  return p->Code / (p->Range /= total);
 1144|  28.5M|}
archive_ppmd8.c:RangeDec_Decode:
 1147|   100M|{
 1148|   100M|  start *= p->Range;
 1149|   100M|  p->Low += start;
 1150|   100M|  p->Code -= start;
 1151|   100M|  p->Range *= size;
 1152|       |
 1153|   110M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   221M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 10.5M, False: 100M]
  ------------------
 1154|   100M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   200M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  13.0k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 13.0k, False: 100M]
  |  Branch (1154:27): [True: 13.0k, False: 0]
  ------------------
 1155|  10.6M|  {
 1156|  10.6M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1157|  10.6M|    p->Range <<= 8;
 1158|  10.6M|    p->Low <<= 8;
 1159|  10.6M|  }
 1160|   100M|}
archive_ppmd8.c:Ppmd8_Update1_0:
 1097|  5.26M|{
 1098|  5.26M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1099|  5.26M|  p->RunLength += p->PrevSuccess;
 1100|  5.26M|  p->MinContext->SummFreq += 4;
 1101|  5.26M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  5.26M|#define MAX_FREQ 124
  ------------------
  |  Branch (1101:7): [True: 31.6k, False: 5.22M]
  ------------------
 1102|  31.6k|    Rescale(p);
 1103|  5.26M|  NextContext(p);
 1104|  5.26M|}
archive_ppmd8.c:Rescale:
  975|  45.0k|{
  976|  45.0k|  unsigned i, adder, sumFreq, escFreq;
  977|  45.0k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|  45.0k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  45.0k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  45.0k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  45.0k|  CPpmd_State *s = p->FoundState;
  979|  45.0k|  {
  980|  45.0k|    CPpmd_State tmp = *s;
  981|   184k|    for (; s != stats; s--)
  ------------------
  |  Branch (981:12): [True: 139k, False: 45.0k]
  ------------------
  982|   139k|      s[0] = s[-1];
  983|  45.0k|    *s = tmp;
  984|  45.0k|  }
  985|  45.0k|  escFreq = p->MinContext->SummFreq - s->Freq;
  986|  45.0k|  s->Freq += 4;
  987|  45.0k|  adder = (p->OrderFall != 0
  988|       |      #ifdef PPMD8_FREEZE_SUPPORT
  989|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  990|       |      #endif
  991|  45.0k|      );
  992|  45.0k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  45.0k|  sumFreq = s->Freq;
  994|       |  
  995|  45.0k|  i = p->MinContext->NumStats;
  996|  45.0k|  do
  997|  2.29M|  {
  998|  2.29M|    escFreq -= (++s)->Freq;
  999|  2.29M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
 1000|  2.29M|    sumFreq += s->Freq;
 1001|  2.29M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1001:9): [True: 684k, False: 1.60M]
  ------------------
 1002|   684k|    {
 1003|   684k|      CPpmd_State *s1 = s;
 1004|   684k|      CPpmd_State tmp = *s1;
 1005|   684k|      do
 1006|  32.8M|        s1[0] = s1[-1];
 1007|  32.8M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1007:14): [True: 32.8M, False: 0]
  |  Branch (1007:31): [True: 32.1M, False: 684k]
  ------------------
 1008|   684k|      *s1 = tmp;
 1009|   684k|    }
 1010|  2.29M|  }
 1011|  2.29M|  while (--i);
  ------------------
  |  Branch (1011:10): [True: 2.24M, False: 45.0k]
  ------------------
 1012|       |  
 1013|  45.0k|  if (s->Freq == 0)
  ------------------
  |  Branch (1013:7): [True: 8.56k, False: 36.4k]
  ------------------
 1014|  8.56k|  {
 1015|  8.56k|    unsigned numStats = p->MinContext->NumStats;
 1016|  8.56k|    unsigned n0, n1;
 1017|  12.0k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1017:24): [True: 3.47k, False: 8.56k]
  ------------------
 1018|  8.56k|    escFreq += i;
 1019|  8.56k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1020|  8.56k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1020:9): [True: 2.77k, False: 5.78k]
  ------------------
 1021|  2.77k|    {
 1022|  2.77k|      CPpmd_State tmp = *stats;
 1023|  2.77k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  2.77k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  2.77k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 2.61k, False: 163]
  ------------------
 1025|  2.61k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  2.61k|#define MAX_FREQ 124
  ------------------
 1026|  2.77k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  2.77k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  2.77k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  2.77k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  2.77k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.77k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  2.77k|      return;
 1030|  2.77k|    }
 1031|  5.78k|    n0 = (numStats + 2) >> 1;
 1032|  5.78k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1033|  5.78k|    if (n0 != n1)
  ------------------
  |  Branch (1033:9): [True: 4.54k, False: 1.24k]
  ------------------
 1034|  4.54k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  4.54k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  4.54k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1035|  5.78k|    p->MinContext->Flags &= ~0x08;
 1036|  5.78k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  5.78k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  5.78k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  5.78k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1037|  5.78k|    i = p->MinContext->NumStats;
 1038|  29.6k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1038:73): [True: 23.8k, False: 5.78k]
  ------------------
 1039|  5.78k|  }
 1040|  42.2k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1041|  42.2k|  p->MinContext->Flags |= 0x4;
 1042|  42.2k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|  42.2k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  42.2k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  42.2k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  42.2k|}
archive_ppmd8.c:InsertNode:
  118|  73.7M|{
  119|  73.7M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|  73.7M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|  73.7M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|  73.7M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|  73.7M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|  73.7M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|  73.7M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|  73.7M|  p->Stamps[indx]++;
  124|  73.7M|}
archive_ppmd8.c:ShrinkUnits:
  255|  2.88M|{
  256|  2.88M|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  2.88M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  257|  2.88M|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  2.88M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  258|  2.88M|  if (i0 == i1)
  ------------------
  |  Branch (258:7): [True: 472k, False: 2.41M]
  ------------------
  259|   472k|    return oldPtr;
  260|  2.41M|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (260:7): [True: 2.41M, False: 4.05k]
  ------------------
  261|  2.41M|  {
  262|  2.41M|    void *ptr = RemoveNode(p, i1);
  263|  2.41M|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  245|  2.41M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  2.41M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  2.41M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  2.41M|	UInt32 n = num;							\
  |  |  249|  3.64M|	do {								\
  |  |  250|  3.64M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  3.64M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 1.23M, False: 2.41M]
  |  |  ------------------
  |  |  252|  2.41M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 2.41M]
  |  |  ------------------
  ------------------
  264|  2.41M|    InsertNode(p, oldPtr, i0);
  265|  2.41M|    return ptr;
  266|  2.41M|  }
  267|  4.05k|  SplitBlock(p, oldPtr, i0, i1);
  268|  4.05k|  return oldPtr;
  269|  2.41M|}
archive_ppmd8.c:RemoveNode:
  127|  36.0M|{
  128|  36.0M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  36.0M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  36.0M|  p->FreeList[indx] = node->Next;
  130|  36.0M|  p->Stamps[indx]--;
  131|  36.0M|  return node;
  132|  36.0M|}
archive_ppmd8.c:SplitBlock:
  135|  4.54M|{
  136|  4.54M|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.54M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.54M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|  4.54M|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|  4.54M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  4.54M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|  4.54M|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  4.54M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 341k, False: 4.19M]
  ------------------
  139|   341k|  {
  140|   341k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|   341k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|   341k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|   341k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   341k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|   341k|  }
  143|  4.54M|  InsertNode(p, ptr, i);
  144|  4.54M|}
archive_ppmd8.c:NextContext:
 1070|  75.7M|{
 1071|  75.7M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|  75.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  75.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  75.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|  75.7M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 42.9M, False: 32.8M]
  |  Branch (1072:28): [True: 35.8M, False: 7.07M]
  ------------------
 1073|  35.8M|    p->MinContext = p->MaxContext = c;
 1074|  39.8M|  else
 1075|  39.8M|  {
 1076|  39.8M|    UpdateModel(p);
 1077|  39.8M|    p->MinContext = p->MaxContext;
 1078|  39.8M|  }
 1079|  75.7M|}
archive_ppmd8.c:UpdateModel:
  806|  50.0M|{
  807|  50.0M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  50.0M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  50.0M|  CTX_PTR c;
  809|  50.0M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  50.0M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  50.0M|  CPpmd_State *s = NULL;
  812|       |  
  813|  50.0M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  50.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (813:7): [True: 46.6M, False: 3.34M]
  |  Branch (813:45): [True: 45.0M, False: 1.63M]
  ------------------
  814|  45.0M|  {
  815|  45.0M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  45.0M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  45.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  45.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  45.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|       |    
  817|  45.0M|    if (c->NumStats == 0)
  ------------------
  |  Branch (817:9): [True: 26.6M, False: 18.3M]
  ------------------
  818|  26.6M|    {
  819|  26.6M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  26.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  26.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  820|  26.6M|      if (s->Freq < 32)
  ------------------
  |  Branch (820:11): [True: 26.6M, False: 1.95k]
  ------------------
  821|  26.6M|        s->Freq++;
  822|  26.6M|    }
  823|  18.3M|    else
  824|  18.3M|    {
  825|  18.3M|      s = STATS(c);
  ------------------
  |  |   30|  18.3M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  18.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  18.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|  18.3M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (826:11): [True: 11.3M, False: 7.00M]
  ------------------
  827|  11.3M|      {
  828|   159M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (828:28): [True: 147M, False: 11.3M]
  ------------------
  829|  11.3M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (829:13): [True: 4.79M, False: 6.59M]
  ------------------
  830|  4.79M|        {
  831|  4.79M|          SwapStates(&s[0], &s[-1]);
  832|  4.79M|          s--;
  833|  4.79M|        }
  834|  11.3M|      }
  835|  18.3M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  18.3M|#define MAX_FREQ 124
  ------------------
  |  Branch (835:11): [True: 18.2M, False: 167k]
  ------------------
  836|  18.2M|      {
  837|  18.2M|        s->Freq += 2;
  838|  18.2M|        c->SummFreq += 2;
  839|  18.2M|      }
  840|  18.3M|    }
  841|  45.0M|  }
  842|       |  
  843|  50.0M|  c = p->MaxContext;
  844|  50.0M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (844:7): [True: 7.07M, False: 42.9M]
  |  Branch (844:28): [True: 6.96M, False: 109k]
  ------------------
  845|  6.96M|  {
  846|  6.96M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  6.96M|#define True 1
  ------------------
  847|  6.96M|    if (cs == 0)
  ------------------
  |  Branch (847:9): [True: 445, False: 6.96M]
  ------------------
  848|    445|    {
  849|    445|      SetSuccessor(p->FoundState, 0);
  850|    445|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    445|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  851|    445|    }
  852|  6.96M|    else
  853|  6.96M|    {
  854|  6.96M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  6.96M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  6.96M|      p->MaxContext = cs;
  856|  6.96M|    }
  857|  6.96M|    return;
  858|  6.96M|  }
  859|       |  
  860|  43.0M|  *p->Text++ = p->FoundState->Symbol;
  861|  43.0M|  successor = REF(p->Text);
  ------------------
  |  |   24|  43.0M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  862|  43.0M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (862:7): [True: 20, False: 43.0M]
  ------------------
  863|     20|  {
  864|     20|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  554|     20|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  865|     20|    return;
  866|     20|  }
  867|       |  
  868|  43.0M|  if (!fSuccessor)
  ------------------
  |  Branch (868:7): [True: 2.17M, False: 40.8M]
  ------------------
  869|  2.17M|  {
  870|  2.17M|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  871|  2.17M|    if (cs == NULL)
  ------------------
  |  Branch (871:9): [True: 52, False: 2.17M]
  ------------------
  872|     52|    {
  873|     52|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|     52|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  874|     52|      return;
  875|     52|    }
  876|  2.17M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  2.17M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  877|  2.17M|  }
  878|  40.8M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |   96|  40.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (878:12): [True: 14.6M, False: 26.2M]
  ------------------
  879|  14.6M|  {
  880|  14.6M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  14.6M|#define False 0
  ------------------
  881|  14.6M|    if (cs == NULL)
  ------------------
  |  Branch (881:9): [True: 201, False: 14.6M]
  ------------------
  882|    201|    {
  883|    201|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|    201|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  884|    201|      return;
  885|    201|    }
  886|  14.6M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  14.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  887|  14.6M|  }
  888|       |  
  889|  43.0M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (889:7): [True: 1.47M, False: 41.5M]
  ------------------
  890|  1.47M|  {
  891|  1.47M|    successor = fSuccessor;
  892|  1.47M|    p->Text -= (p->MaxContext != p->MinContext);
  893|  1.47M|  }
  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|  43.0M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  904|  43.0M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  905|       |  
  906|  82.6M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  39.6M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  39.6M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  39.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  39.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (906:10): [True: 39.6M, False: 43.0M]
  ------------------
  907|  39.6M|  {
  908|  39.6M|    unsigned ns1;
  909|  39.6M|    UInt32 cf, sf;
  910|  39.6M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (910:9): [True: 15.1M, False: 24.5M]
  ------------------
  911|  15.1M|    {
  912|  15.1M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (912:11): [True: 10.1M, False: 4.92M]
  ------------------
  913|  10.1M|      {
  914|       |        /* Expand for one UNIT */
  915|  10.1M|        unsigned oldNU = (ns1 + 1) >> 1;
  916|  10.1M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  10.1M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  917|  10.1M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  10.1M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (917:13): [True: 9.87M, False: 298k]
  ------------------
  918|  9.87M|        {
  919|  9.87M|          void *ptr = AllocUnits(p, i + 1);
  920|  9.87M|          void *oldPtr;
  921|  9.87M|          if (!ptr)
  ------------------
  |  Branch (921:15): [True: 306, False: 9.87M]
  ------------------
  922|    306|          {
  923|    306|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    306|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  924|    306|            return;
  925|    306|          }
  926|  9.87M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  9.87M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  9.87M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  9.87M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  9.87M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  245|  9.87M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  9.87M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  9.87M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  9.87M|	UInt32 n = num;							\
  |  |  249|  14.7M|	do {								\
  |  |  250|  14.7M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  14.7M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 4.88M, False: 9.87M]
  |  |  ------------------
  |  |  252|  9.87M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 9.87M]
  |  |  ------------------
  ------------------
  928|  9.87M|          InsertNode(p, oldPtr, i);
  929|  9.87M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  9.87M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  9.87M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  930|  9.87M|        }
  931|  10.1M|      }
  932|  15.1M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  933|  15.1M|    }
  934|  24.5M|    else
  935|  24.5M|    {
  936|  24.5M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  937|  24.5M|      if (!s2)
  ------------------
  |  Branch (937:11): [True: 398, False: 24.5M]
  ------------------
  938|    398|      {
  939|    398|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    398|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  940|    398|        return;
  941|    398|      }
  942|  24.5M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  24.5M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  24.5M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  943|  24.5M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  24.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  944|  24.5M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  24.5M|#define MAX_FREQ 124
  ------------------
  |  Branch (944:11): [True: 24.5M, False: 11.5k]
  ------------------
  945|  24.5M|        s2->Freq <<= 1;
  946|  11.5k|      else
  947|  11.5k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  11.5k|#define MAX_FREQ 124
  ------------------
  948|  24.5M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  949|  24.5M|    }
  950|  39.6M|    cf = 2 * fFreq * (c->SummFreq + 6);
  951|  39.6M|    sf = (UInt32)s0 + c->SummFreq;
  952|  39.6M|    if (cf < 6 * sf)
  ------------------
  |  Branch (952:9): [True: 20.2M, False: 19.3M]
  ------------------
  953|  20.2M|    {
  954|  20.2M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  955|  20.2M|      c->SummFreq += 4;
  956|  20.2M|    }
  957|  19.3M|    else
  958|  19.3M|    {
  959|  19.3M|      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
  960|  19.3M|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  961|  19.3M|    }
  962|  39.6M|    {
  963|  39.6M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  39.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  39.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  39.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  39.6M|      SetSuccessor(s2, successor);
  965|  39.6M|      s2->Symbol = fSymbol;
  966|  39.6M|      s2->Freq = (Byte)cf;
  967|  39.6M|      c->Flags |= flag;
  968|  39.6M|      c->NumStats = (Byte)(ns1 + 1);
  969|  39.6M|    }
  970|  39.6M|  }
  971|  43.0M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  43.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  43.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  43.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  43.0M|}
archive_ppmd8.c:SwapStates:
  444|  32.3M|{
  445|  32.3M|  CPpmd_State tmp = *t1;
  446|  32.3M|  *t1 = *t2;
  447|  32.3M|  *t2 = tmp;
  448|  32.3M|}
archive_ppmd8.c:CreateSuccessors:
  619|  21.6M|{
  620|  21.6M|  CPpmd_State upState;
  621|  21.6M|  Byte flags;
  622|  21.6M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  21.6M|#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|  21.6M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  625|  21.6M|  unsigned numPs = 0;
  626|       |  
  627|  21.6M|  if (!skip)
  ------------------
  |  Branch (627:7): [True: 14.6M, False: 6.96M]
  ------------------
  628|  14.6M|    ps[numPs++] = p->FoundState;
  629|       |  
  630|   102M|  while (c->Suffix)
  ------------------
  |  Branch (630:10): [True: 102M, False: 377k]
  ------------------
  631|   102M|  {
  632|   102M|    CPpmd_Void_Ref successor;
  633|   102M|    CPpmd_State *s;
  634|   102M|    c = SUFFIX(c);
  ------------------
  |  |   32|   102M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|   102M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|   102M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   102M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|   102M|    if (s1)
  ------------------
  |  Branch (635:9): [True: 21.3M, False: 80.8M]
  ------------------
  636|  21.3M|    {
  637|  21.3M|      s = s1;
  638|  21.3M|      s1 = NULL;
  639|  21.3M|    }
  640|  80.8M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (640:14): [True: 21.1M, False: 59.6M]
  ------------------
  641|  21.1M|    {
  642|   121M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  21.1M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  21.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  21.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (642:26): [True: 100M, False: 21.1M]
  ------------------
  643|  21.1M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  21.1M|#define MAX_FREQ 124
  ------------------
  |  Branch (643:11): [True: 21.0M, False: 38.2k]
  ------------------
  644|  21.0M|      {
  645|  21.0M|        s->Freq++;
  646|  21.0M|        c->SummFreq++;
  647|  21.0M|      }
  648|  21.1M|    }
  649|  59.6M|    else
  650|  59.6M|    {
  651|  59.6M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  59.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  59.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  652|  59.6M|      s->Freq = (Byte)(s->Freq + (!SUFFIX(c)->NumStats & (s->Freq < 24)));
  ------------------
  |  |   32|  59.6M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  59.6M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  59.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  59.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  653|  59.6M|    }
  654|   102M|    successor = SUCCESSOR(s);
  ------------------
  |  |  341|   102M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  655|   102M|    if (successor != upBranch)
  ------------------
  |  Branch (655:9): [True: 21.2M, False: 80.9M]
  ------------------
  656|  21.2M|    {
  657|  21.2M|      c = CTX(successor);
  ------------------
  |  |   29|  21.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  21.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  21.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|  21.2M|      if (numPs == 0)
  ------------------
  |  Branch (658:11): [True: 500k, False: 20.7M]
  ------------------
  659|   500k|        return c;
  660|  20.7M|      break;
  661|  21.2M|    }
  662|  80.9M|    ps[numPs++] = s;
  663|  80.9M|  }
  664|       |  
  665|  21.1M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |   96|  21.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  666|  21.1M|  SetSuccessor(&upState, upBranch + 1);
  667|  21.1M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  668|       |
  669|  21.1M|  if (c->NumStats == 0)
  ------------------
  |  Branch (669:7): [True: 10.8M, False: 10.2M]
  ------------------
  670|  10.8M|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   31|  10.8M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  10.8M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  671|  10.2M|  else
  672|  10.2M|  {
  673|  10.2M|    UInt32 cf, s0;
  674|  10.2M|    CPpmd_State *s;
  675|  59.7M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  10.2M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  10.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  10.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:24): [True: 49.4M, False: 10.2M]
  ------------------
  676|  10.2M|    cf = s->Freq - 1;
  677|  10.2M|    s0 = c->SummFreq - c->NumStats - cf;
  678|  10.2M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (678:32): [True: 6.60M, False: 3.69M]
  ------------------
  679|  10.2M|  }
  680|       |
  681|   116M|  while (numPs != 0)
  ------------------
  |  Branch (681:10): [True: 95.5M, False: 21.1M]
  ------------------
  682|  95.5M|  {
  683|       |    /* Create Child */
  684|  95.5M|    CTX_PTR c1; /* = AllocContext(p); */
  685|  95.5M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (685:9): [True: 71.1M, False: 24.3M]
  ------------------
  686|  71.1M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  71.1M|#define UNIT_SIZE 12
  ------------------
  687|  24.3M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (687:14): [True: 14.9M, False: 9.46M]
  ------------------
  688|  14.9M|      c1 = (CTX_PTR)RemoveNode(p, 0);
  689|  9.46M|    else
  690|  9.46M|    {
  691|  9.46M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  692|  9.46M|      if (!c1)
  ------------------
  |  Branch (692:11): [True: 698, False: 9.46M]
  ------------------
  693|    698|        return NULL;
  694|  9.46M|    }
  695|  95.5M|    c1->NumStats = 0;
  696|  95.5M|    c1->Flags = flags;
  697|  95.5M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|  95.5M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  95.5M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  698|  95.5M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|  95.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  699|  95.5M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|  95.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  700|  95.5M|    c = c1;
  701|  95.5M|  }
  702|       |
  703|  21.1M|  return c;
  704|  21.1M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  12.2M|{
  206|  12.2M|  unsigned i;
  207|  12.2M|  void *retVal;
  208|  12.2M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 2.04k, False: 12.2M]
  ------------------
  209|  2.04k|  {
  210|  2.04k|    GlueFreeBlocks(p);
  211|  2.04k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 979, False: 1.06k]
  ------------------
  212|    979|      return RemoveNode(p, indx);
  213|  2.04k|  }
  214|  12.2M|  i = indx;
  215|  12.2M|  do
  216|   301M|  {
  217|   301M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   301M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   301M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   301M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   301M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   301M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   301M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   301M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   301M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 7.75M, False: 294M]
  ------------------
  218|  7.75M|    {
  219|  7.75M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  7.75M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  7.75M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  7.75M|      p->GlueCount--;
  221|  7.75M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 7.74M, False: 1.40k]
  ------------------
  222|  7.75M|    }
  223|   301M|  }
  224|   294M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 289M, False: 4.53M]
  ------------------
  225|  4.53M|  retVal = RemoveNode(p, i);
  226|  4.53M|  SplitBlock(p, retVal, i, indx);
  227|  4.53M|  return retVal;
  228|  12.2M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|  2.04k|{
  148|  2.04k|  CPpmd8_Node_Ref head = 0;
  149|  2.04k|  CPpmd8_Node_Ref *prev = &head;
  150|  2.04k|  unsigned i;
  151|       |
  152|  2.04k|  p->GlueCount = 1 << 13;
  153|  2.04k|  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.04k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 128, False: 1.91k]
  ------------------
  158|    128|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|  79.7k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  79.7k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  79.7k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  79.7k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  79.7k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  79.7k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  79.7k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  79.7k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  79.7k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 77.7k, False: 2.04k]
  ------------------
  162|  77.7k|  {
  163|  77.7k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|  77.7k|    p->FreeList[i] = 0;
  165|  19.4M|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 19.4M, False: 77.7k]
  ------------------
  166|  19.4M|    {
  167|  19.4M|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  19.4M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  19.4M|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 12.0M, False: 7.37M]
  ------------------
  169|  12.0M|      {
  170|  12.0M|        CPpmd8_Node *node2;
  171|  12.0M|        *prev = next;
  172|  12.0M|        prev = &(node->Next);
  173|  23.0M|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  23.0M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 11.0M, False: 12.0M]
  ------------------
  174|  11.0M|        {
  175|  11.0M|          node->NU += node2->NU;
  176|  11.0M|          node2->NU = 0;
  177|  11.0M|        }
  178|  12.0M|      }
  179|  19.4M|      next = node->Next;
  180|  19.4M|    }
  181|  77.7k|  }
  182|  2.04k|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  12.0M|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 12.0M, False: 2.04k]
  ------------------
  186|  12.0M|  {
  187|  12.0M|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  12.0M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  12.0M|    unsigned nu;
  189|  12.0M|    head = node->Next;
  190|  12.0M|    nu = node->NU;
  191|  12.0M|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 3.63M, False: 8.41M]
  ------------------
  192|  3.63M|      continue;
  193|  8.41M|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 173, False: 8.41M]
  ------------------
  194|    173|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|    173|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|    173|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|    173|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|    173|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|    173|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    173|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    173|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    173|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  8.41M|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  8.41M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 505k, False: 7.90M]
  ------------------
  196|   505k|    {
  197|   505k|      unsigned k = I2U(--i);
  ------------------
  |  |   19|   505k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|   505k|      InsertNode(p, node + k, nu - k - 1);
  199|   505k|    }
  200|  8.41M|    InsertNode(p, node, i);
  201|  8.41M|  }
  202|  2.04k|}
archive_ppmd8.c:RestoreModel:
  562|  1.42k|{
  563|  1.42k|  CTX_PTR c;
  564|  1.42k|  CPpmd_State *s;
  565|  1.42k|  RESET_TEXT(0);
  ------------------
  |  |  349|  1.42k|#define RESET_TEXT(offs) do {						\
  |  |  350|  1.42k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  1.42k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 1.42k]
  |  |  ------------------
  ------------------
  566|  4.30k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|  2.88k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  2.88k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  2.88k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.88k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:27): [True: 2.88k, False: 1.42k]
  ------------------
  567|  2.88k|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (567:9): [True: 1.90k, False: 976]
  ------------------
  568|  1.90k|    {
  569|  1.90k|      s = STATS(c);
  ------------------
  |  |   30|  1.90k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  1.90k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.90k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  1.90k|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  571|  1.90k|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|  1.90k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.90k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  572|  1.90k|      SpecialFreeUnit(p, s);
  573|  1.90k|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  1.90k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.90k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  1.90k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.90k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|  1.90k|    }
  575|    976|    else
  576|    976|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  577|       | 
  578|  6.29k|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  4.87k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  4.87k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  4.87k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.87k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:10): [True: 4.87k, False: 1.42k]
  ------------------
  579|  4.87k|    if (!c->NumStats)
  ------------------
  |  Branch (579:9): [True: 2.83k, False: 2.03k]
  ------------------
  580|  2.83k|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.83k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.83k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.83k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.83k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.83k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.83k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  581|  2.03k|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (581:14): [True: 75, False: 1.96k]
  ------------------
  582|     75|      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.42k|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (601:7): [True: 58, False: 1.36k]
  |  Branch (601:59): [True: 0, False: 1.36k]
  ------------------
  602|     58|    RestartModel(p);
  603|  1.36k|  else
  604|  1.36k|  {
  605|  18.9k|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (605:12): [True: 17.5k, False: 1.36k]
  ------------------
  606|  17.5k|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|  17.5k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  17.5k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  17.5k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  17.5k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.36k|    do
  608|  1.36k|    {
  609|  1.36k|      CutOff(p, p->MaxContext, 0);
  610|  1.36k|      ExpandTextArea(p);
  611|  1.36k|    }
  612|  1.36k|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (612:12): [True: 0, False: 1.36k]
  ------------------
  613|  1.36k|    p->GlueCount = 0;
  614|  1.36k|    p->OrderFall = p->MaxOrder;
  615|  1.36k|  }
  616|  1.42k|}
archive_ppmd8.c:SpecialFreeUnit:
  277|  34.8M|{
  278|  34.8M|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (278:7): [True: 34.8M, False: 1.73k]
  ------------------
  279|  34.8M|    InsertNode(p, ptr, 0);
  280|  1.73k|  else
  281|  1.73k|  {
  282|       |    #ifdef PPMD8_FREEZE_SUPPORT
  283|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  284|       |    #endif
  285|  1.73k|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|  1.73k|#define UNIT_SIZE 12
  ------------------
  286|  1.73k|  }
  287|  34.8M|}
archive_ppmd8.c:Refresh:
  421|  2.88M|{
  422|  2.88M|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  423|  2.88M|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|  2.88M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  2.88M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.88M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  2.88M|  ctx->Stats = REF(s);
  ------------------
  |  |   24|  2.88M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  425|       |  #ifdef PPMD8_FREEZE_SUPPORT
  426|       |  /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */
  427|       |  scale |= (ctx->SummFreq >= ((UInt32)1 << 15));
  428|       |  #endif
  429|  2.88M|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  430|  2.88M|  escFreq = ctx->SummFreq - s->Freq;
  431|  2.88M|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  432|  2.88M|  do
  433|  6.21M|  {
  434|  6.21M|    escFreq -= (++s)->Freq;
  435|  6.21M|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  436|  6.21M|    flags |= 0x08 * (s->Symbol >= 0x40);
  437|  6.21M|  }
  438|  6.21M|  while (--i);
  ------------------
  |  Branch (438:10): [True: 3.33M, False: 2.88M]
  ------------------
  439|  2.88M|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  440|  2.88M|  ctx->Flags = (Byte)flags;
  441|  2.88M|}
archive_ppmd8.c:GetUsedMemory:
  543|  2.72k|{
  544|  2.72k|  UInt32 v = 0;
  545|  2.72k|  unsigned i;
  546|   106k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   106k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   106k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   106k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   106k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   106k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   106k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   106k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   106k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (546:15): [True: 103k, False: 2.72k]
  ------------------
  547|   103k|    v += p->Stamps[i] * I2U(i);
  ------------------
  |  |   19|   103k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  548|  2.72k|  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
  ------------------
  |  |   17|  2.72k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  2.72k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  549|  2.72k|}
archive_ppmd8.c:CutOff:
  451|  88.5M|{
  452|  88.5M|  int i;
  453|  88.5M|  unsigned tmp;
  454|  88.5M|  CPpmd_State *s;
  455|       |  
  456|  88.5M|  if (!ctx->NumStats)
  ------------------
  |  Branch (456:7): [True: 68.8M, False: 19.6M]
  ------------------
  457|  68.8M|  {
  458|  68.8M|    s = ONE_STATE(ctx);
  ------------------
  |  |   31|  68.8M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  68.8M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  459|  68.8M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
  ------------------
  |  |   96|  68.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (459:9): [True: 66.0M, False: 2.82M]
  ------------------
  460|  66.0M|    {
  461|  66.0M|      if (order < p->MaxOrder)
  ------------------
  |  Branch (461:11): [True: 61.3M, False: 4.72M]
  ------------------
  462|  61.3M|        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  61.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  61.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  61.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  4.72M|      else
  464|  4.72M|        SetSuccessor(s, 0);
  465|  66.0M|      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
  ------------------
  |  |  341|   132M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 31.8M, False: 34.2M]
  |  |  ------------------
  ------------------
  |  Branch (465:27): [True: 6.96M, False: 27.2M]
  ------------------
  466|  38.8M|        return REF(ctx);
  ------------------
  |  |   24|  38.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  467|  66.0M|    }
  468|  30.0M|    SpecialFreeUnit(p, ctx);
  469|  30.0M|    return 0;
  470|  68.8M|  }
  471|       |
  472|  19.6M|  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
  ------------------
  |  |   27|  19.6M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  19.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  473|       |
  474|  71.5M|  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  19.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  19.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  19.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  71.5M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  71.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  71.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:46): [True: 51.8M, False: 19.6M]
  ------------------
  475|  51.8M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
  ------------------
  |  |   96|  51.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (475:9): [True: 24.1M, False: 27.7M]
  ------------------
  476|  24.1M|    {
  477|  24.1M|      CPpmd_State *s2 = STATS(ctx) + (i--);
  ------------------
  |  |   30|  24.1M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  24.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  24.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  24.1M|      SetSuccessor(s, 0);
  479|  24.1M|      SwapStates(s, s2);
  480|  24.1M|    }
  481|  27.7M|    else if (order < p->MaxOrder)
  ------------------
  |  Branch (481:14): [True: 27.2M, False: 483k]
  ------------------
  482|  27.2M|      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  27.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  27.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  27.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   483k|    else
  484|   483k|      SetSuccessor(s, 0);
  485|       |    
  486|  19.6M|  if (i != ctx->NumStats && order)
  ------------------
  |  Branch (486:7): [True: 15.3M, False: 4.34M]
  |  Branch (486:29): [True: 15.3M, False: 1.36k]
  ------------------
  487|  15.3M|  {
  488|  15.3M|    ctx->NumStats = (Byte)i;
  489|  15.3M|    s = STATS(ctx);
  ------------------
  |  |   30|  15.3M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  15.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  15.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  15.3M|    if (i < 0)
  ------------------
  |  Branch (490:9): [True: 4.80M, False: 10.5M]
  ------------------
  491|  4.80M|    {
  492|  4.80M|      FreeUnits(p, s, tmp);
  493|  4.80M|      SpecialFreeUnit(p, ctx);
  494|  4.80M|      return 0;
  495|  4.80M|    }
  496|  10.5M|    if (i == 0)
  ------------------
  |  Branch (496:9): [True: 7.65M, False: 2.88M]
  ------------------
  497|  7.65M|    {
  498|  7.65M|      ctx->Flags = (Byte)((ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  499|  7.65M|      *ONE_STATE(ctx) = *s;
  ------------------
  |  |   31|  7.65M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  7.65M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  500|  7.65M|      FreeUnits(p, s, tmp);
  501|       |      /* 9.31: the code was fixed. It's was not BUG, if Freq <= MAX_FREQ = 124 */
  502|  7.65M|      ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  7.65M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  7.65M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  7.65M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  7.65M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  503|  7.65M|    }
  504|  2.88M|    else
  505|  2.88M|      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
  506|  10.5M|  }
  507|  14.8M|  return REF(ctx);
  ------------------
  |  |   24|  14.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  508|  19.6M|}
archive_ppmd8.c:MoveUnitsUp:
  290|  19.6M|{
  291|  19.6M|  unsigned indx = U2I(nu);
  ------------------
  |  |   18|  19.6M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  292|  19.6M|  void *ptr;
  293|  19.6M|  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
  ------------------
  |  |   24|   343k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  |  Branch (293:7): [True: 19.3M, False: 343k]
  |  Branch (293:53): [True: 3.35k, False: 339k]
  ------------------
  294|  19.3M|    return oldPtr;
  295|   339k|  ptr = RemoveNode(p, indx);
  296|   339k|  MyMem12Cpy(ptr, oldPtr, nu);
  ------------------
  |  |  245|   339k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|   339k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|   339k|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|   339k|	UInt32 n = num;							\
  |  |  249|   475k|	do {								\
  |  |  250|   475k|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|   475k|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 135k, False: 339k]
  |  |  ------------------
  |  |  252|   339k|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 339k]
  |  |  ------------------
  ------------------
  297|   339k|  if ((Byte*)oldPtr != p->UnitsStart)
  ------------------
  |  Branch (297:7): [True: 339k, False: 247]
  ------------------
  298|   339k|    InsertNode(p, oldPtr, indx);
  299|    247|  else
  300|    247|    p->UnitsStart += U2B(I2U(indx));
  ------------------
  |  |   17|    247|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|    247|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  301|   339k|  return ptr;
  302|  19.6M|}
archive_ppmd8.c:FreeUnits:
  272|  12.4M|{
  273|  12.4M|  InsertNode(p, ptr, U2I(nu));
  ------------------
  |  |   18|  12.4M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  274|  12.4M|}
archive_ppmd8.c:ExpandTextArea:
  305|  1.36k|{
  306|  1.36k|  UInt32 count[PPMD_NUM_INDEXES];
  307|  1.36k|  unsigned i;
  308|  1.36k|  memset(count, 0, sizeof(count));
  309|  1.36k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (309:7): [True: 0, False: 1.36k]
  ------------------
  310|      0|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  311|       |  
  312|  1.36k|  {
  313|  1.36k|    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
  314|  33.4k|    for (; node->Stamp == EMPTY_NODE; node += node->NU)
  ------------------
  |  |   62|  33.4k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (314:12): [True: 32.0k, False: 1.36k]
  ------------------
  315|  32.0k|    {
  316|  32.0k|      node->Stamp = 0;
  317|  32.0k|      count[U2I(node->NU)]++;
  ------------------
  |  |   18|  32.0k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  318|  32.0k|    }
  319|  1.36k|    p->UnitsStart = (Byte *)node;
  320|  1.36k|  }
  321|       |  
  322|  53.1k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  53.1k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  53.1k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  53.1k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  53.1k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  53.1k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  53.1k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  53.1k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  53.1k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:15): [True: 51.8k, False: 1.36k]
  ------------------
  323|  51.8k|  {
  324|  51.8k|    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
  325|  36.2M|    while (count[i] != 0)
  ------------------
  |  Branch (325:12): [True: 36.2M, False: 51.8k]
  ------------------
  326|  36.2M|    {
  327|  36.2M|      CPpmd8_Node *node = NODE(*next);
  ------------------
  |  |   59|  36.2M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  328|  36.2M|      while (node->Stamp == 0)
  ------------------
  |  Branch (328:14): [True: 32.0k, False: 36.2M]
  ------------------
  329|  32.0k|      {
  330|  32.0k|        *next = node->Next;
  331|  32.0k|        node = NODE(*next);
  ------------------
  |  |   59|  32.0k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  332|  32.0k|        p->Stamps[i]--;
  333|  32.0k|        if (--count[i] == 0)
  ------------------
  |  Branch (333:13): [True: 1.90k, False: 30.1k]
  ------------------
  334|  1.90k|          break;
  335|  32.0k|      }
  336|  36.2M|      next = &node->Next;
  337|  36.2M|    }
  338|  51.8k|  }
  339|  1.36k|}
archive_ppmd8.c:ReduceOrder:
  707|  2.17M|{
  708|  2.17M|  CPpmd_State *s = NULL;
  709|  2.17M|  CTX_PTR c1 = c;
  710|  2.17M|  CPpmd_Void_Ref upBranch = REF(p->Text);
  ------------------
  |  |   24|  2.17M|  #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.17M|  SetSuccessor(p->FoundState, upBranch);
  720|  2.17M|  p->OrderFall++;
  721|       |
  722|  2.17M|  for (;;)
  723|  3.34M|  {
  724|  3.34M|    if (s1)
  ------------------
  |  Branch (724:9): [True: 1.66M, False: 1.67M]
  ------------------
  725|  1.66M|    {
  726|  1.66M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.66M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.66M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.66M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.66M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  727|  1.66M|      s = s1;
  728|  1.66M|      s1 = NULL;
  729|  1.66M|    }
  730|  1.67M|    else
  731|  1.67M|    {
  732|  1.67M|      if (!c->Suffix)
  ------------------
  |  Branch (732:11): [True: 502k, False: 1.17M]
  ------------------
  733|   502k|      {
  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|   502k|        return c;
  743|   502k|      }
  744|  1.17M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.17M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.17M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.17M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.17M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  1.17M|      if (c->NumStats)
  ------------------
  |  Branch (745:11): [True: 565k, False: 609k]
  ------------------
  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: 223k]
  ------------------
  748|  1.03M|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (748:30): [True: 689k, False: 342k]
  ------------------
  749|   565k|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|   565k|#define MAX_FREQ 124
  ------------------
  |  Branch (749:13): [True: 564k, False: 1.23k]
  ------------------
  750|   564k|        {
  751|   564k|          s->Freq += 2;
  752|   564k|          c->SummFreq += 2;
  753|   564k|        }
  754|   565k|      }
  755|   609k|      else
  756|   609k|      {
  757|   609k|        s = ONE_STATE(c);
  ------------------
  |  |   31|   609k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   609k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  758|   609k|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  759|   609k|      }
  760|  1.17M|    }
  761|  2.84M|    if (SUCCESSOR(s))
  ------------------
  |  |  341|  2.84M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 1.67M, False: 1.17M]
  |  |  ------------------
  ------------------
  762|  1.67M|      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.67M|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  341|  1.67M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (781:7): [True: 25.9k, False: 1.64M]
  ------------------
  782|  25.9k|  {
  783|  25.9k|    CTX_PTR successor;
  784|  25.9k|    CPpmd_State *s2 = p->FoundState;
  785|  25.9k|    p->FoundState = s;
  786|       |
  787|  25.9k|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|  25.9k|#define False 0
  ------------------
  788|  25.9k|    if (successor == NULL)
  ------------------
  |  Branch (788:9): [True: 52, False: 25.9k]
  ------------------
  789|     52|      SetSuccessor(s, 0);
  790|  25.9k|    else
  791|  25.9k|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|  25.9k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  792|  25.9k|    p->FoundState = s2;
  793|  25.9k|  }
  794|       |  
  795|  1.67M|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (795:7): [True: 20.0k, False: 1.65M]
  |  Branch (795:28): [True: 20.0k, False: 0]
  ------------------
  796|  20.0k|  {
  797|  20.0k|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  341|  20.0k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  798|  20.0k|    p->Text--;
  799|  20.0k|  }
  800|  1.67M|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  341|  1.67M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (800:7): [True: 52, False: 1.67M]
  ------------------
  801|     52|    return NULL;
  802|  1.67M|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|  1.67M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  1.67M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.67M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  1.67M|}
archive_ppmd8.c:AllocUnits:
  231|  34.4M|{
  232|  34.4M|  UInt32 numBytes;
  233|  34.4M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 13.7M, False: 20.6M]
  ------------------
  234|  13.7M|    return RemoveNode(p, indx);
  235|  20.6M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  20.6M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  20.6M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  20.6M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 17.8M, False: 2.82M]
  ------------------
  237|  17.8M|  {
  238|  17.8M|    void *retVal = p->LoUnit;
  239|  17.8M|    p->LoUnit += numBytes;
  240|  17.8M|    return retVal;
  241|  17.8M|  }
  242|  2.82M|  return AllocUnitsRare(p, indx);
  243|  20.6M|}
archive_ppmd8.c:Ppmd8_Update1:
 1082|  5.17M|{
 1083|  5.17M|  CPpmd_State *s = p->FoundState;
 1084|  5.17M|  s->Freq += 4;
 1085|  5.17M|  p->MinContext->SummFreq += 4;
 1086|  5.17M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1086:7): [True: 3.44M, False: 1.73M]
  ------------------
 1087|  3.44M|  {
 1088|  3.44M|    SwapStates(&s[0], &s[-1]);
 1089|  3.44M|    p->FoundState = --s;
 1090|  3.44M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  3.44M|#define MAX_FREQ 124
  ------------------
  |  Branch (1090:9): [True: 599, False: 3.44M]
  ------------------
 1091|    599|      Rescale(p);
 1092|  3.44M|  }
 1093|  5.17M|  NextContext(p);
 1094|  5.17M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|  65.2M|{
 1108|  65.2M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|  65.2M|  p->PrevSuccess = 1;
 1110|  65.2M|  p->RunLength++;
 1111|  65.2M|  NextContext(p);
 1112|  65.2M|}
archive_ppmd8.c:Ppmd8_MakeEscFreq:
 1046|  14.3M|{
 1047|  14.3M|  CPpmd_See *see;
 1048|  14.3M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1048:7): [True: 12.2M, False: 2.10M]
  ------------------
 1049|  12.2M|  {
 1050|  12.2M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1051|  12.2M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1052|  12.2M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1053|  12.2M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  12.2M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  12.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  12.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  12.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  12.2M|        p->MinContext->Flags;
 1055|  12.2M|    {
 1056|  12.2M|      unsigned r = (see->Summ >> see->Shift);
 1057|  12.2M|      see->Summ = (UInt16)(see->Summ - r);
 1058|  12.2M|      *escFreq = r + (r == 0);
 1059|  12.2M|    }
 1060|  12.2M|  }
 1061|  2.10M|  else
 1062|  2.10M|  {
 1063|  2.10M|    see = &p->DummySee;
 1064|  2.10M|    *escFreq = 1;
 1065|  2.10M|  }
 1066|  14.3M|  return see;
 1067|  14.3M|}
archive_ppmd8.c:Ppmd8_Update2:
 1115|  10.1M|{
 1116|  10.1M|  p->MinContext->SummFreq += 4;
 1117|  10.1M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  10.1M|#define MAX_FREQ 124
  ------------------
  |  Branch (1117:7): [True: 12.8k, False: 10.1M]
  ------------------
 1118|  12.8k|    Rescale(p);
 1119|  10.1M|  p->RunLength = p->InitRL;
 1120|  10.1M|  UpdateModel(p);
 1121|  10.1M|  p->MinContext = p->MaxContext;
 1122|  10.1M|}

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

archive_read_new:
   96|  11.9k|{
   97|  11.9k|	struct archive_read *a;
   98|       |
   99|  11.9k|	a = calloc(1, sizeof(*a));
  100|  11.9k|	if (a == NULL)
  ------------------
  |  Branch (100:6): [True: 0, False: 11.9k]
  ------------------
  101|      0|		return (NULL);
  102|  11.9k|	a->archive.magic = ARCHIVE_READ_MAGIC;
  ------------------
  |  |   59|  11.9k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  103|       |
  104|  11.9k|	a->archive.state = ARCHIVE_STATE_NEW;
  ------------------
  |  |   76|  11.9k|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  105|  11.9k|	a->entry = archive_entry_new2(&a->archive);
  106|  11.9k|	if (a->entry == NULL) {
  ------------------
  |  Branch (106:6): [True: 0, False: 11.9k]
  ------------------
  107|      0|		free(a);
  108|      0|		return (NULL);
  109|      0|	}
  110|  11.9k|	a->archive.vtable = &archive_read_vtable;
  111|  11.9k|	a->entry_bytes_declared = -1;
  112|       |
  113|  11.9k|	a->passphrases.last = &a->passphrases.first;
  114|       |
  115|  11.9k|	return (&a->archive);
  116|  11.9k|}
archive_read_set_open_callback:
  312|  11.9k|{
  313|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  314|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  315|  11.9k|	    "archive_read_set_open_callback");
  316|  11.9k|	a->client.opener = client_opener;
  317|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  318|  11.9k|}
archive_read_set_read_callback:
  323|  11.9k|{
  324|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  325|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  326|  11.9k|	    "archive_read_set_read_callback");
  327|  11.9k|	a->client.reader = client_reader;
  328|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  329|  11.9k|}
archive_read_set_skip_callback:
  334|  11.9k|{
  335|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  336|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  337|  11.9k|	    "archive_read_set_skip_callback");
  338|  11.9k|	a->client.skipper = client_skipper;
  339|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  340|  11.9k|}
archive_read_set_seek_callback:
  345|  11.9k|{
  346|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  347|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  348|  11.9k|	    "archive_read_set_seek_callback");
  349|  11.9k|	a->client.seeker = client_seeker;
  350|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  351|  11.9k|}
archive_read_set_close_callback:
  356|  11.9k|{
  357|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  358|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  359|  11.9k|	    "archive_read_set_close_callback");
  360|  11.9k|	a->client.closer = client_closer;
  361|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  362|  11.9k|}
archive_read_set_callback_data:
  377|  11.9k|{
  378|  11.9k|	return archive_read_set_callback_data2(_a, client_data, 0);
  379|  11.9k|}
archive_read_set_callback_data2:
  384|  11.9k|{
  385|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  386|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  387|  11.9k|	    "archive_read_set_callback_data2");
  388|       |
  389|  11.9k|	if (a->client.nodes == 0)
  ------------------
  |  Branch (389:6): [True: 11.9k, False: 0]
  ------------------
  390|  11.9k|	{
  391|  11.9k|		a->client.dataset = (struct archive_read_data_node *)
  392|  11.9k|		    calloc(1, sizeof(*a->client.dataset));
  393|  11.9k|		if (a->client.dataset == NULL)
  ------------------
  |  Branch (393:7): [True: 0, False: 11.9k]
  ------------------
  394|      0|		{
  395|      0|			archive_set_error(&a->archive, ENOMEM,
  396|      0|				"No memory");
  397|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  398|      0|		}
  399|  11.9k|		a->client.nodes = 1;
  400|  11.9k|	}
  401|       |
  402|  11.9k|	if (iindex > a->client.nodes - 1)
  ------------------
  |  Branch (402:6): [True: 0, False: 11.9k]
  ------------------
  403|      0|	{
  404|      0|		archive_set_error(&a->archive, EINVAL,
  405|      0|			"Invalid index specified");
  406|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  407|      0|	}
  408|  11.9k|	a->client.dataset[iindex].data = client_data;
  409|  11.9k|	a->client.dataset[iindex].begin_position = -1;
  410|  11.9k|	a->client.dataset[iindex].total_size = -1;
  411|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  412|  11.9k|}
archive_read_open1:
  483|  11.9k|{
  484|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  485|  11.9k|	struct archive_read_filter *f, *tmp;
  486|  11.9k|	int slot, e = ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  487|       |
  488|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  489|  11.9k|	    "archive_read_open");
  490|  11.9k|	archive_clear_error(&a->archive);
  491|       |
  492|  11.9k|	if (a->client.reader == NULL) {
  ------------------
  |  Branch (492:6): [True: 0, False: 11.9k]
  ------------------
  493|      0|		archive_set_error(&a->archive, EINVAL,
  494|      0|		    "No reader function provided to archive_read_open");
  495|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  496|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|      0|	}
  498|       |
  499|       |	/* Open data source. */
  500|  11.9k|	if (a->client.opener != NULL) {
  ------------------
  |  Branch (500:6): [True: 11.9k, False: 0]
  ------------------
  501|  11.9k|		e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
  502|  11.9k|		if (e != 0) {
  ------------------
  |  Branch (502:7): [True: 0, False: 11.9k]
  ------------------
  503|       |			/* If the open failed, call the closer to clean up. */
  504|      0|			read_client_close_proxy(a);
  505|      0|			return (e);
  506|      0|		}
  507|  11.9k|	}
  508|       |
  509|  11.9k|	f = calloc(1, sizeof(*f));
  510|  11.9k|	if (f == NULL)
  ------------------
  |  Branch (510:6): [True: 0, False: 11.9k]
  ------------------
  511|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  512|  11.9k|	f->bidder = NULL;
  513|  11.9k|	f->upstream = NULL;
  514|  11.9k|	f->archive = a;
  515|  11.9k|	f->data = a->client.dataset[0].data;
  516|  11.9k|	f->vtable = &none_reader_vtable;
  517|  11.9k|	f->name = "none";
  518|  11.9k|	f->code = ARCHIVE_FILTER_NONE;
  ------------------
  |  |  309|  11.9k|#define	ARCHIVE_FILTER_NONE	0
  ------------------
  519|  11.9k|	f->can_skip = 1;
  520|  11.9k|	f->can_seek = 1;
  521|       |
  522|  11.9k|	a->client.dataset[0].begin_position = 0;
  523|  11.9k|	if (!a->filter || !a->bypass_filter_bidding)
  ------------------
  |  Branch (523:6): [True: 11.9k, False: 0]
  |  Branch (523:20): [True: 0, False: 0]
  ------------------
  524|  11.9k|	{
  525|  11.9k|		a->filter = f;
  526|       |		/* Build out the input pipeline. */
  527|  11.9k|		e = choose_filters(a);
  528|  11.9k|		if (e < ARCHIVE_WARN) {
  ------------------
  |  |  235|  11.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (528:7): [True: 179, False: 11.7k]
  ------------------
  529|    179|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|    179|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  530|    179|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    179|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  531|    179|		}
  532|  11.9k|	}
  533|      0|	else
  534|      0|	{
  535|       |		/* Need to add "NONE" type filter at the end of the filter chain */
  536|      0|		tmp = a->filter;
  537|      0|		while (tmp->upstream)
  ------------------
  |  Branch (537:10): [True: 0, False: 0]
  ------------------
  538|      0|			tmp = tmp->upstream;
  539|      0|		tmp->upstream = f;
  540|      0|	}
  541|       |
  542|  11.7k|	if (!a->format)
  ------------------
  |  Branch (542:6): [True: 11.7k, False: 0]
  ------------------
  543|  11.7k|	{
  544|  11.7k|		slot = choose_format(a);
  545|  11.7k|		if (slot < 0) {
  ------------------
  |  Branch (545:7): [True: 90, False: 11.6k]
  ------------------
  546|     90|			close_filters(a);
  547|     90|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|     90|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  548|     90|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     90|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  549|     90|		}
  550|  11.6k|		a->format = &(a->formats[slot]);
  551|  11.6k|	}
  552|       |
  553|  11.6k|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   78|  11.6k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  554|       |
  555|       |	/* Ensure libarchive starts from the first node in a multivolume set */
  556|  11.6k|	client_switch_proxy(a->filter, 0);
  557|  11.6k|	return (e);
  558|  11.7k|}
__archive_read_header:
  626|    375|{
  627|    375|	if (!a->filter->vtable->read_header)
  ------------------
  |  Branch (627:6): [True: 240, False: 135]
  ------------------
  628|    240|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    240|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  629|    135|	return a->filter->vtable->read_header(a->filter, entry);
  630|    375|}
archive_read_has_encrypted_entries:
  821|  11.6k|{
  822|  11.6k|	struct archive_read *a = (struct archive_read *)_a;
  823|  11.6k|	int format_supports_encryption = archive_read_format_capabilities(_a)
  824|  11.6k|			& (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  398|  11.6k|#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|  11.6k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  825|       |
  826|  11.6k|	if (!_a || !format_supports_encryption) {
  ------------------
  |  Branch (826:6): [True: 0, False: 11.6k]
  |  Branch (826:13): [True: 6.20k, False: 5.45k]
  ------------------
  827|       |		/* Format in general doesn't support encryption */
  828|  6.20k|		return ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED;
  ------------------
  |  |  410|  6.20k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
  ------------------
  829|  6.20k|	}
  830|       |
  831|       |	/* A reader potentially has read enough data now. */
  832|  5.45k|	if (a->format && a->format->has_encrypted_entries) {
  ------------------
  |  Branch (832:6): [True: 5.45k, False: 0]
  |  Branch (832:19): [True: 5.45k, False: 0]
  ------------------
  833|  5.45k|		return (a->format->has_encrypted_entries)(a);
  834|  5.45k|	}
  835|       |
  836|       |	/* For any other reason we cannot say how many entries are there. */
  837|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  838|  5.45k|}
archive_read_format_capabilities:
  846|  23.3k|{
  847|  23.3k|	struct archive_read *a = (struct archive_read *)_a;
  848|  23.3k|	if (a && a->format && a->format->format_capabilties) {
  ------------------
  |  Branch (848:6): [True: 23.3k, False: 0]
  |  Branch (848:11): [True: 23.3k, False: 0]
  |  Branch (848:24): [True: 10.9k, False: 12.4k]
  ------------------
  849|  10.9k|		return (a->format->format_capabilties)(a);
  850|  10.9k|	}
  851|  12.4k|	return ARCHIVE_READ_FORMAT_CAPS_NONE;
  ------------------
  |  |  397|  12.4k|#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
  ------------------
  852|  23.3k|}
archive_read_data:
  867|   621M|{
  868|   621M|	struct archive *a = (struct archive *)_a;
  869|   621M|	char	*dest;
  870|   621M|	const void *read_buf;
  871|   621M|	size_t	 bytes_read;
  872|   621M|	size_t	 len;
  873|   621M|	int	 r;
  874|       |
  875|   621M|	bytes_read = 0;
  876|   621M|	dest = (char *)buff;
  877|       |
  878|  1.24G|	while (s > 0) {
  ------------------
  |  Branch (878:9): [True: 621M, False: 621M]
  ------------------
  879|   621M|		if (a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (879:7): [True: 1.72M, False: 620M]
  ------------------
  880|  1.72M|		    a->read_data_remaining == 0) {
  ------------------
  |  Branch (880:7): [True: 430k, False: 1.29M]
  ------------------
  881|   430k|			read_buf = a->read_data_block;
  882|   430k|			a->read_data_is_posix_read = 1;
  883|   430k|			a->read_data_requested = s;
  884|   430k|			r = archive_read_data_block(a, &read_buf,
  885|   430k|			    &a->read_data_remaining, &a->read_data_offset);
  886|   430k|			a->read_data_block = read_buf;
  887|   430k|			if (r == ARCHIVE_EOF &&
  ------------------
  |  |  232|   861k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (887:8): [True: 249k, False: 181k]
  ------------------
  888|   249k|			    a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (888:8): [True: 239k, False: 9.86k]
  ------------------
  889|   239k|			    a->read_data_remaining == 0)
  ------------------
  |  Branch (889:8): [True: 239k, False: 0]
  ------------------
  890|   239k|				return (bytes_read);
  891|       |			/*
  892|       |			 * Error codes are all negative, so the status
  893|       |			 * return here cannot be confused with a valid
  894|       |			 * byte count.  (ARCHIVE_OK is zero.)
  895|       |			 */
  896|   191k|			if (r < ARCHIVE_OK)
  ------------------
  |  |  233|   191k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (896:8): [True: 37.9k, False: 153k]
  ------------------
  897|  37.9k|				return (r);
  898|   191k|		}
  899|       |
  900|   621M|		if (a->read_data_offset < a->read_data_output_offset) {
  ------------------
  |  Branch (900:7): [True: 458, False: 621M]
  ------------------
  901|    458|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    458|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  902|    458|			    "Encountered out-of-order sparse blocks");
  903|    458|			return (ARCHIVE_RETRY);
  ------------------
  |  |  234|    458|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  904|    458|		}
  905|       |
  906|       |		/* Compute the amount of zero padding needed. */
  907|   621M|		if (a->read_data_output_offset + (int64_t)s <
  ------------------
  |  Branch (907:7): [True: 620M, False: 1.44M]
  ------------------
  908|   621M|		    a->read_data_offset) {
  909|   620M|			len = s;
  910|   620M|		} else if (a->read_data_output_offset <
  ------------------
  |  Branch (910:14): [True: 10.3k, False: 1.43M]
  ------------------
  911|  1.44M|		    a->read_data_offset) {
  912|  10.3k|			len = (size_t)(a->read_data_offset -
  913|  10.3k|			    a->read_data_output_offset);
  914|  10.3k|		} else
  915|  1.43M|			len = 0;
  916|       |
  917|       |		/* Add zeroes. */
  918|   621M|		memset(dest, 0, len);
  919|   621M|		s -= len;
  920|   621M|		a->read_data_output_offset += len;
  921|   621M|		dest += len;
  922|   621M|		bytes_read += len;
  923|       |
  924|       |		/* Copy data if there is any space left. */
  925|   621M|		if (s > 0) {
  ------------------
  |  Branch (925:7): [True: 1.44M, False: 620M]
  ------------------
  926|  1.44M|			len = a->read_data_remaining;
  927|  1.44M|			if (len > s)
  ------------------
  |  Branch (927:8): [True: 1.29M, False: 153k]
  ------------------
  928|  1.29M|				len = s;
  929|  1.44M|			if (len) {
  ------------------
  |  Branch (929:8): [True: 1.40M, False: 39.4k]
  ------------------
  930|  1.40M|				memcpy(dest, a->read_data_block, len);
  931|  1.40M|				s -= len;
  932|  1.40M|				a->read_data_block += len;
  933|  1.40M|				a->read_data_remaining -= len;
  934|  1.40M|				a->read_data_output_offset += len;
  935|  1.40M|				a->read_data_offset += len;
  936|  1.40M|				dest += len;
  937|  1.40M|				bytes_read += len;
  938|  1.40M|			}
  939|  1.44M|		}
  940|   621M|	}
  941|   621M|	a->read_data_is_posix_read = 0;
  942|   621M|	a->read_data_requested = 0;
  943|   621M|	return (bytes_read);
  944|   621M|}
__archive_reset_read_data:
  950|   743k|{
  951|   743k|	a->read_data_output_offset = 0;
  952|   743k|	a->read_data_remaining = 0;
  953|   743k|	a->read_data_is_posix_read = 0;
  954|   743k|	a->read_data_requested = 0;
  955|       |
  956|       |   /* extra resets, from rar.c */
  957|       |   a->read_data_block = NULL;
  958|   743k|   a->read_data_offset = 0;
  959|   743k|}
archive_read_data_skip:
  966|   244k|{
  967|   244k|	struct archive_read *a = (struct archive_read *)_a;
  968|   244k|	int r;
  969|   244k|	const void *buff;
  970|   244k|	size_t size;
  971|   244k|	int64_t offset;
  972|       |
  973|   244k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|   244k|	do { \
  |  |  178|   244k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|   244k|			(allowed_states), (function_name)); \
  |  |  180|   244k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   244k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 244k]
  |  |  ------------------
  |  |  181|   244k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|   244k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 244k]
  |  |  ------------------
  ------------------
  974|   244k|	    ARCHIVE_STATE_DATA | ARCHIVE_STATE_DATA_RECOVERY,
  975|   244k|	    "archive_read_data_skip");
  976|       |
  977|   244k|	if (a->format->read_data_skip != NULL)
  ------------------
  |  Branch (977:6): [True: 244k, False: 0]
  ------------------
  978|   244k|		r = (a->format->read_data_skip)(a);
  979|      0|	else {
  980|      0|		while ((r = archive_read_data_block(&a->archive,
  ------------------
  |  Branch (980:10): [True: 0, False: 0]
  ------------------
  981|      0|			    &buff, &size, &offset))
  982|      0|		    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  983|      0|			;
  984|      0|	}
  985|       |
  986|   244k|	if (r == ARCHIVE_EOF)
  ------------------
  |  |  232|   244k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (986:6): [True: 139, False: 244k]
  ------------------
  987|    139|		r = ARCHIVE_OK;
  ------------------
  |  |  233|    139|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  988|       |
  989|   244k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|   244k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (989:6): [True: 1.42k, False: 243k]
  ------------------
  990|  1.42k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|  1.42k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  991|   243k|	else
  992|   243k|		a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   78|   243k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  993|   244k|	return (r);
  994|   244k|}
archive_seek_data:
  998|  11.6k|{
  999|  11.6k|	struct archive_read *a = (struct archive_read *)_a;
 1000|  11.6k|	la_int64_t r;
 1001|       |
 1002|  11.6k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  177|  11.6k|	do { \
  |  |  178|  11.6k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.6k|			(allowed_states), (function_name)); \
  |  |  180|  11.6k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.6k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 11.6k, False: 0]
  |  |  ------------------
  |  |  181|  11.6k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|  11.6k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.6k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1003|  11.6k|	    "archive_seek_data_block");
 1004|       |
 1005|      0|	if (a->format->seek_data == NULL) {
  ------------------
  |  Branch (1005:6): [True: 0, False: 0]
  ------------------
 1006|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1007|      0|		    "Cannot seek data with this format");
 1008|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1009|      0|	}
 1010|       |
 1011|      0|	r = (a->format->seek_data)(a, offset, whence);
 1012|      0|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1012:6): [True: 0, False: 0]
  ------------------
 1013|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1014|      0|	return (r);
 1015|      0|}
__archive_read_free_filters:
 1072|  12.1k|{
 1073|       |	/* Make sure filters are closed and their buffers are freed */
 1074|  12.1k|	close_filters(a);
 1075|       |
 1076|  26.1k|	while (a->filter != NULL) {
  ------------------
  |  Branch (1076:9): [True: 13.9k, False: 12.1k]
  ------------------
 1077|  13.9k|		struct archive_read_filter *t = a->filter->upstream;
 1078|  13.9k|		free(a->filter);
 1079|  13.9k|		a->filter = t;
 1080|  13.9k|	}
 1081|  12.1k|}
__archive_read_register_format:
 1253|   214k|{
 1254|   214k|	int i, number_slots;
 1255|       |
 1256|   214k|	archive_check_magic(&a->archive,
  ------------------
  |  |  177|   214k|	do { \
  |  |  178|   214k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|   214k|			(allowed_states), (function_name)); \
  |  |  180|   214k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   214k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 214k]
  |  |  ------------------
  |  |  181|   214k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|   214k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 214k]
  |  |  ------------------
  ------------------
 1257|   214k|	    ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
 1258|   214k|	    "__archive_read_register_format");
 1259|       |
 1260|   214k|	number_slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1261|       |
 1262|  1.73M|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1262:14): [True: 1.73M, False: 0]
  ------------------
 1263|  1.73M|		if (a->formats[i].bid == bid)
  ------------------
  |  Branch (1263:7): [True: 23.8k, False: 1.70M]
  ------------------
 1264|  23.8k|			return (ARCHIVE_WARN); /* We've already installed */
  ------------------
  |  |  235|  23.8k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1265|  1.70M|		if (a->formats[i].bid == NULL) {
  ------------------
  |  Branch (1265:7): [True: 190k, False: 1.51M]
  ------------------
 1266|   190k|			a->formats[i].bid = bid;
 1267|   190k|			a->formats[i].options = options;
 1268|   190k|			a->formats[i].read_header = read_header;
 1269|   190k|			a->formats[i].read_data = read_data;
 1270|   190k|			a->formats[i].read_data_skip = read_data_skip;
 1271|   190k|			a->formats[i].seek_data = seek_data;
 1272|   190k|			a->formats[i].cleanup = cleanup;
 1273|   190k|			a->formats[i].data = format_data;
 1274|   190k|			a->formats[i].name = name;
 1275|   190k|			a->formats[i].format_capabilties = format_capabilities;
 1276|   190k|			a->formats[i].has_encrypted_entries = has_encrypted_entries;
 1277|   190k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|   190k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1278|   190k|		}
 1279|  1.70M|	}
 1280|       |
 1281|      0|	archive_set_error(&a->archive, ENOMEM,
 1282|      0|	    "Not enough slots for format registration");
 1283|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1284|   214k|}
__archive_read_register_bidder:
 1294|   155k|{
 1295|   155k|	struct archive_read_filter_bidder *bidder;
 1296|   155k|	int i, number_slots;
 1297|       |
 1298|   155k|	archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|   155k|	do { \
  |  |  178|   155k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|   155k|			(allowed_states), (function_name)); \
  |  |  180|   155k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   155k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 155k]
  |  |  ------------------
  |  |  181|   155k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|   155k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 155k]
  |  |  ------------------
  ------------------
 1299|   155k|	    ARCHIVE_STATE_NEW, "__archive_read_register_bidder");
 1300|       |
 1301|   155k|	number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
 1302|       |
 1303|  1.08M|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1303:14): [True: 1.08M, False: 0]
  ------------------
 1304|  1.08M|		if (a->bidders[i].vtable != NULL)
  ------------------
  |  Branch (1304:7): [True: 931k, False: 155k]
  ------------------
 1305|   931k|			continue;
 1306|   155k|		memset(a->bidders + i, 0, sizeof(a->bidders[0]));
 1307|   155k|		bidder = (a->bidders + i);
 1308|   155k|		bidder->data = bidder_data;
 1309|   155k|		bidder->vtable = vtable;
 1310|   155k|		if (bidder->vtable->bid == NULL || bidder->vtable->init == NULL) {
  ------------------
  |  Branch (1310:7): [True: 0, False: 155k]
  |  Branch (1310:38): [True: 0, False: 155k]
  ------------------
 1311|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1312|      0|					"Internal error: "
 1313|      0|					"no bid/init for filter bidder");
 1314|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1315|      0|		}
 1316|       |
 1317|   155k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|   155k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1318|   155k|	}
 1319|       |
 1320|      0|	archive_set_error(&a->archive, ENOMEM,
 1321|      0|	    "Not enough slots for filter registration");
 1322|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1323|   155k|}
__archive_read_ahead:
 1378|  14.0M|{
 1379|  14.0M|	return (__archive_read_filter_ahead(a->filter, min, avail));
 1380|  14.0M|}
__archive_read_filter_ahead:
 1385|  19.2M|{
 1386|  19.2M|	ssize_t bytes_read;
 1387|  19.2M|	size_t tocopy;
 1388|       |
 1389|  19.2M|	if (f->fatal) {
  ------------------
  |  Branch (1389:6): [True: 3.19k, False: 19.2M]
  ------------------
 1390|  3.19k|		if (avail)
  ------------------
  |  Branch (1390:7): [True: 1.09k, False: 2.09k]
  ------------------
 1391|  1.09k|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|  1.09k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1392|  3.19k|		return (NULL);
 1393|  3.19k|	}
 1394|       |
 1395|       |	/*
 1396|       |	 * Keep pulling more data until we can satisfy the request.
 1397|       |	 */
 1398|  24.3M|	for (;;) {
 1399|       |
 1400|       |		/*
 1401|       |		 * If we can satisfy from the copy buffer (and the
 1402|       |		 * copy buffer isn't empty), we're done.  In particular,
 1403|       |		 * note that min == 0 is a perfectly well-defined
 1404|       |		 * request.
 1405|       |		 */
 1406|  24.3M|		if (f->avail >= min && f->avail > 0) {
  ------------------
  |  Branch (1406:7): [True: 5.41M, False: 18.8M]
  |  Branch (1406:26): [True: 5.35M, False: 55.1k]
  ------------------
 1407|  5.35M|			if (avail != NULL)
  ------------------
  |  Branch (1407:8): [True: 5.15M, False: 201k]
  ------------------
 1408|  5.15M|				*avail = f->avail;
 1409|  5.35M|			return (f->next);
 1410|  5.35M|		}
 1411|       |
 1412|       |		/*
 1413|       |		 * We can satisfy directly from client buffer if everything
 1414|       |		 * currently in the copy buffer is still in the client buffer.
 1415|       |		 */
 1416|  18.9M|		if (f->client_total >= f->client_avail + f->avail
  ------------------
  |  Branch (1416:7): [True: 13.9M, False: 4.99M]
  ------------------
 1417|  13.9M|		    && f->client_avail + f->avail >= min) {
  ------------------
  |  Branch (1417:10): [True: 13.8M, False: 94.4k]
  ------------------
 1418|       |			/* "Roll back" to client buffer. */
 1419|  13.8M|			f->client_avail += f->avail;
 1420|  13.8M|			f->client_next -= f->avail;
 1421|       |			/* Copy buffer is now empty. */
 1422|  13.8M|			f->avail = 0;
 1423|  13.8M|			f->next = f->buffer;
 1424|       |			/* Return data from client buffer. */
 1425|  13.8M|			if (avail != NULL)
  ------------------
  |  Branch (1425:8): [True: 996k, False: 12.8M]
  ------------------
 1426|   996k|				*avail = f->client_avail;
 1427|  13.8M|			return (f->client_next);
 1428|  13.8M|		}
 1429|       |
 1430|       |		/* Move data forward in copy buffer if necessary. */
 1431|  5.08M|		if (f->next > f->buffer &&
  ------------------
  |  Branch (1431:7): [True: 48.2k, False: 5.03M]
  ------------------
 1432|  48.2k|		    min > f->buffer_size - (f->next - f->buffer)) {
  ------------------
  |  Branch (1432:7): [True: 44.9k, False: 3.31k]
  ------------------
 1433|  44.9k|			if (f->avail > 0)
  ------------------
  |  Branch (1433:8): [True: 44.5k, False: 373]
  ------------------
 1434|  44.5k|				memmove(f->buffer, f->next,
 1435|  44.5k|				    f->avail);
 1436|  44.9k|			f->next = f->buffer;
 1437|  44.9k|		}
 1438|       |
 1439|       |		/* If we've used up the client data, get more. */
 1440|  5.08M|		if (f->client_avail <= 0) {
  ------------------
  |  Branch (1440:7): [True: 104k, False: 4.98M]
  ------------------
 1441|   104k|			if (f->end_of_file) {
  ------------------
  |  Branch (1441:8): [True: 19.4k, False: 84.7k]
  ------------------
 1442|  19.4k|				if (avail != NULL)
  ------------------
  |  Branch (1442:9): [True: 15.9k, False: 3.51k]
  ------------------
 1443|  15.9k|					*avail = f->avail;
 1444|  19.4k|				return (NULL);
 1445|  19.4k|			}
 1446|  84.7k|			bytes_read = (f->vtable->read)(f,
 1447|  84.7k|			    &f->client_buff);
 1448|  84.7k|			if (bytes_read < 0) {		/* Read error. */
  ------------------
  |  Branch (1448:8): [True: 718, False: 83.9k]
  ------------------
 1449|    718|				f->client_total = f->client_avail = 0;
 1450|    718|				f->client_next =
 1451|    718|				    f->client_buff = NULL;
 1452|    718|				f->fatal = 1;
 1453|    718|				if (avail != NULL)
  ------------------
  |  Branch (1453:9): [True: 492, False: 226]
  ------------------
 1454|    492|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|    492|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1455|    718|				return (NULL);
 1456|    718|			}
 1457|  83.9k|			if (bytes_read == 0) {
  ------------------
  |  Branch (1457:8): [True: 14.0k, False: 69.9k]
  ------------------
 1458|       |				/* Check for another client object first */
 1459|  14.0k|				if (f->archive->client.cursor !=
  ------------------
  |  Branch (1459:9): [True: 0, False: 14.0k]
  ------------------
 1460|  14.0k|				      f->archive->client.nodes - 1) {
 1461|      0|					if (client_switch_proxy(f,
  ------------------
  |  Branch (1461:10): [True: 0, False: 0]
  ------------------
 1462|      0|					    f->archive->client.cursor + 1)
 1463|      0|					    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1464|      0|						continue;
 1465|      0|				}
 1466|       |				/* Premature end-of-file. */
 1467|  14.0k|				f->client_total = f->client_avail = 0;
 1468|  14.0k|				f->client_next =
 1469|  14.0k|				    f->client_buff = NULL;
 1470|  14.0k|				f->end_of_file = 1;
 1471|       |				/* Return whatever we do have. */
 1472|  14.0k|				if (avail != NULL)
  ------------------
  |  Branch (1472:9): [True: 7.95k, False: 6.10k]
  ------------------
 1473|  7.95k|					*avail = f->avail;
 1474|  14.0k|				return (NULL);
 1475|  14.0k|			}
 1476|  69.9k|			f->client_total = bytes_read;
 1477|  69.9k|			f->client_avail = f->client_total;
 1478|  69.9k|			f->client_next = f->client_buff;
 1479|  4.98M|		} else {
 1480|       |			/*
 1481|       |			 * We can't satisfy the request from the copy
 1482|       |			 * buffer or the existing client data, so we
 1483|       |			 * need to copy more client data over to the
 1484|       |			 * copy buffer.
 1485|       |			 */
 1486|       |
 1487|       |			/* Ensure the buffer is big enough. */
 1488|  4.98M|			if (min > f->buffer_size) {
  ------------------
  |  Branch (1488:8): [True: 9.57k, False: 4.97M]
  ------------------
 1489|  9.57k|				size_t s;
 1490|  9.57k|				char *p;
 1491|       |
 1492|       |				/* Double the buffer; watch for overflow. */
 1493|  9.57k|				s = f->buffer_size;
 1494|  9.57k|				if (s == 0)
  ------------------
  |  Branch (1494:9): [True: 9.02k, False: 553]
  ------------------
 1495|  9.02k|					s = min;
 1496|  11.9k|				while (s < min) {
  ------------------
  |  Branch (1496:12): [True: 2.33k, False: 9.57k]
  ------------------
 1497|  2.33k|					if (archive_ckd_mul_size(&s, s, 2)) {
  ------------------
  |  Branch (1497:10): [True: 0, False: 2.33k]
  ------------------
 1498|       |						/* Integer overflow! */
 1499|      0|						archive_set_error(
 1500|      0|						    &f->archive->archive,
 1501|      0|						    ENOMEM,
 1502|      0|						    "Unable to allocate copy"
 1503|      0|						    " buffer");
 1504|      0|						f->fatal = 1;
 1505|      0|						if (avail != NULL)
  ------------------
  |  Branch (1505:11): [True: 0, False: 0]
  ------------------
 1506|      0|							*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1507|      0|						return (NULL);
 1508|      0|					}
 1509|  2.33k|				}
 1510|       |				/* Now s >= min, so allocate a new buffer. */
 1511|  9.57k|				p = malloc(s);
 1512|  9.57k|				if (p == NULL) {
  ------------------
  |  Branch (1512:9): [True: 5, False: 9.57k]
  ------------------
 1513|      5|					archive_set_error(
 1514|      5|						&f->archive->archive,
 1515|      5|						ENOMEM,
 1516|      5|					    "Unable to allocate copy buffer");
 1517|      5|					f->fatal = 1;
 1518|      5|					if (avail != NULL)
  ------------------
  |  Branch (1518:10): [True: 0, False: 5]
  ------------------
 1519|      0|						*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1520|      5|					return (NULL);
 1521|      5|				}
 1522|       |				/* Move data into newly-enlarged buffer. */
 1523|  9.57k|				if (f->avail > 0)
  ------------------
  |  Branch (1523:9): [True: 299, False: 9.27k]
  ------------------
 1524|    299|					memmove(p, f->next, f->avail);
 1525|  9.57k|				free(f->buffer);
 1526|  9.57k|				f->next = f->buffer = p;
 1527|  9.57k|				f->buffer_size = s;
 1528|  9.57k|			}
 1529|       |
 1530|       |			/* We can add client data to copy buffer. */
 1531|       |			/* First estimate: copy to fill rest of buffer. */
 1532|  4.98M|			tocopy = (f->buffer + f->buffer_size)
 1533|  4.98M|			    - (f->next + f->avail);
 1534|       |			/* Don't waste time buffering more than we need to. */
 1535|  4.98M|			if (tocopy + f->avail > min)
  ------------------
  |  Branch (1535:8): [True: 4.92M, False: 60.3k]
  ------------------
 1536|  4.92M|				tocopy = min - f->avail;
 1537|       |			/* Don't copy more than is available. */
 1538|  4.98M|			if (tocopy > f->client_avail)
  ------------------
  |  Branch (1538:8): [True: 19.3k, False: 4.96M]
  ------------------
 1539|  19.3k|				tocopy = f->client_avail;
 1540|       |
 1541|  4.98M|			memcpy(f->next + f->avail,
 1542|  4.98M|			    f->client_next, tocopy);
 1543|       |			/* Remove this data from client buffer. */
 1544|  4.98M|			f->client_next += tocopy;
 1545|  4.98M|			f->client_avail -= tocopy;
 1546|       |			/* add it to copy buffer. */
 1547|  4.98M|			f->avail += tocopy;
 1548|  4.98M|		}
 1549|  5.08M|	}
 1550|  19.2M|}
__archive_read_consume:
 1557|  14.2M|{
 1558|  14.2M|	return (__archive_read_filter_consume(a->filter, request));
 1559|  14.2M|}
__archive_read_filter_consume:
 1564|  14.2M|{
 1565|  14.2M|	int64_t skipped;
 1566|       |
 1567|  14.2M|	if (request < 0)
  ------------------
  |  Branch (1567:6): [True: 365, False: 14.2M]
  ------------------
 1568|    365|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|    365|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1569|  14.2M|	if (request == 0)
  ------------------
  |  Branch (1569:6): [True: 501k, False: 13.7M]
  ------------------
 1570|   501k|		return 0;
 1571|       |
 1572|  13.7M|	skipped = advance_file_pointer(f, request);
 1573|  13.7M|	if (skipped == request)
  ------------------
  |  Branch (1573:6): [True: 13.7M, False: 3.42k]
  ------------------
 1574|  13.7M|		return (skipped);
 1575|       |	/* We hit EOF before we satisfied the skip request. */
 1576|  3.42k|	if (skipped < 0)  /* Map error code to 0 for error message below. */
  ------------------
  |  Branch (1576:6): [True: 158, False: 3.27k]
  ------------------
 1577|    158|		skipped = 0;
 1578|  3.42k|	archive_set_error(&f->archive->archive,
 1579|  3.42k|	    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.42k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1580|  3.42k|	    "Truncated input file (needed %jd bytes, only %jd available)",
 1581|  3.42k|	    (intmax_t)request, (intmax_t)skipped);
 1582|  3.42k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  3.42k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1583|  13.7M|}
__archive_read_seek:
 1680|  13.4k|{
 1681|  13.4k|	return __archive_read_filter_seek(a->filter, offset, whence);
 1682|  13.4k|}
__archive_read_filter_seek:
 1687|  13.4k|{
 1688|  13.4k|	struct archive_read_client *client;
 1689|  13.4k|	int64_t r;
 1690|  13.4k|	unsigned int cursor;
 1691|       |
 1692|  13.4k|	if (f->closed || f->fatal)
  ------------------
  |  Branch (1692:6): [True: 0, False: 13.4k]
  |  Branch (1692:19): [True: 91, False: 13.3k]
  ------------------
 1693|     91|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     91|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1694|  13.3k|	if (f->can_seek == 0)
  ------------------
  |  Branch (1694:6): [True: 334, False: 13.0k]
  ------------------
 1695|    334|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    334|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1696|       |
 1697|  13.0k|	client = &(f->archive->client);
 1698|  13.0k|	switch (whence) {
 1699|      0|	case SEEK_CUR:
  ------------------
  |  Branch (1699:2): [True: 0, False: 13.0k]
  ------------------
 1700|       |		/* Adjust the offset and use SEEK_SET instead */
 1701|      0|		offset += f->position;
 1702|      0|		__LA_FALLTHROUGH;
 1703|  1.40k|	case SEEK_SET:
  ------------------
  |  Branch (1703:2): [True: 1.40k, False: 11.6k]
  ------------------
 1704|  1.40k|		cursor = 0;
 1705|  1.40k|		while (1)
  ------------------
  |  Branch (1705:10): [True: 1.40k, Folded]
  ------------------
 1706|  1.40k|		{
 1707|  1.40k|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1707:8): [True: 0, False: 1.40k]
  ------------------
 1708|  1.40k|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1708:8): [True: 413, False: 996]
  ------------------
 1709|    996|			    client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1709:8): [True: 993, False: 3]
  ------------------
 1710|    996|			      client->dataset[cursor].total_size - 1 > offset ||
 1711|      3|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1711:8): [True: 3, False: 0]
  ------------------
 1712|  1.40k|				break;
 1713|      0|			r = client->dataset[cursor].begin_position +
 1714|      0|				client->dataset[cursor].total_size;
 1715|      0|			client->dataset[++cursor].begin_position = r;
 1716|      0|		}
 1717|  1.40k|		while (1) {
  ------------------
  |  Branch (1717:10): [True: 1.40k, Folded]
  ------------------
 1718|  1.40k|			r = client_switch_proxy(f, cursor);
 1719|  1.40k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.40k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1719:8): [True: 0, False: 1.40k]
  ------------------
 1720|      0|				return r;
 1721|  1.40k|			if ((r = client_seek_proxy(f, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1721:8): [True: 0, False: 1.40k]
  ------------------
 1722|      0|				return r;
 1723|  1.40k|			client->dataset[cursor].total_size = r;
 1724|  1.40k|			if (client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1724:8): [True: 1.39k, False: 10]
  ------------------
 1725|  1.40k|			    client->dataset[cursor].total_size - 1 > offset ||
 1726|     10|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1726:8): [True: 10, False: 0]
  ------------------
 1727|  1.40k|				break;
 1728|      0|			r = client->dataset[cursor].begin_position +
 1729|      0|				client->dataset[cursor].total_size;
 1730|      0|			client->dataset[++cursor].begin_position = r;
 1731|      0|		}
 1732|  1.40k|		offset -= client->dataset[cursor].begin_position;
 1733|  1.40k|		if (offset < 0
  ------------------
  |  Branch (1733:7): [True: 12, False: 1.39k]
  ------------------
 1734|  1.39k|		    || offset > client->dataset[cursor].total_size)
  ------------------
  |  Branch (1734:10): [True: 10, False: 1.38k]
  ------------------
 1735|     22|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     22|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1736|  1.38k|		if ((r = client_seek_proxy(f, offset, SEEK_SET)) < 0)
  ------------------
  |  Branch (1736:7): [True: 0, False: 1.38k]
  ------------------
 1737|      0|			return r;
 1738|  1.38k|		break;
 1739|       |
 1740|  11.6k|	case SEEK_END:
  ------------------
  |  Branch (1740:2): [True: 11.6k, False: 1.40k]
  ------------------
 1741|  11.6k|		cursor = 0;
 1742|  11.6k|		while (1) {
  ------------------
  |  Branch (1742:10): [True: 11.6k, Folded]
  ------------------
 1743|  11.6k|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1743:8): [True: 0, False: 11.6k]
  ------------------
 1744|  11.6k|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1744:8): [True: 5.74k, False: 5.90k]
  ------------------
 1745|  5.90k|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1745:8): [True: 5.90k, False: 0]
  ------------------
 1746|  11.6k|				break;
 1747|      0|			r = client->dataset[cursor].begin_position +
 1748|      0|				client->dataset[cursor].total_size;
 1749|      0|			client->dataset[++cursor].begin_position = r;
 1750|      0|		}
 1751|  11.6k|		while (1) {
  ------------------
  |  Branch (1751:10): [True: 11.6k, Folded]
  ------------------
 1752|  11.6k|			r = client_switch_proxy(f, cursor);
 1753|  11.6k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1753:8): [True: 0, False: 11.6k]
  ------------------
 1754|      0|				return r;
 1755|  11.6k|			if ((r = client_seek_proxy(f, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1755:8): [True: 0, False: 11.6k]
  ------------------
 1756|      0|				return r;
 1757|  11.6k|			client->dataset[cursor].total_size = r;
 1758|  11.6k|			r = client->dataset[cursor].begin_position +
 1759|  11.6k|				client->dataset[cursor].total_size;
 1760|  11.6k|			if (cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1760:8): [True: 11.6k, False: 0]
  ------------------
 1761|  11.6k|				break;
 1762|      0|			client->dataset[++cursor].begin_position = r;
 1763|      0|		}
 1764|  11.6k|		while (1) {
  ------------------
  |  Branch (1764:10): [True: 11.6k, Folded]
  ------------------
 1765|  11.6k|			if (r + offset >=
  ------------------
  |  Branch (1765:8): [True: 11.6k, False: 0]
  ------------------
 1766|  11.6k|			    client->dataset[cursor].begin_position)
 1767|  11.6k|				break;
 1768|      0|			offset += client->dataset[cursor].total_size;
 1769|      0|			if (cursor == 0)
  ------------------
  |  Branch (1769:8): [True: 0, False: 0]
  ------------------
 1770|      0|				break;
 1771|      0|			cursor--;
 1772|      0|			r = client->dataset[cursor].begin_position +
 1773|      0|				client->dataset[cursor].total_size;
 1774|      0|		}
 1775|  11.6k|		offset = (r + offset) - client->dataset[cursor].begin_position;
 1776|  11.6k|		if ((r = client_switch_proxy(f, cursor)) != ARCHIVE_OK)
  ------------------
  |  |  233|  11.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1776:7): [True: 0, False: 11.6k]
  ------------------
 1777|      0|			return r;
 1778|  11.6k|		r = client_seek_proxy(f, offset, SEEK_SET);
 1779|  11.6k|		if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  11.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1779:7): [True: 0, False: 11.6k]
  ------------------
 1780|      0|			return r;
 1781|  11.6k|		break;
 1782|       |
 1783|  11.6k|	default:
  ------------------
  |  Branch (1783:2): [True: 0, False: 13.0k]
  ------------------
 1784|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1785|  13.0k|	}
 1786|  13.0k|	r += client->dataset[cursor].begin_position;
 1787|       |
 1788|  13.0k|	if (r >= 0) {
  ------------------
  |  Branch (1788:6): [True: 13.0k, False: 0]
  ------------------
 1789|       |		/*
 1790|       |		 * Ouch.  Clearing the buffer like this hurts, especially
 1791|       |		 * at bid time.  A lot of our efficiency at bid time comes
 1792|       |		 * from having bidders reuse the data we've already read.
 1793|       |		 *
 1794|       |		 * TODO: If the seek request is in data we already
 1795|       |		 * have, then don't call the seek callback.
 1796|       |		 *
 1797|       |		 * TODO: Zip seeks to end-of-file at bid time.  If
 1798|       |		 * other formats also start doing this, we may need to
 1799|       |		 * find a way for clients to fudge the seek offset to
 1800|       |		 * a block boundary.
 1801|       |		 *
 1802|       |		 * Hmmm... If whence was SEEK_END, we know the file
 1803|       |		 * size is (r - offset).  Can we use that to simplify
 1804|       |		 * the TODO items above?
 1805|       |		 */
 1806|  13.0k|		f->avail = f->client_avail = 0;
 1807|  13.0k|		f->next = f->buffer;
 1808|  13.0k|		f->position = r;
 1809|  13.0k|		f->end_of_file = 0;
 1810|  13.0k|	}
 1811|  13.0k|	return r;
 1812|  13.0k|}
archive_read.c:_archive_read_free:
 1130|  11.9k|{
 1131|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
 1132|  11.9k|	struct archive_read_passphrase *p;
 1133|  11.9k|	int i, n;
 1134|  11.9k|	int slots;
 1135|  11.9k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1136|       |
 1137|  11.9k|	if (_a == NULL)
  ------------------
  |  Branch (1137:6): [True: 0, False: 11.9k]
  ------------------
 1138|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1139|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
 1140|  11.9k|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_free");
 1141|  11.9k|	if (a->archive.state != ARCHIVE_STATE_CLOSED
  ------------------
  |  |   91|  23.8k|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (1141:6): [True: 11.9k, False: 0]
  ------------------
 1142|  11.9k|	    && a->archive.state != ARCHIVE_STATE_FATAL)
  ------------------
  |  |   94|  11.9k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (1142:9): [True: 0, False: 11.9k]
  ------------------
 1143|      0|		r = archive_read_close(&a->archive);
 1144|       |
 1145|       |	/* Call cleanup functions registered by optional components. */
 1146|  11.9k|	if (a->cleanup_archive_extract != NULL)
  ------------------
  |  Branch (1146:6): [True: 0, False: 11.9k]
  ------------------
 1147|      0|		r = (a->cleanup_archive_extract)(a);
 1148|       |
 1149|       |	/* Cleanup format-specific data. */
 1150|  11.9k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1151|   202k|	for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (1151:14): [True: 190k, False: 11.9k]
  ------------------
 1152|   190k|		a->format = &(a->formats[i]);
 1153|   190k|		if (a->formats[i].cleanup)
  ------------------
  |  Branch (1153:7): [True: 179k, False: 11.9k]
  ------------------
 1154|   179k|			(a->formats[i].cleanup)(a);
 1155|   190k|	}
 1156|       |
 1157|       |	/* Free the filters */
 1158|  11.9k|	__archive_read_free_filters(a);
 1159|       |
 1160|       |	/* Release the bidder objects. */
 1161|  11.9k|	n = sizeof(a->bidders)/sizeof(a->bidders[0]);
 1162|   202k|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1162:14): [True: 190k, False: 11.9k]
  ------------------
 1163|   190k|		if (a->bidders[i].vtable == NULL ||
  ------------------
  |  Branch (1163:7): [True: 35.8k, False: 155k]
  ------------------
 1164|   155k|		    a->bidders[i].vtable->free == NULL)
  ------------------
  |  Branch (1164:7): [True: 155k, False: 0]
  ------------------
 1165|   190k|			continue;
 1166|      0|		(a->bidders[i].vtable->free)(&a->bidders[i]);
 1167|      0|	}
 1168|       |
 1169|       |	/* Release passphrase list. */
 1170|  11.9k|	p = a->passphrases.first;
 1171|  23.8k|	while (p != NULL) {
  ------------------
  |  Branch (1171:9): [True: 11.9k, False: 11.9k]
  ------------------
 1172|  11.9k|		struct archive_read_passphrase *np = p->next;
 1173|       |
 1174|       |		/* A passphrase should be cleaned. */
 1175|  11.9k|		memset(p->passphrase, 0, strlen(p->passphrase));
 1176|  11.9k|		free(p->passphrase);
 1177|  11.9k|		free(p);
 1178|  11.9k|		p = np;
 1179|  11.9k|	}
 1180|       |
 1181|  11.9k|	archive_string_free(&a->archive.error_string);
 1182|  11.9k|	archive_entry_free(a->entry);
 1183|  11.9k|	a->archive.magic = 0;
 1184|  11.9k|	__archive_clean(&a->archive);
 1185|  11.9k|	free(a->client.dataset);
 1186|  11.9k|	free(a);
 1187|  11.9k|	return (r);
 1188|  11.9k|}
archive_read.c:_archive_read_next_header:
  724|   745k|{
  725|   745k|	int ret;
  726|   745k|	struct archive_read *a = (struct archive_read *)_a;
  727|       |	*entryp = NULL;
  728|   745k|	ret = _archive_read_next_header2(_a, a->entry);
  729|   745k|	*entryp = a->entry;
  730|   745k|	return ret;
  731|   745k|}
archive_read.c:_archive_read_next_header2:
  637|   745k|{
  638|   745k|	struct archive_read *a = (struct archive_read *)_a;
  639|   745k|	int r1 = ARCHIVE_OK, r2;
  ------------------
  |  |  233|   745k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  640|       |
  641|   745k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|   745k|	do { \
  |  |  178|   745k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|   745k|			(allowed_states), (function_name)); \
  |  |  180|   745k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   745k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 745k]
  |  |  ------------------
  |  |  181|   745k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|   745k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 745k]
  |  |  ------------------
  ------------------
  642|   745k|	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA |
  643|   745k|	    ARCHIVE_STATE_DATA_RECOVERY,
  644|   745k|	    "archive_read_next_header");
  645|       |
  646|   745k|	archive_entry_clear(entry);
  647|   745k|	archive_clear_error(&a->archive);
  648|       |
  649|       |	/*
  650|       |	 * If client didn't consume entire data, skip any remainder
  651|       |	 * (This is especially important for GNU incremental directories.)
  652|       |	 * A header that failed to parse (DATA_RECOVERY) still needs the
  653|       |	 * same treatment: whatever of its body the format reader left
  654|       |	 * unconsumed must be skipped before we can read the next header.
  655|       |	 */
  656|   745k|	if (a->archive.state == ARCHIVE_STATE_DATA ||
  ------------------
  |  |   82|  1.49M|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (656:6): [True: 244k, False: 500k]
  ------------------
  657|   500k|	    a->archive.state == ARCHIVE_STATE_DATA_RECOVERY) {
  ------------------
  |  |   86|   500k|#define	ARCHIVE_STATE_DATA_RECOVERY	8U
  ------------------
  |  Branch (657:6): [True: 0, False: 500k]
  ------------------
  658|   244k|		r1 = archive_read_data_skip(&a->archive);
  659|   244k|		if (r1 == ARCHIVE_EOF)
  ------------------
  |  |  232|   244k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (659:7): [True: 0, False: 244k]
  ------------------
  660|      0|			archive_set_error(&a->archive, EIO,
  661|      0|			    "Premature end-of-file");
  662|   244k|		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  232|   489k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  239|   244k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (662:7): [True: 0, False: 244k]
  |  Branch (662:28): [True: 1.42k, False: 243k]
  ------------------
  663|  1.42k|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|  1.42k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  664|  1.42k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.42k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  665|  1.42k|		}
  666|   244k|	}
  667|       |
  668|       |	/* Record start-of-header offset in uncompressed stream. */
  669|   743k|	a->header_position = a->filter->position;
  670|       |
  671|   743k|	++_a->file_count;
  672|   743k|	r2 = (a->format->read_header)(a, entry);
  673|       |
  674|       |	/*
  675|       |	 * EOF and FATAL are persistent at this layer.  By
  676|       |	 * modifying the state, we guarantee that future calls to
  677|       |	 * read a header or read data will fail.
  678|       |	 */
  679|   743k|	switch (r2) {
  ------------------
  |  Branch (679:10): [True: 743k, False: 0]
  ------------------
  680|  2.08k|	case ARCHIVE_EOF:
  ------------------
  |  |  232|  2.08k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (680:2): [True: 2.08k, False: 741k]
  ------------------
  681|  2.08k|		a->archive.state = ARCHIVE_STATE_EOF;
  ------------------
  |  |   89|  2.08k|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  682|  2.08k|		--_a->file_count;/* Revert a file counter. */
  683|  2.08k|		break;
  684|   204k|	case ARCHIVE_OK:
  ------------------
  |  |  233|   204k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (684:2): [True: 204k, False: 539k]
  ------------------
  685|   204k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   82|   204k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  686|   204k|		break;
  687|  41.6k|	case ARCHIVE_WARN:
  ------------------
  |  |  235|  41.6k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (687:2): [True: 41.6k, False: 702k]
  ------------------
  688|  41.6k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   82|  41.6k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  689|  41.6k|		break;
  690|   489k|	case ARCHIVE_RETRY:
  ------------------
  |  |  234|   489k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (690:2): [True: 489k, False: 254k]
  ------------------
  691|   489k|		break;
  692|  6.62k|	case ARCHIVE_FATAL:
  ------------------
  |  |  239|  6.62k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (692:2): [True: 6.62k, False: 737k]
  ------------------
  693|  6.62k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|  6.62k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  694|  6.62k|		break;
  695|     57|	case ARCHIVE_FAILED:
  ------------------
  |  |  237|     57|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (695:2): [True: 57, False: 743k]
  ------------------
  696|       |		/*
  697|       |		 * This entry's header could not be parsed, so its metadata
  698|       |		 * cannot be trusted.  ARCHIVE_STATE_DATA_RECOVERY still
  699|       |		 * permits skipping past it (the format reader is
  700|       |		 * responsible for ensuring that's actually possible), but
  701|       |		 * blocks archive_read_data() and friends, which all check
  702|       |		 * for ARCHIVE_STATE_DATA specifically and would otherwise
  703|       |		 * return content for an entry we don't actually understand.
  704|       |		 */
  705|     57|		a->archive.state = ARCHIVE_STATE_DATA_RECOVERY;
  ------------------
  |  |   86|     57|#define	ARCHIVE_STATE_DATA_RECOVERY	8U
  ------------------
  706|     57|		break;
  707|   743k|	}
  708|       |
  709|   743k|	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  233|  1.48M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  235|   539k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (709:6): [True: 204k, False: 539k]
  |  Branch (709:26): [True: 41.6k, False: 497k]
  ------------------
  710|   246k|		a->entry_bytes_declared = archive_entry_size_is_set(entry)
  ------------------
  |  Branch (710:29): [True: 235k, False: 10.8k]
  ------------------
  711|   246k|		    ? archive_entry_size(entry) : -1;
  712|   497k|	else
  713|   497k|		a->entry_bytes_declared = -1;
  714|       |
  715|   743k|	__archive_reset_read_data(&a->archive);
  716|       |
  717|   743k|	a->data_start_node = a->client.cursor;
  718|       |	/* EOF always wins; otherwise return the worst error. */
  719|   743k|	return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1;
  ------------------
  |  |  232|   206k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (719:10): [True: 537k, False: 206k]
  |  Branch (719:21): [True: 2.08k, False: 204k]
  ------------------
  720|   743k|}
archive_read.c:_archive_read_data_block:
 1028|   430k|{
 1029|   430k|	struct archive_read *a = (struct archive_read *)_a;
 1030|   430k|	int r;
 1031|       |
 1032|   430k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  177|   430k|	do { \
  |  |  178|   430k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|   430k|			(allowed_states), (function_name)); \
  |  |  180|   430k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   430k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 57, False: 430k]
  |  |  ------------------
  |  |  181|   430k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|     57|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|   430k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 430k]
  |  |  ------------------
  ------------------
 1033|   430k|	    "archive_read_data_block");
 1034|       |
 1035|   430k|	if (a->format->read_data == NULL) {
  ------------------
  |  Branch (1035:6): [True: 0, False: 430k]
  ------------------
 1036|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1037|      0|		    "Internal error: "
 1038|      0|		    "No format->read_data function registered");
 1039|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1040|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1041|      0|	}
 1042|       |
 1043|   430k|	r = (a->format->read_data)(a, buff, size, offset);
 1044|   430k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|   430k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1044:6): [True: 1.47k, False: 429k]
  ------------------
 1045|  1.47k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|  1.47k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1046|   430k|	return (r);
 1047|   430k|}
archive_read.c:_archive_filter_bytes:
 1231|    418|{
 1232|    418|	struct archive_read_filter *f = get_filter(_a, n);
 1233|    418|	return f == NULL ? -1 : f->position;
  ------------------
  |  Branch (1233:9): [True: 0, False: 418]
  ------------------
 1234|    418|}
archive_read.c:get_filter:
 1192|    418|{
 1193|    418|	struct archive_read *a = (struct archive_read *)_a;
 1194|    418|	struct archive_read_filter *f = a->filter;
 1195|       |	/* We use n == -1 for 'the last filter', which is always the
 1196|       |	 * client proxy. */
 1197|    418|	if (n == -1 && f != NULL) {
  ------------------
  |  Branch (1197:6): [True: 0, False: 418]
  |  Branch (1197:17): [True: 0, False: 0]
  ------------------
 1198|      0|		struct archive_read_filter *last = f;
 1199|      0|		f = f->upstream;
 1200|      0|		while (f != NULL) {
  ------------------
  |  Branch (1200:10): [True: 0, False: 0]
  ------------------
 1201|      0|			last = f;
 1202|      0|			f = f->upstream;
 1203|      0|		}
 1204|      0|		return (last);
 1205|      0|	}
 1206|    418|	if (n < 0)
  ------------------
  |  Branch (1206:6): [True: 0, False: 418]
  ------------------
 1207|      0|		return NULL;
 1208|    418|	while (n > 0 && f != NULL) {
  ------------------
  |  Branch (1208:9): [True: 0, False: 418]
  |  Branch (1208:18): [True: 0, False: 0]
  ------------------
 1209|      0|		f = f->upstream;
 1210|      0|		--n;
 1211|      0|	}
 1212|    418|	return (f);
 1213|    418|}
archive_read.c:read_client_close_proxy:
  250|  11.9k|{
  251|  11.9k|	int r = ARCHIVE_OK, r2;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  252|  11.9k|	unsigned int i;
  253|       |
  254|  11.9k|	if (a->client.closer == NULL)
  ------------------
  |  Branch (254:6): [True: 0, False: 11.9k]
  ------------------
  255|      0|		return (r);
  256|  23.8k|	for (i = 0; i < a->client.nodes; i++)
  ------------------
  |  Branch (256:14): [True: 11.9k, False: 11.9k]
  ------------------
  257|  11.9k|	{
  258|  11.9k|		r2 = (a->client.closer)
  259|  11.9k|			((struct archive *)a, a->client.dataset[i].data);
  260|  11.9k|		if (r > r2)
  ------------------
  |  Branch (260:7): [True: 0, False: 11.9k]
  ------------------
  261|      0|			r = r2;
  262|  11.9k|	}
  263|  11.9k|	return (r);
  264|  11.9k|}
archive_read.c:client_read_proxy:
  180|  35.4k|{
  181|  35.4k|	ssize_t r;
  182|  35.4k|	r = (f->archive->client.reader)(&f->archive->archive,
  183|  35.4k|	    f->data, buff);
  184|  35.4k|	return (r);
  185|  35.4k|}
archive_read.c:client_close_proxy:
  268|  11.9k|{
  269|  11.9k|	return read_client_close_proxy(f->archive);
  270|  11.9k|}
archive_read.c:client_switch_proxy:
  274|  36.3k|{
  275|  36.3k|	struct archive_read *a;
  276|  36.3k|	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  36.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  36.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  277|  36.3k|	void *data2;
  278|       |
  279|  37.8k|	while (f->upstream != NULL)
  ------------------
  |  Branch (279:9): [True: 1.48k, False: 36.3k]
  ------------------
  280|  1.48k|		f = f->upstream;
  281|  36.3k|	a = f->archive;
  282|       |
  283|       |	/* Don't do anything if already in the specified data node */
  284|  36.3k|	if (a->client.cursor == iindex)
  ------------------
  |  Branch (284:6): [True: 36.3k, False: 0]
  ------------------
  285|  36.3k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  36.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  286|       |
  287|      0|	a->client.cursor = iindex;
  288|      0|	data2 = a->client.dataset[a->client.cursor].data;
  289|      0|	if (a->client.switcher != NULL)
  ------------------
  |  Branch (289:6): [True: 0, False: 0]
  ------------------
  290|      0|	{
  291|      0|		r1 = r2 = (a->client.switcher)
  292|      0|			((struct archive *)a, f->data, data2);
  293|      0|		f->data = data2;
  294|      0|	}
  295|      0|	else
  296|      0|	{
  297|       |		/* Attempt to call close and open instead */
  298|      0|		if (a->client.closer != NULL)
  ------------------
  |  Branch (298:7): [True: 0, False: 0]
  ------------------
  299|      0|			r1 = (a->client.closer)
  300|      0|				((struct archive *)a, f->data);
  301|      0|		f->data = data2;
  302|      0|		if (a->client.opener != NULL)
  ------------------
  |  Branch (302:7): [True: 0, False: 0]
  ------------------
  303|      0|			r2 = (a->client.opener)
  304|      0|				((struct archive *)a, f->data);
  305|      0|	}
  306|      0|	return (r1 < r2) ? r1 : r2;
  ------------------
  |  Branch (306:9): [True: 0, False: 0]
  ------------------
  307|  36.3k|}
archive_read.c:choose_filters:
  571|  11.9k|{
  572|  11.9k|	int number_bidders, i, bid, best_bid, number_filters;
  573|  11.9k|	struct archive_read_filter_bidder *bidder, *best_bidder;
  574|  11.9k|	struct archive_read_filter *f;
  575|  11.9k|	ssize_t avail;
  576|  11.9k|	int r;
  577|       |
  578|  13.9k|	for (number_filters = 0; number_filters < MAX_NUMBER_FILTERS; ++number_filters) {
  ------------------
  |  |  567|  13.9k|#define MAX_NUMBER_FILTERS 25
  ------------------
  |  Branch (578:27): [True: 13.9k, False: 0]
  ------------------
  579|  13.9k|		number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
  580|       |
  581|  13.9k|		best_bid = 0;
  582|  13.9k|		best_bidder = NULL;
  583|       |
  584|  13.9k|		bidder = a->bidders;
  585|   237k|		for (i = 0; i < number_bidders; i++, bidder++) {
  ------------------
  |  Branch (585:15): [True: 223k, False: 13.9k]
  ------------------
  586|   223k|			if (bidder->vtable == NULL)
  ------------------
  |  Branch (586:8): [True: 41.9k, False: 181k]
  ------------------
  587|  41.9k|				continue;
  588|   181k|			bid = (bidder->vtable->bid)(bidder, a->filter);
  589|   181k|			if (bid > best_bid) {
  ------------------
  |  Branch (589:8): [True: 2.05k, False: 179k]
  ------------------
  590|  2.05k|				best_bid = bid;
  591|  2.05k|				best_bidder = bidder;
  592|  2.05k|			}
  593|   181k|		}
  594|       |
  595|       |		/* If no bidder, we're done. */
  596|  13.9k|		if (best_bidder == NULL) {
  ------------------
  |  Branch (596:7): [True: 11.9k, False: 2.05k]
  ------------------
  597|       |			/* Verify the filter by asking it for some data. */
  598|  11.9k|			__archive_read_filter_ahead(a->filter, 1, &avail);
  599|  11.9k|			if (avail < 0) {
  ------------------
  |  Branch (599:8): [True: 179, False: 11.7k]
  ------------------
  600|    179|				__archive_read_free_filters(a);
  601|    179|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    179|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  602|    179|			}
  603|  11.7k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  604|  11.9k|		}
  605|       |
  606|  2.05k|		f = calloc(1, sizeof(*f));
  607|  2.05k|		if (f == NULL)
  ------------------
  |  Branch (607:7): [True: 0, False: 2.05k]
  ------------------
  608|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  609|  2.05k|		f->bidder = best_bidder;
  610|  2.05k|		f->archive = a;
  611|  2.05k|		f->upstream = a->filter;
  612|  2.05k|		a->filter = f;
  613|  2.05k|		r = (best_bidder->vtable->init)(a->filter);
  614|  2.05k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (614:7): [True: 0, False: 2.05k]
  ------------------
  615|      0|			__archive_read_free_filters(a);
  616|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  617|      0|		}
  618|  2.05k|	}
  619|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  620|      0|	    "Input requires too many filters for decoding");
  621|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  622|  11.9k|}
archive_read.c:choose_format:
  739|  11.7k|{
  740|  11.7k|	int slots;
  741|  11.7k|	int i;
  742|  11.7k|	int bid, best_bid;
  743|  11.7k|	int best_bid_slot;
  744|       |
  745|  11.7k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
  746|  11.7k|	best_bid = -1;
  747|  11.7k|	best_bid_slot = -1;
  748|       |
  749|       |	/* Set up a->format for convenience of bidders. */
  750|  11.7k|	a->format = &(a->formats[0]);
  751|   199k|	for (i = 0; i < slots; i++, a->format++) {
  ------------------
  |  Branch (751:14): [True: 188k, False: 11.7k]
  ------------------
  752|   188k|		if (a->format->bid) {
  ------------------
  |  Branch (752:7): [True: 188k, False: 0]
  ------------------
  753|   188k|			bid = (a->format->bid)(a, best_bid);
  754|   188k|			if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  239|   188k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (754:8): [True: 0, False: 188k]
  ------------------
  755|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  756|   188k|			if (a->filter->position != 0)
  ------------------
  |  Branch (756:8): [True: 553, False: 187k]
  ------------------
  757|    553|				__archive_read_seek(a, 0, SEEK_SET);
  758|   188k|			if ((bid > best_bid) || (best_bid_slot < 0)) {
  ------------------
  |  Branch (758:8): [True: 22.7k, False: 165k]
  |  Branch (758:28): [True: 11.6k, False: 153k]
  ------------------
  759|  34.3k|				best_bid = bid;
  760|  34.3k|				best_bid_slot = i;
  761|  34.3k|			}
  762|   188k|		}
  763|   188k|	}
  764|       |
  765|       |	/*
  766|       |	 * There were no bidders; this is a serious programmer error
  767|       |	 * and demands a quick and definitive abort.
  768|       |	 */
  769|  11.7k|	if (best_bid_slot < 0) {
  ------------------
  |  Branch (769:6): [True: 0, False: 11.7k]
  ------------------
  770|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  771|      0|		    "No formats registered");
  772|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  773|      0|	}
  774|       |
  775|       |	/*
  776|       |	 * There were bidders, but no non-zero bids; this means we
  777|       |	 * can't support this stream.
  778|       |	 */
  779|  11.7k|	if (best_bid < 1) {
  ------------------
  |  Branch (779:6): [True: 90, False: 11.6k]
  ------------------
  780|     90|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     90|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  781|     90|		    "Unrecognized archive format");
  782|     90|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     90|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  783|     90|	}
  784|       |
  785|  11.6k|	return (best_bid_slot);
  786|  11.7k|}
archive_read.c:close_filters:
 1051|  12.2k|{
 1052|  12.2k|	struct archive_read_filter *f = a->filter;
 1053|  12.2k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  12.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1054|       |	/* Close each filter in the pipeline. */
 1055|  26.4k|	while (f != NULL) {
  ------------------
  |  Branch (1055:9): [True: 14.2k, False: 12.2k]
  ------------------
 1056|  14.2k|		struct archive_read_filter *t = f->upstream;
 1057|  14.2k|		if (!f->closed && f->vtable != NULL) {
  ------------------
  |  Branch (1057:7): [True: 13.9k, False: 271]
  |  Branch (1057:21): [True: 13.9k, False: 0]
  ------------------
 1058|  13.9k|			int r1 = (f->vtable->close)(f);
 1059|  13.9k|			f->closed = 1;
 1060|  13.9k|			if (r1 < r)
  ------------------
  |  Branch (1060:8): [True: 2, False: 13.9k]
  ------------------
 1061|      2|				r = r1;
 1062|  13.9k|		}
 1063|  14.2k|		free(f->buffer);
 1064|       |		f->buffer = NULL;
 1065|  14.2k|		f = t;
 1066|  14.2k|	}
 1067|  12.2k|	return r;
 1068|  12.2k|}
archive_read.c:advance_file_pointer:
 1593|  13.7M|{
 1594|  13.7M|	int64_t bytes_skipped, total_bytes_skipped = 0;
 1595|  13.7M|	ssize_t bytes_read;
 1596|  13.7M|	size_t min;
 1597|       |
 1598|  13.7M|	if (f->fatal)
  ------------------
  |  Branch (1598:6): [True: 53, False: 13.7M]
  ------------------
 1599|     53|		return (-1);
 1600|       |
 1601|       |	/* Use up the copy buffer first. */
 1602|  13.7M|	if (f->avail > 0) {
  ------------------
  |  Branch (1602:6): [True: 382k, False: 13.3M]
  ------------------
 1603|   382k|		min = (size_t)minimum(request, (int64_t)f->avail);
  ------------------
  |  |   59|   382k|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 381k, False: 1.39k]
  |  |  ------------------
  ------------------
 1604|   382k|		f->next += min;
 1605|   382k|		f->avail -= min;
 1606|   382k|		request -= min;
 1607|   382k|		f->position += min;
 1608|   382k|		total_bytes_skipped += min;
 1609|   382k|	}
 1610|       |
 1611|       |	/* Then use up the client buffer. */
 1612|  13.7M|	if (f->client_avail > 0) {
  ------------------
  |  Branch (1612:6): [True: 13.4M, False: 337k]
  ------------------
 1613|  13.4M|		min = (size_t)minimum(request, (int64_t)f->client_avail);
  ------------------
  |  |   59|  13.4M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 13.3M, False: 45.9k]
  |  |  ------------------
  ------------------
 1614|  13.4M|		f->client_next += min;
 1615|  13.4M|		f->client_avail -= min;
 1616|  13.4M|		request -= min;
 1617|  13.4M|		f->position += min;
 1618|  13.4M|		total_bytes_skipped += min;
 1619|  13.4M|	}
 1620|  13.7M|	if (request == 0)
  ------------------
  |  Branch (1620:6): [True: 13.7M, False: 3.63k]
  ------------------
 1621|  13.7M|		return (total_bytes_skipped);
 1622|       |
 1623|       |	/* If there's an optimized skip function, use it. */
 1624|  3.63k|	if (f->can_skip != 0) {
  ------------------
  |  Branch (1624:6): [True: 3.24k, False: 391]
  ------------------
 1625|  3.24k|		bytes_skipped = client_skip_proxy(f, request);
 1626|  3.24k|		if (bytes_skipped < 0) {	/* error */
  ------------------
  |  Branch (1626:7): [True: 0, False: 3.24k]
  ------------------
 1627|      0|			f->fatal = 1;
 1628|      0|			return (bytes_skipped);
 1629|      0|		}
 1630|  3.24k|		f->position += bytes_skipped;
 1631|  3.24k|		total_bytes_skipped += bytes_skipped;
 1632|  3.24k|		request -= bytes_skipped;
 1633|  3.24k|		if (request == 0)
  ------------------
  |  Branch (1633:7): [True: 0, False: 3.24k]
  ------------------
 1634|      0|			return (total_bytes_skipped);
 1635|  3.24k|	}
 1636|       |
 1637|       |	/* Use ordinary reads as necessary to complete the request. */
 1638|  4.19k|	for (;;) {
 1639|  4.19k|		bytes_read = (f->vtable->read)(f, &f->client_buff);
 1640|  4.19k|		if (bytes_read < 0) {
  ------------------
  |  Branch (1640:7): [True: 105, False: 4.09k]
  ------------------
 1641|    105|			f->client_buff = NULL;
 1642|    105|			f->fatal = 1;
 1643|    105|			return (bytes_read);
 1644|    105|		}
 1645|       |
 1646|  4.09k|		if (bytes_read == 0) {
  ------------------
  |  Branch (1646:7): [True: 3.27k, False: 823]
  ------------------
 1647|  3.27k|			if (f->archive->client.cursor !=
  ------------------
  |  Branch (1647:8): [True: 0, False: 3.27k]
  ------------------
 1648|  3.27k|			      f->archive->client.nodes - 1) {
 1649|      0|				if (client_switch_proxy(f,
  ------------------
  |  Branch (1649:9): [True: 0, False: 0]
  ------------------
 1650|      0|				    f->archive->client.cursor + 1)
 1651|      0|				    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1652|      0|					continue;
 1653|      0|			}
 1654|  3.27k|			f->client_buff = NULL;
 1655|  3.27k|			f->end_of_file = 1;
 1656|  3.27k|			return (total_bytes_skipped);
 1657|  3.27k|		}
 1658|       |
 1659|    823|		if (bytes_read >= request) {
  ------------------
  |  Branch (1659:7): [True: 256, False: 567]
  ------------------
 1660|    256|			f->client_next =
 1661|    256|			    ((const char *)f->client_buff) + request;
 1662|    256|			f->client_avail = (size_t)(bytes_read - request);
 1663|    256|			f->client_total = bytes_read;
 1664|    256|			total_bytes_skipped += request;
 1665|    256|			f->position += request;
 1666|    256|			return (total_bytes_skipped);
 1667|    256|		}
 1668|       |
 1669|    567|		f->position += bytes_read;
 1670|    567|		total_bytes_skipped += bytes_read;
 1671|    567|		request -= bytes_read;
 1672|    567|	}
 1673|  3.63k|}
archive_read.c:client_skip_proxy:
  189|  3.24k|{
  190|  3.24k|	if (request < 0)
  ------------------
  |  Branch (190:6): [True: 0, False: 3.24k]
  ------------------
  191|      0|		__archive_errx(1, "Negative skip requested");
  192|  3.24k|	if (request == 0)
  ------------------
  |  Branch (192:6): [True: 0, False: 3.24k]
  ------------------
  193|      0|		return 0;
  194|       |
  195|  3.24k|	if (f->archive->client.skipper != NULL) {
  ------------------
  |  Branch (195:6): [True: 3.24k, False: 0]
  ------------------
  196|  3.24k|		int64_t total = 0;
  197|  3.24k|		for (;;) {
  198|  3.24k|			int64_t get, ask = request;
  199|  3.24k|			get = (f->archive->client.skipper)
  200|  3.24k|				(&f->archive->archive, f->data, ask);
  201|  3.24k|			total += get;
  202|  3.24k|			if (get == 0 || get == request)
  ------------------
  |  Branch (202:8): [True: 3.24k, False: 0]
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|  3.24k|				return (total);
  204|      0|			if (get > request)
  ------------------
  |  Branch (204:8): [True: 0, False: 0]
  ------------------
  205|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  206|      0|			request -= get;
  207|      0|		}
  208|  3.24k|	} else if (f->archive->client.seeker != NULL
  ------------------
  |  Branch (208:13): [True: 0, False: 0]
  ------------------
  209|      0|		&& request > 64 * 1024) {
  ------------------
  |  Branch (209:6): [True: 0, False: 0]
  ------------------
  210|       |		/* If the client provided a seeker but not a skipper,
  211|       |		 * we can use the seeker to skip forward.
  212|       |		 *
  213|       |		 * Note: This isn't always a good idea.  The client
  214|       |		 * skipper is allowed to skip by less than requested
  215|       |		 * if it needs to maintain block alignment.  The
  216|       |		 * seeker is not allowed to play such games, so using
  217|       |		 * the seeker here may be a performance loss compared
  218|       |		 * to just reading and discarding.  That's why we
  219|       |		 * only do this for skips of over 64k.
  220|       |		 */
  221|      0|		int64_t before = f->position;
  222|      0|		int64_t after = (f->archive->client.seeker)
  223|      0|		    (&f->archive->archive, f->data, request, SEEK_CUR);
  224|      0|		if (after != before + request)
  ------------------
  |  Branch (224:7): [True: 0, False: 0]
  ------------------
  225|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  226|      0|		return after - before;
  227|      0|	}
  228|      0|	return 0;
  229|  3.24k|}
archive_read.c:client_seek_proxy:
  233|  26.0k|{
  234|       |	/* DO NOT use the skipper here!  If we transparently handled
  235|       |	 * forward seek here by using the skipper, that will break
  236|       |	 * other libarchive code that assumes a successful forward
  237|       |	 * seek means it can also seek backwards.
  238|       |	 */
  239|  26.0k|	if (f->archive->client.seeker == NULL) {
  ------------------
  |  Branch (239:6): [True: 0, False: 26.0k]
  ------------------
  240|      0|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  241|      0|		    "Current client reader does not support seeking a device");
  242|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  243|      0|	}
  244|  26.0k|	return (f->archive->client.seeker)(&f->archive->archive,
  245|  26.0k|	    f->data, offset, whence);
  246|  26.0k|}

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

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

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

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

archive_read_support_filter_bzip2:
   91|  11.9k|{
   92|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
   93|       |
   94|  11.9k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (94:6): [True: 0, False: 11.9k]
  ------------------
   95|  11.9k|				&bzip2_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#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|  11.9k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
   99|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#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|  11.9k|}
archive_read_support_filter_bzip2.c:bzip2_reader_bid:
  116|  14.1k|{
  117|  14.1k|	const unsigned char *buffer;
  118|  14.1k|	int bits_checked;
  119|       |
  120|  14.1k|	(void)b; /* UNUSED */
  121|       |
  122|       |	/* Minimal bzip2 archive is 14 bytes. */
  123|  14.1k|	buffer = __archive_read_filter_ahead(f, 14, NULL);
  124|  14.1k|	if (buffer == NULL)
  ------------------
  |  Branch (124:6): [True: 209, False: 13.9k]
  ------------------
  125|    209|		return (0);
  126|       |
  127|       |	/* First three bytes must be "BZh" */
  128|  13.9k|	bits_checked = 0;
  129|  13.9k|	if (memcmp(buffer, "BZh", 3) != 0)
  ------------------
  |  Branch (129:6): [True: 13.7k, False: 232]
  ------------------
  130|  13.7k|		return (0);
  131|    232|	bits_checked += 24;
  132|       |
  133|       |	/* Next follows a compression flag which must be an ASCII digit. */
  134|    232|	if (buffer[3] < '1' || buffer[3] > '9')
  ------------------
  |  Branch (134:6): [True: 0, False: 232]
  |  Branch (134:25): [True: 10, False: 222]
  ------------------
  135|     10|		return (0);
  136|    222|	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|    222|	if (memcmp(buffer + 4, "\x31\x41\x59\x26\x53\x59", 6) == 0)
  ------------------
  |  Branch (141:6): [True: 136, False: 86]
  ------------------
  142|    136|		bits_checked += 48;
  143|     86|	else if (memcmp(buffer + 4, "\x17\x72\x45\x38\x50\x90", 6) == 0)
  ------------------
  |  Branch (143:11): [True: 84, False: 2]
  ------------------
  144|     84|		bits_checked += 48;
  145|      2|	else
  146|      2|		return (0);
  147|       |
  148|    220|	return (bits_checked);
  149|    222|}
archive_read_support_filter_bzip2.c:bzip2_reader_init:
  186|     38|{
  187|     38|	static const size_t out_block_size = 64 * 1024;
  188|     38|	void *out_block;
  189|     38|	struct bzip2 *bzip2;
  190|       |
  191|     38|	f->code = ARCHIVE_FILTER_BZIP2;
  ------------------
  |  |  311|     38|#define	ARCHIVE_FILTER_BZIP2	2
  ------------------
  192|     38|	f->name = "bzip2";
  193|       |
  194|     38|	bzip2 = calloc(1, sizeof(*bzip2));
  195|     38|	out_block = malloc(out_block_size);
  196|     38|	if (bzip2 == NULL || out_block == NULL) {
  ------------------
  |  Branch (196:6): [True: 0, False: 38]
  |  Branch (196:23): [True: 0, False: 38]
  ------------------
  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|     38|	f->data = bzip2;
  205|     38|	bzip2->out_block_size = out_block_size;
  206|     38|	bzip2->out_block = out_block;
  207|     38|	f->vtable = &bzip2_reader_vtable;
  208|       |
  209|     38|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  210|     38|}
archive_read_support_filter_bzip2.c:bzip2_filter_read:
  217|  1.53k|{
  218|  1.53k|	struct bzip2 *bzip2 = f->data;
  219|  1.53k|	size_t decompressed;
  220|  1.53k|	const char *read_buf;
  221|  1.53k|	ssize_t ret;
  222|       |
  223|  1.53k|	if (bzip2->eof) {
  ------------------
  |  Branch (223:6): [True: 1, False: 1.53k]
  ------------------
  224|      1|		*p = NULL;
  225|      1|		return (0);
  226|      1|	}
  227|       |
  228|       |	/* Empty our output buffer. */
  229|  1.53k|	bzip2->stream.next_out = bzip2->out_block;
  230|  1.53k|	bzip2->stream.avail_out = (uint32_t)bzip2->out_block_size;
  231|       |
  232|       |	/* Try to fill the output buffer. */
  233|  1.68k|	for (;;) {
  234|  1.68k|		ssize_t max_in;
  235|       |
  236|  1.68k|		if (!bzip2->valid) {
  ------------------
  |  Branch (236:7): [True: 187, False: 1.49k]
  ------------------
  237|    187|			if (bzip2_reader_bid(f->bidder, f->upstream) == 0) {
  ------------------
  |  Branch (237:8): [True: 5, False: 182]
  ------------------
  238|      5|				bzip2->eof = 1;
  239|      5|				*p = bzip2->out_block;
  240|      5|				decompressed = bzip2->stream.next_out
  241|      5|				    - bzip2->out_block;
  242|      5|				return (decompressed);
  243|      5|			}
  244|       |			/* Initialize compression library. */
  245|    182|			ret = BZ2_bzDecompressInit(&(bzip2->stream),
  246|    182|					   0 /* library verbosity */,
  247|    182|					   0 /* don't use low-mem algorithm */);
  248|       |
  249|       |			/* If init fails, try low-memory algorithm instead. */
  250|    182|			if (ret == BZ_MEM_ERROR)
  ------------------
  |  Branch (250:8): [True: 0, False: 182]
  ------------------
  251|      0|				ret = BZ2_bzDecompressInit(&(bzip2->stream),
  252|      0|					   0 /* library verbosity */,
  253|      0|					   1 /* do use low-mem algo */);
  254|       |
  255|    182|			if (ret != BZ_OK) {
  ------------------
  |  Branch (255:8): [True: 0, False: 182]
  ------------------
  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|    182|			bzip2->valid = 1;
  277|    182|		}
  278|       |
  279|       |		/* stream.next_in is really const, but bzlib
  280|       |		 * doesn't declare it so. <sigh> */
  281|  1.67k|		read_buf =
  282|  1.67k|		    __archive_read_filter_ahead(f->upstream, 1, &ret);
  283|  1.67k|		if (read_buf == NULL) {
  ------------------
  |  Branch (283:7): [True: 2, False: 1.67k]
  ------------------
  284|      2|			archive_set_error(&f->archive->archive,
  285|      2|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  286|      2|			    "truncated bzip2 input");
  287|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  288|      2|		}
  289|  1.67k|		bzip2->stream.next_in = (char *)(uintptr_t)read_buf;
  290|  1.67k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (290:7): [Folded, False: 1.67k]
  ------------------
  291|      0|			max_in = SSIZE_MAX;
  292|  1.67k|		else
  293|  1.67k|			max_in = UINT_MAX;
  294|  1.67k|		if (ret > max_in)
  ------------------
  |  Branch (294:7): [True: 0, False: 1.67k]
  ------------------
  295|      0|			ret = max_in;
  296|  1.67k|		bzip2->stream.avail_in = (uint32_t)ret;
  297|       |
  298|       |		/* Decompress as much as we can in one pass. */
  299|  1.67k|		ret = BZ2_bzDecompress(&(bzip2->stream));
  300|  1.67k|		__archive_read_filter_consume(f->upstream,
  301|  1.67k|		    bzip2->stream.next_in - read_buf);
  302|       |
  303|  1.67k|		switch (ret) {
  304|    149|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (304:3): [True: 149, False: 1.52k]
  ------------------
  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|  1.65k|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (316:3): [True: 1.50k, False: 176]
  ------------------
  317|       |			/* If we filled our buffer, update stats and return. */
  318|  1.65k|			if (bzip2->stream.avail_out == 0) {
  ------------------
  |  Branch (318:8): [True: 1.49k, False: 151]
  ------------------
  319|  1.49k|				*p = bzip2->out_block;
  320|  1.49k|				decompressed = bzip2->stream.next_out
  321|  1.49k|				    - bzip2->out_block;
  322|  1.49k|				return (decompressed);
  323|  1.49k|			}
  324|    151|			break;
  325|    151|		default: /* Return an error. */
  ------------------
  |  Branch (325:3): [True: 27, False: 1.65k]
  ------------------
  326|     27|			archive_set_error(&f->archive->archive,
  327|     27|			    ARCHIVE_ERRNO_MISC, "bzip decompression failed");
  ------------------
  |  |  204|     27|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  328|     27|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     27|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  329|  1.67k|		}
  330|  1.67k|	}
  331|  1.53k|}
archive_read_support_filter_bzip2.c:bzip2_filter_close:
  338|     38|{
  339|     38|	struct bzip2 *bzip2 = f->data;
  340|     38|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  341|       |
  342|     38|	if (bzip2->valid) {
  ------------------
  |  Branch (342:6): [True: 33, False: 5]
  ------------------
  343|     33|		switch (BZ2_bzDecompressEnd(&bzip2->stream)) {
  344|     33|		case BZ_OK:
  ------------------
  |  Branch (344:3): [True: 33, False: 0]
  ------------------
  345|     33|			break;
  346|      0|		default:
  ------------------
  |  Branch (346:3): [True: 0, False: 33]
  ------------------
  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|     33|		}
  352|     33|		bzip2->valid = 0;
  353|     33|	}
  354|       |
  355|     38|	free(bzip2->out_block);
  356|     38|	free(bzip2);
  357|     38|	return (ret);
  358|     38|}

archive_read_support_filter_compress:
  160|  11.9k|{
  161|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  162|       |
  163|       |	return __archive_read_register_bidder(a, NULL,
  164|  11.9k|			&compress_bidder_vtable);
  165|  11.9k|}
archive_read_support_filter_compress.c:compress_bidder_bid:
  174|  13.9k|{
  175|  13.9k|	const unsigned char *buffer;
  176|  13.9k|	int bits_checked;
  177|       |
  178|  13.9k|	(void)b; /* UNUSED */
  179|       |
  180|       |	/* Shortest valid compress file is 3 bytes. */
  181|  13.9k|	buffer = __archive_read_filter_ahead(f, 3, NULL);
  182|       |
  183|  13.9k|	if (buffer == NULL)
  ------------------
  |  Branch (183:6): [True: 189, False: 13.8k]
  ------------------
  184|    189|		return (0);
  185|       |
  186|  13.8k|	bits_checked = 0;
  187|       |	/* First two bytes are the magic value */
  188|  13.8k|	if (buffer[0] != 0x1F || buffer[1] != 0x9D)
  ------------------
  |  Branch (188:6): [True: 12.5k, False: 1.25k]
  |  Branch (188:27): [True: 1.15k, False: 96]
  ------------------
  189|  13.7k|		return (0);
  190|       |	/* Third byte holds compression parameters. */
  191|     96|	if (buffer[2] & 0x20) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (191:6): [True: 0, False: 96]
  ------------------
  192|      0|		return (0);
  193|     96|	if (buffer[2] & 0x40) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (193:6): [True: 0, False: 96]
  ------------------
  194|      0|		return (0);
  195|     96|	bits_checked += 18;
  196|       |
  197|     96|	return (bits_checked);
  198|     96|}
archive_read_support_filter_compress.c:compress_bidder_init:
  211|     96|{
  212|     96|	struct compress *compress;
  213|     96|	static const size_t out_block_size = 64 * 1024;
  214|     96|	void *out_block;
  215|       |
  216|     96|	f->code = ARCHIVE_FILTER_COMPRESS;
  ------------------
  |  |  312|     96|#define	ARCHIVE_FILTER_COMPRESS	3
  ------------------
  217|     96|	f->name = "compress (.Z)";
  218|       |
  219|     96|	compress = calloc(1, sizeof(*compress));
  220|     96|	out_block = malloc(out_block_size);
  221|     96|	if (compress == NULL || out_block == NULL) {
  ------------------
  |  Branch (221:6): [True: 0, False: 96]
  |  Branch (221:26): [True: 0, False: 96]
  ------------------
  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|     96|	f->data = compress;
  231|     96|	compress->out_block_size = out_block_size;
  232|     96|	compress->out_block = out_block;
  233|     96|	f->vtable = &compress_reader_vtable;
  234|       |
  235|     96|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     96|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  236|     96|}
archive_read_support_filter_compress.c:compress_filter_read:
  283|    290|{
  284|    290|	struct compress *compress = f->data;
  285|    290|	unsigned char *p, *start, *end;
  286|    290|	int ret;
  287|       |
  288|    290|	if (!compress->initialized) {
  ------------------
  |  Branch (288:6): [True: 96, False: 194]
  ------------------
  289|     96|		ret = compress_filter_init(f);
  290|     96|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|     96|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (290:7): [True: 0, False: 96]
  ------------------
  291|      0|			return (ret);
  292|     96|	}
  293|    290|	if (compress->end_of_stream) {
  ------------------
  |  Branch (293:6): [True: 61, False: 229]
  ------------------
  294|     61|		*pblock = NULL;
  295|     61|		return (0);
  296|     61|	}
  297|    229|	p = start = (unsigned char *)compress->out_block;
  298|    229|	end = start + compress->out_block_size;
  299|       |
  300|  16.8M|	while (p < end && !compress->end_of_stream) {
  ------------------
  |  Branch (300:9): [True: 16.8M, False: 133]
  |  Branch (300:20): [True: 16.8M, False: 71]
  ------------------
  301|  16.8M|		if (compress->stackp > compress->stack) {
  ------------------
  |  Branch (301:7): [True: 10.0M, False: 6.70M]
  ------------------
  302|  10.0M|			*p++ = *--compress->stackp;
  303|  10.0M|		} else {
  304|  6.70M|			ret = next_code(f);
  305|  6.70M|			if (ret == -1)
  ------------------
  |  Branch (305:8): [True: 71, False: 6.70M]
  ------------------
  306|     71|				compress->end_of_stream = ret;
  307|  6.70M|			else if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  6.70M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (307:13): [True: 25, False: 6.70M]
  ------------------
  308|     25|				return (ret);
  309|  6.70M|		}
  310|  16.8M|	}
  311|       |
  312|    204|	*pblock = start;
  313|    204|	return (p - start);
  314|    229|}
archive_read_support_filter_compress.c:compress_filter_init:
  240|     96|{
  241|     96|	struct compress *compress = f->data;
  242|     96|	int code;
  243|       |
  244|     96|	compress->initialized = 1;
  245|       |
  246|     96|	(void)getbits(f, 8); /* Skip first signature byte. */
  247|     96|	(void)getbits(f, 8); /* Skip second signature byte. */
  248|       |
  249|       |	/* Get compression parameters. */
  250|     96|	code = getbits(f, 8);
  251|     96|	if (code < 0 || (code & 0x1f) > 16) {
  ------------------
  |  Branch (251:6): [True: 0, False: 96]
  |  Branch (251:18): [True: 0, False: 96]
  ------------------
  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|     96|	compress->maxcode_bits = code & 0x1f;
  257|     96|	compress->maxcode = (1 << compress->maxcode_bits);
  258|     96|	compress->use_reset_code = code & 0x80;
  259|       |
  260|       |	/* Initialize decompressor. */
  261|     96|	compress->free_ent = 256;
  262|     96|	compress->stackp = compress->stack;
  263|     96|	if (compress->use_reset_code)
  ------------------
  |  Branch (263:6): [True: 69, False: 27]
  ------------------
  264|     69|		compress->free_ent++;
  265|     96|	compress->bits = 9;
  266|     96|	compress->section_end_code = (1<<compress->bits) - 1;
  267|     96|	compress->oldcode = -1;
  268|  24.6k|	for (code = 255; code >= 0; code--) {
  ------------------
  |  Branch (268:19): [True: 24.5k, False: 96]
  ------------------
  269|  24.5k|		compress->prefix[code] = 0;
  270|  24.5k|		compress->suffix[code] = code;
  271|  24.5k|	}
  272|     96|	next_code(f);
  273|       |
  274|     96|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     96|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  275|     96|}
archive_read_support_filter_compress.c:getbits:
  421|  7.80M|{
  422|  7.80M|	struct compress *compress = f->data;
  423|  7.80M|	int code;
  424|  7.80M|	ssize_t ret;
  425|  7.80M|	static const int mask[] = {
  426|  7.80M|		0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff,
  427|  7.80M|		0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff
  428|  7.80M|	};
  429|       |
  430|  17.9M|	while (compress->bits_avail < n) {
  ------------------
  |  Branch (430:9): [True: 10.1M, False: 7.80M]
  ------------------
  431|  10.1M|		if (compress->avail_in <= 0) {
  ------------------
  |  Branch (431:7): [True: 273, False: 10.1M]
  ------------------
  432|    273|			if (compress->consume_unnotified) {
  ------------------
  |  Branch (432:8): [True: 177, False: 96]
  ------------------
  433|    177|				__archive_read_filter_consume(f->upstream,
  434|    177|					compress->consume_unnotified);
  435|    177|				compress->consume_unnotified = 0;
  436|    177|			}
  437|    273|			compress->next_in
  438|    273|			    = __archive_read_filter_ahead(f->upstream,
  439|    273|				1, &ret);
  440|    273|			if (ret == 0)
  ------------------
  |  Branch (440:8): [True: 71, False: 202]
  ------------------
  441|     71|				return (-1);
  442|    202|			if (compress->next_in == NULL)
  ------------------
  |  Branch (442:8): [True: 4, False: 198]
  ------------------
  443|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  444|    198|			compress->consume_unnotified = compress->avail_in = ret;
  445|    198|		}
  446|  10.1M|		compress->bit_buffer |= *compress->next_in++ << compress->bits_avail;
  447|  10.1M|		compress->avail_in--;
  448|  10.1M|		compress->bits_avail += 8;
  449|  10.1M|		compress->bytes_in_section++;
  450|  10.1M|	}
  451|       |
  452|  7.80M|	code = compress->bit_buffer;
  453|  7.80M|	compress->bit_buffer >>= n;
  454|  7.80M|	compress->bits_avail -= n;
  455|       |
  456|  7.80M|	return (code & mask[n]);
  457|  7.80M|}
archive_read_support_filter_compress.c:next_code:
  336|  6.70M|{
  337|  6.70M|	struct compress *compress = f->data;
  338|  6.70M|	int code, newcode;
  339|       |
  340|  6.84M|again:
  341|  6.84M|	code = newcode = getbits(f, compress->bits);
  342|  6.84M|	if (code < 0)
  ------------------
  |  Branch (342:6): [True: 70, False: 6.84M]
  ------------------
  343|     70|		return (code);
  344|       |
  345|       |	/* If it's a reset code, reset the dictionary. */
  346|  6.84M|	if ((code == 256) && compress->use_reset_code) {
  ------------------
  |  Branch (346:6): [True: 143k, False: 6.70M]
  |  Branch (346:23): [True: 138k, False: 4.98k]
  ------------------
  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|   138k|		int skip_bytes =  compress->bits -
  355|   138k|		    (compress->bytes_in_section % compress->bits);
  356|   138k|		skip_bytes %= compress->bits;
  357|   138k|		compress->bits_avail = 0; /* Discard rest of this byte. */
  358|  1.10M|		while (skip_bytes-- > 0) {
  ------------------
  |  Branch (358:10): [True: 964k, False: 138k]
  ------------------
  359|   964k|			code = getbits(f, 8);
  360|   964k|			if (code < 0)
  ------------------
  |  Branch (360:8): [True: 5, False: 964k]
  ------------------
  361|      5|				return (code);
  362|   964k|		}
  363|       |		/* Now, actually do the reset. */
  364|   138k|		compress->bytes_in_section = 0;
  365|   138k|		compress->bits = 9;
  366|   138k|		compress->section_end_code = (1 << compress->bits) - 1;
  367|   138k|		compress->free_ent = 257;
  368|   138k|		compress->oldcode = -1;
  369|   138k|		goto again;
  370|   138k|	}
  371|       |
  372|  6.70M|	if (code > compress->free_ent
  ------------------
  |  Branch (372:6): [True: 21, False: 6.70M]
  ------------------
  373|  6.70M|	    || (code == compress->free_ent && compress->oldcode < 0)) {
  ------------------
  |  Branch (373:10): [True: 3.18k, False: 6.70M]
  |  Branch (373:40): [True: 14, False: 3.17k]
  ------------------
  374|       |		/* An invalid code is a fatal error. */
  375|     35|		archive_set_error(&(f->archive->archive), -1,
  376|     35|		    "Invalid compressed data");
  377|     35|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     35|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  378|     35|	}
  379|       |
  380|       |	/* Special case for KwKwK string. */
  381|  6.70M|	if (code >= compress->free_ent) {
  ------------------
  |  Branch (381:6): [True: 3.17k, False: 6.70M]
  ------------------
  382|  3.17k|		*compress->stackp++ = compress->finbyte;
  383|  3.17k|		code = compress->oldcode;
  384|  3.17k|	}
  385|       |
  386|       |	/* Generate output characters in reverse order. */
  387|  10.0M|	while (code >= 256) {
  ------------------
  |  Branch (387:9): [True: 3.38M, False: 6.70M]
  ------------------
  388|  3.38M|		*compress->stackp++ = compress->suffix[code];
  389|  3.38M|		code = compress->prefix[code];
  390|  3.38M|	}
  391|  6.70M|	*compress->stackp++ = compress->finbyte = code;
  392|       |
  393|       |	/* Generate the new entry. */
  394|  6.70M|	code = compress->free_ent;
  395|  6.70M|	if (code < compress->maxcode && compress->oldcode >= 0) {
  ------------------
  |  Branch (395:6): [True: 290k, False: 6.41M]
  |  Branch (395:34): [True: 289k, False: 999]
  ------------------
  396|   289k|		compress->prefix[code] = compress->oldcode;
  397|   289k|		compress->suffix[code] = compress->finbyte;
  398|   289k|		++compress->free_ent;
  399|   289k|	}
  400|  6.70M|	if (compress->free_ent > compress->section_end_code) {
  ------------------
  |  Branch (400:6): [True: 641, False: 6.70M]
  ------------------
  401|    641|		compress->bits++;
  402|    641|		compress->bytes_in_section = 0;
  403|    641|		if (compress->bits == compress->maxcode_bits)
  ------------------
  |  Branch (403:7): [True: 398, False: 243]
  ------------------
  404|    398|			compress->section_end_code = compress->maxcode;
  405|    243|		else
  406|    243|			compress->section_end_code = (1 << compress->bits) - 1;
  407|    641|	}
  408|       |
  409|       |	/* Remember previous code. */
  410|  6.70M|	compress->oldcode = newcode;
  411|  6.70M|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.70M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  412|  6.70M|}
archive_read_support_filter_compress.c:compress_filter_close:
  321|     96|{
  322|     96|	struct compress *compress = f->data;
  323|       |
  324|     96|	free(compress->out_block);
  325|     96|	free(compress);
  326|     96|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     96|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  327|     96|}

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

archive_read_support_filter_gzip:
   96|  11.9k|{
   97|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
   98|       |
   99|  11.9k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (99:6): [True: 0, False: 11.9k]
  ------------------
  100|  11.9k|				&gzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#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|  11.9k|#if HAVE_ZLIB_H
  105|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#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|  11.9k|}
archive_read_support_filter_gzip.c:gzip_bidder_bid:
  241|  13.9k|{
  242|  13.9k|	int bits_checked;
  243|       |
  244|  13.9k|	(void)b; /* UNUSED */
  245|       |
  246|  13.9k|	if (peek_at_header(f, &bits_checked, NULL))
  ------------------
  |  Branch (246:6): [True: 1.12k, False: 12.8k]
  ------------------
  247|  1.12k|		return (bits_checked);
  248|  12.8k|	return (0);
  249|  13.9k|}
archive_read_support_filter_gzip.c:peek_at_header:
  130|  16.3k|{
  131|  16.3k|	const unsigned char *p;
  132|  16.3k|	ssize_t avail, len;
  133|  16.3k|	int bits = 0;
  134|  16.3k|	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|  16.3k|	len = 10;
  142|  16.3k|	p = __archive_read_filter_ahead(f, len, &avail);
  143|  16.3k|	if (p == NULL)
  ------------------
  |  Branch (143:6): [True: 650, False: 15.6k]
  ------------------
  144|    650|		return (0);
  145|       |	/* We only support deflation- third byte must be 0x08. */
  146|  15.6k|	if (memcmp(p, "\x1F\x8B\x08", 3) != 0)
  ------------------
  |  Branch (146:6): [True: 13.0k, False: 2.66k]
  ------------------
  147|  13.0k|		return (0);
  148|  2.66k|	bits += 24;
  149|  2.66k|	if ((p[3] & 0xE0)!= 0)	/* No reserved flags set. */
  ------------------
  |  Branch (149:6): [True: 30, False: 2.63k]
  ------------------
  150|     30|		return (0);
  151|  2.63k|	bits += 3;
  152|  2.63k|	header_flags = p[3];
  153|       |	/* Bytes 4-7 are mod time in little endian. */
  154|  2.63k|#ifdef HAVE_ZLIB_H
  155|  2.63k|	if (gzip)
  ------------------
  |  Branch (155:6): [True: 1.50k, False: 1.13k]
  ------------------
  156|  1.50k|		gzip->mtime = archive_le32dec(p + 4);
  157|  2.63k|#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.63k|	if (header_flags & 4) {
  ------------------
  |  Branch (164:6): [True: 230, False: 2.40k]
  ------------------
  165|    230|		p = __archive_read_filter_ahead(f, len + 2, &avail);
  166|    230|		if (p == NULL)
  ------------------
  |  Branch (166:7): [True: 0, False: 230]
  ------------------
  167|      0|			return (0);
  168|    230|		len += archive_le16dec(p + len);
  169|    230|		len += 2;
  170|    230|	}
  171|       |
  172|       |	/* Null-terminated optional filename. */
  173|  2.63k|	if (header_flags & 8) {
  ------------------
  |  Branch (173:6): [True: 615, False: 2.01k]
  ------------------
  174|    615|#ifdef HAVE_ZLIB_H
  175|    615|		ssize_t file_start = len;
  176|    615|#endif
  177|  3.00M|		do {
  178|  3.00M|			++len;
  179|  3.00M|			if (avail < len) {
  ------------------
  |  Branch (179:8): [True: 2.94M, False: 59.7k]
  ------------------
  180|  2.94M|				if (avail > MAX_FILENAME_LENGTH) {
  ------------------
  |  |  120|  2.94M|#define MAX_FILENAME_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (180:9): [True: 3, False: 2.94M]
  ------------------
  181|      3|					return (0);
  182|      3|				}
  183|  2.94M|				p = __archive_read_filter_ahead(f,
  184|  2.94M|				    len, &avail);
  185|  2.94M|			}
  186|  3.00M|			if (p == NULL)
  ------------------
  |  Branch (186:8): [True: 10, False: 3.00M]
  ------------------
  187|     10|				return (0);
  188|  3.00M|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (188:12): [True: 3.00M, False: 602]
  ------------------
  189|       |
  190|    602|#ifdef HAVE_ZLIB_H
  191|    602|		if (gzip) {
  ------------------
  |  Branch (191:7): [True: 411, False: 191]
  ------------------
  192|       |			/* Reset the name in case of repeat header reads. */
  193|    411|			free(gzip->name);
  194|    411|			gzip->name = strdup((const char *)&p[file_start]);
  195|    411|		}
  196|    602|#endif
  197|    602|	}
  198|       |
  199|       |	/* Null-terminated optional comment. */
  200|  2.62k|	if (header_flags & 16) {
  ------------------
  |  Branch (200:6): [True: 702, False: 1.91k]
  ------------------
  201|  2.03M|		do {
  202|  2.03M|			++len;
  203|  2.03M|			if (avail < len) {
  ------------------
  |  Branch (203:8): [True: 1.96M, False: 69.4k]
  ------------------
  204|  1.96M|				if (avail > MAX_COMMENT_LENGTH) {
  ------------------
  |  |  121|  1.96M|#define MAX_COMMENT_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (204:9): [True: 2, False: 1.96M]
  ------------------
  205|      2|					return (0);
  206|      2|				}
  207|  1.96M|				p = __archive_read_filter_ahead(f,
  208|  1.96M|				    len, &avail);
  209|  1.96M|			}
  210|  2.03M|			if (p == NULL)
  ------------------
  |  Branch (210:8): [True: 5, False: 2.03M]
  ------------------
  211|      5|				return (0);
  212|  2.03M|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (212:12): [True: 2.03M, False: 695]
  ------------------
  213|    702|	}
  214|       |
  215|       |	/* Optional header CRC */
  216|  2.61k|	if ((header_flags & 2)) {
  ------------------
  |  Branch (216:6): [True: 270, False: 2.34k]
  ------------------
  217|    270|		p = __archive_read_filter_ahead(f, len + 2, &avail);
  218|    270|		if (p == NULL)
  ------------------
  |  Branch (218:7): [True: 5, False: 265]
  ------------------
  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|    265|		len += 2;
  228|    265|	}
  229|       |
  230|  2.60k|	if (pbits != NULL)
  ------------------
  |  Branch (230:6): [True: 1.12k, False: 1.48k]
  ------------------
  231|  1.12k|		*pbits = bits;
  232|  2.60k|	return (len);
  233|  2.61k|}
archive_read_support_filter_gzip.c:gzip_bidder_init:
  304|  1.12k|{
  305|  1.12k|	struct gzip *gzip;
  306|  1.12k|	static const size_t out_block_size = 64 * 1024;
  307|  1.12k|	void *out_block;
  308|       |
  309|  1.12k|	f->code = ARCHIVE_FILTER_GZIP;
  ------------------
  |  |  310|  1.12k|#define	ARCHIVE_FILTER_GZIP	1
  ------------------
  310|  1.12k|	f->name = "gzip";
  311|       |
  312|  1.12k|	gzip = calloc(1, sizeof(*gzip));
  313|  1.12k|	out_block = malloc(out_block_size);
  314|  1.12k|	if (gzip == NULL || out_block == NULL) {
  ------------------
  |  Branch (314:6): [True: 0, False: 1.12k]
  |  Branch (314:22): [True: 0, False: 1.12k]
  ------------------
  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.12k|	f->data = gzip;
  323|  1.12k|	gzip->out_block_size = out_block_size;
  324|  1.12k|	gzip->out_block = out_block;
  325|  1.12k|	f->vtable = &gzip_reader_vtable;
  326|       |
  327|  1.12k|	gzip->in_stream = 0; /* We're not actually within a stream yet. */
  328|       |
  329|  1.12k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  330|  1.12k|}
archive_read_support_filter_gzip.c:gzip_filter_read:
  432|  37.1k|{
  433|  37.1k|	struct gzip *gzip = f->data;
  434|  37.1k|	size_t decompressed;
  435|  37.1k|	ssize_t avail_in, max_in;
  436|  37.1k|	int ret;
  437|       |
  438|       |	/* Empty our output buffer. */
  439|  37.1k|	gzip->stream.next_out = gzip->out_block;
  440|  37.1k|	gzip->stream.avail_out = (uInt)gzip->out_block_size;
  441|       |
  442|       |	/* Try to fill the output buffer. */
  443|  75.2k|	while (gzip->stream.avail_out > 0 && !gzip->eof) {
  ------------------
  |  Branch (443:9): [True: 39.8k, False: 35.3k]
  |  Branch (443:39): [True: 39.1k, False: 694]
  ------------------
  444|       |		/* If we're not in a stream, read a header
  445|       |		 * and initialize the decompression library. */
  446|  39.1k|		if (!gzip->in_stream) {
  ------------------
  |  Branch (446:7): [True: 2.34k, False: 36.7k]
  ------------------
  447|  2.34k|			ret = consume_header(f);
  448|  2.34k|			if (ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|  2.34k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (448:8): [True: 857, False: 1.48k]
  ------------------
  449|    857|				gzip->eof = 1;
  450|    857|				break;
  451|    857|			}
  452|  1.48k|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|  1.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (452:8): [True: 0, False: 1.48k]
  ------------------
  453|      0|				return (ret);
  454|  1.48k|		}
  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|  38.2k|		gzip->stream.next_in = (unsigned char *)(uintptr_t)
  460|  38.2k|		    __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  461|  38.2k|		if (gzip->stream.next_in == NULL) {
  ------------------
  |  Branch (461:7): [True: 178, False: 38.1k]
  ------------------
  462|    178|			archive_set_error(&f->archive->archive,
  463|    178|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    178|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  464|    178|			    "truncated gzip input");
  465|    178|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    178|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  466|    178|		}
  467|  38.1k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (467:7): [Folded, False: 38.1k]
  ------------------
  468|      0|			max_in = SSIZE_MAX;
  469|  38.1k|		else
  470|  38.1k|			max_in = UINT_MAX;
  471|  38.1k|		if (avail_in > max_in)
  ------------------
  |  Branch (471:7): [True: 0, False: 38.1k]
  ------------------
  472|      0|			avail_in = max_in;
  473|  38.1k|		gzip->stream.avail_in = (uInt)avail_in;
  474|       |
  475|       |		/* Decompress and consume some of that data. */
  476|  38.1k|		ret = inflate(&(gzip->stream), 0);
  477|  38.1k|		switch (ret) {
  478|  36.8k|		case Z_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (478:3): [True: 36.8k, False: 1.25k]
  ------------------
  479|  36.8k|			__archive_read_filter_consume(f->upstream,
  480|  36.8k|			    avail_in - gzip->stream.avail_in);
  481|  36.8k|			break;
  482|  1.22k|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (482:3): [True: 1.22k, False: 36.8k]
  ------------------
  483|  1.22k|			__archive_read_filter_consume(f->upstream,
  484|  1.22k|			    avail_in - gzip->stream.avail_in);
  485|       |			/* Consume the stream trailer; release the
  486|       |			 * decompression library. */
  487|  1.22k|			ret = consume_trailer(f);
  488|  1.22k|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|  1.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (488:8): [True: 2, False: 1.22k]
  ------------------
  489|      2|				return (ret);
  490|  1.22k|			break;
  491|  1.22k|		default:
  ------------------
  |  Branch (491:3): [True: 33, False: 38.0k]
  ------------------
  492|       |			/* Return an error. */
  493|     33|			archive_set_error(&f->archive->archive,
  494|     33|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     33|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  495|     33|			    "gzip decompression failed");
  496|     33|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     33|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|  38.1k|		}
  498|  38.1k|	}
  499|       |
  500|       |	/* We've read as much as we can. */
  501|  36.9k|	decompressed = gzip->stream.next_out - gzip->out_block;
  502|  36.9k|	if (decompressed == 0)
  ------------------
  |  Branch (502:6): [True: 697, False: 36.2k]
  ------------------
  503|    697|		*p = NULL;
  504|  36.2k|	else
  505|  36.2k|		*p = gzip->out_block;
  506|  36.9k|	return (decompressed);
  507|  37.1k|}
archive_read_support_filter_gzip.c:consume_header:
  334|  2.34k|{
  335|  2.34k|	struct gzip *gzip = f->data;
  336|  2.34k|	ssize_t avail, max_in;
  337|  2.34k|	size_t len;
  338|  2.34k|	int ret;
  339|       |
  340|       |	/* If this is a real header, consume it. */
  341|  2.34k|	len = peek_at_header(f->upstream, NULL, gzip);
  342|  2.34k|	if (len == 0)
  ------------------
  |  Branch (342:6): [True: 857, False: 1.48k]
  ------------------
  343|    857|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    857|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  344|  1.48k|	__archive_read_filter_consume(f->upstream, len);
  345|       |
  346|       |	/* Initialize CRC accumulator. */
  347|  1.48k|	gzip->crc = crc32(0L, NULL, 0);
  348|       |
  349|       |	/* Initialize compression library. */
  350|  1.48k|	gzip->stream.next_in = (unsigned char *)(uintptr_t)
  351|  1.48k|	    __archive_read_filter_ahead(f->upstream, 1, &avail);
  352|  1.48k|	if (avail < 0) {
  ------------------
  |  Branch (352:6): [True: 0, False: 1.48k]
  ------------------
  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.48k|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (358:6): [Folded, False: 1.48k]
  ------------------
  359|      0|		max_in = SSIZE_MAX;
  360|  1.48k|	else
  361|  1.48k|		max_in = UINT_MAX;
  362|  1.48k|	if (avail > max_in)
  ------------------
  |  Branch (362:6): [True: 0, False: 1.48k]
  ------------------
  363|      0|		avail = max_in;
  364|  1.48k|	gzip->stream.avail_in = (uInt)avail;
  365|  1.48k|	ret = inflateInit2(&(gzip->stream),
  366|  1.48k|	    -15 /* Don't check for zlib header */);
  367|       |
  368|       |	/* Decipher the error code. */
  369|  1.48k|	switch (ret) {
  370|  1.48k|	case Z_OK:
  ------------------
  |  Branch (370:2): [True: 1.48k, False: 0]
  ------------------
  371|  1.48k|		gzip->in_stream = 1;
  372|  1.48k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  373|      0|	case Z_STREAM_ERROR:
  ------------------
  |  Branch (373:2): [True: 0, False: 1.48k]
  ------------------
  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.48k]
  ------------------
  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.48k]
  ------------------
  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.48k]
  ------------------
  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.48k|	}
  397|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  398|  1.48k|}
archive_read_support_filter_gzip.c:consume_trailer:
  402|  1.22k|{
  403|  1.22k|	struct gzip *gzip = f->data;
  404|  1.22k|	const unsigned char *p;
  405|       |
  406|  1.22k|	gzip->in_stream = 0;
  407|  1.22k|	switch (inflateEnd(&(gzip->stream))) {
  408|  1.22k|	case Z_OK:
  ------------------
  |  Branch (408:2): [True: 1.22k, False: 0]
  ------------------
  409|  1.22k|		break;
  410|      0|	default:
  ------------------
  |  Branch (410:2): [True: 0, False: 1.22k]
  ------------------
  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.22k|	}
  416|       |
  417|       |	/* GZip trailer is a fixed 8 byte structure. */
  418|  1.22k|	p = __archive_read_filter_ahead(f->upstream, 8, NULL);
  419|  1.22k|	if (p == NULL)
  ------------------
  |  Branch (419:6): [True: 2, False: 1.22k]
  ------------------
  420|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#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.22k|	__archive_read_filter_consume(f->upstream, 8);
  426|       |
  427|  1.22k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  428|  1.22k|}
archive_read_support_filter_gzip.c:gzip_filter_close:
  514|  1.12k|{
  515|  1.12k|	struct gzip *gzip = f->data;
  516|  1.12k|	int ret;
  517|       |
  518|  1.12k|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|  1.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  519|       |
  520|  1.12k|	if (gzip->in_stream) {
  ------------------
  |  Branch (520:6): [True: 262, False: 859]
  ------------------
  521|    262|		switch (inflateEnd(&(gzip->stream))) {
  522|    262|		case Z_OK:
  ------------------
  |  Branch (522:3): [True: 262, False: 0]
  ------------------
  523|    262|			break;
  524|      0|		default:
  ------------------
  |  Branch (524:3): [True: 0, False: 262]
  ------------------
  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|    262|		}
  530|    262|	}
  531|       |
  532|  1.12k|	free(gzip->name);
  533|  1.12k|	free(gzip->out_block);
  534|  1.12k|	free(gzip);
  535|  1.12k|	return (ret);
  536|  1.12k|}
archive_read_support_filter_gzip.c:gzip_read_header:
  276|    105|{
  277|    105|	struct gzip *gzip = f->data;
  278|       |
  279|       |	/* An mtime of 0 is considered invalid/missing. */
  280|    105|	if (gzip->mtime != 0)
  ------------------
  |  Branch (280:6): [True: 105, False: 0]
  ------------------
  281|    105|		archive_entry_set_mtime(entry, gzip->mtime, 0);
  282|       |
  283|       |	/* If the name is available, extract it. */
  284|    105|	if (gzip->name)
  ------------------
  |  Branch (284:6): [True: 18, False: 87]
  ------------------
  285|     18|		archive_entry_set_pathname(entry, gzip->name);
  286|       |
  287|    105|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    105|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  288|    105|}

archive_read_support_filter_lrzip:
   61|  11.9k|{
   62|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
   63|       |
   64|  11.9k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (64:6): [True: 0, False: 11.9k]
  ------------------
   65|  11.9k|				&lrzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#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|  11.9k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  11.9k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   70|  11.9k|	    "Using external lrzip program for lrzip decompression");
   71|  11.9k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  11.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   72|  11.9k|}
archive_read_support_filter_lrzip.c:lrzip_bidder_bid:
   80|  13.9k|{
   81|  13.9k|	const unsigned char *p;
   82|  13.9k|	int i;
   83|       |
   84|  13.9k|	(void)b; /* UNUSED */
   85|       |	/* Start by looking at the first six bytes of the header, which
   86|       |	 * is all fixed layout. */
   87|  13.9k|	p = __archive_read_filter_ahead(f, 6, NULL);
   88|  13.9k|	if (p == NULL)
  ------------------
  |  Branch (88:6): [True: 196, False: 13.7k]
  ------------------
   89|    196|		return (0);
   90|       |
   91|  13.7k|	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   45|  13.7k|#define LRZIP_HEADER_MAGIC "LRZI"
  ------------------
              	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   46|  13.7k|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (91:6): [True: 13.7k, False: 9]
  ------------------
   92|  13.7k|		return (0);
   93|       |
   94|       |	/* current major version is always 0, verify this */
   95|      9|	if (p[LRZIP_HEADER_MAGIC_LEN])
  ------------------
  |  |   46|      9|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (95:6): [True: 7, False: 2]
  ------------------
   96|      7|		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|  11.9k|{
  119|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  120|       |
  121|  11.9k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (121:6): [True: 0, False: 11.9k]
  ------------------
  122|  11.9k|				&lz4_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#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|  11.9k|#if defined(HAVE_LIBLZ4)
  126|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#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|  11.9k|}
archive_read_support_filter_lz4.c:lz4_reader_bid:
  144|  13.9k|{
  145|  13.9k|	const unsigned char *buffer;
  146|  13.9k|	ssize_t avail;
  147|  13.9k|	int bits_checked = 0;
  148|  13.9k|	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|  13.9k|	const size_t min_lz4_frame_size = 8;
  157|       |
  158|  13.9k|	size_t offset_in_buffer = 0;
  159|  13.9k|	const size_t max_lookahead = 64 * 1024;
  160|  13.9k|	uint32_t magic_number;
  161|       |
  162|  13.9k|	(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|  13.9k|	buffer = __archive_read_filter_ahead(f, min_lz4_archive_size,
  172|  13.9k|	    &avail);
  173|  13.9k|	if (buffer == NULL)
  ------------------
  |  Branch (173:6): [True: 211, False: 13.7k]
  ------------------
  174|    211|		return (0);
  175|       |
  176|  13.7k|	magic_number = archive_le32dec(buffer);
  177|       |
  178|  13.9k|	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   57|  13.9k|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|  13.9k|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (178:9): [True: 129, False: 13.7k]
  ------------------
  179|    129|		size_t min;
  180|    129|		uint32_t frame_data_size;
  181|       |
  182|       |		/* Skip over the magic number */
  183|    129|		bits_checked += 28;
  184|    129|		offset_in_buffer += 4;
  185|       |
  186|       |		/* Ensure that we can read another 4 bytes. */
  187|    129|		if (offset_in_buffer + 4 > (size_t)avail) {
  ------------------
  |  Branch (187:7): [True: 0, False: 129]
  ------------------
  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|    129|		frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  195|       |
  196|       |		/* Skip over the 4 frame data size bytes */
  197|    129|		offset_in_buffer += 4;
  198|       |
  199|       |		/* Skip over the value stored there. */
  200|    129|		if (archive_ckd_add_size(&offset_in_buffer,
  ------------------
  |  Branch (200:7): [True: 0, False: 129]
  ------------------
  201|    129|		    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|    129|		if (archive_ckd_add_size(&min,
  ------------------
  |  Branch (208:7): [True: 0, False: 129]
  ------------------
  209|    129|		    offset_in_buffer, min_lz4_frame_size) ||
  210|    129|		    min > max_lookahead)
  ------------------
  |  Branch (210:7): [True: 3, False: 126]
  ------------------
  211|      3|			return (0);
  212|       |		/* TODO: should this be >= ? */
  213|    126|		if (min > (size_t)avail) {
  ------------------
  |  Branch (213:7): [True: 0, False: 126]
  ------------------
  214|      0|			buffer = __archive_read_filter_ahead(f,
  215|      0|			    min, &avail);
  216|      0|			if (buffer == NULL)
  ------------------
  |  Branch (216:8): [True: 0, False: 0]
  ------------------
  217|      0|				return (0); 
  218|      0|		}
  219|       |
  220|    126|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  221|    126|	}
  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|  13.7k|	buffer = buffer + offset_in_buffer;
  229|       |
  230|  13.7k|	if (magic_number == LZ4_MAGICNUMBER) {
  ------------------
  |  |   52|  13.7k|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (230:6): [True: 317, False: 13.4k]
  ------------------
  231|    317|		unsigned char flag, BD;
  232|       |
  233|    317|		bits_checked += 32;
  234|       |		/* Next follows a stream descriptor. */
  235|       |		/* Descriptor Flags. */
  236|    317|		flag = buffer[4];
  237|       |		/* A version number must be "01". */
  238|    317|		if (((flag & 0xc0) >> 6) != 1)
  ------------------
  |  Branch (238:7): [True: 0, False: 317]
  ------------------
  239|      0|			return (0);
  240|       |		/* A reserved bit must be "0". */
  241|    317|		if (flag & 2)
  ------------------
  |  Branch (241:7): [True: 0, False: 317]
  ------------------
  242|      0|			return (0);
  243|    317|		bits_checked += 8;
  244|    317|		BD = buffer[5];
  245|       |		/* A block maximum size should be more than 3. */
  246|    317|		if (((BD & 0x70) >> 4) < 4)
  ------------------
  |  Branch (246:7): [True: 0, False: 317]
  ------------------
  247|      0|			return (0);
  248|       |		/* Reserved bits must be "0". */
  249|    317|		if (BD & ~0x70)
  ------------------
  |  Branch (249:7): [True: 0, False: 317]
  ------------------
  250|      0|			return (0);
  251|    317|		bits_checked += 8;
  252|       |
  253|    317|		return (bits_checked);
  254|    317|	}
  255|       |
  256|  13.4k|	if (magic_number == LZ4_LEGACY) {
  ------------------
  |  |   53|  13.4k|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (256:6): [True: 81, False: 13.3k]
  ------------------
  257|     81|		bits_checked += 32;
  258|     81|		return (bits_checked);
  259|     81|	}
  260|       |
  261|  13.3k|	return (0);
  262|  13.4k|}
archive_read_support_filter_lz4.c:lz4_reader_init:
  299|    398|{
  300|    398|	struct lz4 *lz4;
  301|       |
  302|    398|	f->code = ARCHIVE_FILTER_LZ4;
  ------------------
  |  |  322|    398|#define	ARCHIVE_FILTER_LZ4	13
  ------------------
  303|    398|	f->name = "lz4";
  304|       |
  305|    398|	lz4 = calloc(1, sizeof(*lz4));
  306|    398|	if (lz4 == NULL) {
  ------------------
  |  Branch (306:6): [True: 0, False: 398]
  ------------------
  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|    398|	f->data = lz4;
  313|    398|	lz4->stage = SELECT_STREAM;
  314|    398|	f->vtable = &lz4_reader_vtable;
  315|       |
  316|    398|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    398|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  317|    398|}
archive_read_support_filter_lz4.c:lz4_filter_read:
  374|  7.90k|{
  375|  7.90k|	struct lz4 *lz4 = f->data;
  376|  7.90k|	ssize_t ret;
  377|       |
  378|  7.90k|	if (lz4->eof) {
  ------------------
  |  Branch (378:6): [True: 9, False: 7.89k]
  ------------------
  379|      9|		*p = NULL;
  380|      9|		return (0);
  381|      9|	}
  382|       |
  383|  7.89k|	__archive_read_filter_consume(f->upstream, lz4->unconsumed);
  384|  7.89k|	lz4->unconsumed = 0;
  385|       |
  386|  7.89k|	switch (lz4->stage) {
  387|    398|	case SELECT_STREAM:
  ------------------
  |  Branch (387:2): [True: 398, False: 7.50k]
  ------------------
  388|    398|		break;
  389|      0|	case READ_DEFAULT_STREAM:
  ------------------
  |  Branch (389:2): [True: 0, False: 7.89k]
  ------------------
  390|      0|	case READ_LEGACY_STREAM:
  ------------------
  |  Branch (390:2): [True: 0, False: 7.89k]
  ------------------
  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.46k|	case READ_DEFAULT_BLOCK:
  ------------------
  |  Branch (395:2): [True: 6.46k, False: 1.43k]
  ------------------
  396|  6.46k|		ret = lz4_filter_read_default_stream(f, p);
  397|  6.46k|		if (ret != 0 || lz4->stage != SELECT_STREAM)
  ------------------
  |  Branch (397:7): [True: 5.43k, False: 1.02k]
  |  Branch (397:19): [True: 7, False: 1.01k]
  ------------------
  398|  5.44k|			return ret;
  399|  1.01k|		break;
  400|  1.04k|	case READ_LEGACY_BLOCK:
  ------------------
  |  Branch (400:2): [True: 1.04k, False: 6.85k]
  ------------------
  401|  1.04k|		ret = lz4_filter_read_legacy_stream(f, p);
  402|  1.04k|		if (ret != 0 || lz4->stage != SELECT_STREAM)
  ------------------
  |  Branch (402:7): [True: 296, False: 744]
  |  Branch (402:19): [True: 0, False: 744]
  ------------------
  403|    296|			return ret;
  404|    744|		break;
  405|    744|	default:
  ------------------
  |  Branch (405:2): [True: 0, False: 7.89k]
  ------------------
  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.89k|	}
  410|       |
  411|  2.15k|	while (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (411:9): [True: 2.15k, False: 0]
  ------------------
  412|  2.15k|		const char *read_buf;
  413|       |
  414|       |		/* Read a magic number. */
  415|  2.15k|		read_buf = __archive_read_filter_ahead(f->upstream, 4,
  416|  2.15k|				NULL);
  417|  2.15k|		if (read_buf == NULL) {
  ------------------
  |  Branch (417:7): [True: 68, False: 2.08k]
  ------------------
  418|     68|			lz4->eof = 1;
  419|     68|			*p = NULL;
  420|     68|			return (0);
  421|     68|		}
  422|  2.08k|		uint32_t number = archive_le32dec(read_buf);
  423|  2.08k|		__archive_read_filter_consume(f->upstream, 4);
  424|  2.08k|		if (number == LZ4_MAGICNUMBER)
  ------------------
  |  |   52|  2.08k|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (424:7): [True: 1.30k, False: 786]
  ------------------
  425|  1.30k|			return lz4_filter_read_default_stream(f, p);
  426|    786|		else if (number == LZ4_LEGACY)
  ------------------
  |  |   53|    786|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (426:12): [True: 769, False: 17]
  ------------------
  427|    769|			return lz4_filter_read_legacy_stream(f, p);
  428|     17|		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   57|     17|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|     17|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (428:12): [True: 0, False: 17]
  ------------------
  429|      0|			read_buf = __archive_read_filter_ahead(
  430|      0|				f->upstream, 4, NULL);
  431|      0|			if (read_buf == NULL) {
  ------------------
  |  Branch (431:8): [True: 0, False: 0]
  ------------------
  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|      0|			int64_t skip_bytes = archive_le32dec(read_buf);
  439|      0|			if (__archive_read_filter_consume(f->upstream,
  ------------------
  |  Branch (439:8): [True: 0, False: 0]
  ------------------
  440|      0|			    4 + skip_bytes) < 0) {
  441|      0|				archive_set_error(
  442|      0|				    &f->archive->archive,
  443|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  444|      0|				    "Malformed lz4 data");
  445|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  446|      0|			}
  447|     17|		} else {
  448|       |			/* Ignore following unrecognized data. */
  449|     17|			lz4->eof = 1;
  450|     17|			*p = NULL;
  451|     17|			return (0);
  452|     17|		}
  453|  2.08k|	}
  454|      0|	lz4->eof = 1;
  455|       |	*p = NULL;
  456|      0|	return (0);
  457|  2.15k|}
archive_read_support_filter_lz4.c:lz4_filter_read_default_stream:
  707|  7.76k|{
  708|  7.76k|	struct lz4 *lz4 = f->data;
  709|  7.76k|	const char *read_buf;
  710|  7.76k|	ssize_t ret;
  711|       |
  712|  7.76k|	if (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (712:6): [True: 1.30k, False: 6.46k]
  ------------------
  713|  1.30k|		lz4->stage = READ_DEFAULT_STREAM;
  714|       |		/* First, read a descriptor. */
  715|  1.30k|		if((ret = lz4_filter_read_descriptor(f)) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (715:6): [True: 2, False: 1.30k]
  ------------------
  716|      2|			return (ret);
  717|  1.30k|		lz4->stage = READ_DEFAULT_BLOCK;
  718|  1.30k|	}
  719|       |	/* Decompress a block. */
  720|  7.76k|	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.76k|	if (ret == 0 && *p == NULL)
  ------------------
  |  Branch (724:6): [True: 1.02k, False: 6.73k]
  |  Branch (724:18): [True: 1.01k, False: 7]
  ------------------
  725|  1.01k|		lz4->stage = SELECT_STREAM;
  726|       |
  727|       |	/* Optional processing, checking a stream sum. */
  728|  7.76k|	if (lz4->flags.stream_checksum) {
  ------------------
  |  Branch (728:6): [True: 6.57k, False: 1.18k]
  ------------------
  729|  6.57k|		if (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (729:7): [True: 469, False: 6.11k]
  ------------------
  730|    469|			unsigned int checksum;
  731|    469|			unsigned int checksum_stream;
  732|    469|			read_buf = __archive_read_filter_ahead(f->upstream,
  733|    469|			    4, NULL);
  734|    469|			if (read_buf == NULL) {
  ------------------
  |  Branch (734:8): [True: 1, False: 468]
  ------------------
  735|      1|				archive_set_error(&f->archive->archive,
  736|      1|				    ARCHIVE_ERRNO_MISC, "truncated lz4 input");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  737|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  738|      1|			}
  739|    468|			checksum = archive_le32dec(read_buf);
  740|    468|			__archive_read_filter_consume(f->upstream, 4);
  741|    468|			checksum_stream = __archive_xxhash.XXH32_digest(
  742|    468|			    lz4->xxh32_state);
  743|    468|			lz4->xxh32_state = NULL;
  744|    468|			if (checksum != checksum_stream) {
  ------------------
  |  Branch (744:8): [True: 468, 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|    468|			}
  752|  6.11k|		} else if (ret > 0)
  ------------------
  |  Branch (752:14): [True: 5.85k, False: 252]
  ------------------
  753|  5.85k|			__archive_xxhash.XXH32_update(lz4->xxh32_state,
  754|  5.85k|			    *p, (int)ret);
  755|  6.57k|	}
  756|  7.75k|	return (ret);
  757|  7.76k|}
archive_read_support_filter_lz4.c:lz4_filter_read_descriptor:
  461|  1.30k|{
  462|  1.30k|	struct lz4 *lz4 = f->data;
  463|  1.30k|	const char *read_buf;
  464|  1.30k|	ssize_t bytes_remaining;
  465|  1.30k|	ssize_t descriptor_bytes;
  466|  1.30k|	unsigned char flag, bd;
  467|  1.30k|	unsigned int chsum, chsum_verifier;
  468|       |
  469|       |	/* Make sure we have 2 bytes for flags. */
  470|  1.30k|	read_buf = __archive_read_filter_ahead(f->upstream, 2,
  471|  1.30k|	    &bytes_remaining);
  472|  1.30k|	if (read_buf == NULL) {
  ------------------
  |  Branch (472:6): [True: 0, False: 1.30k]
  ------------------
  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.30k|	flag = (unsigned char)read_buf[0];
  483|       |	/* Verify version number. */
  484|  1.30k|	if ((flag & 0xc0) != 1<<6)
  ------------------
  |  Branch (484:6): [True: 0, False: 1.30k]
  ------------------
  485|      0|		goto malformed_error;
  486|       |	/* A reserved bit must be zero. */
  487|  1.30k|	if (flag & 0x02)
  ------------------
  |  Branch (487:6): [True: 0, False: 1.30k]
  ------------------
  488|      0|		goto malformed_error;
  489|  1.30k|	lz4->flags.block_independence = (flag & 0x20) != 0;
  490|  1.30k|	lz4->flags.block_checksum = (flag & 0x10)?4:0;
  ------------------
  |  Branch (490:30): [True: 17, False: 1.28k]
  ------------------
  491|  1.30k|	lz4->flags.stream_size = (flag & 0x08) != 0;
  492|  1.30k|	lz4->flags.stream_checksum = (flag & 0x04) != 0;
  493|  1.30k|	lz4->flags.preset_dictionary = (flag & 0x01) != 0;
  494|       |
  495|       |	/* BD */
  496|  1.30k|	bd = (unsigned char)read_buf[1];
  497|       |	/* Reserved bits must be zero. */
  498|  1.30k|	if (bd & 0x8f)
  ------------------
  |  Branch (498:6): [True: 2, False: 1.30k]
  ------------------
  499|      2|		goto malformed_error;
  500|       |	/* Get a maximum block size. */
  501|  1.30k|	switch (read_buf[1] >> 4) {
  502|    396|	case 4: /* 64 KB */
  ------------------
  |  Branch (502:2): [True: 396, False: 904]
  ------------------
  503|    396|		lz4->flags.block_maximum_size = 64 * 1024;
  504|    396|		break;
  505|    369|	case 5: /* 256 KB */
  ------------------
  |  Branch (505:2): [True: 369, False: 931]
  ------------------
  506|    369|		lz4->flags.block_maximum_size = 256 * 1024;
  507|    369|		break;
  508|      0|	case 6: /* 1 MB */
  ------------------
  |  Branch (508:2): [True: 0, False: 1.30k]
  ------------------
  509|      0|		lz4->flags.block_maximum_size = 1024 * 1024;
  510|      0|		break;
  511|    535|	case 7: /* 4 MB */
  ------------------
  |  Branch (511:2): [True: 535, False: 765]
  ------------------
  512|    535|		lz4->flags.block_maximum_size = 4 * 1024 * 1024;
  513|    535|		break;
  514|      0|	default:
  ------------------
  |  Branch (514:2): [True: 0, False: 1.30k]
  ------------------
  515|      0|		goto malformed_error;
  516|  1.30k|	}
  517|       |
  518|       |	/* Read the whole descriptor in a stream block. */
  519|  1.30k|	descriptor_bytes = 3;
  520|  1.30k|	if (lz4->flags.stream_size)
  ------------------
  |  Branch (520:6): [True: 0, False: 1.30k]
  ------------------
  521|      0|		descriptor_bytes += 8;
  522|  1.30k|	if (lz4->flags.preset_dictionary)
  ------------------
  |  Branch (522:6): [True: 0, False: 1.30k]
  ------------------
  523|      0|		descriptor_bytes += 4;
  524|  1.30k|	if (bytes_remaining < descriptor_bytes) {
  ------------------
  |  Branch (524:6): [True: 0, False: 1.30k]
  ------------------
  525|      0|		read_buf = __archive_read_filter_ahead(f->upstream,
  526|      0|		    descriptor_bytes, &bytes_remaining);
  527|      0|		if (read_buf == NULL) {
  ------------------
  |  Branch (527:7): [True: 0, False: 0]
  ------------------
  528|      0|			archive_set_error(&f->archive->archive,
  529|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  530|      0|			    "truncated lz4 input");
  531|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  532|      0|		}
  533|      0|	}
  534|       |	/* Check if a descriptor is corrupted */
  535|  1.30k|	chsum = __archive_xxhash.XXH32(read_buf, (int)descriptor_bytes -1, 0);
  536|  1.30k|	chsum = (chsum >> 8) & 0xff;
  537|  1.30k|	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.30k|	__archive_read_filter_consume(f->upstream, descriptor_bytes);
  544|       |
  545|       |	/* Make sure we have a large enough buffer for uncompressed data. */
  546|  1.30k|	if (lz4_allocate_out_block(f) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (546:6): [True: 0, False: 1.30k]
  ------------------
  547|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  548|  1.30k|	if (lz4->flags.stream_checksum) {
  ------------------
  |  Branch (548:6): [True: 741, False: 559]
  ------------------
  549|    741|		lz4->xxh32_state = __archive_xxhash.XXH32_init(0);
  550|    741|		if (lz4->xxh32_state == NULL)
  ------------------
  |  Branch (550:7): [True: 0, False: 741]
  ------------------
  551|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  552|    741|	}
  553|       |
  554|  1.30k|	lz4->decoded_size = 0;
  555|       |	/* Success */
  556|  1.30k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  557|      2|malformed_error:
  558|      2|	archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  559|      2|	    "malformed lz4 data");
  560|      2|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  561|  1.30k|}
archive_read_support_filter_lz4.c:lz4_allocate_out_block:
  321|  1.30k|{
  322|  1.30k|	struct lz4 *lz4 = f->data;
  323|  1.30k|	size_t out_block_size = lz4->flags.block_maximum_size;
  324|  1.30k|	void *out_block;
  325|       |
  326|  1.30k|	if (!lz4->flags.block_independence)
  ------------------
  |  Branch (326:6): [True: 605, False: 695]
  ------------------
  327|    605|		out_block_size += 64 * 1024;
  328|  1.30k|	if (lz4->out_block_size < out_block_size) {
  ------------------
  |  Branch (328:6): [True: 317, False: 983]
  ------------------
  329|    317|		free(lz4->out_block);
  330|    317|		lz4->out_block = NULL;
  331|    317|		out_block = malloc(out_block_size);
  332|    317|		if (out_block == NULL) {
  ------------------
  |  Branch (332:7): [True: 0, False: 317]
  ------------------
  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|    317|		lz4->out_block_size = out_block_size;
  339|    317|		lz4->out_block = out_block;
  340|    317|	}
  341|  1.30k|	if (!lz4->flags.block_independence)
  ------------------
  |  Branch (341:6): [True: 605, False: 695]
  ------------------
  342|    605|		memset(lz4->out_block, 0, 64 * 1024);
  343|  1.30k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  344|  1.30k|}
archive_read_support_filter_lz4.c:lz4_filter_read_data_block:
  565|  7.76k|{
  566|  7.76k|	struct lz4 *lz4 = f->data;
  567|  7.76k|	ssize_t compressed_size;
  568|  7.76k|	const char *read_buf;
  569|  7.76k|	int checksum_size;
  570|  7.76k|	ssize_t uncompressed_size;
  571|  7.76k|	size_t prefix64k;
  572|       |
  573|  7.76k|	*p = NULL;
  574|       |
  575|       |	/* Make sure we have 4 bytes for a block size. */
  576|  7.76k|	read_buf = __archive_read_filter_ahead(f->upstream, 4, NULL);
  577|  7.76k|	if (read_buf == NULL)
  ------------------
  |  Branch (577:6): [True: 126, False: 7.63k]
  ------------------
  578|    126|		goto truncated_error;
  579|  7.63k|	compressed_size = archive_le32dec(read_buf);
  580|  7.63k|	if ((compressed_size & 0x7fffffff) > lz4->flags.block_maximum_size)
  ------------------
  |  Branch (580:6): [True: 100, False: 7.53k]
  ------------------
  581|    100|		goto malformed_error;
  582|       |	/* A compressed size == 0 means the end of stream blocks. */
  583|  7.53k|	if (compressed_size == 0) {
  ------------------
  |  Branch (583:6): [True: 1.01k, False: 6.51k]
  ------------------
  584|  1.01k|		__archive_read_filter_consume(f->upstream, 4);
  585|  1.01k|		return 0;
  586|  1.01k|	}
  587|       |
  588|  6.51k|	checksum_size = lz4->flags.block_checksum;
  589|       |	/* Check if the block is uncompressed. */
  590|  6.51k|	if (compressed_size & 0x80000000U) {
  ------------------
  |  Branch (590:6): [True: 5.90k, False: 619]
  ------------------
  591|  5.90k|		compressed_size &= 0x7fffffff;
  592|  5.90k|		uncompressed_size = compressed_size;
  593|  5.90k|	} else
  594|    619|		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.51k|	read_buf = __archive_read_filter_ahead(f->upstream,
  602|  6.51k|	    4 + compressed_size + checksum_size, NULL);
  603|  6.51k|	if (read_buf == NULL)
  ------------------
  |  Branch (603:6): [True: 17, False: 6.50k]
  ------------------
  604|     17|		goto truncated_error;
  605|       |
  606|       |	/* Optional processing, checking a block sum. */
  607|  6.50k|	if (checksum_size) {
  ------------------
  |  Branch (607:6): [True: 534, False: 5.96k]
  ------------------
  608|    534|		unsigned int chsum = __archive_xxhash.XXH32(
  609|    534|			read_buf + 4, (int)compressed_size, 0);
  610|    534|		unsigned int chsum_block =
  611|    534|		    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|    534|	}
  617|       |
  618|       |
  619|       |	/* If the block is uncompressed, there is nothing to do. */
  620|  6.50k|	if (uncompressed_size) {
  ------------------
  |  Branch (620:6): [True: 5.89k, False: 610]
  ------------------
  621|       |		/* Prepare a prefix 64k block for next block. */
  622|  5.89k|		if (!lz4->flags.block_independence) {
  ------------------
  |  Branch (622:7): [True: 1.68k, False: 4.21k]
  ------------------
  623|  1.68k|			prefix64k = 64 * 1024;
  624|  1.68k|			if (uncompressed_size < (ssize_t)prefix64k) {
  ------------------
  |  Branch (624:8): [True: 1.67k, False: 1]
  ------------------
  625|  1.67k|				memcpy(lz4->out_block
  626|  1.67k|					+ prefix64k - uncompressed_size,
  627|  1.67k|				    read_buf + 4,
  628|  1.67k|				    uncompressed_size);
  629|  1.67k|				memset(lz4->out_block, 0,
  630|  1.67k|				    prefix64k - uncompressed_size);
  631|  1.67k|			} else {
  632|      1|				memcpy(lz4->out_block,
  633|      1|				    read_buf + 4
  634|      1|					+ uncompressed_size - prefix64k,
  635|      1|				    prefix64k);
  636|      1|			}
  637|  1.68k|			lz4->decoded_size = 0;
  638|  1.68k|		}
  639|  5.89k|		lz4->unconsumed = 4 + uncompressed_size + checksum_size;
  640|  5.89k|		*p = read_buf + 4;
  641|  5.89k|		return uncompressed_size;
  642|  5.89k|	}
  643|       |
  644|       |	/*
  645|       |	   Decompress a block data.
  646|       |	 */
  647|    610|	if (lz4->flags.block_independence) {
  ------------------
  |  Branch (647:6): [True: 332, False: 278]
  ------------------
  648|    332|		prefix64k = 0;
  649|    332|		uncompressed_size = LZ4_decompress_safe(read_buf + 4,
  650|    332|		    lz4->out_block, (int)compressed_size,
  651|    332|		    lz4->flags.block_maximum_size);
  652|    332|	} else {
  653|    278|		prefix64k = 64 * 1024;
  654|    278|		if (lz4->decoded_size) {
  ------------------
  |  Branch (654:7): [True: 51, False: 227]
  ------------------
  655|     51|			if (lz4->decoded_size < prefix64k) {
  ------------------
  |  Branch (655:8): [True: 51, False: 0]
  ------------------
  656|     51|				memmove(lz4->out_block
  657|     51|					+ prefix64k - lz4->decoded_size,
  658|     51|				    lz4->out_block + prefix64k,
  659|     51|				    lz4->decoded_size);
  660|     51|				memset(lz4->out_block, 0,
  661|     51|				    prefix64k - lz4->decoded_size);
  662|     51|			} else {
  663|      0|				memmove(lz4->out_block,
  664|      0|				    lz4->out_block + lz4->decoded_size,
  665|      0|				    prefix64k);
  666|      0|			}
  667|     51|		}
  668|    278|#if LZ4_VERSION_MAJOR >= 1 && LZ4_VERSION_MINOR >= 7
  669|    278|		uncompressed_size = LZ4_decompress_safe_usingDict(
  670|    278|		    read_buf + 4,
  671|    278|		    lz4->out_block + prefix64k, (int)compressed_size,
  672|    278|		    lz4->flags.block_maximum_size,
  673|    278|		    lz4->out_block,
  674|    278|		    (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|    278|	}
  682|       |
  683|       |	/* Check if an error occurred in the decompression process. */
  684|    610|	if (uncompressed_size < 0) {
  ------------------
  |  Branch (684:6): [True: 10, False: 600]
  ------------------
  685|     10|		archive_set_error(&(f->archive->archive),
  686|     10|		    ARCHIVE_ERRNO_MISC, "lz4 decompression failed");
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  687|     10|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  688|     10|	}
  689|       |
  690|    600|	lz4->unconsumed = 4 + compressed_size + checksum_size;
  691|    600|	*p = lz4->out_block + prefix64k;
  692|    600|	lz4->decoded_size = uncompressed_size;
  693|    600|	return uncompressed_size;
  694|       |
  695|    100|malformed_error:
  696|    100|	archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    100|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  697|    100|	    "malformed lz4 data");
  698|    100|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    100|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  699|    143|truncated_error:
  700|    143|	archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    143|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  701|    143|	    "truncated lz4 input");
  702|    143|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    143|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  703|    610|}
archive_read_support_filter_lz4.c:lz4_filter_read_legacy_stream:
  761|  1.80k|{
  762|  1.80k|	struct lz4 *lz4 = f->data;
  763|  1.80k|	uint32_t compressed;
  764|  1.80k|	const char *read_buf;
  765|  1.80k|	ssize_t ret;
  766|       |
  767|  1.80k|	*p = NULL;
  768|  1.80k|	ret = lz4_allocate_out_block_for_legacy(f);
  769|  1.80k|	if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.80k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (769:6): [True: 0, False: 1.80k]
  ------------------
  770|      0|		return ret;
  771|       |
  772|       |	/* Make sure we have 4 bytes for a block size. */
  773|  1.80k|	read_buf = __archive_read_filter_ahead(f->upstream, 4, NULL);
  774|  1.80k|	if (read_buf == NULL) {
  ------------------
  |  Branch (774:6): [True: 50, False: 1.75k]
  ------------------
  775|     50|		if (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (775:7): [True: 0, False: 50]
  ------------------
  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|     50|		lz4->stage = SELECT_STREAM;
  783|     50|		return 0;
  784|     50|	}
  785|  1.75k|	lz4->stage = READ_LEGACY_BLOCK;
  786|  1.75k|	compressed = archive_le32dec(read_buf);
  787|  1.75k|	if (compressed > LZ4_COMPRESSBOUND(LEGACY_BLOCK_SIZE)) {
  ------------------
  |  Branch (787:6): [True: 694, False: 1.06k]
  |  Branch (787:19): [Folded, False: 1.75k]
  ------------------
  788|    694|		lz4->stage = SELECT_STREAM;
  789|    694|		return 0;
  790|    694|	}
  791|       |
  792|       |	/* Make sure we have a whole block. */
  793|  1.06k|	read_buf = __archive_read_filter_ahead(f->upstream,
  794|  1.06k|	    4 + compressed, NULL);
  795|  1.06k|	if (read_buf == NULL) {
  ------------------
  |  Branch (795:6): [True: 23, False: 1.04k]
  ------------------
  796|     23|		archive_set_error(&(f->archive->archive),
  797|     23|		    ARCHIVE_ERRNO_MISC, "truncated lz4 input");
  ------------------
  |  |  204|     23|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  798|     23|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     23|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  799|     23|	}
  800|  1.04k|	ret = LZ4_decompress_safe(read_buf + 4, lz4->out_block,
  801|  1.04k|	    compressed, (int)lz4->out_block_size);
  802|  1.04k|	if (ret < 0) {
  ------------------
  |  Branch (802:6): [True: 1, False: 1.04k]
  ------------------
  803|      1|		archive_set_error(&(f->archive->archive),
  804|      1|		    ARCHIVE_ERRNO_MISC, "lz4 decompression failed");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  805|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  806|      1|	}
  807|  1.04k|	*p = lz4->out_block;
  808|  1.04k|	lz4->unconsumed = 4 + compressed;
  809|  1.04k|	return ret;
  810|  1.04k|}
archive_read_support_filter_lz4.c:lz4_allocate_out_block_for_legacy:
  348|  1.80k|{
  349|  1.80k|	struct lz4 *lz4 = f->data;
  350|  1.80k|	size_t out_block_size = LEGACY_BLOCK_SIZE;
  ------------------
  |  |   89|  1.80k|#define LEGACY_BLOCK_SIZE	(8 * 1024 * 1024)
  ------------------
  351|  1.80k|	void *out_block;
  352|       |
  353|  1.80k|	if (lz4->out_block_size < out_block_size) {
  ------------------
  |  Branch (353:6): [True: 81, False: 1.72k]
  ------------------
  354|     81|		free(lz4->out_block);
  355|     81|		lz4->out_block = NULL;
  356|     81|		out_block = malloc(out_block_size);
  357|     81|		if (out_block == NULL) {
  ------------------
  |  Branch (357:7): [True: 0, False: 81]
  ------------------
  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|     81|		lz4->out_block_size = out_block_size;
  364|     81|		lz4->out_block = out_block;
  365|     81|	}
  366|  1.80k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.80k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  367|  1.80k|}
archive_read_support_filter_lz4.c:lz4_filter_close:
  817|    398|{
  818|    398|	struct lz4 *lz4 = f->data;
  819|    398|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|    398|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  820|       |
  821|    398|	free(lz4->xxh32_state);
  822|    398|	free(lz4->out_block);
  823|    398|	free(lz4);
  824|    398|	return (ret);
  825|    398|}

archive_read_support_filter_lzop:
  109|  11.9k|{
  110|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  111|       |
  112|  11.9k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (112:6): [True: 0, False: 11.9k]
  ------------------
  113|  11.9k|				&lzop_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#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|  11.9k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  11.9k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  121|  11.9k|	    "Using external lzop program for lzop decompression");
  122|  11.9k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  11.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  123|  11.9k|#endif
  124|  11.9k|}
archive_read_support_filter_lzop.c:lzop_bidder_bid:
  132|  13.9k|{
  133|  13.9k|	const unsigned char *p;
  134|       |
  135|  13.9k|	(void)b; /* UNUSED */
  136|       |
  137|  13.9k|	p = __archive_read_filter_ahead(f, LZOP_HEADER_MAGIC_LEN, NULL);
  ------------------
  |  |   68|  13.9k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  138|  13.9k|	if (p == NULL)
  ------------------
  |  Branch (138:6): [True: 196, False: 13.7k]
  ------------------
  139|    196|		return (0);
  140|       |
  141|  13.7k|	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   67|  13.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|  13.7k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  |  Branch (141:6): [True: 13.7k, False: 0]
  ------------------
  142|  13.7k|		return (0);
  143|       |
  144|      0|	return (LZOP_HEADER_MAGIC_LEN * 8);
  ------------------
  |  |   68|      0|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  145|  13.7k|}

__archive_read_program:
  399|      2|{
  400|      2|	struct program *program;
  401|      2|	static const size_t out_buf_len = 65536;
  402|      2|	char *out_buf;
  403|      2|	const char *prefix = "Program: ";
  404|      2|	int ret;
  405|      2|	size_t l;
  406|       |
  407|      2|	l = strlen(prefix) + strlen(cmd) + 1;
  408|      2|	program = calloc(1, sizeof(*program));
  409|      2|	out_buf = malloc(out_buf_len);
  410|      2|	if (program == NULL || out_buf == NULL ||
  ------------------
  |  Branch (410:6): [True: 0, False: 2]
  |  Branch (410:25): [True: 0, False: 2]
  ------------------
  411|      2|	    archive_string_ensure(&program->description, l) == NULL) {
  ------------------
  |  Branch (411:6): [True: 0, False: 2]
  ------------------
  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|      2|	archive_strcpy(&program->description, prefix);
  ------------------
  |  |  165|      2|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|      4|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  422|      2|	archive_strcat(&program->description, cmd);
  423|       |
  424|      2|	f->code = ARCHIVE_FILTER_PROGRAM;
  ------------------
  |  |  313|      2|#define	ARCHIVE_FILTER_PROGRAM	4
  ------------------
  425|      2|	f->name = program->description.s;
  426|       |
  427|      2|	program->out_buf = out_buf;
  428|      2|	program->out_buf_len = out_buf_len;
  429|       |
  430|      2|	ret = __archive_create_child(cmd, &program->child_stdin,
  431|      2|	    &program->child_stdout, &program->child);
  432|      2|	if (ret != ARCHIVE_OK) {
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (432:6): [True: 0, False: 2]
  ------------------
  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|      2|	f->data = program;
  443|      2|	f->vtable = &program_reader_vtable;
  444|       |
  445|       |	/* XXX Check that we can read at least one byte? */
  446|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  447|      2|}
archive_read_support_filter_program.c:program_filter_read:
  463|      2|{
  464|      2|	struct program *program = f->data;
  465|      2|	ssize_t bytes;
  466|      2|	size_t total;
  467|      2|	char *p;
  468|       |
  469|      2|	total = 0;
  470|      2|	p = program->out_buf;
  471|      2|	while (program->child_stdout != -1 && total < program->out_buf_len) {
  ------------------
  |  Branch (471:9): [True: 2, False: 0]
  |  Branch (471:40): [True: 2, False: 0]
  ------------------
  472|      2|		bytes = child_read(f, p, program->out_buf_len - total);
  473|      2|		if (bytes < 0)
  ------------------
  |  Branch (473:7): [True: 2, False: 0]
  ------------------
  474|       |			/* No recovery is possible if we can no longer
  475|       |			 * read from the child. */
  476|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#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|      2|}
archive_read_support_filter_program.c:child_read:
  303|      2|{
  304|      2|	struct program *program = f->data;
  305|      2|	ssize_t ret, requested, avail;
  306|      2|	const char *p;
  307|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  308|       |	HANDLE handle = (HANDLE)_get_osfhandle(program->child_stdout);
  309|       |#endif
  310|       |
  311|      2|	requested = buf_len > SSIZE_MAX ? SSIZE_MAX : buf_len;
  ------------------
  |  Branch (311:14): [True: 0, False: 2]
  ------------------
  312|       |
  313|      2|	for (;;) {
  314|      2|		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|      2|			ret = read(program->child_stdout, buf, requested);
  337|      2|		} while (ret == -1 && errno == EINTR);
  ------------------
  |  Branch (337:12): [True: 0, False: 2]
  |  Branch (337:25): [True: 0, False: 0]
  ------------------
  338|       |
  339|      2|		if (ret > 0)
  ------------------
  |  Branch (339:7): [True: 0, False: 2]
  ------------------
  340|      0|			return (ret);
  341|      2|		if (ret == 0 || (ret == -1 && errno == EPIPE))
  ------------------
  |  Branch (341:7): [True: 2, 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|      2|			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|      2|}
archive_read_support_filter_program.c:child_stop:
  238|      4|{
  239|       |	/* Close our side of the I/O with the child. */
  240|      4|	if (program->child_stdin != -1) {
  ------------------
  |  Branch (240:6): [True: 2, False: 2]
  ------------------
  241|      2|		close(program->child_stdin);
  242|      2|		program->child_stdin = -1;
  243|      2|	}
  244|      4|	if (program->child_stdout != -1) {
  ------------------
  |  Branch (244:6): [True: 2, False: 2]
  ------------------
  245|      2|		close(program->child_stdout);
  246|      2|		program->child_stdout = -1;
  247|      2|	}
  248|       |
  249|      4|	if (program->child != 0) {
  ------------------
  |  Branch (249:6): [True: 2, False: 2]
  ------------------
  250|       |		/* Reap the child. */
  251|      2|		do {
  252|      2|			program->waitpid_return
  253|      2|			    = waitpid(program->child, &program->exit_status, 0);
  254|      2|		} while (program->waitpid_return == -1 && errno == EINTR);
  ------------------
  |  Branch (254:12): [True: 0, False: 2]
  |  Branch (254:45): [True: 0, False: 0]
  ------------------
  255|      2|		program->child = 0;
  256|      2|	}
  257|       |
  258|      4|	if (program->waitpid_return < 0) {
  ------------------
  |  Branch (258:6): [True: 0, False: 4]
  ------------------
  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|      4|#if !defined(_WIN32) || defined(__CYGWIN__)
  266|      4|	if (WIFSIGNALED(program->exit_status)) {
  ------------------
  |  Branch (266:6): [True: 0, False: 4]
  ------------------
  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|      4|#endif /* !_WIN32 || __CYGWIN__ */
  283|       |
  284|      4|	if (WIFEXITED(program->exit_status)) {
  ------------------
  |  Branch (284:6): [True: 4, False: 0]
  ------------------
  285|      4|		if (WEXITSTATUS(program->exit_status) == 0)
  ------------------
  |  Branch (285:7): [True: 0, False: 4]
  ------------------
  286|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  287|       |
  288|      4|		archive_set_error(&f->archive->archive,
  289|      4|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  290|      4|		    "Child process exited with status %d",
  291|      4|		    WEXITSTATUS(program->exit_status));
  292|      4|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  293|      4|	}
  294|       |
  295|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  296|      4|}
archive_read_support_filter_program.c:program_filter_close:
  490|      2|{
  491|      2|	struct program *program = f->data;
  492|      2|	int e;
  493|       |
  494|      2|	e = child_stop(f, program);
  495|       |
  496|       |	/* Release our private data. */
  497|      2|	free(program->out_buf);
  498|      2|	archive_string_free(&program->description);
  499|      2|	free(program);
  500|       |
  501|      2|	return (e);
  502|      2|}

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

archive_read_support_filter_uu:
   92|  11.9k|{
   93|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
   94|       |
   95|       |	return __archive_read_register_bidder(a, NULL,
   96|  11.9k|			&uudecode_bidder_vtable);
   97|  11.9k|}
archive_read_support_filter_uu.c:uudecode_bidder_bid:
  263|  13.9k|{
  264|  13.9k|	const unsigned char *p;
  265|  13.9k|	ssize_t avail, ravail;
  266|  13.9k|	ssize_t len, nl;
  267|  13.9k|	int l;
  268|  13.9k|	int firstline;
  269|  13.9k|	size_t nbytes_read;
  270|       |
  271|  13.9k|	(void)b; /* UNUSED */
  272|       |
  273|  13.9k|	p = __archive_read_filter_ahead(f, 1, &avail);
  274|  13.9k|	if (p == NULL)
  ------------------
  |  Branch (274:6): [True: 183, False: 13.8k]
  ------------------
  275|    183|		return (0);
  276|       |
  277|  13.8k|	firstline = 20;
  278|  13.8k|	ravail = avail;
  279|  13.8k|	nbytes_read = avail;
  280|   725k|	for (;;) {
  281|   725k|		len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  282|   725k|		if (len < 0 || nl == 0)
  ------------------
  |  Branch (282:7): [True: 13.4k, False: 712k]
  |  Branch (282:18): [True: 224, False: 711k]
  ------------------
  283|  13.6k|			return (0); /* No match found. */
  284|   711k|		if (len - nl >= 11 && memcmp(p, "begin ", 6) == 0)
  ------------------
  |  Branch (284:7): [True: 6.43k, False: 705k]
  |  Branch (284:25): [True: 1.84k, False: 4.58k]
  ------------------
  285|  1.84k|			l = 6;
  286|   710k|		else if (len -nl >= 18 && memcmp(p, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (286:12): [True: 1.66k, False: 708k]
  |  Branch (286:29): [True: 86, False: 1.58k]
  ------------------
  287|     86|			l = 13;
  288|   709k|		else
  289|   709k|			l = 0;
  290|       |
  291|   711k|		if (l > 0 && (p[l] < '0' || p[l] > '7' ||
  ------------------
  |  Branch (291:7): [True: 1.93k, False: 709k]
  |  Branch (291:17): [True: 241, False: 1.69k]
  |  Branch (291:31): [True: 270, False: 1.42k]
  ------------------
  292|  1.42k|		    p[l+1] < '0' || p[l+1] > '7' ||
  ------------------
  |  Branch (292:7): [True: 122, False: 1.30k]
  |  Branch (292:23): [True: 91, False: 1.21k]
  ------------------
  293|  1.21k|		    p[l+2] < '0' || p[l+2] > '7' || p[l+3] != ' '))
  ------------------
  |  Branch (293:7): [True: 309, False: 901]
  |  Branch (293:23): [True: 470, False: 431]
  |  Branch (293:39): [True: 292, False: 139]
  ------------------
  294|  1.79k|			l = 0;
  295|       |
  296|   711k|		p += len;
  297|   711k|		avail -= len;
  298|   711k|		if (l)
  ------------------
  |  Branch (298:7): [True: 139, False: 711k]
  ------------------
  299|    139|			break;
  300|   711k|		firstline = 0;
  301|       |
  302|       |		/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  303|   711k|		if (nbytes_read >= UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|   711k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (303:7): [True: 26, False: 711k]
  ------------------
  304|     26|			return (0);
  305|   711k|	}
  306|    139|	if (!avail)
  ------------------
  |  Branch (306:6): [True: 0, False: 139]
  ------------------
  307|      0|		return (0);
  308|    139|	len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  309|    139|	if (len < 0 || nl == 0)
  ------------------
  |  Branch (309:6): [True: 0, False: 139]
  |  Branch (309:17): [True: 0, False: 139]
  ------------------
  310|      0|		return (0);/* There are non-ascii characters. */
  311|    139|	avail -= len;
  312|       |
  313|    139|	if (l == 6) {
  ------------------
  |  Branch (313:6): [True: 73, False: 66]
  ------------------
  314|       |		/* "begin " */
  315|     73|		if (!uuchar[*p])
  ------------------
  |  Branch (315:7): [True: 0, False: 73]
  ------------------
  316|      0|			return (0);
  317|       |		/* Get a length of decoded bytes. */
  318|     73|		l = UUDECODE(*p++); len--;
  ------------------
  |  |  258|     73|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  319|     73|		if (l > 45)
  ------------------
  |  Branch (319:7): [True: 0, False: 73]
  ------------------
  320|       |			/* Normally, maximum length is 45(character 'M'). */
  321|      0|			return (0);
  322|     73|		if (l > len - nl)
  ------------------
  |  Branch (322:7): [True: 1, False: 72]
  ------------------
  323|      1|			return (0); /* Line too short. */
  324|    155|		while (l) {
  ------------------
  |  Branch (324:10): [True: 83, False: 72]
  ------------------
  325|     83|			if (!uuchar[*p++])
  ------------------
  |  Branch (325:8): [True: 0, False: 83]
  ------------------
  326|      0|				return (0);
  327|     83|			--len;
  328|     83|			--l;
  329|     83|		}
  330|     72|		if (len-nl == 1 &&
  ------------------
  |  Branch (330:7): [True: 12, False: 60]
  ------------------
  331|     12|		    (uuchar[*p] ||		 /* Check sum. */
  ------------------
  |  Branch (331:8): [True: 12, False: 0]
  ------------------
  332|     12|		     (*p >= 'a' && *p <= 'z'))) {/* Padding data(MINIX). */
  ------------------
  |  Branch (332:9): [True: 0, False: 0]
  |  Branch (332:22): [True: 0, False: 0]
  ------------------
  333|     12|			++p;
  334|     12|			--len;
  335|     12|		}
  336|     72|		p += nl;
  337|     72|		if (avail && uuchar[*p])
  ------------------
  |  Branch (337:7): [True: 72, False: 0]
  |  Branch (337:16): [True: 72, False: 0]
  ------------------
  338|     72|			return (firstline+30);
  339|     72|	} else if (l == 13) {
  ------------------
  |  Branch (339:13): [True: 66, False: 0]
  ------------------
  340|       |		/* "begin-base64 " */
  341|    348|		while (len-nl > 0) {
  ------------------
  |  Branch (341:10): [True: 282, False: 66]
  ------------------
  342|    282|			if (!base64[*p++])
  ------------------
  |  Branch (342:8): [True: 0, False: 282]
  ------------------
  343|      0|				return (0);
  344|    282|			--len;
  345|    282|		}
  346|     66|		p += nl;
  347|       |
  348|     66|		if (avail >= 5 && memcmp(p, "====\n", 5) == 0)
  ------------------
  |  Branch (348:7): [True: 42, False: 24]
  |  Branch (348:21): [True: 6, False: 36]
  ------------------
  349|      6|			return (firstline+40);
  350|     60|		if (avail >= 6 && memcmp(p, "====\r\n", 6) == 0)
  ------------------
  |  Branch (350:7): [True: 36, False: 24]
  |  Branch (350:21): [True: 0, False: 36]
  ------------------
  351|      0|			return (firstline+40);
  352|     60|		if (avail > 0 && base64[*p])
  ------------------
  |  Branch (352:7): [True: 60, False: 0]
  |  Branch (352:20): [True: 60, False: 0]
  ------------------
  353|     60|			return (firstline+30);
  354|     60|	}
  355|       |
  356|      0|	return (0);
  357|    139|}
archive_read_support_filter_uu.c:bid_get_line:
  213|   725k|{
  214|   725k|	ssize_t len;
  215|   725k|	int quit;
  216|       |	
  217|   725k|	quit = 0;
  218|   725k|	if (*avail == 0) {
  ------------------
  |  Branch (218:6): [True: 73, False: 725k]
  ------------------
  219|     73|		*nl = 0;
  220|     73|		len = 0;
  221|     73|	} else
  222|   725k|		len = get_line(*b, *avail, nl);
  223|       |
  224|       |	/*
  225|       |	 * Read more bytes while it does not reach the end of line.
  226|       |	 */
  227|   725k|	while (*nl == 0 && len == *avail && !quit &&
  ------------------
  |  Branch (227:9): [True: 13.6k, False: 711k]
  |  Branch (227:21): [True: 259, False: 13.4k]
  |  Branch (227:38): [True: 254, False: 5]
  ------------------
  228|    254|	    *nbytes_read < UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|    254|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (228:6): [True: 248, False: 6]
  ------------------
  229|    248|		ssize_t diff = *ravail - *avail;
  230|    248|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  231|    248|		ssize_t tested;
  232|       |
  233|       |		/* Increase reading bytes if it is not enough for at least
  234|       |		 * two new lines. */
  235|    248|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (235:7): [True: 44, False: 204]
  ------------------
  236|     44|			nbytes_req <<= 1;
  237|       |
  238|    248|		*b = __archive_read_filter_ahead(f, nbytes_req, avail);
  239|    248|		if (*b == NULL) {
  ------------------
  |  Branch (239:7): [True: 227, False: 21]
  ------------------
  240|    227|			if (*ravail >= *avail)
  ------------------
  |  Branch (240:8): [True: 213, False: 14]
  ------------------
  241|    213|				return (0);
  242|       |			/* Reading bytes reaches the end of a stream. */
  243|     14|			*b = __archive_read_filter_ahead(f, *avail, avail);
  244|     14|			quit = 1;
  245|     14|		}
  246|     35|		*nbytes_read = *avail;
  247|     35|		*ravail = *avail;
  248|     35|		*b += diff;
  249|     35|		*avail -= diff;
  250|     35|		tested = len;/* Skip some bytes we already determined. */
  251|     35|		len = get_line(*b + tested, *avail - tested, nl);
  252|     35|		if (len >= 0)
  ------------------
  |  Branch (252:7): [True: 33, False: 2]
  ------------------
  253|     33|			len += tested;
  254|     35|	}
  255|   725k|	return (len);
  256|   725k|}
archive_read_support_filter_uu.c:get_line:
  177|  1.39M|{
  178|  1.39M|	ssize_t len;
  179|       |
  180|  1.39M|	len = 0;
  181|  9.77M|	while (len < avail) {
  ------------------
  |  Branch (181:9): [True: 9.76M, False: 3.12k]
  ------------------
  182|  9.76M|		switch (ascii[*b]) {
  ------------------
  |  Branch (182:11): [True: 9.76M, False: 0]
  ------------------
  183|  13.4k|		case 0:	/* Non-ascii character or control character. */
  ------------------
  |  Branch (183:3): [True: 13.4k, False: 9.75M]
  ------------------
  184|  13.4k|			if (nlsize != NULL)
  ------------------
  |  Branch (184:8): [True: 13.4k, False: 0]
  ------------------
  185|  13.4k|				*nlsize = 0;
  186|  13.4k|			return (-1);
  187|  1.18M|		case '\r':
  ------------------
  |  Branch (187:3): [True: 1.18M, False: 8.58M]
  ------------------
  188|  1.18M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (188:8): [True: 1.18M, False: 302]
  |  Branch (188:25): [True: 1.36k, False: 1.18M]
  ------------------
  189|  1.36k|				if (nlsize != NULL)
  ------------------
  |  Branch (189:9): [True: 1.36k, False: 0]
  ------------------
  190|  1.36k|					*nlsize = 2;
  191|  1.36k|				return (len+2);
  192|  1.36k|			}
  193|       |			/* FALL THROUGH */
  194|  1.37M|		case '\n':
  ------------------
  |  Branch (194:3): [True: 189k, False: 9.57M]
  ------------------
  195|  1.37M|			if (nlsize != NULL)
  ------------------
  |  Branch (195:8): [True: 1.37M, False: 0]
  ------------------
  196|  1.37M|				*nlsize = 1;
  197|  1.37M|			return (len+1);
  198|  8.37M|		case 1:
  ------------------
  |  Branch (198:3): [True: 8.37M, False: 1.38M]
  ------------------
  199|  8.37M|			b++;
  200|  8.37M|			len++;
  201|  8.37M|			break;
  202|  9.76M|		}
  203|  9.76M|	}
  204|  3.12k|	if (nlsize != NULL)
  ------------------
  |  Branch (204:6): [True: 3.12k, False: 0]
  ------------------
  205|  3.12k|		*nlsize = 0;
  206|  3.12k|	return (avail);
  207|  1.39M|}
archive_read_support_filter_uu.c:uudecode_bidder_init:
  368|    138|{
  369|    138|	struct uu   *uu;
  370|    138|	void *out_buff;
  371|    138|	void *in_buff;
  372|       |
  373|    138|	f->code = ARCHIVE_FILTER_UU;
  ------------------
  |  |  316|    138|#define	ARCHIVE_FILTER_UU	7
  ------------------
  374|    138|	f->name = "uu";
  375|       |
  376|    138|	uu = calloc(1, sizeof(*uu));
  377|    138|	out_buff = malloc(OUT_BUFF_SIZE);
  ------------------
  |  |   53|    138|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  378|    138|	in_buff = malloc(IN_BUFF_SIZE);
  ------------------
  |  |   49|    138|#define IN_BUFF_SIZE	(1024)
  ------------------
  379|    138|	if (uu == NULL || out_buff == NULL || in_buff == NULL) {
  ------------------
  |  Branch (379:6): [True: 0, False: 138]
  |  Branch (379:20): [True: 0, False: 138]
  |  Branch (379:40): [True: 0, False: 138]
  ------------------
  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|    138|	f->data = uu;
  389|    138|	uu->in_buff = in_buff;
  390|    138|	uu->in_cnt = 0;
  391|    138|	uu->in_allocated = IN_BUFF_SIZE;
  ------------------
  |  |   49|    138|#define IN_BUFF_SIZE	(1024)
  ------------------
  392|    138|	uu->out_buff = out_buff;
  393|    138|	uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|    138|#define ST_FIND_HEAD	0
  ------------------
  394|    138|	uu->mode_set = 0;
  395|    138|	uu->name = NULL;
  396|    138|	f->vtable = &uudecode_reader_vtable;
  397|       |
  398|    138|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    138|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  399|    138|}
archive_read_support_filter_uu.c:uudecode_filter_read:
  456|  2.15k|{
  457|  2.15k|	struct uu *uu = f->data;
  458|  2.15k|	const unsigned char *b, *d;
  459|  2.15k|	unsigned char *out;
  460|  2.15k|	ssize_t avail_in, ravail;
  461|  2.15k|	ssize_t used;
  462|  2.15k|	ssize_t total;
  463|  2.15k|	ssize_t len, llen, nl, namelen;
  464|       |
  465|  3.31k|read_more:
  466|  3.31k|	d = __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  467|  3.31k|	if (d == NULL && avail_in < 0)
  ------------------
  |  Branch (467:6): [True: 78, False: 3.23k]
  |  Branch (467:19): [True: 23, False: 55]
  ------------------
  468|     23|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     23|#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.28k|	if (d == NULL)
  ------------------
  |  Branch (471:6): [True: 55, False: 3.23k]
  ------------------
  472|     55|		avail_in = 0;
  473|  3.28k|	used = 0;
  474|  3.28k|	total = 0;
  475|  3.28k|	out = uu->out_buff;
  476|  3.28k|	if (avail_in > 2 * UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|  3.28k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (476:6): [True: 9, False: 3.28k]
  ------------------
  477|      9|		avail_in = 2 * UUENCODE_BID_MAX_READ;
  ------------------
  |  |   44|      9|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  478|  3.28k|	ravail = avail_in;
  479|  3.28k|	if (uu->state == ST_IGNORE) {
  ------------------
  |  |   59|  3.28k|#define ST_IGNORE	4
  ------------------
  |  Branch (479:6): [True: 4, False: 3.28k]
  ------------------
  480|      4|		used = avail_in;
  481|      4|		goto finish;
  482|      4|	}
  483|  3.28k|	if (uu->in_cnt) {
  ------------------
  |  Branch (483:6): [True: 2.76k, False: 518]
  ------------------
  484|  2.76k|		if (uu->in_cnt > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  2.76k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (484:7): [True: 0, False: 2.76k]
  ------------------
  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.76k|		if (ensure_in_buff_size(f, uu,
  ------------------
  |  Branch (494:7): [True: 0, False: 2.76k]
  ------------------
  495|  2.76k|		    avail_in + uu->in_cnt) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.76k|#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.76k|		if (avail_in > 0)
  ------------------
  |  Branch (497:7): [True: 2.73k, False: 36]
  ------------------
  498|  2.73k|			memcpy(uu->in_buff + uu->in_cnt,
  499|  2.73k|			    d, avail_in);
  500|  2.76k|		d = uu->in_buff;
  501|  2.76k|		avail_in += uu->in_cnt;
  502|  2.76k|		uu->in_cnt = 0;
  503|  2.76k|	}
  504|   665k|	for (;used < avail_in; d += llen, used += llen) {
  ------------------
  |  Branch (504:8): [True: 665k, False: 400]
  ------------------
  505|   665k|		ssize_t l, body;
  506|       |
  507|   665k|		b = d;
  508|   665k|		len = get_line(b, avail_in - used, &nl);
  509|   665k|		if (len < 0) {
  ------------------
  |  Branch (509:7): [True: 16, False: 665k]
  ------------------
  510|       |			/* Non-ascii character is found. */
  511|     16|			if (uu->state == ST_FIND_HEAD &&
  ------------------
  |  |   55|     32|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (511:8): [True: 4, False: 12]
  ------------------
  512|      4|			    (uu->total > 0 || total > 0)) {
  ------------------
  |  Branch (512:9): [True: 0, False: 4]
  |  Branch (512:26): [True: 4, False: 0]
  ------------------
  513|      4|				uu->state = ST_IGNORE;
  ------------------
  |  |   59|      4|#define ST_IGNORE	4
  ------------------
  514|      4|				used = avail_in;
  515|      4|				goto finish;
  516|      4|			}
  517|     12|			archive_set_error(&f->archive->archive,
  518|     12|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  519|     12|			    "Insufficient compressed data");
  520|     12|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  521|     16|		}
  522|   665k|		if (len > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|   665k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (522:7): [True: 0, False: 665k]
  ------------------
  523|      0|			archive_set_error(&f->archive->archive,
  524|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  525|      0|			    "Invalid format data");
  526|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  527|      0|		}
  528|   665k|		llen = len;
  529|   665k|		if ((nl == 0) && (uu->state != ST_UUEND)) {
  ------------------
  |  |   57|  2.93k|#define ST_UUEND	2
  ------------------
  |  Branch (529:7): [True: 2.93k, False: 662k]
  |  Branch (529:20): [True: 2.81k, False: 118]
  ------------------
  530|  2.81k|			if (total == 0 && ravail <= 0) {
  ------------------
  |  Branch (530:8): [True: 1.19k, False: 1.62k]
  |  Branch (530:22): [True: 36, False: 1.15k]
  ------------------
  531|       |				/* There is nothing more to read, fail */
  532|     36|				archive_set_error(&f->archive->archive,
  533|     36|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     36|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  534|     36|				    "Missing format data");
  535|     36|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  536|     36|			}
  537|       |			/*
  538|       |			 * Save remaining data which does not contain
  539|       |			 * NL('\n','\r').
  540|       |			 */
  541|  2.78k|			if (ensure_in_buff_size(f, uu, len)
  ------------------
  |  Branch (541:8): [True: 0, False: 2.78k]
  ------------------
  542|  2.78k|			    != ARCHIVE_OK)
  ------------------
  |  |  233|  2.78k|#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.78k|			if (uu->in_buff != b)
  ------------------
  |  Branch (544:8): [True: 1.90k, False: 874]
  ------------------
  545|  1.90k|				memmove(uu->in_buff, b, len);
  546|  2.78k|			uu->in_cnt = len;
  547|  2.78k|			if (total == 0) {
  ------------------
  |  Branch (547:8): [True: 1.15k, False: 1.62k]
  ------------------
  548|       |				/* Do not return 0; it means end-of-file.
  549|       |				 * We should try to read more bytes. */
  550|  1.15k|				__archive_read_filter_consume(
  551|  1.15k|				    f->upstream, ravail);
  552|  1.15k|				goto read_more;
  553|  1.15k|			}
  554|  1.62k|			used += len;
  555|  1.62k|			break;
  556|  2.78k|		}
  557|   662k|		switch (uu->state) {
  558|      0|		default:
  ------------------
  |  Branch (558:3): [True: 0, False: 662k]
  ------------------
  559|  70.7k|		case ST_FIND_HEAD:
  ------------------
  |  |   55|  70.7k|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (559:3): [True: 70.7k, False: 591k]
  ------------------
  560|       |			/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  561|  70.7k|			if (total + len >= UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  70.7k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (561:8): [True: 0, False: 70.7k]
  ------------------
  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|  70.7k|			if (len - nl >= 11 && memcmp(b, "begin ", 6) == 0)
  ------------------
  |  Branch (567:8): [True: 8.04k, False: 62.7k]
  |  Branch (567:26): [True: 3.11k, False: 4.93k]
  ------------------
  568|  3.11k|				l = 6;
  569|  67.6k|			else if (len - nl >= 18 &&
  ------------------
  |  Branch (569:13): [True: 1.02k, False: 66.6k]
  ------------------
  570|  1.02k|			    memcmp(b, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (570:8): [True: 222, False: 805]
  ------------------
  571|    222|				l = 13;
  572|  67.4k|			else
  573|  67.4k|				l = 0;
  574|  70.7k|			if (l != 0 && b[l] >= '0' && b[l] <= '7' &&
  ------------------
  |  Branch (574:8): [True: 3.33k, False: 67.4k]
  |  Branch (574:18): [True: 3.26k, False: 70]
  |  Branch (574:33): [True: 2.89k, False: 376]
  ------------------
  575|  2.89k|			    b[l+1] >= '0' && b[l+1] <= '7' &&
  ------------------
  |  Branch (575:8): [True: 2.79k, False: 91]
  |  Branch (575:25): [True: 1.92k, False: 874]
  ------------------
  576|  1.92k|			    b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') {
  ------------------
  |  Branch (576:8): [True: 1.78k, False: 142]
  |  Branch (576:25): [True: 869, False: 914]
  |  Branch (576:42): [True: 244, False: 625]
  ------------------
  577|    244|				if (l == 6)
  ------------------
  |  Branch (577:9): [True: 155, False: 89]
  ------------------
  578|    155|					uu->state = ST_READ_UU;
  ------------------
  |  |   56|    155|#define ST_READ_UU	1
  ------------------
  579|     89|				else
  580|     89|					uu->state = ST_READ_BASE64;
  ------------------
  |  |   58|     89|#define ST_READ_BASE64	3
  ------------------
  581|    244|				uu->mode = (mode_t)(
  582|    244|				    ((int)(b[l] - '0') * 64) +
  583|    244|				    ((int)(b[l+1] - '0') * 8) +
  584|    244|				     (int)(b[l+2] - '0'));
  585|    244|				uu->mode_set = 1;
  586|    244|				namelen = len - nl - 4 - l;
  587|    244|				if (namelen > 1) {
  ------------------
  |  Branch (587:9): [True: 67, False: 177]
  ------------------
  588|     67|					if (uu->name != NULL)
  ------------------
  |  Branch (588:10): [True: 23, False: 44]
  ------------------
  589|     23|						free(uu->name);
  590|     67|					uu->name = malloc(namelen + 1);
  591|     67|					if (uu->name == NULL) {
  ------------------
  |  Branch (591:10): [True: 0, False: 67]
  ------------------
  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|     67|					strncpy(uu->name,
  599|     67|					    (const char *)(b + l + 4),
  600|     67|					    namelen);
  601|     67|					uu->name[namelen] = '\0';
  602|     67|				}
  603|    244|			}
  604|  70.7k|			break;
  605|  70.7k|		case ST_READ_UU:
  ------------------
  |  |   56|    604|#define ST_READ_UU	1
  ------------------
  |  Branch (605:3): [True: 604, False: 661k]
  ------------------
  606|    604|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|    604|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (606:8): [True: 3, False: 601]
  ------------------
  607|      3|				goto finish;
  608|    601|			body = len - nl;
  609|    601|			if (!uuchar[*b] || body <= 0) {
  ------------------
  |  Branch (609:8): [True: 3, False: 598]
  |  Branch (609:23): [True: 0, False: 598]
  ------------------
  610|      3|				archive_set_error(&f->archive->archive,
  611|      3|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  612|      3|				    "Insufficient compressed data");
  613|      3|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  614|      3|			}
  615|       |			/* Get length of undecoded bytes of current line. */
  616|    598|			l = UUDECODE(*b++);
  ------------------
  |  |  258|    598|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  617|    598|			body--;
  618|    598|			if (l > body) {
  ------------------
  |  Branch (618:8): [True: 1, False: 597]
  ------------------
  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|    597|			if (l == 0) {
  ------------------
  |  Branch (624:8): [True: 120, False: 477]
  ------------------
  625|    120|				uu->state = ST_UUEND;
  ------------------
  |  |   57|    120|#define ST_UUEND	2
  ------------------
  626|    120|				break;
  627|    120|			}
  628|  1.31k|			while (l > 0) {
  ------------------
  |  Branch (628:11): [True: 841, False: 471]
  ------------------
  629|    841|				int n = 0;
  630|       |
  631|    841|				if (!uuchar[b[0]] || !uuchar[b[1]])
  ------------------
  |  Branch (631:9): [True: 0, False: 841]
  |  Branch (631:26): [True: 3, False: 838]
  ------------------
  632|      3|					break;
  633|    838|				n = UUDECODE(*b++) << 18;
  ------------------
  |  |  258|    838|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  634|    838|				n |= UUDECODE(*b++) << 12;
  ------------------
  |  |  258|    838|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  635|    838|				*out++ = n >> 16; total++;
  636|    838|				--l;
  637|       |
  638|    838|				if (l > 0) {
  ------------------
  |  Branch (638:9): [True: 720, False: 118]
  ------------------
  639|    720|					if (!uuchar[b[0]])
  ------------------
  |  Branch (639:10): [True: 1, False: 719]
  ------------------
  640|      1|						break;
  641|    719|					n |= UUDECODE(*b++) << 6;
  ------------------
  |  |  258|    719|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  642|    719|					*out++ = (n >> 8) & 0xFF; total++;
  643|    719|					--l;
  644|    719|				}
  645|    837|				if (l > 0) {
  ------------------
  |  Branch (645:9): [True: 389, False: 448]
  ------------------
  646|    389|					if (!uuchar[b[0]])
  ------------------
  |  Branch (646:10): [True: 2, False: 387]
  ------------------
  647|      2|						break;
  648|    387|					n |= UUDECODE(*b++);
  ------------------
  |  |  258|    387|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  649|    387|					*out++ = n & 0xFF; total++;
  650|    387|					--l;
  651|    387|				}
  652|    837|			}
  653|    477|			if (l) {
  ------------------
  |  Branch (653:8): [True: 6, False: 471]
  ------------------
  654|      6|				archive_set_error(&f->archive->archive,
  655|      6|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  656|      6|				    "Insufficient compressed data");
  657|      6|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  658|      6|			}
  659|    471|			break;
  660|    471|		case ST_UUEND:
  ------------------
  |  |   57|    118|#define ST_UUEND	2
  ------------------
  |  Branch (660:3): [True: 118, False: 662k]
  ------------------
  661|    118|			if (len - nl == 3 && memcmp(b, "end ", 3) == 0)
  ------------------
  |  Branch (661:8): [True: 91, False: 27]
  |  Branch (661:25): [True: 90, False: 1]
  ------------------
  662|     90|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     90|#define ST_FIND_HEAD	0
  ------------------
  663|     28|			else {
  664|     28|				archive_set_error(&f->archive->archive,
  665|     28|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     28|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  666|     28|				    "Insufficient compressed data");
  667|     28|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     28|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  668|     28|			}
  669|     90|			break;
  670|   590k|		case ST_READ_BASE64:
  ------------------
  |  |   58|   590k|#define ST_READ_BASE64	3
  ------------------
  |  Branch (670:3): [True: 590k, False: 71.4k]
  ------------------
  671|   590k|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|   590k|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (671:8): [True: 3, False: 590k]
  ------------------
  672|      3|				goto finish;
  673|   590k|			l = len - nl;
  674|   590k|			if (l >= 3 && b[0] == '=' && b[1] == '=' &&
  ------------------
  |  Branch (674:8): [True: 443k, False: 147k]
  |  Branch (674:18): [True: 399k, False: 44.5k]
  |  Branch (674:33): [True: 115k, False: 283k]
  ------------------
  675|   115k|			    b[2] == '=') {
  ------------------
  |  Branch (675:8): [True: 35, False: 115k]
  ------------------
  676|     35|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     35|#define ST_FIND_HEAD	0
  ------------------
  677|     35|				break;
  678|     35|			}
  679|   640k|			while (l > 0) {
  ------------------
  |  Branch (679:11): [True: 615k, False: 24.4k]
  ------------------
  680|   615k|				int n = 0;
  681|       |
  682|   615k|				if (!base64[b[0]] || !base64[b[1]])
  ------------------
  |  Branch (682:9): [True: 0, False: 615k]
  |  Branch (682:26): [True: 165k, False: 450k]
  ------------------
  683|   165k|					break;
  684|   450k|				n = base64num[*b++] << 18;
  685|   450k|				n |= base64num[*b++] << 12;
  686|   450k|				*out++ = n >> 16; total++;
  687|   450k|				l -= 2;
  688|       |
  689|   450k|				if (l > 0) {
  ------------------
  |  Branch (689:9): [True: 431k, False: 18.7k]
  ------------------
  690|   431k|					if (*b == '=')
  ------------------
  |  Branch (690:10): [True: 220k, False: 211k]
  ------------------
  691|   220k|						break;
  692|   211k|					if (!base64[*b])
  ------------------
  |  Branch (692:10): [True: 4, False: 211k]
  ------------------
  693|      4|						break;
  694|   211k|					n |= base64num[*b++] << 6;
  695|   211k|					*out++ = (n >> 8) & 0xFF; total++;
  696|   211k|					--l;
  697|   211k|				}
  698|   229k|				if (l > 0) {
  ------------------
  |  Branch (698:9): [True: 210k, False: 18.8k]
  ------------------
  699|   210k|					if (*b == '=')
  ------------------
  |  Branch (699:10): [True: 180k, False: 30.5k]
  ------------------
  700|   180k|						break;
  701|  30.5k|					if (!base64[*b])
  ------------------
  |  Branch (701:10): [True: 2, False: 30.5k]
  ------------------
  702|      2|						break;
  703|  30.5k|					n |= base64num[*b++];
  704|  30.5k|					*out++ = n & 0xFF; total++;
  705|  30.5k|					--l;
  706|  30.5k|				}
  707|   229k|			}
  708|   590k|			if (l && *b != '=') {
  ------------------
  |  Branch (708:8): [True: 566k, False: 24.4k]
  |  Branch (708:13): [True: 6, False: 566k]
  ------------------
  709|      6|				archive_set_error(&f->archive->archive,
  710|      6|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  711|      6|				    "Insufficient compressed data");
  712|      6|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  713|      6|			}
  714|   590k|			break;
  715|   662k|		}
  716|   662k|	}
  717|  2.04k|finish:
  718|  2.04k|	if (ravail < avail_in)
  ------------------
  |  Branch (718:6): [True: 1.85k, False: 192]
  ------------------
  719|  1.85k|		used -= avail_in - ravail;
  720|  2.04k|	__archive_read_filter_consume(f->upstream, used);
  721|       |
  722|  2.04k|	*buff = uu->out_buff;
  723|  2.04k|	uu->total += total;
  724|  2.04k|	return (total);
  725|  3.28k|}
archive_read_support_filter_uu.c:ensure_in_buff_size:
  404|  5.55k|{
  405|       |
  406|  5.55k|	if (size > uu->in_allocated) {
  ------------------
  |  Branch (406:6): [True: 28, False: 5.52k]
  ------------------
  407|     28|		unsigned char *ptr;
  408|     28|		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|     28|		newsize = uu->in_allocated;
  415|  1.03k|		do {
  416|  1.03k|			if (newsize < IN_BUFF_SIZE*32)
  ------------------
  |  |   49|  1.03k|#define IN_BUFF_SIZE	(1024)
  ------------------
  |  Branch (416:8): [True: 122, False: 915]
  ------------------
  417|    122|				newsize <<= 1;
  418|    915|			else
  419|    915|				newsize += IN_BUFF_SIZE;
  ------------------
  |  |   49|    915|#define IN_BUFF_SIZE	(1024)
  ------------------
  420|  1.03k|		} while (size > newsize);
  ------------------
  |  Branch (420:12): [True: 1.00k, False: 28]
  ------------------
  421|       |		/* Allocate the new buffer. */
  422|     28|		ptr = malloc(newsize);
  423|     28|		if (ptr == NULL) {
  ------------------
  |  Branch (423:7): [True: 0, False: 28]
  ------------------
  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|     28|		if (uu->in_cnt)
  ------------------
  |  Branch (430:7): [True: 9, False: 19]
  ------------------
  431|      9|			memmove(ptr, uu->in_buff, uu->in_cnt);
  432|       |		/* Replace in_buff with the new buffer. */
  433|     28|		free(uu->in_buff);
  434|     28|		uu->in_buff = ptr;
  435|     28|		uu->in_allocated = newsize;
  436|     28|	}
  437|  5.55k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  438|  5.55k|}
archive_read_support_filter_uu.c:uudecode_filter_close:
  729|    138|{
  730|    138|	struct uu *uu = f->data;
  731|       |
  732|    138|	free(uu->in_buff);
  733|    138|	free(uu->out_buff);
  734|    138|	free(uu->name);
  735|    138|	free(uu);
  736|       |
  737|    138|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    138|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  738|    138|}
archive_read_support_filter_uu.c:uudecode_read_header:
  442|     30|{
  443|     30|	struct uu *uu = f->data;
  444|       |
  445|     30|	if (uu->mode_set != 0)
  ------------------
  |  Branch (445:6): [True: 30, False: 0]
  ------------------
  446|     30|		archive_entry_set_mode(entry, S_IFREG | uu->mode);
  447|       |
  448|     30|	if (uu->name != NULL)
  ------------------
  |  Branch (448:6): [True: 6, False: 24]
  ------------------
  449|      6|		archive_entry_set_pathname(entry, uu->name);
  450|       |
  451|     30|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     30|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  452|     30|}

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

archive_read_support_filter_zstd:
   83|  11.9k|{
   84|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
   85|       |
   86|  11.9k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (86:6): [True: 0, False: 11.9k]
  ------------------
   87|  11.9k|				&zstd_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#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|  11.9k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  11.9k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   94|  11.9k|	    "Using external zstd program for zstd decompression");
   95|  11.9k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  11.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   96|  11.9k|#endif
   97|  11.9k|}
archive_read_support_filter_zstd.c:zstd_bidder_bid:
  105|  13.9k|{
  106|  13.9k|	const unsigned char *buffer;
  107|  13.9k|	ssize_t avail;
  108|  13.9k|	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|  13.9k|	const size_t min_zstd_frame_size = 8;
  116|       |
  117|  13.9k|	size_t offset_in_buffer = 0;
  118|  13.9k|	const size_t max_lookahead = 64 * 1024;
  119|  13.9k|	uint32_t magic_number;
  120|       |
  121|       |	/* Zstd regular frame magic number. */
  122|  13.9k|	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|  13.9k|	const uint32_t zstd_magic_skippable_start = 0x184D2A50;
  130|  13.9k|	const uint32_t zstd_magic_skippable_mask  = 0xFFFFFFF0;
  131|       |
  132|  13.9k|	(void) b; /* UNUSED */
  133|       |
  134|  13.9k|	buffer = __archive_read_filter_ahead(f, min_zstd_frame_size,
  135|  13.9k|	    &avail);
  136|  13.9k|	if (buffer == NULL)
  ------------------
  |  Branch (136:6): [True: 196, False: 13.7k]
  ------------------
  137|    196|		return (0);
  138|       |
  139|  13.7k|	magic_number = archive_le32dec(buffer);
  140|       |
  141|  13.9k|	while ((magic_number & zstd_magic_skippable_mask) ==
  ------------------
  |  Branch (141:9): [True: 129, False: 13.7k]
  ------------------
  142|  13.9k|	    zstd_magic_skippable_start) {
  143|    129|		size_t min;
  144|    129|		uint32_t frame_data_size;
  145|       |
  146|       |		/* Skip over the magic number */
  147|    129|		bits_checked += 28;
  148|    129|		offset_in_buffer += 4;
  149|       |
  150|       |		/* Ensure that we can read another 4 bytes. */
  151|    129|		if (offset_in_buffer + 4 > (size_t)avail) {
  ------------------
  |  Branch (151:7): [True: 0, False: 129]
  ------------------
  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|    129|		frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  159|       |
  160|       |		/* Skip over the 4 frame data size bytes */
  161|    129|		offset_in_buffer += 4;
  162|       |
  163|       |		/* Skip over the value stored there. */
  164|    129|		if (archive_ckd_add_size(&offset_in_buffer,
  ------------------
  |  Branch (164:7): [True: 0, False: 129]
  ------------------
  165|    129|		    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|    129|		if (archive_ckd_add_size(&min,
  ------------------
  |  Branch (172:7): [True: 0, False: 129]
  ------------------
  173|    129|		    offset_in_buffer, min_zstd_frame_size) ||
  174|    129|		    min > max_lookahead)
  ------------------
  |  Branch (174:7): [True: 3, False: 126]
  ------------------
  175|      3|			return (0);
  176|    126|		if (min > (size_t)avail) {
  ------------------
  |  Branch (176:7): [True: 0, False: 126]
  ------------------
  177|      0|			buffer = __archive_read_filter_ahead(f,
  178|      0|			    min, &avail);
  179|      0|			if (buffer == NULL)
  ------------------
  |  Branch (179:8): [True: 0, False: 0]
  ------------------
  180|      0|				return (0);
  181|      0|		}
  182|       |
  183|    126|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  184|    126|	}
  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|  13.7k|	if (magic_number == zstd_magic)
  ------------------
  |  Branch (191:6): [True: 0, False: 13.7k]
  ------------------
  192|      0|		return (bits_checked + 32);
  193|       |
  194|  13.7k|	return (0);
  195|  13.7k|}

archive_read_support_format_7zip:
  471|  11.9k|{
  472|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  473|  11.9k|	struct _7zip *zip;
  474|  11.9k|	int r;
  475|       |
  476|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  477|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_7zip");
  478|       |
  479|  11.9k|	zip = calloc(1, sizeof(*zip));
  480|  11.9k|	if (zip == NULL) {
  ------------------
  |  Branch (480:6): [True: 0, False: 11.9k]
  ------------------
  481|      0|		archive_set_error(_a, ENOMEM, "Can't allocate 7zip data");
  482|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  483|      0|	}
  484|       |
  485|       |	/*
  486|       |	 * Until enough data has been read, we cannot tell about
  487|       |	 * any encrypted entries yet.
  488|       |	 */
  489|  11.9k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  11.9k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  490|       |
  491|  11.9k|	r = __archive_read_register_format(a,
  492|  11.9k|	    zip,
  493|  11.9k|	    "7zip",
  494|  11.9k|	    archive_read_format_7zip_bid,
  495|  11.9k|	    NULL,
  496|  11.9k|	    archive_read_format_7zip_read_header,
  497|  11.9k|	    archive_read_format_7zip_read_data,
  498|  11.9k|	    archive_read_format_7zip_read_data_skip,
  499|  11.9k|	    NULL,
  500|  11.9k|	    archive_read_format_7zip_cleanup,
  501|  11.9k|	    archive_read_support_format_7zip_capabilities,
  502|  11.9k|	    archive_read_format_7zip_has_encrypted_entries);
  503|       |
  504|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (504:6): [True: 0, False: 11.9k]
  ------------------
  505|      0|		free(zip);
  506|  11.9k|	return (r);
  507|  11.9k|}
archive_read_support_format_7zip.c:archive_read_support_format_7zip_capabilities:
  511|  1.65k|{
  512|  1.65k|	(void)a; /* UNUSED */
  513|  1.65k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|  1.65k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  514|  1.65k|			ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  1.65k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  515|  1.65k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_has_encrypted_entries:
  519|    829|{
  520|    829|	if (a && a->format) {
  ------------------
  |  Branch (520:6): [True: 829, False: 0]
  |  Branch (520:11): [True: 829, False: 0]
  ------------------
  521|    829|		struct _7zip *zip = a->format->data;
  522|    829|		if (zip) {
  ------------------
  |  Branch (522:7): [True: 829, False: 0]
  ------------------
  523|    829|			return zip->has_encrypted_entries;
  524|    829|		}
  525|    829|	}
  526|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  527|    829|}
archive_read_support_format_7zip.c:archive_read_format_7zip_bid:
  598|  11.7k|{
  599|  11.7k|	int64_t data_offset;
  600|       |
  601|       |	/* If someone has already bid more than 32, then avoid
  602|       |	   trashing the look-ahead buffers with a seek. */
  603|  11.7k|	if (best_bid > 32)
  ------------------
  |  Branch (603:6): [True: 4.19k, False: 7.56k]
  ------------------
  604|  4.19k|		return (-1);
  605|       |
  606|  7.56k|	if (get_data_offset(a, &data_offset, 0) < 0)
  ------------------
  |  Branch (606:6): [True: 6.73k, False: 831]
  ------------------
  607|  6.73k|		return (0);
  608|       |
  609|    831|	return (48);
  610|  7.56k|}
archive_read_support_format_7zip.c:get_data_offset:
  531|  8.39k|{
  532|  8.39k|	const unsigned char *p;
  533|  8.39k|	int64_t offset, sfx_offset;
  534|  8.39k|	int r, window;
  535|       |
  536|  8.39k|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL) {
  ------------------
  |  Branch (536:6): [True: 85, False: 8.30k]
  ------------------
  537|     85|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     85|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  538|     85|		    "Truncated 7-Zip file body");
  539|     85|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     85|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  540|     85|	}
  541|       |
  542|       |	/* If first six bytes are the 7-Zip signature,
  543|       |	 * return the offset right now. */
  544|  8.30k|	if (memcmp(p, _7ZIP_SIGNATURE, 6) == 0) {
  ------------------
  |  |   67|  8.30k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (544:6): [True: 1.62k, False: 6.68k]
  ------------------
  545|  1.62k|		*data_offset = 0;
  546|  1.62k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  547|  1.62k|	}
  548|       |
  549|       |	/*
  550|       |	 * It may be a 7-Zip SFX archive file. If first two bytes are
  551|       |	 * 'M' and 'Z' (PE, Windows) or first four bytes are
  552|       |	 * "\x7F\x45LF" (ELF, Posix-like systems), seek the 7-Zip
  553|       |	 * signature. While get_pe_sfx_offset can be performed without
  554|       |	 * performing a seek, get_elf_sfx_offset requires one,
  555|       |	 * thus a performance difference between the two is expected. 
  556|       |	 */
  557|  6.68k|	if ((p[0] == 'M' && p[1] == 'Z'))
  ------------------
  |  Branch (557:7): [True: 651, False: 6.03k]
  |  Branch (557:22): [True: 466, False: 185]
  ------------------
  558|    466|		r = get_pe_sfx_offset(a, &sfx_offset);
  559|  6.21k|	else if (memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (559:11): [True: 96, False: 6.12k]
  ------------------
  560|     96|		r = get_elf_sfx_offset(a, &sfx_offset, compat);
  561|  6.12k|	else
  562|  6.12k|		r = ARCHIVE_FATAL;
  ------------------
  |  |  239|  6.12k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  563|  6.68k|	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |  235|  13.3k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |   71|    158|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (563:6): [True: 6.52k, False: 158]
  |  Branch (563:26): [True: 18, False: 140]
  ------------------
  564|  6.54k|		goto fail;
  565|       |
  566|    140|	offset = sfx_offset;
  567|    140|	window = 4096;
  568|  1.29k|	while (offset + window <= (sfx_offset + SFX_MAX_OFFSET)) {
  ------------------
  |  |   70|  1.29k|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  ------------------
  |  |  |  |   69|  1.29k|#define SFX_MAX_ADDR	0x60000
  |  |  ------------------
  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  ------------------
  |  |  |  |   68|  1.29k|#define SFX_MIN_ADDR	0x27000
  |  |  ------------------
  ------------------
  |  Branch (568:9): [True: 1.28k, False: 9]
  ------------------
  569|  1.28k|		ssize_t bytes_avail;
  570|  1.28k|		const unsigned char *buff = __archive_read_ahead(a,
  571|  1.28k|				offset + window, &bytes_avail);
  572|  1.28k|		if (buff == NULL) {
  ------------------
  |  Branch (572:7): [True: 805, False: 480]
  ------------------
  573|       |			/* Remaining bytes are less than window. */
  574|    805|			window >>= 1;
  575|    805|			if (window < 0x40)
  ------------------
  |  Branch (575:8): [True: 98, False: 707]
  ------------------
  576|     98|				goto fail;
  577|    707|			continue;
  578|    805|		}
  579|    480|		p = buff + offset;
  580|   661k|		while (buff + bytes_avail - p >= 32) {
  ------------------
  |  Branch (580:10): [True: 661k, False: 447]
  ------------------
  581|   661k|			size_t step = check_7zip_header_in_sfx(p);
  582|   661k|			if (step == 0) {
  ------------------
  |  Branch (582:8): [True: 33, False: 661k]
  ------------------
  583|     33|				*data_offset = p - buff;
  584|     33|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  585|     33|			}
  586|   661k|			p += step;
  587|   661k|		}
  588|    447|		offset = p - buff;
  589|    447|	}
  590|  6.64k|fail:
  591|  6.64k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  6.64k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  592|  6.64k|	    "Couldn't find out 7-Zip header");
  593|  6.64k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  6.64k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  594|    140|}
archive_read_support_format_7zip.c:get_pe_sfx_offset:
  639|    466|{
  640|    466|	const char *h;
  641|    466|	int64_t max_offset, offset;
  642|    466|	ssize_t bytes;
  643|    466|	uint16_t opt_hdr_sz, sec_cnt;
  644|       |
  645|       |	/*
  646|       |	 * If encounter any weirdness, revert to old brute-force style search
  647|       |	 */
  648|    466|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   68|    466|#define SFX_MIN_ADDR	0x27000
  ------------------
  649|       |
  650|    466|	for (;;) {
  651|       |		/*
  652|       |		 * Read Dos header to find e_lfanew
  653|       |		 */
  654|    466|		h = __archive_read_ahead(a, PE_DOS_HDR_LEN, &bytes);
  ------------------
  |  |   76|    466|#define PE_DOS_HDR_LEN			0x40
  ------------------
  655|    466|		if (h == NULL) {
  ------------------
  |  Branch (655:7): [True: 0, False: 466]
  ------------------
  656|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  657|      0|		}
  658|    466|		if (h[0] != 'M' || h[1] != 'Z') {
  ------------------
  |  Branch (658:7): [True: 0, False: 466]
  |  Branch (658:22): [True: 0, False: 466]
  ------------------
  659|      0|			break;
  660|      0|		}
  661|    466|		offset = archive_le32dec(h + PE_DOS_HDR_ELFANEW_OFFSET);
  ------------------
  |  |   77|    466|#define PE_DOS_HDR_ELFANEW_OFFSET	0x3c
  ------------------
  662|    466|		if (offset > SFX_MAX_SEEK) {
  ------------------
  |  |   71|    466|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (662:7): [True: 274, False: 192]
  ------------------
  663|    274|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    274|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  664|    274|		}
  665|       |
  666|       |		/*
  667|       |		 * Read COFF header to find opt header size and sec cnt
  668|       |		 */
  669|    192|		if (bytes < offset + PE_COFF_HDR_LEN) {
  ------------------
  |  |   78|    192|#define PE_COFF_HDR_LEN			0x18
  ------------------
  |  Branch (669:7): [True: 58, False: 134]
  ------------------
  670|     58|			h = __archive_read_ahead(a, offset + PE_COFF_HDR_LEN,
  ------------------
  |  |   78|     58|#define PE_COFF_HDR_LEN			0x18
  ------------------
  671|     58|			    &bytes);
  672|     58|			if (h == NULL) {
  ------------------
  |  Branch (672:8): [True: 44, False: 14]
  ------------------
  673|     44|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     44|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  674|     44|			}
  675|     14|			if (h[offset] != 'P' || h[offset + 1] != 'E') {
  ------------------
  |  Branch (675:8): [True: 7, False: 7]
  |  Branch (675:28): [True: 1, False: 6]
  ------------------
  676|      8|				break;
  677|      8|			}
  678|     14|		}
  679|    140|		sec_cnt = archive_le16dec(
  680|    140|		    h + offset + PE_COFF_HDR_SEC_CNT_OFFSET);
  ------------------
  |  |   79|    140|#define PE_COFF_HDR_SEC_CNT_OFFSET	0x6
  ------------------
  681|    140|		opt_hdr_sz = archive_le16dec(
  682|    140|		    h + offset + PE_COFF_HDR_OPT_SZ_OFFSET);
  ------------------
  |  |   80|    140|#define PE_COFF_HDR_OPT_SZ_OFFSET	0x14
  ------------------
  683|       |
  684|       |		/*
  685|       |		 * Skip optional header
  686|       |		 */
  687|    140|		if (opt_hdr_sz != 0) {
  ------------------
  |  Branch (687:7): [True: 93, False: 47]
  ------------------
  688|     93|			offset += PE_COFF_HDR_LEN + opt_hdr_sz;
  ------------------
  |  |   78|     93|#define PE_COFF_HDR_LEN			0x18
  ------------------
  689|     93|		} else {
  690|     47|			break;
  691|     47|		}
  692|       |
  693|     93|		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   81|     93|#define PE_SEC_HDR_LEN 			0x28
  ------------------
              		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   71|     93|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (693:7): [True: 0, False: 93]
  ------------------
  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|     93|		if (bytes < offset + sec_cnt * PE_SEC_HDR_LEN) {
  ------------------
  |  |   81|     93|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  |  Branch (700:7): [True: 35, False: 58]
  ------------------
  701|     35|			h = __archive_read_ahead(a,
  702|     35|			    offset + sec_cnt * PE_SEC_HDR_LEN, NULL);
  ------------------
  |  |   81|     35|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  703|     35|			if (h == NULL) {
  ------------------
  |  Branch (703:8): [True: 28, False: 7]
  ------------------
  704|     28|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     28|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  705|     28|			}
  706|     35|		}
  707|     65|		max_offset = offset;
  708|  81.5k|		while (sec_cnt > 0) {
  ------------------
  |  Branch (708:10): [True: 81.4k, False: 65]
  ------------------
  709|  81.4k|			int64_t sec_end;
  710|       |
  711|  81.4k|			sec_end = (int64_t)archive_le32dec(
  712|  81.4k|				      h + offset + PE_SEC_HDR_RAW_SZ_OFFSET) +
  ------------------
  |  |   83|  81.4k|#define PE_SEC_HDR_RAW_SZ_OFFSET	0x10
  ------------------
  713|  81.4k|			    archive_le32dec(
  714|  81.4k|				h + offset + PE_SEC_HDR_RAW_ADDR_OFFSET);
  ------------------
  |  |   82|  81.4k|#define PE_SEC_HDR_RAW_ADDR_OFFSET	0x14
  ------------------
  715|  81.4k|			if (sec_end > max_offset) {
  ------------------
  |  Branch (715:8): [True: 9.52k, False: 71.9k]
  ------------------
  716|  9.52k|				max_offset = sec_end;
  717|  9.52k|			}
  718|  81.4k|			offset += PE_SEC_HDR_LEN;
  ------------------
  |  |   81|  81.4k|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  719|  81.4k|			sec_cnt--;
  720|  81.4k|		}
  721|     65|		*sfx_offset = max_offset;
  722|     65|		break;
  723|     93|	}
  724|       |
  725|    120|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    120|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  726|    466|}
archive_read_support_format_7zip.c:get_elf_sfx_offset:
  730|     96|{
  731|     96|	int64_t r;
  732|     96|	const char *h;
  733|     96|	char big_endian, format_64;
  734|     96|	size_t request;
  735|     96|	uint64_t e_shoff, strtab_offset, strtab_size;
  736|     96|	uint16_t e_shentsize, e_shnum, e_shstrndx;
  737|     96|	uint16_t (*dec16)(const void *);
  738|     96|	uint32_t (*dec32)(const void *);
  739|     96|	uint64_t (*dec64)(const void *);
  740|       |
  741|       |	/*
  742|       |	 * If encounter any weirdness, revert to old brute-force style search
  743|       |	 */
  744|     96|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   68|     96|#define SFX_MIN_ADDR	0x27000
  ------------------
  745|       |
  746|     96|	for (;;) {
  747|       |		/*
  748|       |		 * Read Elf header to find bitness & endianness
  749|       |		 */
  750|     96|		h = __archive_read_ahead(a, ELF_HDR_MIN_LEN, NULL);
  ------------------
  |  |   88|     96|#define ELF_HDR_MIN_LEN 0x40 /* sizeof(Elf64_Ehdr) */
  ------------------
  751|     96|		if (h == NULL) {
  ------------------
  |  Branch (751:7): [True: 0, False: 96]
  ------------------
  752|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  753|      0|		}
  754|     96|		if (memcmp(h, "\x7F\x45LF", 4) != 0) {
  ------------------
  |  Branch (754:7): [True: 0, False: 96]
  ------------------
  755|      0|			break;
  756|      0|		}
  757|     96|		format_64 = h[ELF_HDR_EI_CLASS_OFFSET] == 0x2;
  ------------------
  |  |   89|     96|#define ELF_HDR_EI_CLASS_OFFSET 0x04
  ------------------
  758|     96|		big_endian = h[ELF_HDR_EI_DATA_OFFSET] == 0x2;
  ------------------
  |  |   90|     96|#define ELF_HDR_EI_DATA_OFFSET 0x05
  ------------------
  759|     96|		if (big_endian) {
  ------------------
  |  Branch (759:7): [True: 49, False: 47]
  ------------------
  760|     49|			dec16 = &archive_be16dec;
  761|     49|			dec32 = &archive_be32dec;
  762|     49|			dec64 = &archive_be64dec;
  763|     49|		} else {
  764|     47|			dec16 = &archive_le16dec;
  765|     47|			dec32 = &archive_le32dec;
  766|     47|			dec64 = &archive_le64dec;
  767|     47|		}
  768|       |
  769|       |		/*
  770|       |		 * Read section header table info
  771|       |		 */
  772|     96|		if (format_64) {
  ------------------
  |  Branch (772:7): [True: 56, False: 40]
  ------------------
  773|     56|			e_shoff = (*dec64)(h + 0x28);
  774|     56|			e_shentsize = (*dec16)(h + 0x3A);
  775|     56|			e_shnum = (*dec16)(h + 0x3C);
  776|     56|			e_shstrndx = (*dec16)(h + 0x3E);
  777|     56|			if (e_shnum <= e_shstrndx || e_shentsize < 0x28)
  ------------------
  |  Branch (777:8): [True: 4, False: 52]
  |  Branch (777:33): [True: 0, False: 52]
  ------------------
  778|      4|				break;
  779|       |
  780|     56|		} else {
  781|     40|			e_shoff = (*dec32)(h + 0x20);
  782|     40|			e_shentsize = (*dec16)(h + 0x2E);
  783|     40|			e_shnum = (*dec16)(h + 0x30);
  784|     40|			e_shstrndx = (*dec16)(h + 0x32);
  785|     40|			if (e_shnum <= e_shstrndx || e_shentsize < 0x18)
  ------------------
  |  Branch (785:8): [True: 9, False: 31]
  |  Branch (785:33): [True: 0, False: 31]
  ------------------
  786|      9|				break;
  787|     40|		}
  788|       |
  789|     83|		if ((int64_t)e_shoff < 0) {
  ------------------
  |  Branch (789:7): [True: 4, False: 79]
  ------------------
  790|      4|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  791|      4|		}
  792|       |
  793|       |		/*
  794|       |		 * Reading the section table to find strtab section
  795|       |		 */
  796|     79|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (796:7): [True: 9, False: 70]
  ------------------
  797|      9|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      9|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  798|      9|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  799|      9|		}
  800|     70|		if (format_64) {
  ------------------
  |  Branch (800:7): [True: 46, False: 24]
  ------------------
  801|     46|			request = (size_t)e_shnum * e_shentsize + 0x28;
  802|     46|		} else {
  803|     24|			request = (size_t)e_shnum * e_shentsize + 0x18;
  804|     24|		}
  805|     70|		if (request > SFX_MAX_SEEK) {
  ------------------
  |  |   71|     70|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (805:7): [True: 0, False: 70]
  ------------------
  806|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  807|      0|		}
  808|     70|		h = __archive_read_ahead(a, request, NULL);
  809|     70|		if (h == NULL) {
  ------------------
  |  Branch (809:7): [True: 2, False: 68]
  ------------------
  810|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  811|      2|		}
  812|     68|		if (format_64) {
  ------------------
  |  Branch (812:7): [True: 46, False: 22]
  ------------------
  813|     46|			strtab_offset = (*dec64)(
  814|     46|			    h + e_shstrndx * e_shentsize + 0x18);
  815|     46|			strtab_size = (*dec64)(
  816|     46|			    h + e_shstrndx * e_shentsize + 0x20);
  817|     46|		} else {
  818|     22|			strtab_offset = (*dec32)(
  819|     22|			    h + e_shstrndx * e_shentsize + 0x10);
  820|     22|			strtab_size = (*dec32)(
  821|     22|			    h + e_shstrndx * e_shentsize + 0x14);
  822|     22|		}
  823|     68|		if ((int64_t)strtab_offset < 0 || strtab_size < 6 ||
  ------------------
  |  Branch (823:7): [True: 12, False: 56]
  |  Branch (823:37): [True: 1, False: 55]
  ------------------
  824|     55|		    strtab_size > SFX_MAX_SEEK)
  ------------------
  |  |   71|     55|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (824:7): [True: 25, False: 30]
  ------------------
  825|     38|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     38|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  826|       |
  827|       |		/*
  828|       |		 * Read the STRTAB section to find the .data offset
  829|       |		 */
  830|     30|		if (seek_compat(a, strtab_offset, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (830:7): [True: 1, False: 29]
  ------------------
  831|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  832|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  833|      1|		}
  834|     29|		h = __archive_read_ahead(a, strtab_size, NULL);
  835|     29|		if (h == NULL) {
  ------------------
  |  Branch (835:7): [True: 3, False: 26]
  ------------------
  836|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  837|      3|		}
  838|     26|		size_t data_sym_offset = strtab_size;
  839|  11.1k|		for (size_t offset = 0; offset + 6 <= strtab_size; offset++) {
  ------------------
  |  Branch (839:27): [True: 11.1k, False: 3]
  ------------------
  840|  11.1k|			if (memcmp(h + offset, ".data\00", 6) == 0) {
  ------------------
  |  Branch (840:8): [True: 23, False: 11.1k]
  ------------------
  841|     23|				data_sym_offset = offset;
  842|     23|				break;
  843|     23|			}
  844|  11.1k|		}
  845|     26|		if (data_sym_offset == strtab_size) {
  ------------------
  |  Branch (845:7): [True: 3, False: 23]
  ------------------
  846|      3|			break;
  847|      3|		}
  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|    598|		while (e_shnum > 0) {
  ------------------
  |  Branch (861:10): [True: 584, False: 14]
  ------------------
  862|    584|			uint32_t name_offset;
  863|       |
  864|    584|			name_offset = (*dec32)(h + sec_tbl_offset);
  865|    584|			if (name_offset == data_sym_offset) {
  ------------------
  |  Branch (865:8): [True: 9, False: 575]
  ------------------
  866|      9|				int64_t sel_offset;
  867|       |
  868|      9|				if (format_64) {
  ------------------
  |  Branch (868:9): [True: 6, False: 3]
  ------------------
  869|      6|					sel_offset = (*dec64)(
  870|      6|					    h + sec_tbl_offset + 0x18);
  871|      6|				} else {
  872|      3|					sel_offset = (*dec32)(
  873|      3|					    h + sec_tbl_offset + 0x10);
  874|      3|				}
  875|      9|				if (sel_offset >= 0)
  ------------------
  |  Branch (875:9): [True: 7, False: 2]
  ------------------
  876|      7|					*sfx_offset = sel_offset;
  877|      9|				break;
  878|      9|			}
  879|    575|			sec_tbl_offset += e_shentsize;
  880|    575|			e_shnum--;
  881|    575|		}
  882|     23|		break;
  883|     23|	}
  884|       |
  885|     39|	r = seek_compat(a, 0, SEEK_SET, compat);
  886|     39|	if (r < 0)
  ------------------
  |  Branch (886:6): [True: 1, False: 38]
  ------------------
  887|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  888|     39|	return (int)r;
  889|     96|}
archive_read_support_format_7zip.c:seek_compat:
 4638|    522|{
 4639|    522|	int64_t ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|    522|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4640|       |
 4641|    522|	if (a->filter->can_seek)
  ------------------
  |  Branch (4641:6): [True: 515, False: 7]
  ------------------
 4642|    515|		ret = __archive_read_seek(a, offset, whence);
 4643|      7|	else if (compat) {
  ------------------
  |  Branch (4643:11): [True: 4, False: 3]
  ------------------
 4644|      4|		switch (whence) {
 4645|      0|		case SEEK_CUR:
  ------------------
  |  Branch (4645:3): [True: 0, False: 4]
  ------------------
 4646|      0|			ret = __archive_read_consume(a, offset);
 4647|      0|			break;
 4648|      4|		case SEEK_SET:
  ------------------
  |  Branch (4648:3): [True: 4, False: 0]
  ------------------
 4649|      4|			if (a->filter->position > offset)
  ------------------
  |  Branch (4649:8): [True: 1, False: 3]
  ------------------
 4650|      1|				break;
 4651|      3|			ret = __archive_read_consume(a,
 4652|      3|			    offset - a->filter->position);
 4653|      3|			break;
 4654|      0|		default:
  ------------------
  |  Branch (4654:3): [True: 0, False: 4]
  ------------------
 4655|      0|			break;
 4656|      4|		}
 4657|      4|	}
 4658|       |
 4659|    522|	return (ret);
 4660|    522|}
archive_read_support_format_7zip.c:check_7zip_header_in_sfx:
  614|   661k|{
  615|   661k|	switch (p[5]) {
  616|  6.04k|	case 0x1C:
  ------------------
  |  Branch (616:2): [True: 6.04k, False: 655k]
  ------------------
  617|  6.04k|		if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0)
  ------------------
  |  |   67|  6.04k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (617:7): [True: 3.03k, False: 3.00k]
  ------------------
  618|  3.03k|			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|  3.00k|		if (crc32(0, p + 12, 20) != archive_le32dec(p + 8))
  ------------------
  |  Branch (624:7): [True: 2.97k, False: 33]
  ------------------
  625|  2.97k|			return (6);
  626|       |		/* Hit the header! */
  627|     33|		return (0);
  628|  7.43k|	case 0x37: return (5);
  ------------------
  |  Branch (628:2): [True: 7.43k, False: 653k]
  ------------------
  629|  4.34k|	case 0x7A: return (4);
  ------------------
  |  Branch (629:2): [True: 4.34k, False: 657k]
  ------------------
  630|  1.09k|	case 0xBC: return (3);
  ------------------
  |  Branch (630:2): [True: 1.09k, False: 660k]
  ------------------
  631|  3.04k|	case 0xAF: return (2);
  ------------------
  |  Branch (631:2): [True: 3.04k, False: 658k]
  ------------------
  632|  3.63k|	case 0x27: return (1);
  ------------------
  |  Branch (632:2): [True: 3.63k, False: 657k]
  ------------------
  633|   635k|	default: return (6);
  ------------------
  |  Branch (633:2): [True: 635k, False: 25.5k]
  ------------------
  634|   661k|	}
  635|   661k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_header:
  894|  6.09k|{
  895|  6.09k|	struct _7zip *zip = a->format->data;
  896|  6.09k|	struct _7zip_entry *zip_entry;
  897|  6.09k|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|  6.09k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  898|  6.09k|	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|  6.09k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  6.09k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (907:6): [True: 829, False: 5.26k]
  ------------------
  908|    829|		zip->has_encrypted_entries = 0;
  909|    829|	}
  910|       |
  911|  6.09k|	a->archive.archive_format = ARCHIVE_FORMAT_7ZIP;
  ------------------
  |  |  385|  6.09k|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  912|  6.09k|	a->archive.archive_format_name = "7-Zip";
  913|       |
  914|  6.09k|	if (zip->entries == NULL) {
  ------------------
  |  Branch (914:6): [True: 829, False: 5.26k]
  ------------------
  915|    829|		struct _7z_header_info header;
  916|       |
  917|    829|		memset(&header, 0, sizeof(header));
  918|    829|		r = slurp_central_directory(a, zip, &header);
  919|    829|		free_Header(&header);
  920|    829|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    829|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (920:7): [True: 685, False: 144]
  ------------------
  921|    685|			return (r);
  922|    144|		zip->entries_remaining = zip->numFiles;
  923|    144|		zip->entry = zip->entries;
  924|  5.26k|	} else {
  925|  5.26k|		++zip->entry;
  926|  5.26k|	}
  927|  5.41k|	zip_entry = zip->entry;
  928|       |
  929|  5.41k|	if (zip->entries_remaining == 0 || zip_entry == NULL)
  ------------------
  |  Branch (929:6): [True: 107, False: 5.30k]
  |  Branch (929:37): [True: 0, False: 5.30k]
  ------------------
  930|    107|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    107|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  931|  5.30k|	--zip->entries_remaining;
  932|       |
  933|  5.30k|	zip->entry_offset = 0;
  934|  5.30k|	zip->end_of_entry = 0;
  935|  5.30k|	zip->entry_crc32 = 0;
  936|       |
  937|       |	/* Setup a string conversion for a filename. */
  938|  5.30k|	if (zip->sconv == NULL) {
  ------------------
  |  Branch (938:6): [True: 143, False: 5.16k]
  ------------------
  939|    143|		zip->sconv = archive_string_conversion_from_charset(
  940|    143|		    &a->archive, "UTF-16LE", 1);
  941|    143|		if (zip->sconv == NULL)
  ------------------
  |  Branch (941:7): [True: 0, False: 143]
  ------------------
  942|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  943|    143|	}
  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.30k|	if (zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (949:6): [True: 125, False: 5.17k]
  ------------------
  950|    125|		size_t fidx = 0;
  951|       |
  952|    125|		folder = &(zip->si.ci.folders[zip_entry->folderIndex]);
  953|    373|		for (fidx = 0; fidx < folder->numCoders; fidx++) {
  ------------------
  |  Branch (953:18): [True: 248, False: 125]
  ------------------
  954|    248|			switch(folder->coders[fidx].codec) {
  ------------------
  |  Branch (954:11): [True: 0, False: 248]
  ------------------
  955|      0|				case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (955:5): [True: 0, False: 248]
  ------------------
  956|      0|				case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (956:5): [True: 0, False: 248]
  ------------------
  957|      0|				case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (957:5): [True: 0, False: 248]
  ------------------
  958|      0|					archive_entry_set_is_data_encrypted(entry, 1);
  959|      0|					zip->has_encrypted_entries = 1;
  960|      0|					break;
  961|      0|				}
  962|    248|			}
  963|    248|		}
  964|    125|	}
  965|       |
  966|  5.30k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  5.30k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (966:6): [True: 642, False: 4.66k]
  ------------------
  967|  5.30k|	    (const char *)zip_entry->utf16name,
  968|  5.30k|	    zip_entry->name_len, zip->sconv) != 0) {
  969|    642|		if (errno == ENOMEM) {
  ------------------
  |  Branch (969:7): [True: 0, False: 642]
  ------------------
  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|    642|		archive_set_error(&a->archive,
  975|    642|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    642|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  976|    642|		    "Pathname cannot be converted "
  977|    642|		    "from %s to current locale",
  978|    642|		    archive_string_conversion_charset_name(zip->sconv));
  979|    642|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    642|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  980|    642|	}
  981|       |
  982|       |	/* Populate some additional entry fields: */
  983|  5.30k|	archive_entry_set_mode(entry, zip_entry->mode);
  984|  5.30k|	if (zip_entry->flg & MTIME_IS_SET)
  ------------------
  |  |  245|  5.30k|#define MTIME_IS_SET	(1<<0)
  ------------------
  |  Branch (984:6): [True: 212, False: 5.09k]
  ------------------
  985|    212|		archive_entry_set_mtime(entry, zip_entry->mtime,
  986|    212|			zip_entry->mtime_ns);
  987|  5.30k|	if (zip_entry->flg & CTIME_IS_SET)
  ------------------
  |  |  247|  5.30k|#define CTIME_IS_SET	(1<<2)
  ------------------
  |  Branch (987:6): [True: 60, False: 5.24k]
  ------------------
  988|     60|		archive_entry_set_ctime(entry, zip_entry->ctime,
  989|     60|		    zip_entry->ctime_ns);
  990|  5.30k|	if (zip_entry->flg & ATIME_IS_SET)
  ------------------
  |  |  246|  5.30k|#define ATIME_IS_SET	(1<<1)
  ------------------
  |  Branch (990:6): [True: 59, False: 5.24k]
  ------------------
  991|     59|		archive_entry_set_atime(entry, zip_entry->atime,
  992|     59|		    zip_entry->atime_ns);
  993|  5.30k|	if (zip_entry->ssIndex != (size_t)-1) {
  ------------------
  |  Branch (993:6): [True: 125, False: 5.17k]
  ------------------
  994|    125|		zip->entry_bytes_remaining =
  995|    125|		    zip->si.ss.unpackSizes[zip_entry->ssIndex];
  996|    125|		archive_entry_set_size(entry, zip->entry_bytes_remaining);
  997|  5.17k|	} else {
  998|  5.17k|		zip->entry_bytes_remaining = 0;
  999|  5.17k|		archive_entry_set_size(entry, 0);
 1000|  5.17k|	}
 1001|       |
 1002|       |	// These attributes are supported by the windows implementation of archive_write_disk.
 1003|  5.30k|	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  150|  5.30k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  154|  5.30k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  158|  5.30k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
 1004|       |
 1005|  5.30k|	if (zip_entry->attr & supported_attrs) {
  ------------------
  |  Branch (1005:6): [True: 1.00k, False: 4.30k]
  ------------------
 1006|  1.00k|		char buf[sizeof(",rdonly,hidden,system")];
 1007|  1.00k|		const char *fflags[3] = { "", "", "" };
 1008|  1.00k|		const char **flag = fflags;
 1009|       |
 1010|  1.00k|		if (zip_entry->attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  150|  1.00k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (1010:7): [True: 612, False: 388]
  ------------------
 1011|    612|			*flag++ = ",rdonly";
 1012|  1.00k|		if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN)
  ------------------
  |  |  154|  1.00k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
  |  Branch (1012:7): [True: 630, False: 370]
  ------------------
 1013|    630|			*flag++ = ",hidden";
 1014|  1.00k|		if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM)
  ------------------
  |  |  158|  1.00k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  |  Branch (1014:7): [True: 539, False: 461]
  ------------------
 1015|    539|			*flag++ = ",system";
 1016|       |
 1017|  1.00k|		snprintf(buf, sizeof(buf), "%s%s%s", fflags[0], fflags[1], fflags[2]);
 1018|  1.00k|		archive_entry_copy_fflags_text(entry, buf + 1);
 1019|  1.00k|	}
 1020|       |
 1021|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1022|  5.30k|	if (zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1022:6): [True: 5.17k, False: 124]
  ------------------
 1023|  5.17k|		zip->end_of_entry = 1;
 1024|       |
 1025|  5.30k|	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  5.30k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  5.30k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1025:6): [True: 85, False: 5.21k]
  ------------------
 1026|     85|		unsigned char *symname = NULL;
 1027|     85|		size_t symsize = 0;
 1028|       |
 1029|     85|		if (zip->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (1029:7): [True: 2, False: 83]
  ------------------
 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|     83|		while (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (1040:10): [True: 0, False: 83]
  ------------------
 1041|      0|			const void *buff;
 1042|      0|			unsigned char *mem;
 1043|      0|			size_t size;
 1044|      0|			int64_t offset;
 1045|       |
 1046|      0|			r = archive_read_format_7zip_read_data(a, &buff,
 1047|      0|				&size, &offset);
 1048|      0|			if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1048:8): [True: 0, False: 0]
  ------------------
 1049|      0|				free(symname);
 1050|      0|				return (r);
 1051|      0|			}
 1052|      0|			mem = realloc(symname, symsize + size + 1);
 1053|      0|			if (mem == NULL) {
  ------------------
  |  Branch (1053:8): [True: 0, False: 0]
  ------------------
 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|      0|			symname = mem;
 1060|      0|			memcpy(symname+symsize, buff, size);
 1061|      0|			symsize += size;
 1062|      0|		}
 1063|     83|		if (symsize == 0) {
  ------------------
  |  Branch (1063:7): [True: 83, False: 0]
  ------------------
 1064|       |			/* If there is no symname, handle it as a regular
 1065|       |			 * file. */
 1066|     83|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|     83|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1067|     83|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|     83|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1068|     83|			archive_entry_set_mode(entry, zip_entry->mode);
 1069|     83|		} else {
 1070|      0|			struct archive_string_conv* utf8_conv;
 1071|       |
 1072|      0|			symname[symsize] = '\0';
 1073|       |
 1074|       |			/* Symbolic links are embedded as UTF-8 strings */
 1075|      0|			utf8_conv = archive_string_conversion_from_charset(&a->archive,
 1076|      0|			    "UTF-8", 1);
 1077|      0|			if (utf8_conv == NULL) {
  ------------------
  |  Branch (1077:8): [True: 0, False: 0]
  ------------------
 1078|      0|				free(symname);
 1079|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1080|      0|			}
 1081|       |
 1082|      0|			archive_entry_copy_symlink_l(entry, (const char*)symname, symsize,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1083|      0|			    utf8_conv);
 1084|      0|		}
 1085|     83|		free(symname);
 1086|     83|		archive_entry_set_size(entry, 0);
 1087|     83|	}
 1088|       |
 1089|  5.30k|	return (ret);
 1090|  5.30k|}
archive_read_support_format_7zip.c:slurp_central_directory:
 3287|    829|{
 3288|    829|	const unsigned char *p;
 3289|    829|	int64_t next_header_offset;
 3290|    829|	int64_t next_header_size;
 3291|    829|	uint32_t next_header_crc;
 3292|    829|	ssize_t bytes_avail;
 3293|    829|	int64_t data_offset;
 3294|    829|	int check_header_crc, r;
 3295|       |
 3296|    829|	if (get_data_offset(a, &data_offset, 1) < 0)
  ------------------
  |  Branch (3296:6): [True: 1, False: 828]
  ------------------
 3297|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3298|    828|	if (__archive_read_consume(a, data_offset) < 0) {
  ------------------
  |  Branch (3298:6): [True: 0, False: 828]
  ------------------
 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|    828|	if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL) {
  ------------------
  |  Branch (3302:6): [True: 0, False: 828]
  ------------------
 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|    828|	if (archive_ckd_add_i64(&zip->seek_base, data_offset, 32)) {
  ------------------
  |  Branch (3308:6): [True: 0, False: 828]
  ------------------
 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|    828|	if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0) {
  ------------------
  |  |   67|    828|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (3313:6): [True: 0, False: 828]
  ------------------
 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|    828|	if (crc32(0, p + 12, 20)
  ------------------
  |  Branch (3319:6): [True: 766, False: 62]
  ------------------
 3320|    828|	    != 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|    766|	}
 3326|       |
 3327|    828|	next_header_offset = archive_le64dec(p + 12);
 3328|    828|	if (next_header_offset < 0) {
  ------------------
  |  Branch (3328:6): [True: 0, False: 828]
  ------------------
 3329|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3330|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3331|      0|	}
 3332|    828|	next_header_size = archive_le64dec(p + 20);
 3333|    828|	if (next_header_size < 0) {
  ------------------
  |  Branch (3333:6): [True: 2, False: 826]
  ------------------
 3334|      2|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3335|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3336|      2|	}
 3337|    826|	next_header_crc = archive_le32dec(p + 28);
 3338|       |
 3339|    826|	if (next_header_size == 0)
  ------------------
  |  Branch (3339:6): [True: 1, False: 825]
  ------------------
 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|    825|	__archive_read_consume(a, 32);
 3344|    825|	if (next_header_offset != 0) {
  ------------------
  |  Branch (3344:6): [True: 761, False: 64]
  ------------------
 3345|    761|		if (bytes_avail >= next_header_offset)
  ------------------
  |  Branch (3345:7): [True: 758, False: 3]
  ------------------
 3346|    758|			__archive_read_consume(a, next_header_offset);
 3347|      3|		else {
 3348|      3|			int64_t target;
 3349|       |
 3350|      3|			if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3350:8): [True: 0, False: 3]
  ------------------
 3351|      3|			    zip->seek_base, next_header_offset) ||
 3352|      3|			    seek_compat(a, target, SEEK_SET, 1) < 0) {
  ------------------
  |  Branch (3352:8): [True: 3, False: 0]
  ------------------
 3353|      3|				archive_set_error(&a->archive,
 3354|      3|				    ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3355|      3|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3356|      3|			}
 3357|      3|		}
 3358|    761|	}
 3359|    822|	zip->stream_offset = next_header_offset;
 3360|    822|	zip->header_offset = next_header_offset;
 3361|    822|	zip->header_bytes_remaining = next_header_size;
 3362|    822|	zip->header_crc32 = 0;
 3363|    822|	zip->header_is_encoded = 0;
 3364|    822|	zip->header_is_being_read = 1;
 3365|    822|	zip->has_encrypted_entries = 0;
 3366|    822|	check_header_crc = 1;
 3367|       |
 3368|    822|	if ((p = header_bytes(a, 1)) == NULL) {
  ------------------
  |  Branch (3368:6): [True: 1, False: 821]
  ------------------
 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|    821|	switch (p[0]) {
 3376|    318|	case kEncodedHeader:
  ------------------
  |  |  144|    318|#define kEncodedHeader		0x17
  ------------------
  |  Branch (3376:2): [True: 318, False: 503]
  ------------------
 3377|       |		/*
 3378|       |		 * The archive has an encoded header and we have to decode it
 3379|       |		 * in order to parse the header correctly.
 3380|       |		 */
 3381|    318|		r = decode_encoded_header_info(a, &(zip->si));
 3382|       |
 3383|       |		/* Check the EncodedHeader CRC.*/
 3384|    318|		if (r == 0 && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3384:7): [True: 287, False: 31]
  |  Branch (3384:17): [True: 242, False: 45]
  ------------------
 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|    242|		}
 3391|    318|		if (r == 0) {
  ------------------
  |  Branch (3391:7): [True: 287, False: 31]
  ------------------
 3392|    287|			if (zip->si.ci.folders[0].digest_defined)
  ------------------
  |  Branch (3392:8): [True: 100, False: 187]
  ------------------
 3393|    100|				next_header_crc = zip->si.ci.folders[0].digest;
 3394|    187|			else
 3395|    187|				check_header_crc = 0;
 3396|    287|			if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3396:8): [True: 287, False: 0]
  ------------------
 3397|    287|				read_consume(a);
 3398|    287|			r = setup_decode_folder(a, zip->si.ci.folders, 1);
 3399|    287|			if (r == 0) {
  ------------------
  |  Branch (3399:8): [True: 256, False: 31]
  ------------------
 3400|    256|				zip->header_bytes_remaining =
 3401|    256|					zip->folder_outbytes_remaining;
 3402|    256|				r = seek_pack(a);
 3403|    256|			}
 3404|    287|		}
 3405|       |		/* Clean up StreamsInfo. */
 3406|    318|		free_StreamsInfo(&(zip->si));
 3407|    318|		memset(&(zip->si), 0, sizeof(zip->si));
 3408|    318|		if (r < 0)
  ------------------
  |  Branch (3408:7): [True: 65, False: 253]
  ------------------
 3409|     65|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     65|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3410|    253|		zip->header_is_encoded = 1;
 3411|    253|		zip->header_crc32 = 0;
 3412|       |		/* FALL THROUGH */
 3413|    744|	case kHeader:
  ------------------
  |  |  123|    744|#define kHeader			0x01
  ------------------
  |  Branch (3413:2): [True: 491, False: 330]
  ------------------
 3414|       |		/*
 3415|       |		 * Parse the header.
 3416|       |		 */
 3417|    744|		errno = 0;
 3418|    744|		r = read_Header(a, header, zip->header_is_encoded);
 3419|    744|		if (r < 0) {
  ------------------
  |  Branch (3419:7): [True: 582, False: 162]
  ------------------
 3420|    582|			if (errno == ENOMEM)
  ------------------
  |  Branch (3420:8): [True: 2, False: 580]
  ------------------
 3421|      2|				archive_set_error(&a->archive, -1,
 3422|      2|				    "Couldn't allocate memory");
 3423|    580|			else
 3424|    580|				archive_set_error(&a->archive, -1,
 3425|    580|				    "Damaged 7-Zip archive");
 3426|    582|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    582|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3427|    582|		}
 3428|       |
 3429|       |		/*
 3430|       |		 *  Must be kEnd.
 3431|       |		 */
 3432|    162|		if ((p = header_bytes(a, 1)) == NULL ||*p != kEnd) {
  ------------------
  |  |  122|    157|#define kEnd			0x00
  ------------------
  |  Branch (3432:7): [True: 5, False: 157]
  |  Branch (3432:42): [True: 13, False: 144]
  ------------------
 3433|     18|			archive_set_error(&a->archive, -1,
 3434|     18|			    "Malformed 7-Zip archive");
 3435|     18|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3436|     18|		}
 3437|       |
 3438|       |		/* Check the Header CRC.*/
 3439|    144|		if (check_header_crc && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3439:7): [True: 140, False: 4]
  |  Branch (3439:27): [True: 94, False: 46]
  ------------------
 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|     94|		}
 3446|    144|		break;
 3447|     12|	default:
  ------------------
  |  Branch (3447:2): [True: 12, False: 809]
  ------------------
 3448|     12|		archive_set_error(&a->archive, -1,
 3449|     12|		    "Unexpected Property ID = %X", p[0]);
 3450|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3451|    821|	}
 3452|       |
 3453|       |	/* Clean up variables be used for decoding the archive header */
 3454|    144|	zip->pack_stream_remaining = 0;
 3455|    144|	zip->pack_stream_index = 0;
 3456|    144|	zip->folder_outbytes_remaining = 0;
 3457|    144|	zip->uncompressed_buffer_bytes_remaining = 0;
 3458|    144|	zip->pack_stream_bytes_unconsumed = 0;
 3459|    144|	zip->header_is_being_read = 0;
 3460|       |
 3461|    144|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    144|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3462|    821|}
archive_read_support_format_7zip.c:header_bytes:
 3253|  1.26M|{
 3254|  1.26M|	struct _7zip *zip = a->format->data;
 3255|  1.26M|	const unsigned char *p;
 3256|       |
 3257|  1.26M|	if ((uint64_t)zip->header_bytes_remaining < rbytes)
  ------------------
  |  Branch (3257:6): [True: 9, False: 1.26M]
  ------------------
 3258|      9|		return (NULL);
 3259|  1.26M|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3259:6): [True: 1.26M, False: 7.23k]
  ------------------
 3260|  1.26M|		read_consume(a);
 3261|       |
 3262|  1.26M|	if (zip->header_is_encoded == 0) {
  ------------------
  |  Branch (3262:6): [True: 1.26M, False: 4.36k]
  ------------------
 3263|  1.26M|		p = __archive_read_ahead(a, rbytes, NULL);
 3264|  1.26M|		if (p == NULL)
  ------------------
  |  Branch (3264:7): [True: 182, False: 1.26M]
  ------------------
 3265|    182|			return (NULL);
 3266|  1.26M|		zip->header_bytes_remaining -= rbytes;
 3267|  1.26M|		zip->pack_stream_bytes_unconsumed = rbytes;
 3268|  1.26M|	} else {
 3269|  4.36k|		const void *buff;
 3270|  4.36k|		ssize_t bytes;
 3271|       |
 3272|  4.36k|		bytes = read_stream(a, &buff, rbytes, rbytes);
 3273|  4.36k|		if (bytes <= 0)
  ------------------
  |  Branch (3273:7): [True: 128, False: 4.23k]
  ------------------
 3274|    128|			return (NULL);
 3275|  4.23k|		zip->header_bytes_remaining -= bytes;
 3276|  4.23k|		p = buff;
 3277|  4.23k|	}
 3278|       |
 3279|       |	/* Update checksum */
 3280|  1.26M|	zip->header_crc32 = crc32(zip->header_crc32, p, (unsigned)rbytes);
 3281|  1.26M|	return (p);
 3282|  1.26M|}
archive_read_support_format_7zip.c:read_stream:
 3719|  4.48k|{
 3720|  4.48k|	struct _7zip *zip = a->format->data;
 3721|  4.48k|	int64_t skip_bytes = 0;
 3722|  4.48k|	ssize_t r;
 3723|       |
 3724|  4.48k|	if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3724:6): [True: 337, False: 4.14k]
  ------------------
 3725|    337|		if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3725:7): [True: 249, False: 88]
  ------------------
 3726|    249|			r = extract_pack_stream(a, 0);
 3727|    249|			if (r < 0)
  ------------------
  |  Branch (3727:8): [True: 124, False: 125]
  ------------------
 3728|    124|				return (r);
 3729|    125|			return (get_uncompressed_data(a, buff, size, minimum));
 3730|    249|		} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3730:14): [True: 7, False: 81]
  ------------------
 3731|       |			/* Extract a remaining pack stream. */
 3732|      7|			r = extract_pack_stream(a, 0);
 3733|      7|			if (r < 0)
  ------------------
  |  Branch (3733:8): [True: 3, False: 4]
  ------------------
 3734|      3|				return (r);
 3735|      4|			return (get_uncompressed_data(a, buff, size, minimum));
 3736|      7|		}
 3737|    337|	} else
 3738|  4.14k|		return (get_uncompressed_data(a, buff, size, minimum));
 3739|       |
 3740|       |	/*
 3741|       |	 * Current pack stream has been consumed.
 3742|       |	 */
 3743|     81|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3743:6): [True: 81, False: 0]
  ------------------
 3744|     81|		if (zip->header_is_being_read) {
  ------------------
  |  Branch (3744:7): [True: 1, False: 80]
  ------------------
 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|     80|		if (zip->folder_index == 0 &&
  ------------------
  |  Branch (3756:7): [True: 77, False: 3]
  ------------------
 3757|     77|		    (zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
  ------------------
  |  Branch (3757:8): [True: 0, False: 77]
  ------------------
 3758|     77|		     || zip->folder_index != zip->entry->folderIndex)) {
  ------------------
  |  Branch (3758:11): [True: 0, False: 77]
  ------------------
 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|     80|		if (zip->folder_index >= zip->si.ci.numFolders) {
  ------------------
  |  Branch (3764:7): [True: 0, False: 80]
  ------------------
 3765|       |			/*
 3766|       |			 * We have consumed all folders and its pack streams.
 3767|       |			 */
 3768|      0|			*buff = NULL;
 3769|      0|			return (0);
 3770|      0|		}
 3771|     80|		r = setup_decode_folder(a,
 3772|     80|			&(zip->si.ci.folders[zip->folder_index]), 0);
 3773|     80|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     80|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3773:7): [True: 4, False: 76]
  ------------------
 3774|      4|			return (r);
 3775|       |
 3776|     76|		zip->folder_index++;
 3777|     76|	}
 3778|       |
 3779|       |	/*
 3780|       |	 * Switch to next pack stream.
 3781|       |	 */
 3782|     76|	r = seek_pack(a);
 3783|     76|	if (r < 0)
  ------------------
  |  Branch (3783:6): [True: 0, False: 76]
  ------------------
 3784|      0|		return (r);
 3785|       |
 3786|       |	/* Extract a new pack stream. */
 3787|     76|	r = extract_pack_stream(a, 0);
 3788|     76|	if (r < 0)
  ------------------
  |  Branch (3788:6): [True: 23, False: 53]
  ------------------
 3789|     23|		return (r);
 3790|       |
 3791|       |	/*
 3792|       |	 * Skip the bytes we already have skipped in skip_stream().
 3793|       |	 */
 3794|     53|	while (1) {
  ------------------
  |  Branch (3794:9): [True: 53, Folded]
  ------------------
 3795|     53|		size_t request;
 3796|     53|		ssize_t skipped;
 3797|       |
 3798|     53|		if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3798:7): [True: 4, False: 49]
  ------------------
 3799|      4|			if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3799:8): [True: 0, False: 4]
  ------------------
 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|      4|			} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3803:15): [True: 4, False: 0]
  ------------------
 3804|       |				/* Extract a remaining pack stream. */
 3805|      4|				r = extract_pack_stream(a, 0);
 3806|      4|				if (r < 0)
  ------------------
  |  Branch (3806:9): [True: 0, False: 4]
  ------------------
 3807|      0|					return (r);
 3808|      4|			} 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|      4|		}
 3815|       |
 3816|     53|		if (!skip_bytes)
  ------------------
  |  Branch (3816:7): [True: 53, False: 0]
  ------------------
 3817|     53|			break;
 3818|       |
 3819|      0|		if (skip_bytes > MAX_READ)
  ------------------
  |  |  396|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
  |  Branch (3819:7): [True: 0, False: 0]
  ------------------
 3820|      0|			request = MAX_READ;
  ------------------
  |  |  396|      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|     53|	return (get_uncompressed_data(a, buff, size, minimum));
 3833|     53|}
archive_read_support_format_7zip.c:extract_pack_stream:
 3530|    398|{
 3531|    398|	struct _7zip *zip = a->format->data;
 3532|    398|	ssize_t bytes_avail;
 3533|    398|	int r;
 3534|       |
 3535|    398|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   95|    796|#define _7Z_COPY	0
  ------------------
  |  Branch (3535:6): [True: 127, False: 271]
  |  Branch (3535:32): [True: 47, False: 80]
  ------------------
 3536|     47|		if (minimum == 0)
  ------------------
  |  Branch (3536:7): [True: 47, False: 0]
  ------------------
 3537|     47|			minimum = 1;
 3538|     47|		if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL
  ------------------
  |  Branch (3538:7): [True: 0, False: 47]
  ------------------
 3539|     47|		    || bytes_avail <= 0) {
  ------------------
  |  Branch (3539:10): [True: 0, False: 47]
  ------------------
 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|     47|		if (bytes_avail > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3545:7): [True: 47, False: 0]
  ------------------
 3546|     47|			bytes_avail = (ssize_t)zip->pack_stream_inbytes_remaining;
 3547|     47|		zip->pack_stream_inbytes_remaining -= bytes_avail;
 3548|     47|		if (bytes_avail > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3548:7): [True: 7, False: 40]
  ------------------
 3549|      7|			bytes_avail = (ssize_t)zip->folder_outbytes_remaining;
 3550|     47|		zip->folder_outbytes_remaining -= bytes_avail;
 3551|     47|		zip->uncompressed_buffer_bytes_remaining = bytes_avail;
 3552|     47|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3553|     47|	}
 3554|       |
 3555|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3556|    351|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3556:6): [True: 254, False: 97]
  ------------------
 3557|    254|		size_t new_size = UBUFF_SIZE;
  ------------------
  |  |  293|    254|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3558|       |
 3559|    254|		if (new_size < minimum)
  ------------------
  |  Branch (3559:7): [True: 0, False: 254]
  ------------------
 3560|      0|		    new_size = align_size(minimum);
 3561|    254|		zip->uncompressed_buffer = malloc(new_size);
 3562|    254|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3562:7): [True: 0, False: 254]
  ------------------
 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|    254|		zip->uncompressed_buffer_size = new_size;
 3568|    254|		zip->uncompressed_buffer_bytes_remaining = 0;
 3569|    254|	} else if (zip->uncompressed_buffer_size < minimum ||
  ------------------
  |  Branch (3569:13): [True: 0, False: 97]
  ------------------
 3570|     97|	    zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3570:6): [True: 0, False: 97]
  ------------------
 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|     97|		zip->uncompressed_buffer_bytes_remaining = 0;
 3609|    351|	zip->uncompressed_buffer_pointer = NULL;
 3610|    477|	for (;;) {
 3611|    477|		size_t bytes_in, bytes_out;
 3612|    477|		const void *buff_in;
 3613|    477|		unsigned char *buff_out;
 3614|    477|		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|    477|		buff_in = __archive_read_ahead(a, 1, &bytes_avail);
 3623|    477|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (3623:7): [True: 0, False: 477]
  ------------------
 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|    477|		buff_out = zip->uncompressed_buffer
 3631|    477|			+ zip->uncompressed_buffer_bytes_remaining;
 3632|    477|		bytes_out = zip->uncompressed_buffer_size
 3633|    477|			- zip->uncompressed_buffer_bytes_remaining;
 3634|    477|		bytes_in = bytes_avail;
 3635|    477|		if (bytes_in > (uint64_t)zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3635:7): [True: 477, False: 0]
  ------------------
 3636|    477|			bytes_in = (size_t)zip->pack_stream_inbytes_remaining;
 3637|       |		/* Drive decompression. */
 3638|    477|		r = decompress(a, zip, buff_out, &bytes_out,
 3639|    477|			buff_in, &bytes_in);
 3640|    477|		switch (r) {
 3641|    320|		case ARCHIVE_OK:
  ------------------
  |  |  233|    320|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3641:3): [True: 320, False: 157]
  ------------------
 3642|    320|			end_of_data = 0;
 3643|    320|			break;
 3644|     40|		case ARCHIVE_EOF:
  ------------------
  |  |  232|     40|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3644:3): [True: 40, False: 437]
  ------------------
 3645|     40|			end_of_data = 1;
 3646|     40|			break;
 3647|    117|		default:
  ------------------
  |  Branch (3647:3): [True: 117, False: 360]
  ------------------
 3648|    117|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    117|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3649|    477|		}
 3650|    360|		zip->pack_stream_inbytes_remaining -= bytes_in;
 3651|    360|		if (bytes_out > (uint64_t)zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3651:7): [True: 152, False: 208]
  ------------------
 3652|    152|			bytes_out = (size_t)zip->folder_outbytes_remaining;
 3653|    360|		zip->folder_outbytes_remaining -= bytes_out;
 3654|    360|		zip->uncompressed_buffer_bytes_remaining += bytes_out;
 3655|    360|		zip->pack_stream_bytes_unconsumed = bytes_in;
 3656|       |
 3657|       |		/*
 3658|       |		 * Continue decompression until uncompressed_buffer is full.
 3659|       |		 */
 3660|    360|		if (zip->uncompressed_buffer_bytes_remaining ==
  ------------------
  |  Branch (3660:7): [True: 1, False: 359]
  ------------------
 3661|    360|		    zip->uncompressed_buffer_size)
 3662|      1|			break;
 3663|    359|		if (zip->codec2 == _7Z_X86 && zip->odd_bcj_size &&
  ------------------
  |  |  107|    718|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (3663:7): [True: 54, False: 305]
  |  Branch (3663:33): [True: 38, False: 16]
  ------------------
 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|    359|		if (zip->pack_stream_inbytes_remaining == 0 &&
  ------------------
  |  Branch (3667:7): [True: 346, False: 13]
  ------------------
 3668|    346|		    zip->folder_outbytes_remaining == 0)
  ------------------
  |  Branch (3668:7): [True: 198, False: 148]
  ------------------
 3669|    198|			break;
 3670|    161|		if (end_of_data || (bytes_in == 0 && bytes_out == 0)) {
  ------------------
  |  Branch (3670:7): [True: 31, False: 130]
  |  Branch (3670:23): [True: 4, False: 126]
  |  Branch (3670:40): [True: 4, False: 0]
  ------------------
 3671|     35|			archive_set_error(&(a->archive),
 3672|     35|			    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|     35|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3673|     35|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     35|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3674|     35|		}
 3675|    126|		read_consume(a);
 3676|    126|	}
 3677|    199|	if (zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3677:6): [True: 0, False: 199]
  ------------------
 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|    199|	zip->uncompressed_buffer_pointer = zip->uncompressed_buffer;
 3683|    199|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    199|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3684|    199|}
archive_read_support_format_7zip.c:decompress:
 1675|    477|{
 1676|    477|	const uint8_t *t_next_in;
 1677|    477|	uint8_t *t_next_out;
 1678|    477|	size_t o_avail_in, o_avail_out;
 1679|    477|	size_t t_avail_in, t_avail_out;
 1680|    477|	uint8_t *bcj2_next_out;
 1681|    477|	size_t bcj2_avail_out;
 1682|    477|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    477|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1683|       |
 1684|    477|	t_avail_in = o_avail_in = *used;
 1685|    477|	t_avail_out = o_avail_out = *outbytes;
 1686|    477|	t_next_in = b;
 1687|    477|	t_next_out = buff;
 1688|       |
 1689|    477|	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |   97|    954|#define _7Z_LZMA2	0x21
  ------------------
              	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |  107|    442|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1689:6): [True: 442, False: 35]
  |  Branch (1689:33): [True: 54, False: 388]
  ------------------
 1690|     54|		int i;
 1691|       |
 1692|       |		/* Do not copy out the BCJ remaining bytes when the output
 1693|       |		 * buffer size is less than five bytes. */
 1694|     54|		if (o_avail_in != 0 && t_avail_out < 5 && zip->odd_bcj_size) {
  ------------------
  |  Branch (1694:7): [True: 39, False: 15]
  |  Branch (1694:26): [True: 0, False: 39]
  |  Branch (1694:45): [True: 0, False: 0]
  ------------------
 1695|      0|			*used = 0;
 1696|      0|			*outbytes = 0;
 1697|      0|			return (ret);
 1698|      0|		}
 1699|    108|		for (i = 0; zip->odd_bcj_size > 0 && t_avail_out; i++) {
  ------------------
  |  Branch (1699:15): [True: 54, False: 54]
  |  Branch (1699:40): [True: 54, False: 0]
  ------------------
 1700|     54|			*t_next_out++ = zip->odd_bcj[i];
 1701|     54|			t_avail_out--;
 1702|     54|			zip->odd_bcj_size--;
 1703|     54|		}
 1704|     54|		if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1704:7): [True: 15, False: 39]
  |  Branch (1704:26): [True: 0, False: 39]
  ------------------
 1705|     15|			*used = o_avail_in - t_avail_in;
 1706|     15|			*outbytes = o_avail_out - t_avail_out;
 1707|     15|			if (o_avail_in == 0)
  ------------------
  |  Branch (1707:8): [True: 15, False: 0]
  ------------------
 1708|     15|				ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     15|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1709|     15|			return (ret);
 1710|     15|		}
 1711|     54|	}
 1712|       |
 1713|    462|	bcj2_next_out = t_next_out;
 1714|    462|	bcj2_avail_out = t_avail_out;
 1715|    462|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  108|    462|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1715:6): [True: 21, False: 441]
  ------------------
 1716|       |		/*
 1717|       |		 * Decode a remaining decompressed main stream for BCJ2.
 1718|       |		 */
 1719|     21|		if (zip->tmp_stream_bytes_remaining) {
  ------------------
  |  Branch (1719:7): [True: 0, False: 21]
  ------------------
 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|     21|		t_next_out = zip->tmp_stream_buff;
 1745|     21|		t_avail_out = zip->tmp_stream_buff_size;
 1746|     21|	}
 1747|       |
 1748|    462|	switch (zip->codec) {
 1749|     94|	case _7Z_COPY:
  ------------------
  |  |   95|     94|#define _7Z_COPY	0
  ------------------
  |  Branch (1749:2): [True: 94, False: 368]
  ------------------
 1750|     94|	{
 1751|     94|		size_t bytes = (t_avail_in > t_avail_out) ?
  ------------------
  |  Branch (1751:18): [True: 0, False: 94]
  ------------------
 1752|     94|		    t_avail_out : t_avail_in;
 1753|       |
 1754|     94|		memcpy(t_next_out, t_next_in, bytes);
 1755|     94|		t_avail_in -= bytes;
 1756|     94|		t_avail_out -= bytes;
 1757|     94|		if (o_avail_in == 0)
  ------------------
  |  Branch (1757:7): [True: 14, False: 80]
  ------------------
 1758|     14|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     14|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1759|     94|		break;
 1760|      0|	}
 1761|      0|#ifdef HAVE_LZMA_H
 1762|    165|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   96|    130|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   97|    165|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1762:2): [True: 130, False: 332]
  |  Branch (1762:17): [True: 35, False: 427]
  ------------------
 1763|    165|		zip->lzstream.next_in = t_next_in;
 1764|    165|		zip->lzstream.avail_in = t_avail_in;
 1765|    165|		zip->lzstream.next_out = t_next_out;
 1766|    165|		zip->lzstream.avail_out = t_avail_out;
 1767|       |
 1768|    165|		r = lzma_code(&(zip->lzstream), LZMA_RUN);
 1769|    165|		switch (r) {
 1770|     20|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1770:3): [True: 20, False: 145]
  ------------------
 1771|     20|			lzma_end(&(zip->lzstream));
 1772|     20|			zip->lzstream_valid = 0;
 1773|     20|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     20|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1774|     20|			break;
 1775|    140|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1775:3): [True: 140, False: 25]
  ------------------
 1776|    140|			break;
 1777|      5|		default:
  ------------------
  |  Branch (1777:3): [True: 5, False: 160]
  ------------------
 1778|      5|			archive_set_error(&(a->archive),
 1779|      5|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1780|      5|				"Decompression failed (%d)",
 1781|      5|			    r);
 1782|      5|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1783|    165|		}
 1784|    160|		t_avail_in = zip->lzstream.avail_in;
 1785|    160|		t_avail_out = zip->lzstream.avail_out;
 1786|    160|		break;
 1787|      0|#endif
 1788|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1789|      0|	case _7Z_BZ2:
  ------------------
  |  |   99|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1789:2): [True: 0, False: 462]
  ------------------
 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:
  ------------------
  |  |   98|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1826:2): [True: 0, False: 462]
  ------------------
 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|    203|	case _7Z_PPMD:
  ------------------
  |  |  100|    203|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1872:2): [True: 203, False: 259]
  ------------------
 1873|    203|	{
 1874|    203|		int64_t flush_bytes;
 1875|       |
 1876|    203|		if (!zip->ppmd7_valid || zip->ppmd7_stat < 0 ||
  ------------------
  |  Branch (1876:7): [True: 0, False: 203]
  |  Branch (1876:28): [True: 0, False: 203]
  ------------------
 1877|    203|		    t_avail_out <= 0) {
  ------------------
  |  Branch (1877:7): [True: 0, False: 203]
  ------------------
 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|    203|		zip->ppstream.next_in = t_next_in;
 1884|    203|		zip->ppstream.avail_in = t_avail_in;
 1885|    203|		zip->ppstream.stream_in = 0;
 1886|    203|		zip->ppstream.next_out = t_next_out;
 1887|    203|		zip->ppstream.avail_out = t_avail_out;
 1888|    203|		if (zip->ppmd7_stat == 0) {
  ------------------
  |  Branch (1888:7): [True: 110, False: 93]
  ------------------
 1889|    110|			zip->bytein.a = a;
 1890|    110|			zip->bytein.Read = &ppmd_read;
 1891|    110|			zip->range_dec.Stream = &zip->bytein;
 1892|    110|			r = __archive_ppmd7_functions.Ppmd7z_RangeDec_Init(
 1893|    110|				&(zip->range_dec));
 1894|    110|			if (r == 0) {
  ------------------
  |  Branch (1894:8): [True: 1, False: 109]
  ------------------
 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|    109|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1901:8): [True: 5, False: 104]
  ------------------
 1902|      5|				zip->ppmd7_stat = -1;
 1903|      5|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1904|      5|			}
 1905|    104|			zip->ppmd7_stat = 1;
 1906|    104|		}
 1907|       |
 1908|    197|		if (t_avail_in == 0)
  ------------------
  |  Branch (1908:7): [True: 83, False: 114]
  ------------------
 1909|       |			/* XXX Flush out remaining decoded data XXX */
 1910|     83|			flush_bytes = zip->folder_outbytes_remaining;
 1911|    114|		else
 1912|    114|			flush_bytes = 0;
 1913|       |
 1914|  1.31M|		do {
 1915|  1.31M|			int sym;
 1916|       |
 1917|  1.31M|			sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
 1918|  1.31M|				&(zip->ppmd7_context), &(zip->range_dec.p));
 1919|  1.31M|			if (sym < 0) {
  ------------------
  |  Branch (1919:8): [True: 8, False: 1.31M]
  ------------------
 1920|      8|				zip->ppmd7_stat = -1;
 1921|      8|				archive_set_error(&a->archive,
 1922|      8|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1923|      8|				    "Failed to decode PPMd");
 1924|      8|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      8|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1925|      8|			}
 1926|  1.31M|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1926:8): [True: 85, False: 1.31M]
  ------------------
 1927|     85|				zip->ppmd7_stat = -1;
 1928|     85|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     85|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1929|     85|			}
 1930|  1.31M|			*zip->ppstream.next_out++ = (unsigned char)sym;
 1931|  1.31M|			zip->ppstream.avail_out--;
 1932|  1.31M|			if (flush_bytes > 0)
  ------------------
  |  Branch (1932:8): [True: 105, False: 1.31M]
  ------------------
 1933|    105|				flush_bytes--;
 1934|  1.31M|		} while (zip->ppstream.avail_out &&
  ------------------
  |  Branch (1934:12): [True: 1.31M, False: 11]
  ------------------
 1935|  1.31M|			(zip->ppstream.avail_in || flush_bytes));
  ------------------
  |  Branch (1935:5): [True: 1.31M, False: 197]
  |  Branch (1935:31): [True: 104, False: 93]
  ------------------
 1936|       |
 1937|    104|		t_avail_in = zip->ppstream.avail_in;
 1938|    104|		t_avail_out = zip->ppstream.avail_out;
 1939|    104|		break;
 1940|    197|	}
 1941|      0|	default:
  ------------------
  |  Branch (1941:2): [True: 0, False: 462]
  ------------------
 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|    462|	}
 1946|    358|	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  233|    716|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  232|     34|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1946:6): [True: 34, False: 324]
  |  Branch (1946:27): [True: 0, False: 34]
  ------------------
 1947|      0|		return (ret);
 1948|       |
 1949|    358|	if (zip->codec == _7Z_PPMD)
  ------------------
  |  |  100|    358|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1949:6): [True: 104, False: 254]
  ------------------
 1950|    104|		*used = zip->ppstream.stream_in;
 1951|    254|	else
 1952|    254|		*used = o_avail_in - t_avail_in;
 1953|    358|	*outbytes = o_avail_out - t_avail_out;
 1954|       |
 1955|       |	/*
 1956|       |	 * Decode BCJ.
 1957|       |	 */
 1958|    358|	if (zip->codec != _7Z_LZMA2) {
  ------------------
  |  |   97|    358|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1958:6): [True: 324, False: 34]
  ------------------
 1959|    324|		if (zip->codec2 == _7Z_X86) {
  ------------------
  |  |  107|    324|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1959:7): [True: 39, False: 285]
  ------------------
 1960|     39|			size_t l = x86_Convert(zip, buff, *outbytes);
 1961|       |
 1962|     39|			zip->odd_bcj_size = *outbytes - l;
 1963|     39|			if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
  ------------------
  |  Branch (1963:8): [True: 39, False: 0]
  |  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|      1|				zip->odd_bcj_size = 0;
 1971|    285|		} else if (zip->codec2 == _7Z_ARM) {
  ------------------
  |  |  111|    285|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1971:14): [True: 14, False: 271]
  ------------------
 1972|     14|			*outbytes = arm_Convert(zip, buff, *outbytes);
 1973|    271|		} else if (zip->codec2 == _7Z_ARM64) {
  ------------------
  |  |  113|    271|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1973:14): [True: 32, False: 239]
  ------------------
 1974|     32|			*outbytes = arm64_Convert(zip, buff, *outbytes);
 1975|    239|		} else if (zip->codec2 == _7Z_SPARC) {
  ------------------
  |  |  115|    239|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1975:14): [True: 17, False: 222]
  ------------------
 1976|     17|			*outbytes = sparc_Convert(zip, buff, *outbytes);
 1977|    222|		} else if (zip->codec2 == _7Z_POWERPC) {
  ------------------
  |  |  109|    222|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1977:14): [True: 18, False: 204]
  ------------------
 1978|     18|			*outbytes = powerpc_Convert(zip, buff, *outbytes);
 1979|     18|		}
 1980|    324|	}
 1981|       |
 1982|       |	/*
 1983|       |	 * Decode BCJ2 with a decompressed main stream.
 1984|       |	 */
 1985|    358|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  108|    358|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1985:6): [True: 21, False: 337]
  ------------------
 1986|     21|		ssize_t bytes;
 1987|       |
 1988|     21|		zip->tmp_stream_bytes_avail =
 1989|     21|		    zip->tmp_stream_buff_size - t_avail_out;
 1990|     21|		if (zip->tmp_stream_bytes_avail >
  ------------------
  |  Branch (1990:7): [True: 4, False: 17]
  ------------------
 1991|     21|		      (uint64_t)zip->main_stream_bytes_remaining)
 1992|      4|			zip->tmp_stream_bytes_avail =
 1993|      4|			    zip->main_stream_bytes_remaining;
 1994|     21|		zip->tmp_stream_bytes_remaining = zip->tmp_stream_bytes_avail;
 1995|     21|		bytes = Bcj2_Decode(zip, bcj2_next_out, bcj2_avail_out);
 1996|     21|		if (bytes < 0) {
  ------------------
  |  Branch (1996:7): [True: 13, False: 8]
  ------------------
 1997|     13|			archive_set_error(&(a->archive),
 1998|     13|			    ARCHIVE_ERRNO_MISC, "BCJ2 conversion failed");
  ------------------
  |  |  204|     13|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1999|     13|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     13|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2000|     13|		}
 2001|      8|		zip->main_stream_bytes_remaining -=
 2002|      8|		    zip->tmp_stream_bytes_avail
 2003|      8|		      - zip->tmp_stream_bytes_remaining;
 2004|      8|		bcj2_avail_out -= bytes;
 2005|      8|		*outbytes = o_avail_out - bcj2_avail_out;
 2006|      8|	}
 2007|       |
 2008|    345|	return (ret);
 2009|    358|}
archive_read_support_format_7zip.c:Bcj2_Decode:
 4498|     21|{
 4499|     21|	size_t inPos = 0, outPos = 0;
 4500|     21|	const uint8_t *buf0, *buf1, *buf2, *buf3;
 4501|     21|	size_t size0, size1, size2, size3;
 4502|     21|	const uint8_t *buffer, *bufferLim;
 4503|     21|	size_t i, j;
 4504|       |
 4505|     21|	size0 = zip->tmp_stream_bytes_remaining;
 4506|     21|	buf0 = zip->tmp_stream_buff + zip->tmp_stream_bytes_avail - size0;
 4507|     21|	size1 = zip->sub_stream_bytes_remaining[0];
 4508|     21|	buf1 = zip->sub_stream_buff[0] + zip->sub_stream_size[0] - size1;
 4509|     21|	size2 = zip->sub_stream_bytes_remaining[1];
 4510|     21|	buf2 = zip->sub_stream_buff[1] + zip->sub_stream_size[1] - size2;
 4511|     21|	size3 = zip->sub_stream_bytes_remaining[2];
 4512|     21|	buf3 = zip->sub_stream_buff[2] + zip->sub_stream_size[2] - size3;
 4513|       |
 4514|     21|	buffer = buf3;
 4515|     21|	bufferLim = buffer + size3;
 4516|       |
 4517|     21|	if (zip->bcj_state == 0) {
  ------------------
  |  Branch (4517:6): [True: 19, False: 2]
  ------------------
 4518|       |		/*
 4519|       |		 * Initialize.
 4520|       |		 */
 4521|     19|		zip->bcj2_prevByte = 0;
 4522|     19|		for (i = 0;
 4523|  4.92k|		    i < sizeof(zip->bcj2_p) / sizeof(zip->bcj2_p[0]); i++)
  ------------------
  |  Branch (4523:7): [True: 4.90k, False: 19]
  ------------------
 4524|  4.90k|			zip->bcj2_p[i] = kBitModelTotal >> 1;
  ------------------
  |  | 4473|  4.90k|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  ------------------
  |  |  |  | 4472|  4.90k|#define kNumBitModelTotalBits 11
  |  |  ------------------
  ------------------
 4525|     19|		RC_INIT2;
  ------------------
  |  | 4478|     19|#define RC_INIT2 do {							\
  |  | 4479|     19|	zip->bcj2_code = 0;						\
  |  | 4480|     19|	zip->bcj2_range = 0xFFFFFFFF;					\
  |  | 4481|     19|	{								\
  |  | 4482|     19|		int ii;							\
  |  | 4483|    114|		for (ii = 0; ii < 5; ii++) {				\
  |  |  ------------------
  |  |  |  Branch (4483:16): [True: 95, False: 19]
  |  |  ------------------
  |  | 4484|     95|			RC_TEST;					\
  |  |  ------------------
  |  |  |  | 4477|     95|#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: 95]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4485|     95|			zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; \
  |  |  ------------------
  |  |  |  | 4476|     95|#define RC_READ_BYTE (*buffer++)
  |  |  ------------------
  |  | 4486|     95|		}							\
  |  | 4487|     19|	}								\
  |  | 4488|     19|} while (0)
  |  |  ------------------
  |  |  |  Branch (4488:10): [Folded, False: 19]
  |  |  ------------------
  ------------------
 4526|     19|		zip->bcj_state = 1;
 4527|     19|	}
 4528|       |
 4529|       |	/*
 4530|       |	 * Gather the odd bytes of a previous call.
 4531|       |	 */
 4532|     21|	for (i = 0; zip->odd_bcj_size > 0 && outPos < outSize; i++) {
  ------------------
  |  Branch (4532:14): [True: 0, False: 21]
  |  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|     21|	if (outSize == 0) {
  ------------------
  |  Branch (4537:6): [True: 0, False: 21]
  ------------------
 4538|      0|		zip->bcj2_outPos += outPos;
 4539|      0|		return (outPos);
 4540|      0|	}
 4541|       |
 4542|     98|	for (;;) {
 4543|     98|		uint8_t b;
 4544|     98|		CProb *prob;
  ------------------
  |  |  375|     98|#define CProb uint16_t
  ------------------
 4545|     98|		uint32_t bound;
 4546|     98|		uint32_t ttt;
 4547|       |
 4548|     98|		size_t limit = size0 - inPos;
 4549|     98|		if (outSize - outPos < limit)
  ------------------
  |  Branch (4549:7): [True: 0, False: 98]
  ------------------
 4550|      0|			limit = outSize - outPos;
 4551|       |
 4552|     98|		if (zip->bcj_state == 1) {
  ------------------
  |  Branch (4552:7): [True: 98, False: 0]
  ------------------
 4553|    549|			while (limit != 0) {
  ------------------
  |  Branch (4553:11): [True: 541, False: 8]
  ------------------
 4554|    541|				uint8_t bb = buf0[inPos];
 4555|    541|				outBuf[outPos++] = bb;
 4556|    541|				if (IsJ(zip->bcj2_prevByte, bb)) {
  ------------------
  |  | 4467|    541|#define IsJ(b0, b1) ((b1 & 0xFE) == 0xE8 || IsJcc(b0, b1))
  |  |  ------------------
  |  |  |  | 4466|    485|#define IsJcc(b0, b1) ((b0) == 0x0F && ((b1) & 0xF0) == 0x80)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4466:24): [True: 100, False: 385]
  |  |  |  |  |  Branch (4466:40): [True: 34, False: 66]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (4467:22): [True: 56, False: 485]
  |  |  ------------------
  ------------------
 4557|     90|					zip->bcj_state = 2;
 4558|     90|					break;
 4559|     90|				}
 4560|    451|				inPos++;
 4561|    451|				zip->bcj2_prevByte = bb;
 4562|    451|				limit--;
 4563|    451|			}
 4564|     98|		}
 4565|       |
 4566|     98|		if (limit == 0 || outPos == outSize)
  ------------------
  |  Branch (4566:7): [True: 8, False: 90]
  |  Branch (4566:21): [True: 0, False: 90]
  ------------------
 4567|      8|			break;
 4568|     90|		zip->bcj_state = 1;
 4569|       |
 4570|     90|		b = buf0[inPos++];
 4571|       |
 4572|     90|		if (b == 0xE8)
  ------------------
  |  Branch (4572:7): [True: 26, False: 64]
  ------------------
 4573|     26|			prob = zip->bcj2_p + zip->bcj2_prevByte;
 4574|     64|		else if (b == 0xE9)
  ------------------
  |  Branch (4574:12): [True: 30, False: 34]
  ------------------
 4575|     30|			prob = zip->bcj2_p + 256;
 4576|     34|		else
 4577|     34|			prob = zip->bcj2_p + 257;
 4578|       |
 4579|     90|		IF_BIT_0(prob) {
  ------------------
  |  | 4492|     90|#define IF_BIT_0(p) ttt = *(p); bound = (zip->bcj2_range >> kNumBitModelTotalBits) * ttt; if (zip->bcj2_code < bound)
  |  |  ------------------
  |  |  |  | 4472|     90|#define kNumBitModelTotalBits 11
  |  |  ------------------
  |  |  |  Branch (4492:95): [True: 80, False: 10]
  |  |  ------------------
  ------------------
 4580|     80|			UPDATE_0(prob)
  ------------------
  |  | 4493|     80|#define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4473|     80|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  |  |  ------------------
  |  |  |  |  |  | 4472|     80|#define kNumBitModelTotalBits 11
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4474|     80|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4490|     80|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4470|     80|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4469|     80|#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: 77]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4581|     77|			zip->bcj2_prevByte = b;
 4582|     77|		} else {
 4583|     10|			uint32_t dest;
 4584|     10|			const uint8_t *v;
 4585|     10|			uint8_t out[4];
 4586|       |
 4587|     10|			UPDATE_1(prob)
  ------------------
  |  | 4494|     10|#define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4474|     10|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4490|     10|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4470|     10|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4469|     10|#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: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4588|      9|			if (b == 0xE8) {
  ------------------
  |  Branch (4588:8): [True: 3, False: 6]
  ------------------
 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|      6|			} else {
 4595|      6|				v = buf2;
 4596|      6|				if (size2 < 4)
  ------------------
  |  Branch (4596:9): [True: 6, False: 0]
  ------------------
 4597|      6|					return SZ_ERROR_DATA;
  ------------------
  |  | 4464|      6|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  ------------------
  |  |  |  |  237|      6|#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|     90|	}
 4622|      8|	zip->tmp_stream_bytes_remaining -= inPos;
 4623|      8|	zip->sub_stream_bytes_remaining[0] = size1;
 4624|      8|	zip->sub_stream_bytes_remaining[1] = size2;
 4625|      8|	zip->sub_stream_bytes_remaining[2] = bufferLim - buffer;
 4626|      8|	zip->bcj2_outPos += outPos;
 4627|       |
 4628|      8|	return ((ssize_t)outPos);
 4629|     21|}
archive_read_support_format_7zip.c:ppmd_read:
 1292|  10.1k|{
 1293|  10.1k|	struct archive_read *a = ((IByteIn*)p)->a;
 1294|  10.1k|	struct _7zip *zip = a->format->data;
 1295|  10.1k|	Byte b;
 1296|       |
 1297|  10.1k|	if (zip->ppstream.avail_in == 0) {
  ------------------
  |  Branch (1297:6): [True: 116, False: 10.0k]
  ------------------
 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|    116|		if (zip->pack_stream_inbytes_remaining <= 0 ||
  ------------------
  |  Branch (1303:7): [True: 108, False: 8]
  ------------------
 1304|      8|		    zip->ppstream.stream_in >=
  ------------------
  |  Branch (1304:7): [True: 8, False: 0]
  ------------------
 1305|    116|		    (uint64_t)zip->pack_stream_inbytes_remaining) {
 1306|    116|			archive_set_error(&a->archive,
 1307|    116|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    116|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1308|    116|			    "Truncated 7z file data");
 1309|    116|			zip->ppstream.overconsumed = 1;
 1310|    116|			return (0);
 1311|    116|		}
 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|  10.0k|	} else {
 1323|  10.0k|		b = *zip->ppstream.next_in++;
 1324|  10.0k|		zip->ppstream.avail_in--;
 1325|  10.0k|	}
 1326|  10.0k|	zip->ppstream.stream_in++;
 1327|  10.0k|	return (b);
 1328|  10.1k|}
archive_read_support_format_7zip.c:x86_Convert:
 4174|     39|{
 4175|     39|	static const uint8_t kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
 4176|     39|	static const uint8_t kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
 4177|     39|	size_t bufferPos, prevPosT;
 4178|     39|	uint32_t ip, prevMask;
 4179|       |
 4180|     39|	if (size < 5)
  ------------------
  |  Branch (4180:6): [True: 1, False: 38]
  ------------------
 4181|      1|		return 0;
 4182|       |
 4183|     38|	bufferPos = 0;
 4184|     38|	prevPosT = zip->bcj_prevPosT;
 4185|     38|	prevMask = zip->bcj_prevMask;
 4186|     38|	ip = zip->bcj_ip;
 4187|       |
 4188|  1.47k|	for (;;) {
 4189|  1.47k|		uint8_t *p = data + bufferPos;
 4190|  1.47k|		uint8_t *limit = data + size - 4;
 4191|       |
 4192|  10.2k|		for (; p < limit; p++)
  ------------------
  |  Branch (4192:10): [True: 10.1k, False: 38]
  ------------------
 4193|  10.1k|			if ((*p & 0xFE) == 0xE8)
  ------------------
  |  Branch (4193:8): [True: 1.43k, False: 8.75k]
  ------------------
 4194|  1.43k|				break;
 4195|  1.47k|		bufferPos = (size_t)(p - data);
 4196|  1.47k|		if (p >= limit)
  ------------------
  |  Branch (4196:7): [True: 38, False: 1.43k]
  ------------------
 4197|     38|			break;
 4198|  1.43k|		prevPosT = bufferPos - prevPosT;
 4199|  1.43k|		if (prevPosT == 0 || prevPosT > 3)
  ------------------
  |  Branch (4199:7): [True: 0, False: 1.43k]
  |  Branch (4199:24): [True: 540, False: 897]
  ------------------
 4200|    540|			prevMask = 0;
 4201|    897|		else {
 4202|    897|			prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7;
 4203|    897|			if (prevMask != 0) {
  ------------------
  |  Branch (4203:8): [True: 862, False: 35]
  ------------------
 4204|    862|				unsigned char b =
 4205|    862|					p[4 - kMaskToBitNumber[prevMask]];
 4206|    862|				if (!kMaskToAllowedStatus[prevMask] ||
  ------------------
  |  Branch (4206:9): [True: 403, False: 459]
  ------------------
 4207|    459|				    Test86MSByte(b)) {
  ------------------
  |  | 4161|    459|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4161:26): [True: 13, False: 446]
  |  |  |  Branch (4161:38): [True: 23, False: 423]
  |  |  ------------------
  ------------------
 4208|    439|					prevPosT = bufferPos;
 4209|    439|					prevMask = ((prevMask << 1) & 0x7) | 1;
 4210|    439|					bufferPos++;
 4211|    439|					continue;
 4212|    439|				}
 4213|    862|			}
 4214|    897|		}
 4215|    998|		prevPosT = bufferPos;
 4216|       |
 4217|    998|		if (Test86MSByte(p[4])) {
  ------------------
  |  | 4161|    998|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4161:26): [True: 105, False: 893]
  |  |  |  Branch (4161:38): [True: 97, False: 796]
  |  |  ------------------
  ------------------
 4218|    202|			uint32_t src = archive_le32dec(p + 1);
 4219|    202|			uint32_t dest;
 4220|    214|			for (;;) {
 4221|    214|				uint8_t b;
 4222|    214|				int b_index;
 4223|       |
 4224|    214|				dest = src - (ip + (uint32_t)bufferPos);
 4225|    214|				if (prevMask == 0)
  ------------------
  |  Branch (4225:9): [True: 124, False: 90]
  ------------------
 4226|    124|					break;
 4227|     90|				b_index = kMaskToBitNumber[prevMask] * 8;
 4228|     90|				b = (uint8_t)(dest >> (24 - b_index));
 4229|     90|				if (!Test86MSByte(b))
  ------------------
  |  | 4161|     90|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4161:26): [True: 11, False: 79]
  |  |  |  Branch (4161:38): [True: 1, False: 78]
  |  |  ------------------
  ------------------
 4230|     78|					break;
 4231|     12|				src = dest ^ ((1 << (32 - b_index)) - 1);
 4232|     12|			}
 4233|    202|			p[4] = (uint8_t)(~(((dest >> 24) & 1) - 1));
 4234|    202|			p[3] = (uint8_t)(dest >> 16);
 4235|    202|			p[2] = (uint8_t)(dest >> 8);
 4236|    202|			p[1] = (uint8_t)dest;
 4237|    202|			bufferPos += 5;
 4238|    796|		} else {
 4239|    796|			prevMask = ((prevMask << 1) & 0x7) | 1;
 4240|    796|			bufferPos++;
 4241|    796|		}
 4242|    998|	}
 4243|     38|	zip->bcj_prevPosT = prevPosT;
 4244|     38|	zip->bcj_prevMask = prevMask;
 4245|     38|	zip->bcj_ip += (uint32_t)bufferPos;
 4246|     38|	return (bufferPos);
 4247|     39|}
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|    140|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4275:14): [True: 126, False: 14]
  ------------------
 4276|    126|		if (buf[i + 3] == 0xEB) {
  ------------------
  |  Branch (4276:7): [True: 40, False: 86]
  ------------------
 4277|       |			// Calculate the transformed addr.
 4278|     40|			addr = archive_le24dec(buf + i);
 4279|     40|			addr <<= 2;
 4280|     40|			addr -= zip->bcj_ip + (uint32_t)i;
 4281|     40|			addr >>= 2;
 4282|       |
 4283|       |			// Store the transformed addr in buf.
 4284|     40|			archive_le24enc(buf + i, addr);
 4285|     40|		}
 4286|    126|	}
 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|     32|{
 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|     32|	size_t i;
 4311|     32|	uint32_t instr;
 4312|     32|	uint32_t addr;
 4313|       |
 4314|    609|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4314:14): [True: 577, False: 32]
  ------------------
 4315|    577|		instr = archive_le32dec(buf + i);
 4316|       |
 4317|    577|		if ((instr >> 26) == 0x25) {
  ------------------
  |  Branch (4317:7): [True: 86, False: 491]
  ------------------
 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|    491|		} else if ((instr & 0x9F000000) == 0x90000000) {
  ------------------
  |  Branch (4323:14): [True: 86, False: 405]
  ------------------
 4324|       |			/* ADRP instruction */
 4325|     86|			addr = ((instr >> 29) & 3) | ((instr >> 3) & 0x1FFFFC);
 4326|       |
 4327|       |			/* Only convert values in the range +/-512 MiB. */
 4328|     86|			if ((addr + 0x020000) & 0x1C0000)
  ------------------
  |  Branch (4328:8): [True: 45, False: 41]
  ------------------
 4329|     45|				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|    577|	}
 4341|       |
 4342|     32|	zip->bcj_ip += (uint32_t)i;
 4343|       |
 4344|     32|	return i;
 4345|     32|}
archive_read_support_format_7zip.c:sparc_Convert:
 4349|     17|{
 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|     17|	size_t i;
 4376|     17|	uint32_t instr;
 4377|       |
 4378|     17|	size &= ~(size_t)3;
 4379|       |
 4380|    193|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4380:14): [True: 176, False: 17]
  ------------------
 4381|    176|		instr = archive_be32dec(buf + i);
 4382|       |
 4383|    176|		if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {
  ------------------
  |  Branch (4383:7): [True: 13, False: 163]
  |  Branch (4383:33): [True: 10, False: 153]
  ------------------
 4384|     23|			instr <<= 2;
 4385|     23|			instr -= zip->bcj_ip + (uint32_t)i;
 4386|     23|			instr >>= 2;
 4387|     23|			instr = ((uint32_t)0x40000000 - (instr & 0x400000))
 4388|     23|			        | 0x40000000 | (instr & 0x3FFFFF);
 4389|       |
 4390|     23|			archive_be32enc(buf + i, instr);
 4391|     23|		}
 4392|    176|	}
 4393|       |
 4394|     17|	zip->bcj_ip += (uint32_t)i;
 4395|       |
 4396|     17|	return i;
 4397|     17|}
archive_read_support_format_7zip.c:powerpc_Convert:
 4401|     18|{
 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|     18|	size &= ~(size_t)3;
 4428|       |
 4429|     18|	size_t i;
 4430|    253|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4430:14): [True: 235, False: 18]
  ------------------
 4431|       |		// PowerPC branch 6(48) 24(Offset) 1(Abs) 1(Link)
 4432|    235|		if ((buf[i] >> 2) == 0x12
  ------------------
  |  Branch (4432:7): [True: 89, False: 146]
  ------------------
 4433|     89|			&& ((buf[i + 3] & 3) == 1)) {
  ------------------
  |  Branch (4433:7): [True: 47, False: 42]
  ------------------
 4434|       |
 4435|     47|			const uint32_t src
 4436|     47|				= (((uint32_t)(buf[i + 0]) & 3) << 24)
 4437|     47|				| ((uint32_t)(buf[i + 1]) << 16)
 4438|     47|				| ((uint32_t)(buf[i + 2]) << 8)
 4439|     47|				| ((uint32_t)(buf[i + 3]) & ~UINT32_C(3));
 4440|       |
 4441|     47|			uint32_t dest = src - (zip->bcj_ip + (uint32_t)(i));
 4442|       |
 4443|     47|			buf[i + 0] = 0x48 | ((dest >> 24) &  0x03);
 4444|     47|			buf[i + 1] = (dest >> 16);
 4445|     47|			buf[i + 2] = (dest >> 8);
 4446|     47|			buf[i + 3] &= 0x03;
 4447|     47|			buf[i + 3] |= dest;
 4448|     47|		}
 4449|    235|	}
 4450|       |
 4451|     18|	zip->bcj_ip += (uint32_t)i;
 4452|       |
 4453|     18|	return i;
 4454|     18|}
archive_read_support_format_7zip.c:get_uncompressed_data:
 3467|  4.39k|{
 3468|  4.39k|	struct _7zip *zip = a->format->data;
 3469|  4.39k|	ssize_t bytes_avail;
 3470|       |
 3471|  4.39k|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   95|  8.78k|#define _7Z_COPY	0
  ------------------
  |  Branch (3471:6): [True: 305, False: 4.08k]
  |  Branch (3471:32): [True: 57, False: 248]
  ------------------
 3472|       |		/* Copy mode. */
 3473|       |
 3474|     57|		*buff = __archive_read_ahead(a, minimum, &bytes_avail);
 3475|     57|		if (*buff == NULL) {
  ------------------
  |  Branch (3475:7): [True: 0, False: 57]
  ------------------
 3476|      0|			archive_set_error(&a->archive,
 3477|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3478|      0|			    "Truncated 7-Zip file data");
 3479|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3480|      0|		}
 3481|     57|		if ((size_t)bytes_avail >
  ------------------
  |  Branch (3481:7): [True: 57, False: 0]
  ------------------
 3482|     57|		    zip->uncompressed_buffer_bytes_remaining)
 3483|     57|			bytes_avail = (ssize_t)
 3484|     57|			    zip->uncompressed_buffer_bytes_remaining;
 3485|     57|		if ((size_t)bytes_avail > size)
  ------------------
  |  Branch (3485:7): [True: 17, False: 40]
  ------------------
 3486|     17|			bytes_avail = (ssize_t)size;
 3487|       |
 3488|     57|		zip->pack_stream_bytes_unconsumed = bytes_avail;
 3489|  4.33k|	} else if (zip->uncompressed_buffer_pointer == NULL) {
  ------------------
  |  Branch (3489:13): [True: 0, False: 4.33k]
  ------------------
 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.33k|	} else {
 3495|       |		/* Packed mode. */
 3496|  4.33k|		if (minimum > zip->uncompressed_buffer_bytes_remaining) {
  ------------------
  |  Branch (3496:7): [True: 0, False: 4.33k]
  ------------------
 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.33k|		if (size > zip->uncompressed_buffer_bytes_remaining)
  ------------------
  |  Branch (3505:7): [True: 0, False: 4.33k]
  ------------------
 3506|      0|			bytes_avail = (ssize_t)
 3507|      0|			    zip->uncompressed_buffer_bytes_remaining;
 3508|  4.33k|		else
 3509|  4.33k|			bytes_avail = (ssize_t)size;
 3510|  4.33k|		*buff = zip->uncompressed_buffer_pointer;
 3511|  4.33k|		zip->uncompressed_buffer_pointer += bytes_avail;
 3512|  4.33k|	}
 3513|  4.39k|	zip->uncompressed_buffer_bytes_remaining -= bytes_avail;
 3514|  4.39k|	return (bytes_avail);
 3515|  4.39k|}
archive_read_support_format_7zip.c:decode_encoded_header_info:
 3218|    318|{
 3219|    318|	struct _7zip *zip = a->format->data;
 3220|    318|	int64_t pi_end;
 3221|       |
 3222|    318|	errno = 0;
 3223|    318|	if (read_StreamsInfo(a, si) < 0) {
  ------------------
  |  Branch (3223:6): [True: 30, False: 288]
  ------------------
 3224|     30|		if (errno == ENOMEM)
  ------------------
  |  Branch (3224:7): [True: 0, False: 30]
  ------------------
 3225|      0|			archive_set_error(&a->archive, -1,
 3226|      0|			    "Couldn't allocate memory");
 3227|     30|		else
 3228|     30|			archive_set_error(&a->archive, -1,
 3229|     30|			    "Malformed 7-Zip archive");
 3230|     30|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3231|     30|	}
 3232|       |
 3233|    288|	if (si->pi.numPackStreams == 0 || si->ci.numFolders == 0) {
  ------------------
  |  Branch (3233:6): [True: 0, False: 288]
  |  Branch (3233:36): [True: 1, False: 287]
  ------------------
 3234|      1|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3235|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3236|      1|	}
 3237|       |
 3238|    287|	if (archive_ckd_add_i64(&pi_end, si->pi.pos, si->pi.sizes[0])) {
  ------------------
  |  Branch (3238:6): [True: 0, False: 287]
  ------------------
 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|    287|	if (zip->header_offset < pi_end) {
  ------------------
  |  Branch (3243:6): [True: 0, False: 287]
  ------------------
 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|    287|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    287|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3249|    287|}
archive_read_support_format_7zip.c:read_StreamsInfo:
 2693|    695|{
 2694|    695|	struct _7zip *zip = a->format->data;
 2695|    695|	const unsigned char *p;
 2696|    695|	size_t i;
 2697|       |
 2698|    695|	memset(si, 0, sizeof(*si));
 2699|       |
 2700|    695|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2700:6): [True: 0, False: 695]
  ------------------
 2701|      0|		return (-1);
 2702|    695|	if (*p == kPackInfo) {
  ------------------
  |  |  128|    695|#define kPackInfo		0x06
  ------------------
  |  Branch (2702:6): [True: 683, False: 12]
  ------------------
 2703|    683|		int64_t packPos;
 2704|       |
 2705|    683|		if (read_PackInfo(a, &(si->pi)) < 0)
  ------------------
  |  Branch (2705:7): [True: 53, False: 630]
  ------------------
 2706|     53|			return (-1);
 2707|       |
 2708|    630|		if (si->pi.positions == NULL || si->pi.sizes == NULL)
  ------------------
  |  Branch (2708:7): [True: 1, False: 629]
  |  Branch (2708:35): [True: 0, False: 629]
  ------------------
 2709|      1|			return (-1);
 2710|       |		/*
 2711|       |		 * Calculate packed stream positions.
 2712|       |		 */
 2713|    629|		packPos = si->pi.pos;
 2714|  1.57k|		for (i = 0; i < si->pi.numPackStreams; i++) {
  ------------------
  |  Branch (2714:15): [True: 959, False: 620]
  ------------------
 2715|    959|			si->pi.positions[i] = packPos;
 2716|    959|			if (archive_ckd_add_i64(&packPos,
  ------------------
  |  Branch (2716:8): [True: 0, False: 959]
  ------------------
 2717|    959|			    packPos, si->pi.sizes[i]))
 2718|      0|				return (-1);
 2719|    959|			if (packPos > zip->header_offset)
  ------------------
  |  Branch (2719:8): [True: 9, False: 950]
  ------------------
 2720|      9|				return (-1);
 2721|    959|		}
 2722|    620|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2722:7): [True: 0, False: 620]
  ------------------
 2723|      0|			return (-1);
 2724|    620|	}
 2725|    632|	if (*p == kUnPackInfo) {
  ------------------
  |  |  129|    632|#define kUnPackInfo		0x07
  ------------------
  |  Branch (2725:6): [True: 631, False: 1]
  ------------------
 2726|    631|		size_t packIndex;
 2727|    631|		struct _7z_folder *f;
 2728|       |
 2729|    631|		if (read_CodersInfo(a, &(si->ci)) < 0)
  ------------------
  |  Branch (2729:7): [True: 182, False: 449]
  ------------------
 2730|    182|			return (-1);
 2731|       |
 2732|       |		/*
 2733|       |		 * Calculate packed stream indexes.
 2734|       |		 */
 2735|    449|		packIndex = 0;
 2736|    449|		f = si->ci.folders;
 2737|    902|		for (i = 0; i < si->ci.numFolders; i++) {
  ------------------
  |  Branch (2737:15): [True: 455, False: 447]
  ------------------
 2738|    455|			f[i].packIndex = packIndex;
 2739|    455|			if (archive_ckd_add_size(&packIndex,
  ------------------
  |  Branch (2739:8): [True: 0, False: 455]
  ------------------
 2740|    455|			    packIndex, f[i].numPackedStreams) ||
 2741|    455|			    packIndex > si->pi.numPackStreams)
  ------------------
  |  Branch (2741:8): [True: 2, False: 453]
  ------------------
 2742|      2|				return (-1);
 2743|    455|		}
 2744|    447|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2744:7): [True: 1, False: 446]
  ------------------
 2745|      1|			return (-1);
 2746|    447|	}
 2747|       |
 2748|    447|	if (*p == kSubStreamsInfo) {
  ------------------
  |  |  130|    447|#define kSubStreamsInfo		0x08
  ------------------
  |  Branch (2748:6): [True: 152, False: 295]
  ------------------
 2749|    152|		if (read_SubStreamsInfo(a, &(si->ss),
  ------------------
  |  Branch (2749:7): [True: 24, False: 128]
  ------------------
 2750|    152|		    si->ci.folders, si->ci.numFolders) < 0)
 2751|     24|			return (-1);
 2752|    128|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2752:7): [True: 0, False: 128]
  ------------------
 2753|      0|			return (-1);
 2754|    128|	}
 2755|       |
 2756|       |	/*
 2757|       |	 *  Must be kEnd.
 2758|       |	 */
 2759|    423|	if (*p != kEnd)
  ------------------
  |  |  122|    423|#define kEnd			0x00
  ------------------
  |  Branch (2759:6): [True: 1, False: 422]
  ------------------
 2760|      1|		return (-1);
 2761|    422|	return (0);
 2762|    423|}
archive_read_support_format_7zip.c:read_PackInfo:
 2176|    683|{
 2177|    683|	const unsigned char *p;
 2178|    683|	size_t i;
 2179|       |
 2180|    683|	memset(pi, 0, sizeof(*pi));
 2181|       |
 2182|       |	/*
 2183|       |	 * Read PackPos.
 2184|       |	 */
 2185|    683|	if (parse_7zip_int64(a, &(pi->pos)) < 0)
  ------------------
  |  Branch (2185:6): [True: 1, False: 682]
  ------------------
 2186|      1|		return (-1);
 2187|       |
 2188|       |	/*
 2189|       |	 * Read NumPackStreams.
 2190|       |	 */
 2191|    682|	if (parse_7zip_size(a, &(pi->numPackStreams)) < 0)
  ------------------
  |  Branch (2191:6): [True: 8, False: 674]
  ------------------
 2192|      8|		return (-1);
 2193|    674|	if (pi->numPackStreams == 0)
  ------------------
  |  Branch (2193:6): [True: 2, False: 672]
  ------------------
 2194|      2|		return (-1);
 2195|       |
 2196|       |	/*
 2197|       |	 * Read PackSizes[num]
 2198|       |	 */
 2199|    672|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2199:6): [True: 0, False: 672]
  ------------------
 2200|      0|		return (-1);
 2201|    672|	if (*p == kEnd)
  ------------------
  |  |  122|    672|#define kEnd			0x00
  ------------------
  |  Branch (2201:6): [True: 1, False: 671]
  ------------------
 2202|       |		/* PackSizes[num] are not present. */
 2203|      1|		return (0);
 2204|    671|	if (*p != kSize)
  ------------------
  |  |  131|    671|#define kSize			0x09
  ------------------
  |  Branch (2204:6): [True: 1, False: 670]
  ------------------
 2205|      1|		return (-1);
 2206|    670|	pi->sizes = calloc(pi->numPackStreams, sizeof(int64_t));
 2207|    670|	pi->positions = calloc(pi->numPackStreams, sizeof(int64_t));
 2208|    670|	if (pi->sizes == NULL || pi->positions == NULL)
  ------------------
  |  Branch (2208:6): [True: 0, False: 670]
  |  Branch (2208:27): [True: 0, False: 670]
  ------------------
 2209|      0|		return (-1);
 2210|       |
 2211|  13.2k|	for (i = 0; i < pi->numPackStreams; i++) {
  ------------------
  |  Branch (2211:14): [True: 12.5k, False: 642]
  ------------------
 2212|  12.5k|		if (parse_7zip_int64(a, &(pi->sizes[i])) < 0)
  ------------------
  |  Branch (2212:7): [True: 28, False: 12.5k]
  ------------------
 2213|     28|			return (-1);
 2214|  12.5k|	}
 2215|       |
 2216|       |	/*
 2217|       |	 * Read PackStreamDigests[num]
 2218|       |	 */
 2219|    642|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2219:6): [True: 0, False: 642]
  ------------------
 2220|      0|		return (-1);
 2221|    642|	if (*p == kEnd) {
  ------------------
  |  |  122|    642|#define kEnd			0x00
  ------------------
  |  Branch (2221:6): [True: 628, False: 14]
  ------------------
 2222|       |		/* PackStreamDigests[num] are not present. */
 2223|    628|		pi->digest.defineds =
 2224|    628|		    calloc(pi->numPackStreams, sizeof(*pi->digest.defineds));
 2225|    628|		pi->digest.digests =
 2226|    628|		    calloc(pi->numPackStreams, sizeof(*pi->digest.digests));
 2227|    628|		if (pi->digest.defineds == NULL || pi->digest.digests == NULL)
  ------------------
  |  Branch (2227:7): [True: 0, False: 628]
  |  Branch (2227:38): [True: 0, False: 628]
  ------------------
 2228|      0|			return (-1);
 2229|    628|		return (0);
 2230|    628|	}
 2231|       |
 2232|     14|	if (*p != kCRC)
  ------------------
  |  |  132|     14|#define kCRC			0x0A
  ------------------
  |  Branch (2232:6): [True: 1, False: 13]
  ------------------
 2233|      1|		return (-1);
 2234|       |
 2235|     13|	if (read_Digests(a, &(pi->digest), pi->numPackStreams) < 0)
  ------------------
  |  Branch (2235:6): [True: 10, False: 3]
  ------------------
 2236|     10|		return (-1);
 2237|       |
 2238|       |	/*
 2239|       |	 *  Must be marked by kEnd.
 2240|       |	 */
 2241|      3|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2241:6): [True: 0, False: 3]
  ------------------
 2242|      0|		return (-1);
 2243|      3|	if (*p != kEnd)
  ------------------
  |  |  122|      3|#define kEnd			0x00
  ------------------
  |  Branch (2243:6): [True: 2, False: 1]
  ------------------
 2244|      2|		return (-1);
 2245|      1|	return (0);
 2246|      3|}
archive_read_support_format_7zip.c:parse_7zip_int64:
 2072|  1.21M|{
 2073|  1.21M|	uint64_t v;
 2074|  1.21M|	const unsigned char *p;
 2075|  1.21M|	unsigned char avail, mask;
 2076|  1.21M|	int i;
 2077|       |
 2078|  1.21M|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2078:6): [True: 37, False: 1.21M]
  ------------------
 2079|     37|		return (-1);
 2080|  1.21M|	avail = *p;
 2081|  1.21M|	mask = 0x80;
 2082|  1.21M|	v = 0;
 2083|  1.22M|	for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (2083:14): [True: 1.22M, False: 1.22k]
  ------------------
 2084|  1.22M|		if (avail & mask) {
  ------------------
  |  Branch (2084:7): [True: 17.1k, False: 1.20M]
  ------------------
 2085|  17.1k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2085:8): [True: 23, False: 17.1k]
  ------------------
 2086|     23|				return (-1);
 2087|  17.1k|			v |= ((uint64_t)*p) << (8 * i);
 2088|  17.1k|			mask >>= 1;
 2089|  17.1k|			continue;
 2090|  17.1k|		}
 2091|  1.20M|		v += ((uint64_t)(avail & (mask - 1))) << (8 * i);
 2092|  1.20M|		break;
 2093|  1.22M|	}
 2094|  1.21M|	if (v > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2094:6): [True: 111, False: 1.21M]
  ------------------
 2095|    111|		return (-1);
 2096|  1.21M|	*val = (int64_t)v;
 2097|  1.21M|	return (0);
 2098|  1.21M|}
archive_read_support_format_7zip.c:parse_7zip_size:
 2060|  1.17M|{
 2061|  1.17M|	int64_t v;
 2062|       |
 2063|  1.17M|	if (parse_7zip_int64(a, &v) < 0 || v > UMAX_ENTRY)
  ------------------
  |  |  393|  1.17M|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  205|  1.17M|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2063:6): [True: 88, False: 1.17M]
  |  Branch (2063:37): [True: 60, False: 1.17M]
  ------------------
 2064|    148|		return (-1);
 2065|       |
 2066|  1.17M|	*val = (size_t)v;
 2067|  1.17M|	return (0);
 2068|  1.17M|}
archive_read_support_format_7zip.c:read_Digests:
 2129|    248|{
 2130|    248|	const unsigned char *p;
 2131|    248|	size_t i;
 2132|       |
 2133|    248|	if (num == 0)
  ------------------
  |  Branch (2133:6): [True: 0, False: 248]
  ------------------
 2134|      0|		return (-1);
 2135|    248|	memset(d, 0, sizeof(*d));
 2136|       |
 2137|    248|	d->defineds = malloc(num);
 2138|    248|	if (d->defineds == NULL)
  ------------------
  |  Branch (2138:6): [True: 0, False: 248]
  ------------------
 2139|      0|		return (-1);
 2140|       |	/*
 2141|       |	 * Read Bools.
 2142|       |	 */
 2143|    248|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2143:6): [True: 0, False: 248]
  ------------------
 2144|      0|		return (-1);
 2145|    248|	if (*p == 0) {
  ------------------
  |  Branch (2145:6): [True: 13, False: 235]
  ------------------
 2146|     13|		if (read_Bools(a, d->defineds, num) < 0)
  ------------------
  |  Branch (2146:7): [True: 3, False: 10]
  ------------------
 2147|      3|			return (-1);
 2148|     13|	} else
 2149|       |		/* All are defined */
 2150|    235|		memset(d->defineds, 1, num);
 2151|       |
 2152|    245|	d->digests = calloc(num, sizeof(*d->digests));
 2153|    245|	if (d->digests == NULL)
  ------------------
  |  Branch (2153:6): [True: 0, False: 245]
  ------------------
 2154|      0|		return (-1);
 2155|  1.27k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2155:14): [True: 1.04k, False: 237]
  ------------------
 2156|  1.04k|		if (d->defineds[i]) {
  ------------------
  |  Branch (2156:7): [True: 712, False: 328]
  ------------------
 2157|    712|			if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (2157:8): [True: 8, False: 704]
  ------------------
 2158|      8|				return (-1);
 2159|    704|			d->digests[i] = archive_le32dec(p);
 2160|    704|		}
 2161|  1.04k|	}
 2162|       |
 2163|    237|	return (0);
 2164|    245|}
archive_read_support_format_7zip.c:read_Bools:
 2102|    916|{
 2103|    916|	const unsigned char *p;
 2104|    916|	size_t i;
 2105|    916|	unsigned mask = 0, avail = 0;
 2106|       |
 2107|  55.7k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2107:14): [True: 54.8k, False: 912]
  ------------------
 2108|  54.8k|		if (mask == 0) {
  ------------------
  |  Branch (2108:7): [True: 7.10k, False: 47.7k]
  ------------------
 2109|  7.10k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2109:8): [True: 4, False: 7.09k]
  ------------------
 2110|      4|				return (-1);
 2111|  7.09k|			avail = *p;
 2112|  7.09k|			mask = 0x80;
 2113|  7.09k|		}
 2114|  54.8k|		data[i] = (avail & mask) ? 1 : 0;
  ------------------
  |  Branch (2114:13): [True: 26.3k, False: 28.5k]
  ------------------
 2115|  54.8k|		mask >>= 1;
 2116|  54.8k|	}
 2117|    912|	return (0);
 2118|    916|}
archive_read_support_format_7zip.c:read_CodersInfo:
 2411|    631|{
 2412|    631|	struct _7zip *zip = a->format->data;
 2413|    631|	const unsigned char *p;
 2414|    631|	struct _7z_digests digest;
 2415|    631|	size_t dataStreamIndex, i;
 2416|       |
 2417|    631|	memset(ci, 0, sizeof(*ci));
 2418|    631|	memset(&digest, 0, sizeof(digest));
 2419|       |
 2420|    631|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2420:6): [True: 0, False: 631]
  ------------------
 2421|      0|		goto failed;
 2422|    631|	if (*p != kFolder)
  ------------------
  |  |  133|    631|#define kFolder			0x0B
  ------------------
  |  Branch (2422:6): [True: 1, False: 630]
  ------------------
 2423|      1|		goto failed;
 2424|       |
 2425|       |	/*
 2426|       |	 * Read NumFolders.
 2427|       |	 */
 2428|    630|	if (parse_7zip_size(a, &(ci->numFolders)) < 0)
  ------------------
  |  Branch (2428:6): [True: 0, False: 630]
  ------------------
 2429|      0|		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|    630|	if (ci->numFolders > (uint64_t)zip->header_bytes_remaining)
  ------------------
  |  Branch (2436:6): [True: 0, False: 630]
  ------------------
 2437|      0|		goto failed;
 2438|       |
 2439|       |	/*
 2440|       |	 * Read External.
 2441|       |	 */
 2442|    630|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2442:6): [True: 0, False: 630]
  ------------------
 2443|      0|		goto failed;
 2444|    630|	switch (*p) {
 2445|    630|	case 0:
  ------------------
  |  Branch (2445:2): [True: 630, False: 0]
  ------------------
 2446|    630|		ci->folders =
 2447|    630|			calloc(ci->numFolders, sizeof(*ci->folders));
 2448|    630|		if (ci->folders == NULL)
  ------------------
  |  Branch (2448:7): [True: 0, False: 630]
  ------------------
 2449|      0|			return (-1);
 2450|  2.20k|		for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2450:15): [True: 1.72k, False: 481]
  ------------------
 2451|  1.72k|			if (read_Folder(a, &(ci->folders[i])) < 0)
  ------------------
  |  Branch (2451:8): [True: 149, False: 1.57k]
  ------------------
 2452|    149|				goto failed;
 2453|  1.72k|		}
 2454|    481|		break;
 2455|    481|	case 1:
  ------------------
  |  Branch (2455:2): [True: 0, False: 630]
  ------------------
 2456|      0|		if (parse_7zip_size(a, &dataStreamIndex) < 0)
  ------------------
  |  Branch (2456:7): [True: 0, False: 0]
  ------------------
 2457|      0|			return (-1);
 2458|      0|		if (ci->numFolders > 0) {
  ------------------
  |  Branch (2458:7): [True: 0, False: 0]
  ------------------
 2459|      0|			archive_set_error(&a->archive, -1,
 2460|      0|			    "Malformed 7-Zip archive");
 2461|      0|			goto failed;
 2462|      0|		}
 2463|      0|		break;
 2464|      0|	default:
  ------------------
  |  Branch (2464:2): [True: 0, False: 630]
  ------------------
 2465|      0|		archive_set_error(&a->archive, -1,
 2466|      0|		    "Malformed 7-Zip archive");
 2467|      0|		goto failed;
 2468|    630|	}
 2469|       |
 2470|    481|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2470:6): [True: 0, False: 481]
  ------------------
 2471|      0|		goto failed;
 2472|    481|	if (*p != kCodersUnPackSize)
  ------------------
  |  |  134|    481|#define kCodersUnPackSize	0x0C
  ------------------
  |  Branch (2472:6): [True: 5, False: 476]
  ------------------
 2473|      5|		goto failed;
 2474|       |
 2475|    983|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2475:14): [True: 530, False: 453]
  ------------------
 2476|    530|		struct _7z_folder *folder = &(ci->folders[i]);
 2477|    530|		size_t j;
 2478|       |
 2479|    530|		folder->unPackSize =
 2480|    530|		    calloc(folder->numOutStreams, sizeof(*folder->unPackSize));
 2481|    530|		if (folder->unPackSize == NULL)
  ------------------
  |  Branch (2481:7): [True: 0, False: 530]
  ------------------
 2482|      0|			goto failed;
 2483|  1.80k|		for (j = 0; j < folder->numOutStreams; j++) {
  ------------------
  |  Branch (2483:15): [True: 1.29k, False: 507]
  ------------------
 2484|  1.29k|			if (parse_7zip_int64(a, &(folder->unPackSize[j])) < 0)
  ------------------
  |  Branch (2484:8): [True: 23, False: 1.27k]
  ------------------
 2485|     23|				goto failed;
 2486|  1.29k|		}
 2487|    530|	}
 2488|       |
 2489|       |	/*
 2490|       |	 * Read CRCs.
 2491|       |	 */
 2492|    453|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2492:6): [True: 0, False: 453]
  ------------------
 2493|      0|		goto failed;
 2494|    453|	if (*p == kEnd)
  ------------------
  |  |  122|    453|#define kEnd			0x00
  ------------------
  |  Branch (2494:6): [True: 342, False: 111]
  ------------------
 2495|    342|		return (0);
 2496|    111|	if (*p != kCRC)
  ------------------
  |  |  132|    111|#define kCRC			0x0A
  ------------------
  |  Branch (2496:6): [True: 2, False: 109]
  ------------------
 2497|      2|		goto failed;
 2498|    109|	if (read_Digests(a, &digest, ci->numFolders) < 0)
  ------------------
  |  Branch (2498:6): [True: 1, False: 108]
  ------------------
 2499|      1|		goto failed;
 2500|    231|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2500:14): [True: 123, False: 108]
  ------------------
 2501|    123|		ci->folders[i].digest_defined = digest.defineds[i];
 2502|    123|		ci->folders[i].digest = digest.digests[i];
 2503|    123|	}
 2504|       |
 2505|       |	/*
 2506|       |	 *  Must be kEnd.
 2507|       |	 */
 2508|    108|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2508:6): [True: 1, False: 107]
  ------------------
 2509|      1|		goto failed;
 2510|    107|	if (*p != kEnd)
  ------------------
  |  |  122|    107|#define kEnd			0x00
  ------------------
  |  Branch (2510:6): [True: 0, False: 107]
  ------------------
 2511|      0|		goto failed;
 2512|    107|	free_Digest(&digest);
 2513|    107|	return (0);
 2514|    182|failed:
 2515|    182|	free_Digest(&digest);
 2516|    182|	return (-1);
 2517|    107|}
archive_read_support_format_7zip.c:read_Folder:
 2265|  1.72k|{
 2266|  1.72k|	struct _7zip *zip = a->format->data;
 2267|  1.72k|	const unsigned char *p;
 2268|  1.72k|	size_t numInStreamsTotal = 0;
 2269|  1.72k|	size_t numOutStreamsTotal = 0;
 2270|  1.72k|	size_t i;
 2271|       |
 2272|  1.72k|	memset(f, 0, sizeof(*f));
 2273|       |
 2274|       |	/*
 2275|       |	 * Read NumCoders.
 2276|       |	 */
 2277|  1.72k|	if (parse_7zip_size(a, &(f->numCoders)) < 0)
  ------------------
  |  Branch (2277:6): [True: 8, False: 1.71k]
  ------------------
 2278|      8|		return (-1);
 2279|  1.71k|	if (f->numCoders > 4)
  ------------------
  |  Branch (2279:6): [True: 4, False: 1.71k]
  ------------------
 2280|       |		/* Too many coders. */
 2281|      4|		return (-1);
 2282|       |
 2283|  1.71k|	f->coders = calloc(f->numCoders, sizeof(*f->coders));
 2284|  1.71k|	if (f->coders == NULL)
  ------------------
  |  Branch (2284:6): [True: 0, False: 1.71k]
  ------------------
 2285|      0|		return (-1);
 2286|  4.71k|	for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2286:14): [True: 3.03k, False: 1.68k]
  ------------------
 2287|  3.03k|		size_t codec_size;
 2288|  3.03k|		int simple, attr;
 2289|       |
 2290|  3.03k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2290:7): [True: 2, False: 3.03k]
  ------------------
 2291|      2|			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.03k|		codec_size = *p & 0xf;
 2301|  3.03k|		simple = (*p & 0x10) ? 0 : 1;
  ------------------
  |  Branch (2301:12): [True: 263, False: 2.76k]
  ------------------
 2302|  3.03k|		attr = *p & 0x20;
 2303|  3.03k|		if (*p & 0x80)
  ------------------
  |  Branch (2303:7): [True: 2, False: 3.02k]
  ------------------
 2304|      2|			return (-1);/* Not supported. */
 2305|       |
 2306|       |		/*
 2307|       |		 * Read Decompression Method IDs.
 2308|       |		 */
 2309|  3.02k|		if ((p = header_bytes(a, codec_size)) == NULL)
  ------------------
  |  Branch (2309:7): [True: 5, False: 3.02k]
  ------------------
 2310|      5|			return (-1);
 2311|       |
 2312|  3.02k|		if (decode_codec_id(p, codec_size, &f->coders[i].codec) < 0)
  ------------------
  |  Branch (2312:7): [True: 3, False: 3.02k]
  ------------------
 2313|      3|			return (-1);
 2314|       |
 2315|  3.02k|		if (simple) {
  ------------------
  |  Branch (2315:7): [True: 2.76k, False: 257]
  ------------------
 2316|  2.76k|			f->coders[i].numInStreams = 1;
 2317|  2.76k|			f->coders[i].numOutStreams = 1;
 2318|  2.76k|		} else {
 2319|    257|			if (parse_7zip_size(
  ------------------
  |  Branch (2319:8): [True: 9, False: 248]
  ------------------
 2320|    257|			    a, &(f->coders[i].numInStreams)) < 0)
 2321|      9|				return (-1);
 2322|    248|			if (parse_7zip_size(
  ------------------
  |  Branch (2322:8): [True: 4, False: 244]
  ------------------
 2323|    248|			    a, &(f->coders[i].numOutStreams)) < 0)
 2324|      4|				return (-1);
 2325|    248|		}
 2326|       |
 2327|  3.00k|		if (attr) {
  ------------------
  |  Branch (2327:7): [True: 545, False: 2.46k]
  ------------------
 2328|    545|			if (parse_7zip_size(
  ------------------
  |  Branch (2328:8): [True: 3, False: 542]
  ------------------
 2329|    545|			    a, &(f->coders[i].propertiesSize)) < 0)
 2330|      3|				return (-1);
 2331|    542|			if ((p = header_bytes(
  ------------------
  |  Branch (2331:8): [True: 2, False: 540]
  ------------------
 2332|    542|			    a, f->coders[i].propertiesSize)) == NULL)
 2333|      2|				return (-1);
 2334|    540|			f->coders[i].properties =
 2335|    540|			    malloc(f->coders[i].propertiesSize);
 2336|    540|			if (f->coders[i].properties == NULL)
  ------------------
  |  Branch (2336:8): [True: 0, False: 540]
  ------------------
 2337|      0|				return (-1);
 2338|    540|			memcpy(f->coders[i].properties, p,
 2339|    540|			    f->coders[i].propertiesSize);
 2340|    540|		}
 2341|       |
 2342|  3.00k|		if (archive_ckd_add_size(&numInStreamsTotal,
  ------------------
  |  Branch (2342:7): [True: 0, False: 3.00k]
  ------------------
 2343|  3.00k|		    numInStreamsTotal, f->coders[i].numInStreams) ||
 2344|  3.00k|		    archive_ckd_add_size(&numOutStreamsTotal,
  ------------------
  |  Branch (2344:7): [True: 0, False: 3.00k]
  ------------------
 2345|  3.00k|		    numOutStreamsTotal, f->coders[i].numOutStreams))
 2346|      0|			return (-1);
 2347|  3.00k|	}
 2348|       |
 2349|  1.68k|	if (numOutStreamsTotal == 0 ||
  ------------------
  |  Branch (2349:6): [True: 4, False: 1.67k]
  ------------------
 2350|  1.67k|	    numInStreamsTotal < numOutStreamsTotal-1)
  ------------------
  |  Branch (2350:6): [True: 2, False: 1.67k]
  ------------------
 2351|      6|		return (-1);
 2352|       |
 2353|  1.67k|	f->numBindPairs = numOutStreamsTotal - 1;
 2354|  1.67k|	if ((uint64_t)zip->header_bytes_remaining < f->numBindPairs)
  ------------------
  |  Branch (2354:6): [True: 0, False: 1.67k]
  ------------------
 2355|      0|			return (-1);
 2356|  1.67k|	if (f->numBindPairs > 0) {
  ------------------
  |  Branch (2356:6): [True: 809, False: 865]
  ------------------
 2357|    809|		f->bindPairs =
 2358|    809|			calloc(f->numBindPairs, sizeof(*f->bindPairs));
 2359|    809|		if (f->bindPairs == NULL)
  ------------------
  |  Branch (2359:7): [True: 0, False: 809]
  ------------------
 2360|      0|			return (-1);
 2361|    809|	} else
 2362|    865|		f->bindPairs = NULL;
 2363|   531k|	for (i = 0; i < f->numBindPairs; i++) {
  ------------------
  |  Branch (2363:14): [True: 529k, False: 1.60k]
  ------------------
 2364|   529k|		if (parse_7zip_size(a, &(f->bindPairs[i].inIndex)) < 0)
  ------------------
  |  Branch (2364:7): [True: 41, False: 529k]
  ------------------
 2365|     41|			return (-1);
 2366|   529k|		if (parse_7zip_size(a, &(f->bindPairs[i].outIndex)) < 0)
  ------------------
  |  Branch (2366:7): [True: 29, False: 529k]
  ------------------
 2367|     29|			return (-1);
 2368|   529k|	}
 2369|       |
 2370|  1.60k|	f->numPackedStreams = numInStreamsTotal - f->numBindPairs;
 2371|       |	/* packedStreams are not needed; parse/verify nonetheless */
 2372|  1.60k|	if (f->numPackedStreams == 1) {
  ------------------
  |  Branch (2372:6): [True: 1.46k, False: 135]
  ------------------
 2373|  1.54k|		for (i = 0; i < numInStreamsTotal; i++) {
  ------------------
  |  Branch (2373:15): [True: 1.54k, False: 0]
  ------------------
 2374|  1.54k|			size_t j;
 2375|  3.80k|			for (j = 0; j < f->numBindPairs; j++) {
  ------------------
  |  Branch (2375:16): [True: 2.34k, False: 1.46k]
  ------------------
 2376|  2.34k|				if (f->bindPairs[j].inIndex == i)
  ------------------
  |  Branch (2376:9): [True: 75, False: 2.26k]
  ------------------
 2377|     75|					break;
 2378|  2.34k|			}
 2379|  1.54k|			if (j == f->numBindPairs)
  ------------------
  |  Branch (2379:8): [True: 1.46k, False: 75]
  ------------------
 2380|  1.46k|				break;
 2381|  1.54k|		}
 2382|  1.46k|		if (i == numInStreamsTotal)
  ------------------
  |  Branch (2382:7): [True: 0, False: 1.46k]
  ------------------
 2383|      0|			return (-1);
 2384|  1.46k|	} else {
 2385|   107k|		for (i = 0; i < f->numPackedStreams; i++) {
  ------------------
  |  Branch (2385:15): [True: 107k, False: 104]
  ------------------
 2386|   107k|			size_t packedStream;
 2387|   107k|			if (parse_7zip_size(a, &packedStream) < 0)
  ------------------
  |  Branch (2387:8): [True: 31, False: 107k]
  ------------------
 2388|     31|				return (-1);
 2389|   107k|		}
 2390|    135|	}
 2391|  1.57k|	f->numInStreams = numInStreamsTotal;
 2392|  1.57k|	f->numOutStreams = numOutStreamsTotal;
 2393|       |
 2394|  1.57k|	return (0);
 2395|  1.60k|}
archive_read_support_format_7zip.c:decode_codec_id:
 1278|  3.02k|{
 1279|  3.02k|	size_t i;
 1280|       |
 1281|  3.02k|	*id = 0;
 1282|  10.5k|	for (i = 0; i < id_size; i++) {
  ------------------
  |  Branch (1282:14): [True: 7.53k, False: 3.02k]
  ------------------
 1283|  7.53k|		if (archive_ckd_mul_i64(id, *id, 256) ||
  ------------------
  |  Branch (1283:7): [True: 3, False: 7.53k]
  ------------------
 1284|  7.53k|		    archive_ckd_add_i64(id, *id, codecId[i]))
  ------------------
  |  Branch (1284:7): [True: 0, False: 7.53k]
  ------------------
 1285|      3|			return (-1);
 1286|  7.53k|	}
 1287|  3.02k|	return (0);
 1288|  3.02k|}
archive_read_support_format_7zip.c:free_Digest:
 2122|  12.6k|{
 2123|  12.6k|	free(d->defineds);
 2124|  12.6k|	free(d->digests);
 2125|  12.6k|}
archive_read_support_format_7zip.c:read_SubStreamsInfo:
 2548|    152|{
 2549|    152|	const unsigned char *p;
 2550|    152|	int64_t *usizes;
 2551|    152|	size_t numDigests;
 2552|    152|	size_t unpack_streams;
 2553|    152|	size_t i;
 2554|    152|	int type;
 2555|       |
 2556|    152|	memset(ss, 0, sizeof(*ss));
 2557|       |
 2558|    307|	for (i = 0; i < numFolders; i++)
  ------------------
  |  Branch (2558:14): [True: 155, False: 152]
  ------------------
 2559|    155|		f[i].numUnpackStreams = 1;
 2560|       |
 2561|    152|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2561:6): [True: 1, False: 151]
  ------------------
 2562|      1|		return (-1);
 2563|    151|	type = *p;
 2564|       |
 2565|    151|	if (type == kNumUnPackStream) {
  ------------------
  |  |  135|    151|#define kNumUnPackStream	0x0D
  ------------------
  |  Branch (2565:6): [True: 81, False: 70]
  ------------------
 2566|     81|		unpack_streams = 0;
 2567|    160|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2567:15): [True: 81, False: 79]
  ------------------
 2568|     81|			if (parse_7zip_size(a, &(f[i].numUnpackStreams)) < 0)
  ------------------
  |  Branch (2568:8): [True: 2, False: 79]
  ------------------
 2569|      2|				return (-1);
 2570|     79|			if (archive_ckd_add_size(&unpack_streams,
  ------------------
  |  Branch (2570:8): [True: 0, False: 79]
  ------------------
 2571|     79|			    unpack_streams, f[i].numUnpackStreams))
 2572|      0|				return (-1);
 2573|     79|		}
 2574|     79|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2574:7): [True: 0, False: 79]
  ------------------
 2575|      0|			return (-1);
 2576|     79|		type = *p;
 2577|     79|	} else
 2578|     70|		unpack_streams = numFolders;
 2579|       |
 2580|    149|	if (unpack_streams > UMAX_ENTRY)
  ------------------
  |  |  393|    149|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  205|    149|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2580:6): [True: 0, False: 149]
  ------------------
 2581|      0|		return (-1);
 2582|       |
 2583|    149|	if (type != kSize) {
  ------------------
  |  |  131|    149|#define kSize			0x09
  ------------------
  |  Branch (2583:6): [True: 70, False: 79]
  ------------------
 2584|    143|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2584:15): [True: 73, False: 70]
  ------------------
 2585|     73|			if (f[i].numUnpackStreams > 1)
  ------------------
  |  Branch (2585:8): [True: 0, False: 73]
  ------------------
 2586|      0|				return (-1);
 2587|     73|		}
 2588|     70|	}
 2589|       |
 2590|    149|	ss->unpack_streams = unpack_streams;
 2591|    149|	if (unpack_streams) {
  ------------------
  |  Branch (2591:6): [True: 149, False: 0]
  ------------------
 2592|    149|		ss->unpackSizes = calloc(unpack_streams,
 2593|    149|		    sizeof(*ss->unpackSizes));
 2594|    149|		ss->digestsDefined = calloc(unpack_streams,
 2595|    149|		    sizeof(*ss->digestsDefined));
 2596|    149|		ss->digests = calloc(unpack_streams,
 2597|    149|		    sizeof(*ss->digests));
 2598|    149|		if (ss->unpackSizes == NULL || ss->digestsDefined == NULL ||
  ------------------
  |  Branch (2598:7): [True: 0, False: 149]
  |  Branch (2598:34): [True: 0, False: 149]
  ------------------
 2599|    149|		    ss->digests == NULL)
  ------------------
  |  Branch (2599:7): [True: 0, False: 149]
  ------------------
 2600|      0|			return (-1);
 2601|    149|	}
 2602|       |
 2603|    149|	usizes = ss->unpackSizes;
 2604|    284|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2604:14): [True: 152, False: 132]
  ------------------
 2605|    152|		int64_t size, sum;
 2606|    152|		size_t pack;
 2607|       |
 2608|    152|		if (f[i].numUnpackStreams == 0)
  ------------------
  |  Branch (2608:7): [True: 0, False: 152]
  ------------------
 2609|      0|			continue;
 2610|       |
 2611|    152|		sum = 0;
 2612|    152|		if (type == kSize) {
  ------------------
  |  |  131|    152|#define kSize			0x09
  ------------------
  |  Branch (2612:7): [True: 79, False: 73]
  ------------------
 2613|  16.5k|			for (pack = 1; pack < f[i].numUnpackStreams; pack++) {
  ------------------
  |  Branch (2613:19): [True: 16.4k, False: 63]
  ------------------
 2614|  16.4k|				if (parse_7zip_int64(a, usizes) < 0)
  ------------------
  |  Branch (2614:9): [True: 13, False: 16.4k]
  ------------------
 2615|     13|					return (-1);
 2616|  16.4k|				if (archive_ckd_add_i64(&sum, sum, *usizes++))
  ------------------
  |  Branch (2616:9): [True: 3, False: 16.4k]
  ------------------
 2617|      3|					return (-1);
 2618|  16.4k|			}
 2619|     79|		}
 2620|    136|		size = folder_uncompressed_size(&f[i]);
 2621|    136|		if (size < sum)
  ------------------
  |  Branch (2621:7): [True: 1, False: 135]
  ------------------
 2622|      1|			return (-1);
 2623|    135|		*usizes++ = size - sum;
 2624|    135|	}
 2625|       |
 2626|    132|	if (type == kSize) {
  ------------------
  |  |  131|    132|#define kSize			0x09
  ------------------
  |  Branch (2626:6): [True: 62, False: 70]
  ------------------
 2627|     62|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2627:7): [True: 0, False: 62]
  ------------------
 2628|      0|			return (-1);
 2629|     62|		type = *p;
 2630|     62|	}
 2631|       |
 2632|    132|	numDigests = 0;
 2633|    267|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2633:14): [True: 135, False: 132]
  ------------------
 2634|    135|		if (f[i].numUnpackStreams != 1 || !f[i].digest_defined)
  ------------------
  |  Branch (2634:7): [True: 62, False: 73]
  |  Branch (2634:37): [True: 73, False: 0]
  ------------------
 2635|    135|			if (archive_ckd_add_size(&numDigests,
  ------------------
  |  Branch (2635:8): [True: 0, False: 135]
  ------------------
 2636|    135|			    numDigests, f[i].numUnpackStreams)) {
 2637|      0|				errno = ENOMEM;
 2638|      0|				return (-1);
 2639|      0|			}
 2640|    135|	}
 2641|       |
 2642|    132|	if (type == kCRC) {
  ------------------
  |  |  132|    132|#define kCRC			0x0A
  ------------------
  |  Branch (2642:6): [True: 126, False: 6]
  ------------------
 2643|    126|		struct _7z_digests tmpDigests;
 2644|    126|		unsigned char *digestsDefined = ss->digestsDefined;
 2645|    126|		uint32_t *digests = ss->digests;
 2646|    126|		size_t di = 0;
 2647|       |
 2648|    126|		memset(&tmpDigests, 0, sizeof(tmpDigests));
 2649|    126|		if (read_Digests(a, &(tmpDigests), numDigests) < 0) {
  ------------------
  |  Branch (2649:7): [True: 0, False: 126]
  ------------------
 2650|      0|			free_Digest(&tmpDigests);
 2651|      0|			return (-1);
 2652|      0|		}
 2653|    255|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2653:15): [True: 129, False: 126]
  ------------------
 2654|    129|			if (f[i].numUnpackStreams == 1 && f[i].digest_defined) {
  ------------------
  |  Branch (2654:8): [True: 67, False: 62]
  |  Branch (2654:38): [True: 0, False: 67]
  ------------------
 2655|      0|				*digestsDefined++ = 1;
 2656|      0|				*digests++ = f[i].digest;
 2657|    129|			} else {
 2658|    129|				size_t j;
 2659|       |
 2660|    389|				for (j = 0; j < f[i].numUnpackStreams;
  ------------------
  |  Branch (2660:17): [True: 260, False: 129]
  ------------------
 2661|    260|				    j++, di++) {
 2662|    260|					*digestsDefined++ =
 2663|    260|					    tmpDigests.defineds[di];
 2664|    260|					*digests++ =
 2665|    260|					    tmpDigests.digests[di];
 2666|    260|				}
 2667|    129|			}
 2668|    129|		}
 2669|    126|		free_Digest(&tmpDigests);
 2670|    126|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2670:7): [True: 0, False: 126]
  ------------------
 2671|      0|			return (-1);
 2672|    126|		type = *p;
 2673|    126|	}
 2674|       |
 2675|       |	/*
 2676|       |	 *  Must be kEnd.
 2677|       |	 */
 2678|    132|	if (type != kEnd)
  ------------------
  |  |  122|    132|#define kEnd			0x00
  ------------------
  |  Branch (2678:6): [True: 4, False: 128]
  ------------------
 2679|      4|		return (-1);
 2680|    128|	return (0);
 2681|    132|}
archive_read_support_format_7zip.c:folder_uncompressed_size:
 2521|    522|{
 2522|    522|	size_t n = f->numOutStreams;
 2523|    522|	size_t pairs = f->numBindPairs;
 2524|       |
 2525|    603|	while (n-- > 0) {
  ------------------
  |  Branch (2525:9): [True: 603, False: 0]
  ------------------
 2526|    603|		size_t i;
 2527|  2.56k|		for (i = 0; i < pairs; i++) {
  ------------------
  |  Branch (2527:15): [True: 2.04k, False: 522]
  ------------------
 2528|  2.04k|			if (f->bindPairs[i].outIndex == n)
  ------------------
  |  Branch (2528:8): [True: 81, False: 1.96k]
  ------------------
 2529|     81|				break;
 2530|  2.04k|		}
 2531|    603|		if (i >= pairs)
  ------------------
  |  Branch (2531:7): [True: 522, False: 81]
  ------------------
 2532|    522|			return (f->unPackSize[n]);
 2533|    603|	}
 2534|      0|	return (0);
 2535|    522|}
archive_read_support_format_7zip.c:read_consume:
 1209|  1.26M|{
 1210|  1.26M|	struct _7zip *zip = a->format->data;
 1211|       |
 1212|  1.26M|	if (zip->pack_stream_bytes_unconsumed) {
  ------------------
  |  Branch (1212:6): [True: 1.26M, False: 0]
  ------------------
 1213|  1.26M|		int64_t r;
 1214|       |
 1215|  1.26M|		if ((r = __archive_read_consume(a,
  ------------------
  |  Branch (1215:7): [True: 0, False: 1.26M]
  ------------------
 1216|  1.26M|		    zip->pack_stream_bytes_unconsumed)) < 0)
 1217|      0|			return ((int)r);
 1218|       |
 1219|  1.26M|		zip->stream_offset += zip->pack_stream_bytes_unconsumed;
 1220|  1.26M|		zip->pack_stream_bytes_unconsumed = 0;
 1221|  1.26M|	}
 1222|       |
 1223|  1.26M|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.26M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1224|  1.26M|}
archive_read_support_format_7zip.c:setup_decode_folder:
 3838|    367|{
 3839|    367|	struct _7zip *zip = a->format->data;
 3840|    367|	const struct _7z_coder *coder1, *coder2;
 3841|    367|	const char *cname = (header)?"archive header":"file content";
  ------------------
  |  Branch (3841:22): [True: 287, False: 80]
  ------------------
 3842|    367|	size_t i;
 3843|    367|	int r, found_bcj2 = 0;
 3844|       |
 3845|       |	/*
 3846|       |	 * Release the memory which the previous folder used for BCJ2.
 3847|       |	 */
 3848|  1.46k|	for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3848:14): [True: 1.10k, False: 367]
  ------------------
 3849|  1.10k|		free(zip->sub_stream_buff[i]);
 3850|  1.10k|		zip->sub_stream_buff[i] = NULL;
 3851|  1.10k|	}
 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|    913|	for (i = 0; i < folder->numCoders; i++) {
  ------------------
  |  Branch (3858:14): [True: 546, False: 367]
  ------------------
 3859|    546|		switch(folder->coders[i].codec) {
  ------------------
  |  Branch (3859:10): [True: 22, False: 524]
  ------------------
 3860|      0|			case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (3860:4): [True: 0, False: 546]
  ------------------
 3861|      0|			case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (3861:4): [True: 0, False: 546]
  ------------------
 3862|      0|			case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (3862:4): [True: 0, False: 546]
  ------------------
 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|     22|			case _7Z_X86_BCJ2: {
  ------------------
  |  |  108|     22|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3876:4): [True: 22, False: 524]
  ------------------
 3877|     22|				found_bcj2++;
 3878|     22|				break;
 3879|      0|			}
 3880|    546|		}
 3881|    546|	}
 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|    367|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|    367|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (3885:6): [True: 0, False: 367]
  ------------------
 3886|      0|		zip->has_encrypted_entries = 0;
 3887|      0|	}
 3888|       |
 3889|    367|	if ((folder->numCoders > 2 && !found_bcj2) || found_bcj2 > 1) {
  ------------------
  |  Branch (3889:7): [True: 21, False: 346]
  |  Branch (3889:32): [True: 0, False: 21]
  |  Branch (3889:48): [True: 0, False: 367]
  ------------------
 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|    367|	zip->pack_stream_remaining = folder->numPackedStreams;
 3901|    367|	zip->pack_stream_index = folder->packIndex;
 3902|    367|	zip->folder_outbytes_remaining = folder_uncompressed_size(folder);
 3903|    367|	zip->uncompressed_buffer_bytes_remaining = 0;
 3904|    367|	coder1 = &(folder->coders[0]);
 3905|    367|	if (folder->numCoders == 2)
  ------------------
  |  Branch (3905:6): [True: 116, False: 251]
  ------------------
 3906|    116|		coder2 = &(folder->coders[1]);
 3907|    251|	else
 3908|    251|		coder2 = NULL;
 3909|       |
 3910|    367|	if (found_bcj2) {
  ------------------
  |  Branch (3910:6): [True: 22, False: 345]
  ------------------
 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|     22|		const struct _7z_coder *fc = folder->coders;
 3917|     22|		static const struct _7z_coder coder_copy = {0, 1, 1, 0, NULL};
 3918|     22|		const struct _7z_coder *scoder[3] =
 3919|     22|			{&coder_copy, &coder_copy, &coder_copy};
 3920|     22|		const void *buff;
 3921|     22|		ssize_t bytes;
 3922|     22|		unsigned char *b[3] = {NULL, NULL, NULL};
 3923|     22|		int64_t sunpack[3] ={-1, -1, -1};
 3924|     22|		int64_t remaining;
 3925|     22|		size_t s[3] = {0, 0, 0};
 3926|     22|		int idx[3] = {0, 1, 2};
 3927|       |
 3928|     22|		if (folder->numCoders == 4 && fc[3].codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  108|     43|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3928:7): [True: 21, False: 1]
  |  Branch (3928:33): [True: 21, False: 0]
  ------------------
 3929|     21|		    folder->numInStreams == 7 && folder->numOutStreams == 4 &&
  ------------------
  |  Branch (3929:7): [True: 21, False: 0]
  |  Branch (3929:36): [True: 21, False: 0]
  ------------------
 3930|     21|		    zip->pack_stream_remaining == 4) {
  ------------------
  |  Branch (3930:7): [True: 21, False: 0]
  ------------------
 3931|       |			/* Source type 1 made by 7zr or 7z with -m options. */
 3932|     21|			if (folder->bindPairs[0].inIndex == 5) {
  ------------------
  |  Branch (3932:8): [True: 21, False: 0]
  ------------------
 3933|       |				/* The form made by 7zr */
 3934|     21|				idx[0] = 1; idx[1] = 2; idx[2] = 0;
 3935|     21|				scoder[1] = &(fc[1]);
 3936|     21|				scoder[2] = &(fc[0]);
 3937|     21|				sunpack[1] = folder->unPackSize[1];
 3938|     21|				sunpack[2] = folder->unPackSize[0];
 3939|     21|				coder1 = &(fc[2]);
 3940|     21|			} 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 &&
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3959:9): [True: 0, False: 0]
  ------------------
 3960|      0|				    fc[1].codec == _7Z_COPY)
  ------------------
  |  |   95|      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 &&
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3962:14): [True: 0, False: 0]
  ------------------
 3963|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   95|      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 &&
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3965:14): [True: 0, False: 0]
  ------------------
 3966|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   95|      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|     21|			coder2 = &(fc[3]);
 3977|     21|			remaining = folder->unPackSize[2];
 3978|     21|		} else if (coder2 != NULL && coder2->codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  108|      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|     21|		zip->main_stream_bytes_remaining = remaining;
 3991|       |
 3992|       |
 3993|       |		/* Skip the main stream at this time. */
 3994|     21|		if ((r = seek_pack(a)) < 0)
  ------------------
  |  Branch (3994:7): [True: 0, False: 21]
  ------------------
 3995|      0|			return (r);
 3996|     21|		zip->pack_stream_bytes_unconsumed =
 3997|     21|		    zip->pack_stream_inbytes_remaining;
 3998|     21|		if ((r = read_consume(a)) < 0)
  ------------------
  |  Branch (3998:7): [True: 0, False: 21]
  ------------------
 3999|      0|			return (r);
 4000|       |
 4001|       |		/* Read following three sub streams. */
 4002|     81|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4002:15): [True: 62, False: 19]
  ------------------
 4003|     62|			const struct _7z_coder *coder = scoder[i];
 4004|       |
 4005|     62|			if ((r = seek_pack(a)) < 0) {
  ------------------
  |  Branch (4005:8): [True: 0, False: 62]
  ------------------
 4006|      0|				free(b[0]); free(b[1]); free(b[2]);
 4007|      0|				return (r);
 4008|      0|			}
 4009|       |
 4010|     62|			if (sunpack[i] == -1)
  ------------------
  |  Branch (4010:8): [True: 21, False: 41]
  ------------------
 4011|     21|				zip->folder_outbytes_remaining =
 4012|     21|				    zip->pack_stream_inbytes_remaining;
 4013|     41|			else
 4014|     41|				zip->folder_outbytes_remaining = sunpack[i];
 4015|       |
 4016|     62|			r = init_decompression(a, zip, coder, NULL);
 4017|     62|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|     62|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4017:8): [True: 0, False: 62]
  ------------------
 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|     62|			if ((uint64_t)zip->folder_outbytes_remaining > SIZE_MAX) {
  ------------------
  |  Branch (4024:8): [True: 0, False: 62]
  ------------------
 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|     62|			b[i] = malloc((size_t)zip->folder_outbytes_remaining);
 4033|     62|			if (b[i] == NULL) {
  ------------------
  |  Branch (4033:8): [True: 0, False: 62]
  ------------------
 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|    122|			while (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (4041:11): [True: 62, False: 60]
  ------------------
 4042|     62|				r = (int)extract_pack_stream(a, 0);
 4043|     62|				if (r < 0) {
  ------------------
  |  Branch (4043:9): [True: 2, False: 60]
  ------------------
 4044|      2|					free(b[0]); free(b[1]); free(b[2]);
 4045|      2|					return (r);
 4046|      2|				}
 4047|     60|				bytes = get_uncompressed_data(a, &buff,
 4048|     60|				    zip->uncompressed_buffer_bytes_remaining,
 4049|     60|				    0);
 4050|     60|				if (bytes < 0) {
  ------------------
  |  Branch (4050:9): [True: 0, False: 60]
  ------------------
 4051|      0|					free(b[0]); free(b[1]); free(b[2]);
 4052|      0|					return ((int)bytes);
 4053|      0|				}
 4054|     60|				memcpy(b[i]+s[i], buff, bytes);
 4055|     60|				s[i] += bytes;
 4056|     60|				if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4056:9): [True: 60, False: 0]
  ------------------
 4057|     60|					read_consume(a);
 4058|     60|			}
 4059|     62|		}
 4060|       |
 4061|       |		/* Set the sub streams to the right place. */
 4062|     76|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4062:15): [True: 57, False: 19]
  ------------------
 4063|     57|			zip->sub_stream_buff[i] = b[idx[i]];
 4064|     57|			zip->sub_stream_size[i] = s[idx[i]];
 4065|     57|			zip->sub_stream_bytes_remaining[i] = s[idx[i]];
 4066|     57|		}
 4067|       |
 4068|       |		/* Allocate memory used for decoded main stream bytes. */
 4069|     19|		if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4069:7): [True: 19, False: 0]
  ------------------
 4070|     19|			zip->tmp_stream_buff_size = 32 * 1024;
 4071|     19|			zip->tmp_stream_buff =
 4072|     19|			    malloc(zip->tmp_stream_buff_size);
 4073|     19|			if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4073:8): [True: 0, False: 19]
  ------------------
 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|     19|		}
 4079|     19|		zip->tmp_stream_bytes_avail = 0;
 4080|     19|		zip->tmp_stream_bytes_remaining = 0;
 4081|     19|		zip->odd_bcj_size = 0;
 4082|     19|		zip->bcj2_outPos = 0;
 4083|       |
 4084|       |		/*
 4085|       |		 * Reset a stream reader in order to read the main stream
 4086|       |		 * of BCJ2.
 4087|       |		 */
 4088|     19|		zip->pack_stream_remaining = 1;
 4089|     19|		zip->pack_stream_index = folder->packIndex;
 4090|     19|		zip->folder_outbytes_remaining =
 4091|     19|		    folder_uncompressed_size(folder);
 4092|     19|		zip->uncompressed_buffer_bytes_remaining = 0;
 4093|     19|	}
 4094|       |
 4095|       |	/*
 4096|       |	 * Initialize the decompressor for the new folder's pack streams.
 4097|       |	 */
 4098|    364|	r = init_decompression(a, zip, coder1, coder2);
 4099|    364|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    364|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4099:6): [True: 32, False: 332]
  ------------------
 4100|     32|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     32|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4101|    332|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    332|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4102|    364|}
archive_read_support_format_7zip.c:init_decompression:
 1333|    426|{
 1334|    426|	int r;
 1335|       |
 1336|    426|	zip->codec = coder1->codec;
 1337|    426|	zip->codec2 = -1;
 1338|       |
 1339|    426|	switch (zip->codec) {
 1340|    127|	case _7Z_COPY:
  ------------------
  |  |   95|    127|#define _7Z_COPY	0
  ------------------
  |  Branch (1340:2): [True: 127, False: 299]
  ------------------
 1341|    127|	case _7Z_BZ2:
  ------------------
  |  |   99|    127|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1341:2): [True: 0, False: 426]
  ------------------
 1342|    127|	case _7Z_DEFLATE:
  ------------------
  |  |   98|    127|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1342:2): [True: 0, False: 426]
  ------------------
 1343|    127|	case _7Z_ZSTD:
  ------------------
  |  |  117|    127|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1343:2): [True: 0, False: 426]
  ------------------
 1344|    242|	case _7Z_PPMD:
  ------------------
  |  |  100|    242|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1344:2): [True: 115, False: 311]
  ------------------
 1345|    242|		if (coder2 != NULL) {
  ------------------
  |  Branch (1345:7): [True: 85, False: 157]
  ------------------
 1346|     85|			if (coder2->codec != _7Z_X86 &&
  ------------------
  |  |  107|    170|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1346:8): [True: 72, False: 13]
  ------------------
 1347|     72|			    coder2->codec != _7Z_X86_BCJ2 &&
  ------------------
  |  |  108|    157|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1347:8): [True: 72, False: 0]
  ------------------
 1348|     72|			    coder2->codec != _7Z_ARM &&
  ------------------
  |  |  111|    157|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1348:8): [True: 61, False: 11]
  ------------------
 1349|     61|			    coder2->codec != _7Z_ARM64 &&
  ------------------
  |  |  113|    146|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1349:8): [True: 36, False: 25]
  ------------------
 1350|     36|			    coder2->codec != _7Z_POWERPC &&
  ------------------
  |  |  109|    121|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1350:8): [True: 20, False: 16]
  ------------------
 1351|     20|			    coder2->codec != _7Z_SPARC) {
  ------------------
  |  |  115|     20|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1351:8): [True: 5, False: 15]
  ------------------
 1352|      5|				archive_set_error(&a->archive,
 1353|      5|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1354|      5|				    "Unsupported filter %jx for %jx",
 1355|      5|				    (uintmax_t)coder2->codec,
 1356|      5|				    (uintmax_t)coder1->codec);
 1357|      5|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1358|      5|			}
 1359|     80|			zip->codec2 = coder2->codec;
 1360|     80|			zip->bcj_state = 0;
 1361|     80|			if (coder2->codec == _7Z_X86)
  ------------------
  |  |  107|     80|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1361:8): [True: 13, False: 67]
  ------------------
 1362|     13|				x86_Init(zip);
 1363|     67|			else if (coder2->codec == _7Z_ARM)
  ------------------
  |  |  111|     67|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1363:13): [True: 11, False: 56]
  ------------------
 1364|     11|				arm_Init(zip);
 1365|     80|		}
 1366|    237|		break;
 1367|    237|	default:
  ------------------
  |  Branch (1367:2): [True: 184, False: 242]
  ------------------
 1368|    184|		break;
 1369|    426|	}
 1370|       |
 1371|    421|	switch (zip->codec) {
 1372|    122|	case _7Z_COPY:
  ------------------
  |  |   95|    122|#define _7Z_COPY	0
  ------------------
  |  Branch (1372:2): [True: 122, False: 299]
  ------------------
 1373|    122|		break;
 1374|       |
 1375|    163|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   96|    132|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   97|    163|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1375:2): [True: 132, False: 289]
  |  Branch (1375:17): [True: 31, False: 390]
  ------------------
 1376|    163|#ifdef HAVE_LZMA_H
 1377|    163|#if LZMA_VERSION_MAJOR >= 5
 1378|       |/* Effectively disable the limiter. */
 1379|    163|#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|    163|	{
 1385|    163|		lzma_options_delta delta_opt;
 1386|    163|		lzma_filter filters[LZMA_FILTERS_MAX], *ff;
 1387|    163|		int fi = 0;
 1388|       |
 1389|    163|		if (zip->lzstream_valid) {
  ------------------
  |  Branch (1389:7): [True: 96, False: 67]
  ------------------
 1390|     96|			lzma_end(&(zip->lzstream));
 1391|     96|			zip->lzstream_valid = 0;
 1392|     96|		}
 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|    163|		if (coder2 != NULL) {
  ------------------
  |  Branch (1413:7): [True: 49, False: 114]
  ------------------
 1414|     49|			zip->codec2 = coder2->codec;
 1415|       |
 1416|     49|			filters[fi].options = NULL;
 1417|     49|			switch (zip->codec2) {
 1418|     26|			case _7Z_X86:
  ------------------
  |  |  107|     26|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1418:4): [True: 26, False: 23]
  ------------------
 1419|     26|				if (zip->codec == _7Z_LZMA2) {
  ------------------
  |  |   97|     26|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1419:9): [True: 0, False: 26]
  ------------------
 1420|      0|					filters[fi].id = LZMA_FILTER_X86;
 1421|      0|					fi++;
 1422|      0|				} else
 1423|       |					/* Use our filter. */
 1424|     26|					x86_Init(zip);
 1425|     26|				break;
 1426|     19|			case _7Z_X86_BCJ2:
  ------------------
  |  |  108|     19|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1426:4): [True: 19, False: 30]
  ------------------
 1427|       |				/* Use our filter. */
 1428|     19|				zip->bcj_state = 0;
 1429|     19|				break;
 1430|      0|			case _7Z_DELTA:
  ------------------
  |  |  101|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1430:4): [True: 0, False: 49]
  ------------------
 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:
  ------------------
  |  |  109|      1|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1446:4): [True: 1, False: 48]
  ------------------
 1447|      1|				filters[fi].id = LZMA_FILTER_POWERPC;
 1448|      1|				fi++;
 1449|      1|				break;
 1450|      1|			case _7Z_IA64:
  ------------------
  |  |  110|      1|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1450:4): [True: 1, False: 48]
  ------------------
 1451|      1|				filters[fi].id = LZMA_FILTER_IA64;
 1452|      1|				fi++;
 1453|      1|				break;
 1454|      1|			case _7Z_ARM:
  ------------------
  |  |  111|      1|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1454:4): [True: 1, False: 48]
  ------------------
 1455|      1|				filters[fi].id = LZMA_FILTER_ARM;
 1456|      1|				fi++;
 1457|      1|				break;
 1458|      0|			case _7Z_ARMTHUMB:
  ------------------
  |  |  112|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1458:4): [True: 0, False: 49]
  ------------------
 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:
  ------------------
  |  |  115|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1474:4): [True: 0, False: 49]
  ------------------
 1475|      0|				filters[fi].id = LZMA_FILTER_SPARC;
 1476|      0|				fi++;
 1477|      0|				break;
 1478|      1|			default:
  ------------------
  |  Branch (1478:4): [True: 1, False: 48]
  ------------------
 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|     49|			}
 1485|     49|		}
 1486|       |
 1487|    162|		if (zip->codec == _7Z_LZMA2)
  ------------------
  |  |   97|    162|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1487:7): [True: 31, False: 131]
  ------------------
 1488|     31|			filters[fi].id = LZMA_FILTER_LZMA2;
 1489|    131|		else
 1490|    131|			filters[fi].id = LZMA_FILTER_LZMA1;
 1491|    162|		filters[fi].options = NULL;
 1492|    162|		ff = &filters[fi];
 1493|    162|		r = lzma_properties_decode(&filters[fi], NULL,
 1494|    162|		    coder1->properties, coder1->propertiesSize);
 1495|    162|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1495:7): [True: 1, False: 161]
  ------------------
 1496|      1|			set_error(a, r);
 1497|      1|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1498|      1|		}
 1499|    161|		fi++;
 1500|       |
 1501|    161|		filters[fi].id = LZMA_VLI_UNKNOWN;
 1502|    161|		filters[fi].options = NULL;
 1503|    161|		r = lzma_raw_decoder(&(zip->lzstream), filters);
 1504|    161|		free(ff->options);
 1505|    161|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1505:7): [True: 0, False: 161]
  ------------------
 1506|      0|			set_error(a, r);
 1507|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1508|      0|		}
 1509|    161|		zip->lzstream_valid = 1;
 1510|    161|		zip->lzstream.total_in = 0;
 1511|    161|		zip->lzstream.total_out = 0;
 1512|    161|		break;
 1513|    161|	}
 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:
  ------------------
  |  |   99|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1519:2): [True: 0, False: 421]
  ------------------
 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:
  ------------------
  |  |  117|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1560:2): [True: 0, False: 421]
  ------------------
 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:
  ------------------
  |  |   98|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1576:2): [True: 0, False: 421]
  ------------------
 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|    115|	case _7Z_PPMD:
  ------------------
  |  |  100|    115|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1597:2): [True: 115, False: 306]
  ------------------
 1598|    115|	{
 1599|    115|		unsigned order;
 1600|    115|		uint32_t msize;
 1601|       |
 1602|    115|		if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1602:7): [True: 0, False: 115]
  ------------------
 1603|      0|			__archive_ppmd7_functions.Ppmd7_Free(
 1604|      0|			    &zip->ppmd7_context);
 1605|      0|			zip->ppmd7_valid = 0;
 1606|      0|		}
 1607|       |
 1608|    115|		if (coder1->propertiesSize < 5) {
  ------------------
  |  Branch (1608:7): [True: 1, False: 114]
  ------------------
 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|    114|		order = coder1->properties[0];
 1614|    114|		msize = archive_le32dec(&(coder1->properties[1]));
 1615|    114|		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   18|    228|#define PPMD7_MIN_ORDER 2
  ------------------
              		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   19|    227|#define PPMD7_MAX_ORDER 64
  ------------------
  |  Branch (1615:7): [True: 1, False: 113]
  |  Branch (1615:34): [True: 1, False: 112]
  ------------------
 1616|    112|		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   21|    226|#define PPMD7_MIN_MEM_SIZE (1 << 11)
  ------------------
              		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   22|    112|#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3)
  ------------------
  |  Branch (1616:7): [True: 0, False: 112]
  |  Branch (1616:37): [True: 1, False: 111]
  ------------------
 1617|      3|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1618|      3|			    "Malformed PPMd parameter");
 1619|      3|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1620|      3|		}
 1621|    111|		__archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context);
 1622|    111|		r = __archive_ppmd7_functions.Ppmd7_Alloc(
 1623|    111|			&zip->ppmd7_context, msize);
 1624|    111|		if (r == 0) {
  ------------------
  |  Branch (1624:7): [True: 0, False: 111]
  ------------------
 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|    111|		__archive_ppmd7_functions.Ppmd7_Init(
 1630|    111|			&zip->ppmd7_context, order);
 1631|    111|		__archive_ppmd7_functions.Ppmd7z_RangeDec_CreateVTable(
 1632|    111|			&zip->range_dec);
 1633|    111|		zip->ppmd7_valid = 1;
 1634|    111|		zip->ppmd7_stat = 0;
 1635|    111|		zip->ppstream.overconsumed = 0;
 1636|    111|		break;
 1637|    111|	}
 1638|      0|	case _7Z_X86:
  ------------------
  |  |  107|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1638:2): [True: 0, False: 421]
  ------------------
 1639|      0|	case _7Z_X86_BCJ2:
  ------------------
  |  |  108|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1639:2): [True: 0, False: 421]
  ------------------
 1640|      0|	case _7Z_POWERPC:
  ------------------
  |  |  109|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1640:2): [True: 0, False: 421]
  ------------------
 1641|      0|	case _7Z_IA64:
  ------------------
  |  |  110|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1641:2): [True: 0, False: 421]
  ------------------
 1642|      0|	case _7Z_ARM:
  ------------------
  |  |  111|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1642:2): [True: 0, False: 421]
  ------------------
 1643|      0|	case _7Z_ARMTHUMB:
  ------------------
  |  |  112|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1643:2): [True: 0, False: 421]
  ------------------
 1644|      0|	case _7Z_ARM64:
  ------------------
  |  |  113|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1644:2): [True: 0, False: 421]
  ------------------
 1645|      0|	case _7Z_RISCV:
  ------------------
  |  |  114|      0|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1645:2): [True: 0, False: 421]
  ------------------
 1646|      0|	case _7Z_SPARC:
  ------------------
  |  |  115|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1646:2): [True: 0, False: 421]
  ------------------
 1647|      1|	case _7Z_DELTA:
  ------------------
  |  |  101|      1|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1647:2): [True: 1, False: 420]
  ------------------
 1648|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1649|      1|		    "Unexpected codec ID: %jX", (uintmax_t)zip->codec);
 1650|      1|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1651|      0|	case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (1651:2): [True: 0, False: 421]
  ------------------
 1652|      0|	case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (1652:2): [True: 0, False: 421]
  ------------------
 1653|      0|	case _7Z_CRYPTO_AES_256_SHA_256:
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1653:2): [True: 0, False: 421]
  ------------------
 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|     20|	default:
  ------------------
  |  Branch (1663:2): [True: 20, False: 401]
  ------------------
 1664|     20|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     20|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1665|     20|		    "Unknown codec ID: %jX", (uintmax_t)zip->codec);
 1666|     20|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     20|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1667|    421|	}
 1668|       |
 1669|    394|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    394|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1670|    421|}
archive_read_support_format_7zip.c:x86_Init:
 4165|     39|{
 4166|     39|	zip->bcj_state = 0;
 4167|     39|	zip->bcj_prevPosT = (size_t)0 - 1;
 4168|     39|	zip->bcj_prevMask = 0;
 4169|     39|	zip->bcj_ip = 5;
 4170|     39|}
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|      1|{
 1233|       |
 1234|      1|	switch (ret) {
 1235|      0|	case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1235:2): [True: 0, False: 1]
  ------------------
 1236|      0|	case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1236:2): [True: 0, False: 1]
  ------------------
 1237|      0|		break;
 1238|      0|	case LZMA_MEM_ERROR:
  ------------------
  |  Branch (1238:2): [True: 0, False: 1]
  ------------------
 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: 1]
  ------------------
 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: 1]
  ------------------
 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|      1|	case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (1251:2): [True: 1, False: 0]
  ------------------
 1252|      1|		archive_set_error(&a->archive,
 1253|      1|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1254|      1|		    "Lzma library error: Invalid options");
 1255|      1|		break;
 1256|      0|	case LZMA_DATA_ERROR:
  ------------------
  |  Branch (1256:2): [True: 0, False: 1]
  ------------------
 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: 1]
  ------------------
 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: 1]
  ------------------
 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|      1|	}
 1273|      1|}
archive_read_support_format_7zip.c:seek_pack:
 3688|    415|{
 3689|    415|	struct _7zip *zip = a->format->data;
 3690|    415|	int64_t pack_offset;
 3691|       |
 3692|    415|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3692:6): [True: 2, False: 413]
  ------------------
 3693|      2|		archive_set_error(&(a->archive),
 3694|      2|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3695|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3696|      2|	}
 3697|    413|	zip->pack_stream_inbytes_remaining =
 3698|    413|	    zip->si.pi.sizes[zip->pack_stream_index];
 3699|    413|	pack_offset = zip->si.pi.positions[zip->pack_stream_index];
 3700|    413|	if (zip->stream_offset != pack_offset) {
  ------------------
  |  Branch (3700:6): [True: 348, False: 65]
  ------------------
 3701|    348|		int64_t target;
 3702|       |
 3703|    348|		if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3703:7): [True: 0, False: 348]
  ------------------
 3704|    348|		    zip->seek_base, pack_offset) ||
 3705|    348|		    0 > seek_compat(a, target, SEEK_SET, 1)) {
  ------------------
  |  Branch (3705:7): [True: 1, False: 347]
  ------------------
 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|    347|		zip->stream_offset = pack_offset;
 3710|    347|	}
 3711|    412|	zip->pack_stream_index++;
 3712|    412|	zip->pack_stream_remaining--;
 3713|    412|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    412|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3714|    413|}
archive_read_support_format_7zip.c:free_StreamsInfo:
 2685|  12.2k|{
 2686|  12.2k|	free_PackInfo(&(si->pi));
 2687|  12.2k|	free_CodersInfo(&(si->ci));
 2688|  12.2k|	free_SubStreamsInfo(&(si->ss));
 2689|  12.2k|}
archive_read_support_format_7zip.c:free_PackInfo:
 2168|  12.2k|{
 2169|  12.2k|	free(pi->sizes);
 2170|  12.2k|	free(pi->positions);
 2171|  12.2k|	free_Digest(&(pi->digest));
 2172|  12.2k|}
archive_read_support_format_7zip.c:free_CodersInfo:
 2399|  12.2k|{
 2400|  12.2k|	size_t i;
 2401|       |
 2402|  12.2k|	if (ci->folders) {
  ------------------
  |  Branch (2402:6): [True: 630, False: 11.6k]
  ------------------
 2403|   408k|		for (i = 0; i < ci->numFolders; i++)
  ------------------
  |  Branch (2403:15): [True: 407k, False: 630]
  ------------------
 2404|   407k|			free_Folder(&(ci->folders[i]));
 2405|    630|		free(ci->folders);
 2406|    630|	}
 2407|  12.2k|}
archive_read_support_format_7zip.c:free_Folder:
 2250|   407k|{
 2251|   407k|	if (f->coders) {
  ------------------
  |  Branch (2251:6): [True: 1.71k, False: 406k]
  ------------------
 2252|  1.71k|		size_t i;
 2253|       |
 2254|  4.76k|		for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2254:15): [True: 3.05k, False: 1.71k]
  ------------------
 2255|  3.05k|			free(f->coders[i].properties);
 2256|  3.05k|		}
 2257|  1.71k|		free(f->coders);
 2258|  1.71k|	}
 2259|   407k|	free(f->bindPairs);
 2260|   407k|	free(f->unPackSize);
 2261|   407k|}
archive_read_support_format_7zip.c:free_SubStreamsInfo:
 2539|  12.2k|{
 2540|  12.2k|	free(ss->unpackSizes);
 2541|  12.2k|	free(ss->digestsDefined);
 2542|  12.2k|	free(ss->digests);
 2543|  12.2k|}
archive_read_support_format_7zip.c:read_Header:
 2795|    744|{
 2796|    744|	struct _7zip *zip = a->format->data;
 2797|    744|	const unsigned char *p;
 2798|    744|	struct _7z_folder *folders;
 2799|    744|	struct _7z_stream_info *si = &(zip->si);
 2800|    744|	struct _7zip_entry *entries;
 2801|    744|	size_t folderIndex, indexInFolder;
 2802|    744|	size_t i;
 2803|    744|	size_t eindex, empty_streams, sindex;
 2804|    744|	int attr_seen = 0;
 2805|       |
 2806|    744|	if (check_header_id) {
  ------------------
  |  Branch (2806:6): [True: 253, False: 491]
  ------------------
 2807|       |		/*
 2808|       |		 * Read Header.
 2809|       |		 */
 2810|    253|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2810:7): [True: 128, False: 125]
  ------------------
 2811|    128|			return (-1);
 2812|    125|		if (*p != kHeader)
  ------------------
  |  |  123|    125|#define kHeader			0x01
  ------------------
  |  Branch (2812:7): [True: 52, False: 73]
  ------------------
 2813|     52|			return (-1);
 2814|    125|	}
 2815|       |
 2816|       |	/*
 2817|       |	 * Read ArchiveProperties.
 2818|       |	 */
 2819|    564|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2819:6): [True: 0, False: 564]
  ------------------
 2820|      0|		return (-1);
 2821|    564|	if (*p == kArchiveProperties) {
  ------------------
  |  |  124|    564|#define kArchiveProperties	0x02
  ------------------
  |  Branch (2821:6): [True: 42, False: 522]
  ------------------
 2822|    844|		for (;;) {
 2823|    844|			int64_t size;
 2824|    844|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2824:8): [True: 1, False: 843]
  ------------------
 2825|      1|				return (-1);
 2826|    843|			if (*p == kEnd)
  ------------------
  |  |  122|    843|#define kEnd			0x00
  ------------------
  |  Branch (2826:8): [True: 1, False: 842]
  ------------------
 2827|      1|				break;
 2828|    842|			if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (2828:8): [True: 9, False: 833]
  ------------------
 2829|      9|				return (-1);
 2830|    833|			if (size < 0 || zip->header_bytes_remaining < size)
  ------------------
  |  Branch (2830:8): [True: 0, False: 833]
  |  Branch (2830:20): [True: 5, False: 828]
  ------------------
 2831|      5|				return (-1);
 2832|       |
 2833|       |			/* Skip the property data to keep header parsing aligned. */
 2834|  1.61k|			while (size > 0) {
  ------------------
  |  Branch (2834:11): [True: 812, False: 802]
  ------------------
 2835|    812|				int64_t skip = size;
 2836|       |
 2837|    812|				if (skip > UBUFF_SIZE)
  ------------------
  |  |  293|    812|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2837:9): [True: 60, False: 752]
  ------------------
 2838|     60|					skip = UBUFF_SIZE;
  ------------------
  |  |  293|     60|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2839|    812|				if (header_bytes(a, (size_t)skip) == NULL)
  ------------------
  |  Branch (2839:9): [True: 26, False: 786]
  ------------------
 2840|     26|					return (-1);
 2841|    786|				size -= skip;
 2842|    786|			}
 2843|    828|		}
 2844|      1|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2844:7): [True: 0, False: 1]
  ------------------
 2845|      0|			return (-1);
 2846|      1|	}
 2847|       |
 2848|       |	/*
 2849|       |	 * Read MainStreamsInfo.
 2850|       |	 */
 2851|    523|	if (*p == kMainStreamsInfo) {
  ------------------
  |  |  126|    523|#define kMainStreamsInfo	0x04
  ------------------
  |  Branch (2851:6): [True: 377, False: 146]
  ------------------
 2852|    377|		if (read_StreamsInfo(a, &(zip->si)) < 0)
  ------------------
  |  Branch (2852:7): [True: 243, False: 134]
  ------------------
 2853|    243|			return (-1);
 2854|    134|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2854:7): [True: 1, False: 133]
  ------------------
 2855|      1|			return (-1);
 2856|    134|	}
 2857|    279|	if (*p == kEnd)
  ------------------
  |  |  122|    279|#define kEnd			0x00
  ------------------
  |  Branch (2857:6): [True: 1, False: 278]
  ------------------
 2858|      1|		return (0);
 2859|       |
 2860|       |	/*
 2861|       |	 * Read FilesInfo.
 2862|       |	 */
 2863|    278|	if (*p != kFilesInfo)
  ------------------
  |  |  127|    278|#define kFilesInfo		0x05
  ------------------
  |  Branch (2863:6): [True: 5, False: 273]
  ------------------
 2864|      5|		return (-1);
 2865|       |
 2866|    273|	if (parse_7zip_size(a, &(zip->numFiles)) < 0)
  ------------------
  |  Branch (2866:6): [True: 1, False: 272]
  ------------------
 2867|      1|		return (-1);
 2868|    272|	if (!files_info_numfiles_is_sane(zip))
  ------------------
  |  Branch (2868:6): [True: 0, False: 272]
  ------------------
 2869|      0|		return (-1);
 2870|       |
 2871|    272|	zip->entries = calloc(zip->numFiles, sizeof(*zip->entries));
 2872|    272|	if (zip->entries == NULL)
  ------------------
  |  Branch (2872:6): [True: 0, False: 272]
  ------------------
 2873|      0|		return (-1);
 2874|    272|	entries = zip->entries;
 2875|       |
 2876|    272|	empty_streams = 0;
 2877|  5.50k|	for (;;) {
 2878|  5.50k|		int type;
 2879|  5.50k|		int64_t size;
 2880|  5.50k|		size_t ll;
 2881|       |
 2882|  5.50k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2882:7): [True: 2, False: 5.50k]
  ------------------
 2883|      2|			return (-1);
 2884|  5.50k|		type = *p;
 2885|  5.50k|		if (type == kEnd)
  ------------------
  |  |  122|  5.50k|#define kEnd			0x00
  ------------------
  |  Branch (2885:7): [True: 170, False: 5.33k]
  ------------------
 2886|    170|			break;
 2887|       |
 2888|  5.33k|		if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (2888:7): [True: 9, False: 5.32k]
  ------------------
 2889|      9|			return (-1);
 2890|  5.32k|		if (zip->header_bytes_remaining < size ||
  ------------------
  |  Branch (2890:7): [True: 4, False: 5.31k]
  ------------------
 2891|  5.31k|		    size > (int64_t)(SIZE_MAX / 4))
  ------------------
  |  Branch (2891:7): [True: 0, False: 5.31k]
  ------------------
 2892|      4|			return (-1);
 2893|  5.31k|		ll = (size_t)size;
 2894|       |
 2895|  5.31k|		switch (type) {
 2896|    162|		case kEmptyStream:
  ------------------
  |  |  136|    162|#define kEmptyStream		0x0E
  ------------------
  |  Branch (2896:3): [True: 162, False: 5.15k]
  ------------------
 2897|    162|			if (h->emptyStreamBools != NULL)
  ------------------
  |  Branch (2897:8): [True: 0, False: 162]
  ------------------
 2898|      0|				return (-1);
 2899|    162|			h->emptyStreamBools = calloc(zip->numFiles,
 2900|    162|			    sizeof(*h->emptyStreamBools));
 2901|    162|			if (h->emptyStreamBools == NULL)
  ------------------
  |  Branch (2901:8): [True: 0, False: 162]
  ------------------
 2902|      0|				return (-1);
 2903|    162|			if (read_Bools(
  ------------------
  |  Branch (2903:8): [True: 0, False: 162]
  ------------------
 2904|    162|			    a, h->emptyStreamBools, zip->numFiles) < 0)
 2905|      0|				return (-1);
 2906|    162|			empty_streams = 0;
 2907|  9.89k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2907:16): [True: 9.72k, False: 162]
  ------------------
 2908|  9.72k|				if (h->emptyStreamBools[i])
  ------------------
  |  Branch (2908:9): [True: 8.93k, False: 797]
  ------------------
 2909|  8.93k|					empty_streams++;
 2910|  9.72k|			}
 2911|    162|			break;
 2912|    241|		case kEmptyFile:
  ------------------
  |  |  137|    241|#define kEmptyFile		0x0F
  ------------------
  |  Branch (2912:3): [True: 241, False: 5.07k]
  ------------------
 2913|    241|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2913:8): [True: 227, False: 14]
  ------------------
 2914|       |				/* Unexcepted sequence. Skip this. */
 2915|    227|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2915:9): [True: 1, False: 226]
  ------------------
 2916|      1|					return (-1);
 2917|    226|				break;
 2918|    227|			}
 2919|     14|			if (h->emptyFileBools != NULL)
  ------------------
  |  Branch (2919:8): [True: 0, False: 14]
  ------------------
 2920|      0|				return (-1);
 2921|     14|			h->emptyFileBools = calloc(empty_streams,
 2922|     14|			    sizeof(*h->emptyFileBools));
 2923|     14|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (2923:8): [True: 0, False: 14]
  ------------------
 2924|      0|				return (-1);
 2925|     14|			if (read_Bools(a, h->emptyFileBools, empty_streams) < 0)
  ------------------
  |  Branch (2925:8): [True: 0, False: 14]
  ------------------
 2926|      0|				return (-1);
 2927|     14|			break;
 2928|     29|		case kAnti:
  ------------------
  |  |  138|     29|#define kAnti			0x10
  ------------------
  |  Branch (2928:3): [True: 29, False: 5.28k]
  ------------------
 2929|     29|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2929:8): [True: 29, False: 0]
  ------------------
 2930|       |				/* Unexcepted sequence. Skip this. */
 2931|     29|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2931:9): [True: 1, False: 28]
  ------------------
 2932|      1|					return (-1);
 2933|     28|				break;
 2934|     29|			}
 2935|      0|			if (h->antiBools != NULL)
  ------------------
  |  Branch (2935:8): [True: 0, False: 0]
  ------------------
 2936|      0|				return (-1);
 2937|      0|			h->antiBools = calloc(empty_streams,
 2938|      0|			    sizeof(*h->antiBools));
 2939|      0|			if (h->antiBools == NULL)
  ------------------
  |  Branch (2939:8): [True: 0, False: 0]
  ------------------
 2940|      0|				return (-1);
 2941|      0|			if (read_Bools(a, h->antiBools, empty_streams) < 0)
  ------------------
  |  Branch (2941:8): [True: 0, False: 0]
  ------------------
 2942|      0|				return (-1);
 2943|      0|			break;
 2944|    338|		case kCTime:
  ------------------
  |  |  140|    338|#define kCTime			0x12
  ------------------
  |  Branch (2944:3): [True: 338, False: 4.98k]
  ------------------
 2945|  1.48k|		case kATime:
  ------------------
  |  |  141|  1.48k|#define kATime			0x13
  ------------------
  |  Branch (2945:3): [True: 1.14k, False: 4.17k]
  ------------------
 2946|  1.77k|		case kMTime:
  ------------------
  |  |  142|  1.77k|#define kMTime			0x14
  ------------------
  |  Branch (2946:3): [True: 287, False: 5.03k]
  ------------------
 2947|  1.77k|			if (read_Times(a, type) < 0)
  ------------------
  |  Branch (2947:8): [True: 28, False: 1.74k]
  ------------------
 2948|     28|				return (-1);
 2949|  1.74k|			break;
 2950|  1.74k|		case kName:
  ------------------
  |  |  139|    108|#define kName			0x11
  ------------------
  |  Branch (2950:3): [True: 108, False: 5.21k]
  ------------------
 2951|    108|		{
 2952|    108|			unsigned char *np;
 2953|    108|			size_t nl, nb;
 2954|       |
 2955|       |			/* Skip one byte. */
 2956|    108|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2956:8): [True: 0, False: 108]
  ------------------
 2957|      0|				return (-1);
 2958|    108|			ll--;
 2959|       |
 2960|    108|			if ((ll & 1) || ll < zip->numFiles * 4)
  ------------------
  |  Branch (2960:8): [True: 0, False: 108]
  |  Branch (2960:20): [True: 0, False: 108]
  ------------------
 2961|      0|				return (-1);
 2962|       |
 2963|    108|			if (zip->entry_names != NULL)
  ------------------
  |  Branch (2963:8): [True: 0, False: 108]
  ------------------
 2964|      0|				return (-1);
 2965|    108|			zip->entry_names = malloc(ll);
 2966|    108|			if (zip->entry_names == NULL)
  ------------------
  |  Branch (2966:8): [True: 0, False: 108]
  ------------------
 2967|      0|				return (-1);
 2968|    108|			np = zip->entry_names;
 2969|    108|			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|    215|			while (nb) {
  ------------------
  |  Branch (2976:11): [True: 108, False: 107]
  ------------------
 2977|    108|				size_t b;
 2978|    108|				if (nb > UBUFF_SIZE)
  ------------------
  |  |  293|    108|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2978:9): [True: 0, False: 108]
  ------------------
 2979|      0|					b = UBUFF_SIZE;
  ------------------
  |  |  293|      0|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2980|    108|				else
 2981|    108|					b = nb;
 2982|    108|				if ((p = header_bytes(a, b)) == NULL)
  ------------------
  |  Branch (2982:9): [True: 1, False: 107]
  ------------------
 2983|      1|					return (-1);
 2984|    107|				memcpy(np, p, b);
 2985|    107|				np += b;
 2986|    107|				nb -= b;
 2987|    107|			}
 2988|    107|			np = zip->entry_names;
 2989|    107|			nl = ll;
 2990|       |
 2991|  3.51k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2991:16): [True: 3.40k, False: 104]
  ------------------
 2992|  3.40k|				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|  31.4k|				while (nl >= 2 && (np[0] || np[1])) {
  ------------------
  |  Branch (2998:12): [True: 31.4k, False: 3]
  |  Branch (2998:24): [True: 27.0k, False: 4.45k]
  |  Branch (2998:33): [True: 1.05k, False: 3.40k]
  ------------------
 2999|  28.0k|					np += 2;
 3000|  28.0k|					nl -= 2;
 3001|  28.0k|				}
 3002|  3.40k|				if (nl < 2)
  ------------------
  |  Branch (3002:9): [True: 3, False: 3.40k]
  ------------------
 3003|      3|					return (-1);/* Terminator not found */
 3004|  3.40k|				entries[i].name_len = np - entries[i].utf16name;
 3005|  3.40k|				np += 2;
 3006|  3.40k|				nl -= 2;
 3007|  3.40k|			}
 3008|    104|			break;
 3009|    107|		}
 3010|    110|		case kAttributes:
  ------------------
  |  |  143|    110|#define kAttributes		0x15
  ------------------
  |  Branch (3010:3): [True: 110, False: 5.20k]
  ------------------
 3011|    110|		{
 3012|    110|			int allAreDefined;
 3013|       |
 3014|    110|			if ((p = header_bytes(a, 2)) == NULL)
  ------------------
  |  Branch (3014:8): [True: 0, False: 110]
  ------------------
 3015|      0|				return (-1);
 3016|    110|			allAreDefined = *p;
 3017|    110|			if (attr_seen)
  ------------------
  |  Branch (3017:8): [True: 0, False: 110]
  ------------------
 3018|      0|				return (-1);
 3019|    110|			attr_seen = 1;
 3020|    110|			if (!allAreDefined) {
  ------------------
  |  Branch (3020:8): [True: 28, False: 82]
  ------------------
 3021|     28|				h->attrBools = calloc(zip->numFiles,
 3022|     28|				    sizeof(*h->attrBools));
 3023|     28|				if (h->attrBools == NULL)
  ------------------
  |  Branch (3023:9): [True: 0, False: 28]
  ------------------
 3024|      0|					return (-1);
 3025|     28|				if (read_Bools(a, h->attrBools,
  ------------------
  |  Branch (3025:9): [True: 0, False: 28]
  ------------------
 3026|     28|				    zip->numFiles) < 0)
 3027|      0|					return (-1);
 3028|     28|			}
 3029|  5.67k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3029:16): [True: 5.57k, False: 102]
  ------------------
 3030|  5.57k|				if (allAreDefined || h->attrBools[i]) {
  ------------------
  |  Branch (3030:9): [True: 1.78k, False: 3.79k]
  |  Branch (3030:26): [True: 1.11k, False: 2.67k]
  ------------------
 3031|  2.89k|					if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (3031:10): [True: 8, False: 2.88k]
  ------------------
 3032|      8|						return (-1);
 3033|  2.88k|					entries[i].attr = archive_le32dec(p);
 3034|  2.88k|				}
 3035|  5.57k|			}
 3036|    102|			break;
 3037|    110|		}
 3038|    708|		case kDummy:
  ------------------
  |  |  145|    708|#define kDummy			0x19
  ------------------
  |  Branch (3038:3): [True: 708, False: 4.61k]
  ------------------
 3039|    708|			if (ll == 0)
  ------------------
  |  Branch (3039:8): [True: 101, False: 607]
  ------------------
 3040|    101|				break;
 3041|    607|			__LA_FALLTHROUGH;
 3042|  2.79k|		default:
  ------------------
  |  Branch (3042:3): [True: 2.18k, False: 3.12k]
  ------------------
 3043|  2.79k|			if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3043:8): [True: 45, False: 2.75k]
  ------------------
 3044|     45|				return (-1);
 3045|  2.75k|			break;
 3046|  5.31k|		}
 3047|  5.31k|	}
 3048|       |
 3049|       |	/*
 3050|       |	 * Set up entry's attributes.
 3051|       |	 */
 3052|    170|	folders = si->ci.folders;
 3053|    170|	eindex = sindex = 0;
 3054|    170|	folderIndex = indexInFolder = 0;
 3055|  6.80k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3055:14): [True: 6.63k, False: 161]
  ------------------
 3056|  6.63k|		if (h->emptyStreamBools == NULL || h->emptyStreamBools[i] == 0)
  ------------------
  |  Branch (3056:7): [True: 56, False: 6.58k]
  |  Branch (3056:38): [True: 117, False: 6.46k]
  ------------------
 3057|    173|			entries[i].flg |= HAS_STREAM;
  ------------------
  |  |  249|    173|#define HAS_STREAM	(1<<4)
  ------------------
 3058|       |		/* The high 16 bits of attributes is a posix file mode. */
 3059|  6.63k|		entries[i].mode = entries[i].attr >> 16;
 3060|       |
 3061|  6.63k|		if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
  ------------------
  |  |  169|  6.63k|#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
  ------------------
  |  Branch (3061:7): [True: 5.78k, False: 851]
  ------------------
 3062|       |			// Only windows permissions specified for this entry. Translate to
 3063|       |			// reasonable corresponding unix permissions.
 3064|       |
 3065|  5.78k|			if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
  ------------------
  |  |  162|  5.78k|#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  ------------------
  |  Branch (3065:8): [True: 276, False: 5.51k]
  ------------------
 3066|    276|				if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  150|    276|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3066:9): [True: 137, False: 139]
  ------------------
 3067|       |					// Read-only directory.
 3068|    137|					entries[i].mode = AE_IFDIR | 0555;
  ------------------
  |  |  221|    137|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3069|    139|				} else {
 3070|       |					// Read-write directory.
 3071|    139|					entries[i].mode = AE_IFDIR | 0755;
  ------------------
  |  |  221|    139|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3072|    139|				}
 3073|  5.51k|			} else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  150|  5.51k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3073:15): [True: 204, False: 5.30k]
  ------------------
 3074|       |				// Readonly file.
 3075|    204|				entries[i].mode = AE_IFREG | 0444;
  ------------------
  |  |  216|    204|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3076|  5.30k|			} else {
 3077|       |				// Assume read-write file.
 3078|  5.30k|				entries[i].mode = AE_IFREG | 0644;
  ------------------
  |  |  216|  5.30k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3079|  5.30k|			}
 3080|  5.78k|		}
 3081|       |
 3082|  6.63k|		if (entries[i].flg & HAS_STREAM) {
  ------------------
  |  |  249|  6.63k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3082:7): [True: 173, False: 6.46k]
  ------------------
 3083|    173|			if (sindex >= si->ss.unpack_streams)
  ------------------
  |  Branch (3083:8): [True: 9, False: 164]
  ------------------
 3084|      9|				return (-1);
 3085|    164|			if (entries[i].mode == 0)
  ------------------
  |  Branch (3085:8): [True: 0, False: 164]
  ------------------
 3086|      0|				entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3087|    164|			if (si->ss.digestsDefined[sindex])
  ------------------
  |  Branch (3087:8): [True: 164, False: 0]
  ------------------
 3088|    164|				entries[i].flg |= CRC32_IS_SET;
  ------------------
  |  |  248|    164|#define CRC32_IS_SET	(1<<3)
  ------------------
 3089|    164|			entries[i].ssIndex = sindex;
 3090|    164|			sindex++;
 3091|  6.46k|		} else {
 3092|  6.46k|			int dir = 1;
 3093|       |
 3094|  6.46k|			if (h->emptyFileBools != NULL) {
  ------------------
  |  Branch (3094:8): [True: 868, False: 5.59k]
  ------------------
 3095|    868|				dir = !h->emptyFileBools[eindex];
 3096|    868|				eindex++;
 3097|    868|			}
 3098|  6.46k|			if (entries[i].mode == 0) {
  ------------------
  |  Branch (3098:8): [True: 188, False: 6.27k]
  ------------------
 3099|    188|				if (dir)
  ------------------
  |  Branch (3099:9): [True: 128, False: 60]
  ------------------
 3100|    128|					entries[i].mode = AE_IFDIR | 0777;
  ------------------
  |  |  221|    128|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3101|     60|				else
 3102|     60|					entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|     60|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3103|  6.27k|			} else if (dir &&
  ------------------
  |  Branch (3103:15): [True: 6.01k, False: 263]
  ------------------
 3104|  6.01k|			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  6.01k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  6.01k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3104:8): [True: 5.69k, False: 323]
  ------------------
 3105|  5.69k|				entries[i].mode &= ~AE_IFMT;
  ------------------
  |  |  215|  5.69k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 3106|  5.69k|				entries[i].mode |= AE_IFDIR;
  ------------------
  |  |  221|  5.69k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3107|  5.69k|			}
 3108|  6.46k|			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  215|  6.46k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  221|  12.9k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3108:8): [True: 6.16k, False: 300]
  ------------------
 3109|  6.16k|			    entries[i].name_len >= 2 &&
  ------------------
  |  Branch (3109:8): [True: 916, False: 5.25k]
  ------------------
 3110|    916|			    (entries[i].utf16name[entries[i].name_len-2] != '/' ||
  ------------------
  |  Branch (3110:9): [True: 863, False: 53]
  ------------------
 3111|    881|			     entries[i].utf16name[entries[i].name_len-1] != 0)) {
  ------------------
  |  Branch (3111:9): [True: 18, False: 35]
  ------------------
 3112|    881|				entries[i].utf16name[entries[i].name_len] = '/';
 3113|    881|				entries[i].utf16name[entries[i].name_len+1] = 0;
 3114|    881|				entries[i].name_len += 2;
 3115|    881|			}
 3116|  6.46k|			entries[i].ssIndex = -1;
 3117|  6.46k|		}
 3118|  6.63k|		if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  150|  6.63k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3118:7): [True: 698, False: 5.93k]
  ------------------
 3119|    698|			entries[i].mode &= ~0222;/* Read only. */
 3120|       |
 3121|  6.63k|		if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
  ------------------
  |  |  249|  6.63k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3121:7): [True: 6.46k, False: 164]
  |  Branch (3121:45): [True: 6.46k, False: 0]
  ------------------
 3122|       |			/*
 3123|       |			 * The entry is an empty file or a directory file,
 3124|       |			 * those both have no contents.
 3125|       |			 */
 3126|  6.46k|			entries[i].folderIndex = -1;
 3127|  6.46k|			continue;
 3128|  6.46k|		}
 3129|    164|		if (indexInFolder == 0) {
  ------------------
  |  Branch (3129:7): [True: 85, False: 79]
  ------------------
 3130|     85|			for (;;) {
 3131|     85|				if (folderIndex >= si->ci.numFolders)
  ------------------
  |  Branch (3131:9): [True: 0, False: 85]
  ------------------
 3132|      0|					return (-1);
 3133|     85|				if (folders[folderIndex].numUnpackStreams)
  ------------------
  |  Branch (3133:9): [True: 85, False: 0]
  ------------------
 3134|     85|					break;
 3135|      0|				folderIndex++;
 3136|      0|			}
 3137|     85|		}
 3138|    164|		entries[i].folderIndex = folderIndex;
 3139|    164|		if ((entries[i].flg & HAS_STREAM) == 0)
  ------------------
  |  |  249|    164|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3139:7): [True: 0, False: 164]
  ------------------
 3140|      0|			continue;
 3141|    164|		indexInFolder++;
 3142|    164|		if (indexInFolder >= folders[folderIndex].numUnpackStreams) {
  ------------------
  |  Branch (3142:7): [True: 80, False: 84]
  ------------------
 3143|     80|			folderIndex++;
 3144|     80|			indexInFolder = 0;
 3145|     80|		}
 3146|    164|	}
 3147|       |
 3148|    161|	return (0);
 3149|    170|}
archive_read_support_format_7zip.c:files_info_numfiles_is_sane:
 2779|    272|{
 2780|    272|	int64_t empty_stream_map_bytes;
 2781|       |
 2782|    272|	if (zip->numFiles > SIZE_MAX / sizeof(*zip->entries))
  ------------------
  |  Branch (2782:6): [True: 0, False: 272]
  ------------------
 2783|      0|		return (0);
 2784|       |
 2785|    272|	if (zip->numFiles <= zip->si.ss.unpack_streams)
  ------------------
  |  Branch (2785:6): [True: 57, False: 215]
  ------------------
 2786|     57|		return (1);
 2787|       |
 2788|    215|	empty_stream_map_bytes = (zip->numFiles + 7) / 8;
 2789|    215|	return (empty_stream_map_bytes <= zip->header_bytes_remaining);
 2790|    272|}
archive_read_support_format_7zip.c:read_Times:
 3153|  1.77k|{
 3154|  1.77k|	struct _7zip *zip = a->format->data;
 3155|  1.77k|	const unsigned char *p;
 3156|  1.77k|	struct _7zip_entry *entries = zip->entries;
 3157|  1.77k|	unsigned char *timeBools = NULL;
 3158|  1.77k|	int allAreDefined;
 3159|  1.77k|	size_t dataIndex, i;
 3160|       |
 3161|       |	/* Read allAreDefined. */
 3162|  1.77k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3162:6): [True: 1, False: 1.77k]
  ------------------
 3163|      1|		goto failed;
 3164|  1.77k|	allAreDefined = *p;
 3165|       |
 3166|  1.77k|	if (!allAreDefined) {
  ------------------
  |  Branch (3166:6): [True: 699, False: 1.07k]
  ------------------
 3167|    699|		timeBools = calloc(zip->numFiles, sizeof(*timeBools));
 3168|    699|		if (timeBools == NULL)
  ------------------
  |  Branch (3168:7): [True: 0, False: 699]
  ------------------
 3169|      0|			goto failed;
 3170|    699|		if (read_Bools(a, timeBools, zip->numFiles) < 0)
  ------------------
  |  Branch (3170:7): [True: 1, False: 698]
  ------------------
 3171|      1|			goto failed;
 3172|    699|	}
 3173|       |
 3174|       |	/* Read external. */
 3175|  1.76k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3175:6): [True: 5, False: 1.76k]
  ------------------
 3176|      5|		goto failed;
 3177|  1.76k|	if (*p) {
  ------------------
  |  Branch (3177:6): [True: 1.57k, False: 191]
  ------------------
 3178|  1.57k|		if (parse_7zip_size(a, &dataIndex) < 0)
  ------------------
  |  Branch (3178:7): [True: 12, False: 1.56k]
  ------------------
 3179|     12|			goto failed;
 3180|  1.57k|	}
 3181|       |
 3182|  5.01k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3182:14): [True: 3.27k, False: 1.74k]
  ------------------
 3183|  3.27k|		if (!allAreDefined && !timeBools[i])
  ------------------
  |  Branch (3183:7): [True: 2.20k, False: 1.06k]
  |  Branch (3183:25): [True: 1.61k, False: 595]
  ------------------
 3184|  1.61k|			continue;
 3185|  1.66k|		if ((p = header_bytes(a, 8)) == NULL)
  ------------------
  |  Branch (3185:7): [True: 9, False: 1.65k]
  ------------------
 3186|      9|			goto failed;
 3187|  1.65k|		switch (type) {
  ------------------
  |  Branch (3187:11): [True: 1.65k, False: 0]
  ------------------
 3188|    269|		case kCTime:
  ------------------
  |  |  140|    269|#define kCTime			0x12
  ------------------
  |  Branch (3188:3): [True: 269, False: 1.38k]
  ------------------
 3189|    269|			ntfs_to_unix(archive_le64dec(p),
 3190|    269|			    &(entries[i].ctime),
 3191|    269|			    &(entries[i].ctime_ns));
 3192|    269|			entries[i].flg |= CTIME_IS_SET;
  ------------------
  |  |  247|    269|#define CTIME_IS_SET	(1<<2)
  ------------------
 3193|    269|			break;
 3194|    855|		case kATime:
  ------------------
  |  |  141|    855|#define kATime			0x13
  ------------------
  |  Branch (3194:3): [True: 855, False: 797]
  ------------------
 3195|    855|			ntfs_to_unix(archive_le64dec(p),
 3196|    855|			    &(entries[i].atime),
 3197|    855|			    &(entries[i].atime_ns));
 3198|    855|			entries[i].flg |= ATIME_IS_SET;
  ------------------
  |  |  246|    855|#define ATIME_IS_SET	(1<<1)
  ------------------
 3199|    855|			break;
 3200|    528|		case kMTime:
  ------------------
  |  |  142|    528|#define kMTime			0x14
  ------------------
  |  Branch (3200:3): [True: 528, False: 1.12k]
  ------------------
 3201|    528|			ntfs_to_unix(archive_le64dec(p),
 3202|    528|			    &(entries[i].mtime),
 3203|    528|			    &(entries[i].mtime_ns));
 3204|    528|			entries[i].flg |= MTIME_IS_SET;
  ------------------
  |  |  245|    528|#define MTIME_IS_SET	(1<<0)
  ------------------
 3205|    528|			break;
 3206|  1.65k|		}
 3207|  1.65k|	}
 3208|       |
 3209|  1.74k|	free(timeBools);
 3210|  1.74k|	return (0);
 3211|     28|failed:
 3212|     28|	free(timeBools);
 3213|     28|	return (-1);
 3214|  1.75k|}
archive_read_support_format_7zip.c:free_Header:
 2766|    829|{
 2767|    829|	free(h->emptyStreamBools);
 2768|    829|	free(h->emptyFileBools);
 2769|    829|	free(h->antiBools);
 2770|    829|	free(h->attrBools);
 2771|    829|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data:
 1095|  5.31k|{
 1096|  5.31k|	struct _7zip *zip = a->format->data;
 1097|  5.31k|	ssize_t bytes;
 1098|  5.31k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  5.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1099|       |
 1100|  5.31k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  5.31k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1100:6): [True: 0, False: 5.31k]
  ------------------
 1101|      0|		zip->has_encrypted_entries = 0;
 1102|      0|	}
 1103|       |
 1104|  5.31k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1104:6): [True: 7, False: 5.30k]
  ------------------
 1105|      7|		read_consume(a);
 1106|       |
 1107|  5.31k|	*offset = zip->entry_offset;
 1108|  5.31k|	*size = 0;
 1109|  5.31k|	*buff = NULL;
 1110|       |	/*
 1111|       |	 * If we hit end-of-entry last time, clean up and return
 1112|       |	 * ARCHIVE_EOF this time.
 1113|       |	 */
 1114|  5.31k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1114:6): [True: 5.18k, False: 126]
  ------------------
 1115|  5.18k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  5.18k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1116|       |
 1117|    126|	size_t bytes_to_read = MAX_READ;
  ------------------
  |  |  396|    126|#define MAX_READ	16 * 1024 * 1024
  ------------------
 1118|    126|	if ((int64_t)bytes_to_read > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (1118:6): [True: 120, False: 6]
  ------------------
 1119|    120|		bytes_to_read = (size_t)zip->entry_bytes_remaining;
 1120|    120|	}
 1121|    126|	bytes = read_stream(a, buff, bytes_to_read, 0);
 1122|    126|	if (bytes < 0)
  ------------------
  |  Branch (1122:6): [True: 27, False: 99]
  ------------------
 1123|     27|		return ((int)bytes);
 1124|     99|	if (bytes == 0) {
  ------------------
  |  Branch (1124:6): [True: 8, False: 91]
  ------------------
 1125|      8|		archive_set_error(&a->archive,
 1126|      8|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1127|      8|		    "Truncated 7-Zip file body");
 1128|      8|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1129|      8|	}
 1130|     91|	zip->entry_bytes_remaining -= bytes;
 1131|     91|	if (zip->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1131:6): [True: 87, False: 4]
  ------------------
 1132|     87|		zip->end_of_entry = 1;
 1133|       |
 1134|       |	/* Update checksum */
 1135|     91|	if ((zip->entry->flg & CRC32_IS_SET) && bytes)
  ------------------
  |  |  248|     91|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1135:6): [True: 91, False: 0]
  |  Branch (1135:42): [True: 91, False: 0]
  ------------------
 1136|     91|		zip->entry_crc32 = crc32(zip->entry_crc32, *buff,
 1137|     91|		    (unsigned)bytes);
 1138|       |
 1139|       |	/* If we hit the end, swallow any end-of-data marker. */
 1140|     91|	if (zip->end_of_entry) {
  ------------------
  |  Branch (1140:6): [True: 87, False: 4]
  ------------------
 1141|       |		/* Check computed CRC against file contents. */
 1142|     87|		if ((zip->entry->flg & CRC32_IS_SET) &&
  ------------------
  |  |  248|     87|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1142:7): [True: 87, False: 0]
  ------------------
 1143|     87|			zip->si.ss.digests[zip->entry->ssIndex] !=
  ------------------
  |  Branch (1143:4): [True: 82, False: 5]
  ------------------
 1144|     87|		    zip->entry_crc32) {
 1145|     82|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     82|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1146|     82|			    "7-Zip bad CRC: 0x%lx should be 0x%lx",
 1147|     82|			    zip->entry_crc32,
 1148|     82|			    (unsigned long)zip->si.ss.digests[
 1149|     82|			    		zip->entry->ssIndex]);
 1150|     82|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     82|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1151|     82|		}
 1152|     87|	}
 1153|       |
 1154|     91|	*size = bytes;
 1155|     91|	*offset = zip->entry_offset;
 1156|     91|	zip->entry_offset += bytes;
 1157|       |
 1158|     91|	return (ret);
 1159|     99|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data_skip:
 1163|  5.26k|{
 1164|  5.26k|	struct _7zip *zip = a->format->data;
 1165|  5.26k|	int r;
 1166|       |
 1167|  5.26k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1167:6): [True: 55, False: 5.21k]
  ------------------
 1168|     55|		read_consume(a);
 1169|       |
 1170|       |	/* If we've already read to end of data, we're done. */
 1171|  5.26k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1171:6): [True: 5.26k, False: 0]
  ------------------
 1172|  5.26k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.26k|#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|  11.9k|{
 1191|  11.9k|	struct _7zip *zip = a->format->data;
 1192|       |
 1193|  11.9k|	free_StreamsInfo(&(zip->si));
 1194|  11.9k|	free(zip->entries);
 1195|  11.9k|	free(zip->entry_names);
 1196|  11.9k|	free_decompression(a, zip);
 1197|  11.9k|	free(zip->uncompressed_buffer);
 1198|  11.9k|	free(zip->sub_stream_buff[0]);
 1199|  11.9k|	free(zip->sub_stream_buff[1]);
 1200|  11.9k|	free(zip->sub_stream_buff[2]);
 1201|  11.9k|	free(zip->tmp_stream_buff);
 1202|  11.9k|	free(zip);
 1203|  11.9k|	a->format->data = NULL;
 1204|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1205|  11.9k|}
archive_read_support_format_7zip.c:free_decompression:
 2013|  11.9k|{
 2014|  11.9k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#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|  11.9k|#ifdef HAVE_LZMA_H
 2021|  11.9k|	if (zip->lzstream_valid)
  ------------------
  |  Branch (2021:6): [True: 45, False: 11.8k]
  ------------------
 2022|     45|		lzma_end(&(zip->lzstream));
 2023|  11.9k|#endif
 2024|  11.9k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 2025|  11.9k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (2025:6): [True: 0, False: 11.9k]
  ------------------
 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|  11.9k|#endif
 2035|  11.9k|#ifdef HAVE_ZLIB_H
 2036|  11.9k|	if (zip->stream_valid) {
  ------------------
  |  Branch (2036:6): [True: 0, False: 11.9k]
  ------------------
 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|  11.9k|#endif
 2046|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 2047|       |	if (zip->zstdstream_valid)
 2048|       |		ZSTD_freeDStream(zip->zstd_dstream);
 2049|       |#endif
 2050|  11.9k|	if (zip->ppmd7_valid) {
  ------------------
  |  Branch (2050:6): [True: 111, False: 11.8k]
  ------------------
 2051|    111|		__archive_ppmd7_functions.Ppmd7_Free(
 2052|    111|			&zip->ppmd7_context);
 2053|    111|		zip->ppmd7_valid = 0;
 2054|    111|	}
 2055|  11.9k|	return (r);
 2056|  11.9k|}

archive_read_support_format_all:
   33|  11.9k|{
   34|  11.9k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
   35|  11.9k|	    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|  11.9k|	archive_read_support_format_ar(a);
   57|  11.9k|	archive_read_support_format_cpio(a);
   58|  11.9k|	archive_read_support_format_empty(a);
   59|  11.9k|	archive_read_support_format_lha(a);
   60|  11.9k|	archive_read_support_format_mtree(a);
   61|  11.9k|	archive_read_support_format_tar(a);
   62|  11.9k|	archive_read_support_format_xar(a);
   63|  11.9k|	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|  11.9k|	archive_read_support_format_7zip(a);
   72|  11.9k|	archive_read_support_format_cab(a);
   73|  11.9k|	archive_read_support_format_rar(a);
   74|  11.9k|	archive_read_support_format_rar5(a);
   75|  11.9k|	archive_read_support_format_iso9660(a);
   76|       |	/* Seek is really bad, since it forces the read-ahead
   77|       |	 * logic to discard buffered data. */
   78|  11.9k|	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|  11.9k|	archive_clear_error(a);
   87|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   88|  11.9k|}

archive_read_support_format_ar:
   99|  11.9k|{
  100|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  101|  11.9k|	struct ar *ar;
  102|  11.9k|	int r;
  103|       |
  104|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  105|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
  106|       |
  107|  11.9k|	ar = calloc(1, sizeof(*ar));
  108|  11.9k|	if (ar == NULL) {
  ------------------
  |  Branch (108:6): [True: 0, False: 11.9k]
  ------------------
  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|  11.9k|	ar->strtab = NULL;
  113|       |
  114|  11.9k|	r = __archive_read_register_format(a,
  115|  11.9k|	    ar,
  116|  11.9k|	    "ar",
  117|  11.9k|	    archive_read_format_ar_bid,
  118|  11.9k|	    NULL,
  119|  11.9k|	    archive_read_format_ar_read_header,
  120|  11.9k|	    archive_read_format_ar_read_data,
  121|  11.9k|	    archive_read_format_ar_skip,
  122|  11.9k|	    NULL,
  123|  11.9k|	    archive_read_format_ar_cleanup,
  124|  11.9k|	    NULL,
  125|  11.9k|	    NULL);
  126|       |
  127|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (127:6): [True: 0, False: 11.9k]
  ------------------
  128|      0|		free(ar);
  129|  11.9k|	return (r);
  130|  11.9k|}
archive_read_support_format_ar.c:archive_read_format_ar_cleanup:
  134|  11.9k|{
  135|  11.9k|	struct ar *ar = a->format->data;
  136|       |
  137|  11.9k|	free(ar->strtab);
  138|  11.9k|	free(ar);
  139|  11.9k|	a->format->data = NULL;
  140|       |
  141|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  142|  11.9k|}
archive_read_support_format_ar.c:archive_read_format_ar_bid:
  146|  11.7k|{
  147|  11.7k|	const void *h;
  148|       |
  149|  11.7k|	(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|  11.7k|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (155:6): [True: 17, False: 11.7k]
  ------------------
  156|     17|		return (-1);
  157|  11.7k|	if (memcmp(h, "!<arch>\n", 8) == 0) {
  ------------------
  |  Branch (157:6): [True: 140, False: 11.6k]
  ------------------
  158|    140|		return (64);
  159|    140|	}
  160|  11.6k|	return (-1);
  161|  11.7k|}
archive_read_support_format_ar.c:archive_read_format_ar_read_header:
  398|  3.30k|{
  399|  3.30k|	struct ar *ar = a->format->data;
  400|  3.30k|	int64_t unconsumed;
  401|  3.30k|	const void *header_data;
  402|  3.30k|	int ret;
  403|       |
  404|  3.30k|	if (!ar->read_global_header) {
  ------------------
  |  Branch (404:6): [True: 140, False: 3.16k]
  ------------------
  405|       |		/*
  406|       |		 * We are at the beginning of the archive now,
  407|       |		 * so we have to consume the ar global header first.
  408|       |		 */
  409|    140|		__archive_read_consume(a, 8);
  410|    140|		ar->read_global_header = 1;
  411|       |		/* Set a default format code for now. */
  412|    140|		a->archive.archive_format = ARCHIVE_FORMAT_AR;
  ------------------
  |  |  376|    140|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  413|    140|	}
  414|       |
  415|       |	/* Read the header for the next file entry. */
  416|  3.30k|	if ((header_data = __archive_read_ahead(a, 60, NULL)) == NULL)
  ------------------
  |  Branch (416:6): [True: 60, False: 3.24k]
  ------------------
  417|       |		/* Broken header. */
  418|     60|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     60|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  419|       |
  420|  3.24k|	unconsumed = 60;
  421|       |
  422|  3.24k|	ret = _ar_read_header(a, entry, ar, (const char *)header_data, &unconsumed);
  423|       |
  424|  3.24k|	if (unconsumed)
  ------------------
  |  Branch (424:6): [True: 1.64k, False: 1.60k]
  ------------------
  425|  1.64k|		__archive_read_consume(a, unconsumed);
  426|       |
  427|  3.24k|	return ret;
  428|  3.30k|}
archive_read_support_format_ar.c:_ar_read_header:
  166|  3.24k|{
  167|  3.24k|	char filename[AR_name_size + 1];
  168|  3.24k|	uint64_t number; /* Used to hold parsed numbers before validation. */
  169|  3.24k|	char *p;
  170|  3.24k|	const void *b;
  171|       |
  172|       |	/* Verify the magic signature on the file header. */
  173|  3.24k|	if (strncmp(h + AR_fmag_offset, "`\n", 2) != 0) {
  ------------------
  |  |   81|  3.24k|#define AR_fmag_offset 58
  ------------------
  |  Branch (173:6): [True: 51, False: 3.19k]
  ------------------
  174|     51|		archive_set_error(&a->archive, EINVAL,
  175|     51|		    "Incorrect file header signature");
  176|     51|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     51|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  177|     51|	}
  178|       |
  179|       |	/* Copy filename into work buffer. */
  180|  3.19k|	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   69|  3.19k|#define AR_name_offset 0
  ------------------
              	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   70|  3.19k|#define AR_name_size 16
  ------------------
  181|  3.19k|	filename[AR_name_size] = '\0';
  ------------------
  |  |   70|  3.19k|#define AR_name_size 16
  ------------------
  182|       |
  183|       |	/*
  184|       |	 * Guess the format variant based on the filename.
  185|       |	 */
  186|  3.19k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR) {
  ------------------
  |  |  376|  3.19k|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (186:6): [True: 241, False: 2.95k]
  ------------------
  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|    241|		if (strncmp(filename, "#1/", 3) == 0)
  ------------------
  |  Branch (194:7): [True: 44, False: 197]
  ------------------
  195|     44|			a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
  ------------------
  |  |  378|     44|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|     44|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  196|    197|		else if (strchr(filename, '/') != NULL)
  ------------------
  |  Branch (196:12): [True: 84, False: 113]
  ------------------
  197|     84|			a->archive.archive_format = ARCHIVE_FORMAT_AR_GNU;
  ------------------
  |  |  377|     84|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|     84|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  198|    113|		else if (strncmp(filename, "__.SYMDEF", 9) == 0)
  ------------------
  |  Branch (198:12): [True: 0, False: 113]
  ------------------
  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|    241|	}
  206|       |
  207|       |	/* Update format name from the code. */
  208|  3.19k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR_GNU)
  ------------------
  |  |  377|  3.19k|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|  3.19k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (208:6): [True: 1.98k, False: 1.21k]
  ------------------
  209|  1.98k|		a->archive.archive_format_name = "ar (GNU/SVR4)";
  210|  1.21k|	else if (a->archive.archive_format == ARCHIVE_FORMAT_AR_BSD)
  ------------------
  |  |  378|  1.21k|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|  1.21k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (210:11): [True: 1.10k, False: 113]
  ------------------
  211|  1.10k|		a->archive.archive_format_name = "ar (BSD)";
  212|    113|	else
  213|    113|		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|  3.19k|	p = filename + AR_name_size - 1;
  ------------------
  |  |   70|  3.19k|#define AR_name_size 16
  ------------------
  223|  4.93k|	while (p >= filename && *p == ' ') {
  ------------------
  |  Branch (223:9): [True: 4.93k, False: 0]
  |  Branch (223:26): [True: 1.73k, False: 3.19k]
  ------------------
  224|  1.73k|		*p = '\0';
  225|  1.73k|		p--;
  226|  1.73k|	}
  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|  3.19k|	if (filename[0] != '/' && p > filename && *p == '/') {
  ------------------
  |  Branch (235:6): [True: 2.77k, False: 422]
  |  Branch (235:28): [True: 2.73k, False: 34]
  |  Branch (235:44): [True: 11, False: 2.72k]
  ------------------
  236|     11|		*p = '\0';
  237|     11|	}
  238|       |
  239|  3.19k|	if (p < filename) {
  ------------------
  |  Branch (239:6): [True: 0, False: 3.19k]
  ------------------
  240|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  241|      0|		    "Found entry with empty filename");
  242|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  243|      0|	}
  244|       |
  245|       |	/*
  246|       |	 * Parse the time, owner, mode, size fields.
  247|       |	 * This must come before any call to _read_ahead.
  248|       |	 */
  249|  3.19k|	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|  3.19k|	if (strcmp(filename, "//") == 0) {
  ------------------
  |  Branch (255:6): [True: 30, False: 3.16k]
  ------------------
  256|     30|		char *st;
  257|     30|		size_t entry_size;
  258|       |
  259|     30|		archive_entry_copy_pathname(entry, filename);
  260|       |		/* Get the size of the filename table. */
  261|     30|		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|     30|#define AR_size_offset 48
  ------------------
              		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   80|     30|#define AR_size_size 10
  ------------------
  262|     30|		if (number > SIZE_MAX || number > 1024 * 1024 * 1024) {
  ------------------
  |  Branch (262:7): [True: 0, False: 30]
  |  Branch (262:28): [True: 0, False: 30]
  ------------------
  263|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  264|      0|			    "Filename table too large");
  265|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  266|      0|		}
  267|     30|		entry_size = (size_t)number;
  268|     30|		if (entry_size == 0) {
  ------------------
  |  Branch (268:7): [True: 0, False: 30]
  ------------------
  269|      0|			archive_set_error(&a->archive, EINVAL,
  270|      0|			    "Invalid string table");
  271|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  272|      0|		}
  273|     30|		if (ar->strtab != NULL) {
  ------------------
  |  Branch (273:7): [True: 0, False: 30]
  ------------------
  274|      0|			archive_set_error(&a->archive, EINVAL,
  275|      0|			    "More than one string table exists");
  276|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  277|      0|		}
  278|       |
  279|       |		/* Read the filename table into memory. */
  280|     30|		st = malloc(entry_size);
  281|     30|		if (st == NULL) {
  ------------------
  |  Branch (281:7): [True: 0, False: 30]
  ------------------
  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|     30|		ar->strtab = st;
  287|     30|		ar->strtab_size = entry_size;
  288|       |
  289|     30|		if (*unconsumed) {
  ------------------
  |  Branch (289:7): [True: 30, False: 0]
  ------------------
  290|     30|			__archive_read_consume(a, *unconsumed);
  291|     30|			*unconsumed = 0;
  292|     30|		}
  293|       |
  294|     30|		if ((b = __archive_read_ahead(a, entry_size, NULL)) == NULL)
  ------------------
  |  Branch (294:7): [True: 0, False: 30]
  ------------------
  295|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  296|     30|		memcpy(st, b, entry_size);
  297|     30|		__archive_read_consume(a, entry_size);
  298|       |		/* All contents are consumed. */
  299|     30|		ar->entry_bytes_remaining = 0;
  300|     30|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  301|       |
  302|       |		/* Parse the filename table. */
  303|     30|		return (ar_parse_gnu_filename_table(a));
  304|     30|	}
  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|  3.16k|	if (filename[0] == '/' && filename[1] >= '0' && filename[1] <= '9') {
  ------------------
  |  Branch (312:6): [True: 392, False: 2.77k]
  |  Branch (312:28): [True: 302, False: 90]
  |  Branch (312:50): [True: 299, False: 3]
  ------------------
  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: 0, False: 299]
  |  Branch (315:29): [True: 8, False: 291]
  ------------------
  316|      8|			archive_set_error(&a->archive, EINVAL,
  317|      8|			    "Can't find long filename for GNU/SVR4 archive entry");
  318|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  319|      8|		}
  320|       |
  321|    291|		archive_entry_copy_pathname(entry, &ar->strtab[(size_t)number]);
  322|    291|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    291|#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.86k|	if (strncmp(filename, "#1/", 3) == 0) {
  ------------------
  |  Branch (330:6): [True: 1.57k, False: 1.28k]
  ------------------
  331|  1.57k|		size_t bsd_name_length;
  332|       |
  333|       |		/* Parse the size of the name, adjust the file size. */
  334|  1.57k|		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   69|  1.57k|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   70|  1.57k|#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.57k|		if (number > SIZE_MAX - 1
  ------------------
  |  Branch (340:7): [True: 0, False: 1.57k]
  ------------------
  341|  1.57k|		    || number > 1024 * 1024
  ------------------
  |  Branch (341:10): [True: 2, False: 1.57k]
  ------------------
  342|  1.57k|		    || number > (uint64_t)ar->entry_bytes_remaining) {
  ------------------
  |  Branch (342:10): [True: 2, False: 1.57k]
  ------------------
  343|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  344|      4|			    "Bad input file size");
  345|      4|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  346|      4|		}
  347|  1.57k|		bsd_name_length = (size_t)number;
  348|  1.57k|		ar->entry_bytes_remaining -= bsd_name_length;
  349|       |		/* Adjust file size reported to client. */
  350|  1.57k|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  351|       |
  352|  1.57k|		if (*unconsumed) {
  ------------------
  |  Branch (352:7): [True: 1.57k, False: 0]
  ------------------
  353|  1.57k|			__archive_read_consume(a, *unconsumed);
  354|  1.57k|			*unconsumed = 0;
  355|  1.57k|		}
  356|       |
  357|       |		/* Read the long name into memory. */
  358|  1.57k|		if ((b = __archive_read_ahead(a, bsd_name_length, NULL)) == NULL) {
  ------------------
  |  Branch (358:7): [True: 3, False: 1.57k]
  ------------------
  359|      3|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  360|      3|			    "Truncated input file");
  361|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  362|      3|		}
  363|       |		/* Store it in the entry. */
  364|  1.57k|		p = malloc(bsd_name_length + 1);
  365|  1.57k|		if (p == NULL) {
  ------------------
  |  Branch (365:7): [True: 0, False: 1.57k]
  ------------------
  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.57k|		strncpy(p, b, bsd_name_length);
  371|  1.57k|		p[bsd_name_length] = '\0';
  372|       |
  373|  1.57k|		__archive_read_consume(a, bsd_name_length);
  374|       |
  375|  1.57k|		archive_entry_copy_pathname(entry, p);
  376|  1.57k|		free(p);
  377|  1.57k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.57k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  378|  1.57k|	}
  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|  1.28k|	archive_entry_copy_pathname(entry, filename);
  392|  1.28k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  393|  2.86k|}
archive_read_support_format_ar.c:ar_parse_common_header:
  434|  3.19k|{
  435|  3.19k|	int64_t n;
  436|       |
  437|       |	/* Copy remaining header */
  438|  3.19k|	archive_entry_set_mtime(entry,
  439|  3.19k|	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   71|  3.19k|#define AR_date_offset 16
  ------------------
              	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   72|  3.19k|#define AR_date_size 12
  ------------------
  440|  3.19k|	archive_entry_set_uid(entry,
  441|  3.19k|	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   73|  3.19k|#define AR_uid_offset 28
  ------------------
              	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   74|  3.19k|#define AR_uid_size 6
  ------------------
  442|  3.19k|	archive_entry_set_gid(entry,
  443|  3.19k|	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   75|  3.19k|#define AR_gid_offset 34
  ------------------
              	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   76|  3.19k|#define AR_gid_size 6
  ------------------
  444|  3.19k|	archive_entry_set_mode(entry,
  445|  3.19k|	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   77|  3.19k|#define AR_mode_offset 40
  ------------------
              	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   78|  3.19k|#define AR_mode_size 8
  ------------------
  446|  3.19k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  3.19k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  447|  3.19k|	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|  3.19k|#define AR_size_offset 48
  ------------------
              	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   80|  3.19k|#define AR_size_size 10
  ------------------
  448|       |
  449|  3.19k|	ar->entry_offset = 0;
  450|  3.19k|	ar->entry_padding = n % 2;
  451|  3.19k|	archive_entry_set_size(entry, n);
  452|  3.19k|	ar->entry_bytes_remaining = n;
  453|  3.19k|}
archive_read_support_format_ar.c:ar_atol8:
  551|  3.19k|{
  552|  3.19k|	uint64_t l;
  553|  3.19k|	unsigned int digit, base;
  554|       |
  555|  3.19k|	base = 8;
  556|       |
  557|  13.7k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (557:10): [True: 4.31k, False: 9.41k]
  |  Branch (557:23): [True: 6.34k, False: 3.07k]
  |  Branch (557:38): [True: 10.5k, False: 122]
  ------------------
  558|  10.5k|		p++;
  559|       |
  560|  3.19k|	l = 0;
  561|  3.19k|	digit = *p - '0';
  562|  3.77k|	while (*p >= '0' && digit < base && char_cnt-- > 0) {
  ------------------
  |  Branch (562:9): [True: 1.85k, False: 1.91k]
  |  Branch (562:22): [True: 597, False: 1.26k]
  |  Branch (562:38): [True: 582, False: 15]
  ------------------
  563|    582|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (563:7): [True: 0, False: 582]
  ------------------
  564|    582|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (564:7): [True: 0, False: 582]
  ------------------
  565|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  566|      0|			break;
  567|      0|		}
  568|    582|		digit = *++p - '0';
  569|    582|	}
  570|  3.19k|	return (l);
  571|  3.19k|}
archive_read_support_format_ar.c:ar_atol10:
  575|  14.6k|{
  576|  14.6k|	uint64_t l;
  577|  14.6k|	unsigned int base, digit;
  578|       |
  579|  14.6k|	base = 10;
  580|       |
  581|  52.3k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (581:10): [True: 17.2k, False: 35.1k]
  |  Branch (581:23): [True: 22.3k, False: 12.7k]
  |  Branch (581:38): [True: 37.6k, False: 1.89k]
  ------------------
  582|  37.6k|		p++;
  583|  14.6k|	l = 0;
  584|  14.6k|	digit = *p - '0';
  585|  30.2k|	while (*p >= '0' && digit < base  && char_cnt-- > 0) {
  ------------------
  |  Branch (585:9): [True: 20.0k, False: 10.2k]
  |  Branch (585:22): [True: 16.1k, False: 3.86k]
  |  Branch (585:39): [True: 15.5k, False: 579]
  ------------------
  586|  15.5k|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (586:7): [True: 0, False: 15.5k]
  ------------------
  587|  15.5k|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (587:7): [True: 0, False: 15.5k]
  ------------------
  588|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  589|      0|			break;
  590|      0|		}
  591|  15.5k|		digit = *++p - '0';
  592|  15.5k|	}
  593|  14.6k|	return (l);
  594|  14.6k|}
archive_read_support_format_ar.c:ar_parse_gnu_filename_table:
  514|     30|{
  515|     30|	struct ar *ar = a->format->data;
  516|     30|	char *p;
  517|     30|	size_t size;
  518|       |
  519|     30|	size = ar->strtab_size;
  520|       |
  521|  2.45k|	for (p = ar->strtab; p < ar->strtab + size - 1; ++p) {
  ------------------
  |  Branch (521:23): [True: 2.43k, False: 25]
  ------------------
  522|  2.43k|		if (*p == '/') {
  ------------------
  |  Branch (522:7): [True: 276, False: 2.15k]
  ------------------
  523|    276|			*p++ = '\0';
  524|    276|			if (*p != '\n')
  ------------------
  |  Branch (524:8): [True: 5, False: 271]
  ------------------
  525|      5|				goto bad_string_table;
  526|    271|			*p = '\0';
  527|    271|		}
  528|  2.43k|	}
  529|       |	/*
  530|       |	 * GNU ar always pads the table to an even size.
  531|       |	 * The pad character is either '\n' or '`'.
  532|       |	 */
  533|     25|	if (p != ar->strtab + size && *p != '\n' && *p != '`')
  ------------------
  |  Branch (533:6): [True: 24, False: 1]
  |  Branch (533:32): [True: 23, False: 1]
  |  Branch (533:46): [True: 2, False: 21]
  ------------------
  534|      2|		goto bad_string_table;
  535|       |
  536|       |	/* Enforce zero termination. */
  537|     23|	ar->strtab[size - 1] = '\0';
  538|       |
  539|     23|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  540|       |
  541|      7|bad_string_table:
  542|      7|	archive_set_error(&a->archive, EINVAL,
  543|      7|	    "Invalid string table");
  544|      7|	free(ar->strtab);
  545|      7|	ar->strtab = NULL;
  546|      7|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  547|     25|}
archive_read_support_format_ar.c:archive_read_format_ar_read_data:
  458|  7.08k|{
  459|  7.08k|	struct ar *ar = a->format->data;
  460|  7.08k|	ssize_t bytes_read;
  461|       |
  462|  7.08k|	if (ar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (462:6): [True: 1.95k, False: 5.12k]
  ------------------
  463|  1.95k|		__archive_read_consume(a, ar->entry_bytes_unconsumed);
  464|  1.95k|		ar->entry_bytes_unconsumed = 0;
  465|  1.95k|	}
  466|       |
  467|  7.08k|	if (ar->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (467:6): [True: 1.96k, False: 5.12k]
  ------------------
  468|  1.96k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  469|  1.96k|		if (bytes_read == 0) {
  ------------------
  |  Branch (469:7): [True: 6, False: 1.95k]
  ------------------
  470|      6|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  471|      6|			    "Truncated ar archive");
  472|      6|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  473|      6|		}
  474|  1.95k|		if (bytes_read < 0)
  ------------------
  |  Branch (474:7): [True: 0, False: 1.95k]
  ------------------
  475|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  476|  1.95k|		if (bytes_read > ar->entry_bytes_remaining)
  ------------------
  |  Branch (476:7): [True: 1.95k, False: 5]
  ------------------
  477|  1.95k|			bytes_read = (ssize_t)ar->entry_bytes_remaining;
  478|  1.95k|		*size = bytes_read;
  479|  1.95k|		ar->entry_bytes_unconsumed = bytes_read;
  480|  1.95k|		*offset = ar->entry_offset;
  481|  1.95k|		ar->entry_offset += bytes_read;
  482|  1.95k|		ar->entry_bytes_remaining -= bytes_read;
  483|  1.95k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.95k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  484|  5.12k|	} else {
  485|  5.12k|		if (__archive_read_consume(a, ar->entry_padding) < 0)
  ------------------
  |  Branch (485:7): [True: 1, False: 5.12k]
  ------------------
  486|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  487|  5.12k|		ar->entry_padding = 0;
  488|  5.12k|		*buff = NULL;
  489|  5.12k|		*size = 0;
  490|  5.12k|		*offset = ar->entry_offset;
  491|  5.12k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  5.12k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  492|  5.12k|	}
  493|  7.08k|}
archive_read_support_format_ar.c:archive_read_format_ar_skip:
  497|  3.16k|{
  498|  3.16k|	struct ar *ar = a->format->data;
  499|       |
  500|  3.16k|	if (__archive_read_consume(a,
  ------------------
  |  Branch (500:6): [True: 0, False: 3.16k]
  ------------------
  501|  3.16k|	    ar->entry_bytes_remaining + ar->entry_padding +
  502|  3.16k|	    ar->entry_bytes_unconsumed) < 0)
  503|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  504|       |
  505|  3.16k|	ar->entry_bytes_remaining = 0;
  506|  3.16k|	ar->entry_bytes_unconsumed = 0;
  507|  3.16k|	ar->entry_padding = 0;
  508|       |
  509|  3.16k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  510|  3.16k|}

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

archive_read_support_format_cpio:
  227|  11.9k|{
  228|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  229|  11.9k|	struct cpio *cpio;
  230|  11.9k|	int r;
  231|       |
  232|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  233|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cpio");
  234|       |
  235|  11.9k|	cpio = calloc(1, sizeof(*cpio));
  236|  11.9k|	if (cpio == NULL) {
  ------------------
  |  Branch (236:6): [True: 0, False: 11.9k]
  ------------------
  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|  11.9k|	cpio->magic = CPIO_MAGIC;
  ------------------
  |  |  176|  11.9k|#define	CPIO_MAGIC   0x13141516
  ------------------
  241|       |
  242|  11.9k|	r = __archive_read_register_format(a,
  243|  11.9k|	    cpio,
  244|  11.9k|	    "cpio",
  245|  11.9k|	    archive_read_format_cpio_bid,
  246|  11.9k|	    archive_read_format_cpio_options,
  247|  11.9k|	    archive_read_format_cpio_read_header,
  248|  11.9k|	    archive_read_format_cpio_read_data,
  249|  11.9k|	    archive_read_format_cpio_skip,
  250|  11.9k|	    NULL,
  251|  11.9k|	    archive_read_format_cpio_cleanup,
  252|  11.9k|	    NULL,
  253|  11.9k|	    NULL);
  254|       |
  255|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (255:6): [True: 0, False: 11.9k]
  ------------------
  256|      0|		free(cpio);
  257|  11.9k|	return (r);
  258|  11.9k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_bid:
  263|  11.7k|{
  264|  11.7k|	struct cpio *cpio = a->format->data;
  265|  11.7k|	const unsigned char *p;
  266|  11.7k|	int bid;
  267|       |
  268|  11.7k|	(void)best_bid; /* UNUSED */
  269|       |
  270|  11.7k|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL)
  ------------------
  |  Branch (270:6): [True: 17, False: 11.7k]
  ------------------
  271|     17|		return (-1);
  272|       |
  273|  11.7k|	bid = 0;
  274|  11.7k|	if (memcmp(p, "070707", 6) == 0) {
  ------------------
  |  Branch (274:6): [True: 35, False: 11.7k]
  ------------------
  275|       |		/* ASCII cpio archive (odc, POSIX.1) */
  276|     35|		cpio->read_header = header_odc;
  277|     35|		bid += 48;
  278|       |		/*
  279|       |		 * XXX TODO:  More verification; Could check that only octal
  280|       |		 * digits appear in appropriate header locations. XXX
  281|       |		 */
  282|  11.7k|	} else if (memcmp(p, "070727", 6) == 0) {
  ------------------
  |  Branch (282:13): [True: 169, False: 11.5k]
  ------------------
  283|       |		/* afio large ASCII cpio archive */
  284|    169|		cpio->read_header = header_odc;
  285|    169|		bid += 48;
  286|       |		/*
  287|       |		 * XXX TODO:  More verification; Could check that almost hex
  288|       |		 * digits appear in appropriate header locations. XXX
  289|       |		 */
  290|  11.5k|	} else if (memcmp(p, "070701", 6) == 0) {
  ------------------
  |  Branch (290:13): [True: 143, False: 11.3k]
  ------------------
  291|       |		/* ASCII cpio archive (SVR4 without CRC) */
  292|    143|		cpio->read_header = header_newc;
  293|    143|		bid += 48;
  294|       |		/*
  295|       |		 * XXX TODO:  More verification; Could check that only hex
  296|       |		 * digits appear in appropriate header locations. XXX
  297|       |		 */
  298|  11.3k|	} else if (memcmp(p, "070702", 6) == 0) {
  ------------------
  |  Branch (298:13): [True: 68, False: 11.3k]
  ------------------
  299|       |		/* ASCII cpio archive (SVR4 with CRC) */
  300|       |		/* XXX TODO: Flag that we should check the CRC. XXX */
  301|     68|		cpio->read_header = header_newc;
  302|     68|		bid += 48;
  303|       |		/*
  304|       |		 * XXX TODO:  More verification; Could check that only hex
  305|       |		 * digits appear in appropriate header locations. XXX
  306|       |		 */
  307|  11.3k|	} else if (archive_be16dec(p) == 070707) {
  ------------------
  |  Branch (307:13): [True: 41, False: 11.2k]
  ------------------
  308|       |		/* big-endian binary cpio archives */
  309|     41|		cpio->read_header = header_bin_be;
  310|     41|		bid += 16;
  311|       |		/* Is more verification possible here? */
  312|  11.2k|	} else if (archive_le16dec(p) == 070707) {
  ------------------
  |  Branch (312:13): [True: 17, False: 11.2k]
  ------------------
  313|       |		/* little-endian binary cpio archives */
  314|     17|		cpio->read_header = header_bin_le;
  315|     17|		bid += 16;
  316|       |		/* Is more verification possible here? */
  317|     17|	} else
  318|  11.2k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  11.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  319|       |
  320|    473|	return (bid);
  321|  11.7k|}
archive_read_support_format_cpio.c:header_odc:
  790|  1.63k|{
  791|  1.63k|	const void *h;
  792|  1.63k|	int r;
  793|  1.63k|	const char *header;
  794|       |
  795|  1.63k|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_POSIX;
  ------------------
  |  |  357|  1.63k|#define	ARCHIVE_FORMAT_CPIO_POSIX		(ARCHIVE_FORMAT_CPIO | 1)
  |  |  ------------------
  |  |  |  |  356|  1.63k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  796|  1.63k|	a->archive.archive_format_name = "POSIX octet-oriented cpio";
  797|       |
  798|       |	/* Find the start of the next header. */
  799|  1.63k|	r = find_odc_header(a);
  800|  1.63k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  1.63k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (800:6): [True: 145, False: 1.48k]
  ------------------
  801|    145|		return (r);
  802|       |
  803|  1.48k|	if (a->archive.archive_format == ARCHIVE_FORMAT_CPIO_AFIO_LARGE) {
  ------------------
  |  |  362|  1.48k|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|  1.48k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (803:6): [True: 53, False: 1.43k]
  ------------------
  804|     53|		int r2 = (header_afiol(a, cpio, entry, namelength, name_pad));
  805|     53|		if (r2 == ARCHIVE_OK)
  ------------------
  |  |  233|     53|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (805:7): [True: 29, False: 24]
  ------------------
  806|     29|			return (r);
  807|     24|		else
  808|     24|			return (r2);
  809|     53|	}
  810|       |
  811|       |	/* Read fixed-size portion of header. */
  812|  1.43k|	h = __archive_read_ahead(a, odc_header_size, NULL);
  ------------------
  |  |   93|  1.43k|#define	odc_header_size 76
  ------------------
  813|  1.43k|	if (h == NULL)
  ------------------
  |  Branch (813:6): [True: 0, False: 1.43k]
  ------------------
  814|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  815|       |
  816|       |	/* Parse out octal fields. */
  817|  1.43k|	header = (const char *)h;
  818|       |
  819|  1.43k|	archive_entry_set_dev(entry, 
  820|  1.43k|		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   73|  1.43k|#define	odc_dev_offset 6
  ------------------
              		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   74|  1.43k|#define	odc_dev_size 6
  ------------------
  821|  1.43k|	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   75|  1.43k|#define	odc_ino_offset 12
  ------------------
              	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   76|  1.43k|#define	odc_ino_size 6
  ------------------
  822|  1.43k|	archive_entry_set_mode(entry, 
  823|  1.43k|		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   77|  1.43k|#define	odc_mode_offset 18
  ------------------
              		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   78|  1.43k|#define	odc_mode_size 6
  ------------------
  824|  1.43k|	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   79|  1.43k|#define	odc_uid_offset 24
  ------------------
              	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   80|  1.43k|#define	odc_uid_size 6
  ------------------
  825|  1.43k|	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   81|  1.43k|#define	odc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   82|  1.43k|#define	odc_gid_size 6
  ------------------
  826|  1.43k|	archive_entry_set_nlink(entry, 
  827|  1.43k|		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   83|  1.43k|#define	odc_nlink_offset 36
  ------------------
              		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   84|  1.43k|#define	odc_nlink_size 6
  ------------------
  828|  1.43k|	archive_entry_set_rdev(entry,
  829|  1.43k|		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   85|  1.43k|#define	odc_rdev_offset 42
  ------------------
              		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   86|  1.43k|#define	odc_rdev_size 6
  ------------------
  830|  1.43k|	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   87|  1.43k|#define	odc_mtime_offset 48
  ------------------
              	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   88|  1.43k|#define	odc_mtime_size 11
  ------------------
  831|  1.43k|	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   89|  1.43k|#define	odc_namesize_offset 59
  ------------------
              	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   90|  1.43k|#define	odc_namesize_size 6
  ------------------
  832|  1.43k|	*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.43k|	cpio->entry_bytes_remaining =
  840|  1.43k|	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   91|  1.43k|#define	odc_filesize_offset 65
  ------------------
              	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   92|  1.43k|#define	odc_filesize_size 11
  ------------------
  841|  1.43k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  842|  1.43k|	cpio->entry_padding = 0;
  843|  1.43k|	__archive_read_consume(a, odc_header_size);
  ------------------
  |  |   93|  1.43k|#define	odc_header_size 76
  ------------------
  844|  1.43k|	return (r);
  845|  1.43k|}
archive_read_support_format_cpio.c:find_odc_header:
  712|  1.63k|{
  713|  1.63k|	const void *h;
  714|  1.63k|	const char *p, *q;
  715|  1.63k|	int64_t skip;
  716|  1.63k|	uintmax_t skipped = 0;
  717|  1.63k|	ssize_t bytes;
  718|       |
  719|  2.54k|	for (;;) {
  720|  2.54k|		size_t header_size;
  721|       |
  722|  2.54k|		header_size = afiol_header_size;
  ------------------
  |  |  162|  2.54k|#define afiol_header_size 116
  ------------------
  723|  2.54k|		h = __archive_read_ahead(a, afiol_header_size, &bytes);
  ------------------
  |  |  162|  2.54k|#define afiol_header_size 116
  ------------------
  724|  2.54k|		if (h == NULL) {
  ------------------
  |  Branch (724:7): [True: 283, False: 2.26k]
  ------------------
  725|    283|			if (bytes >= odc_header_size) {
  ------------------
  |  |   93|    283|#define	odc_header_size 76
  ------------------
  |  Branch (725:8): [True: 138, False: 145]
  ------------------
  726|    138|				header_size = odc_header_size;
  ------------------
  |  |   93|    138|#define	odc_header_size 76
  ------------------
  727|    138|				h = __archive_read_ahead(a, odc_header_size,
  ------------------
  |  |   93|    138|#define	odc_header_size 76
  ------------------
  728|    138|				    &bytes);
  729|    138|			}
  730|    283|			if (h == NULL)
  ------------------
  |  Branch (730:8): [True: 145, False: 138]
  ------------------
  731|    145|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    145|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  732|    283|		}
  733|  2.39k|		p = h;
  734|  2.39k|		q = p + bytes;
  735|       |
  736|       |		/* Try the typical case first, then go into the slow search.*/
  737|  2.39k|		if (memcmp("070707", p, 6) == 0 && is_octal(p, odc_header_size))
  ------------------
  |  |   93|    784|#define	odc_header_size 76
  ------------------
  |  Branch (737:7): [True: 784, False: 1.61k]
  |  Branch (737:38): [True: 362, False: 422]
  ------------------
  738|    362|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    362|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  739|  2.03k|		if (memcmp("070727", p, 6) == 0 && is_afio_large(p, bytes)) {
  ------------------
  |  Branch (739:7): [True: 205, False: 1.83k]
  |  Branch (739:38): [True: 2, False: 203]
  ------------------
  740|      2|			a->archive.archive_format = ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  362|      2|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|      2|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  741|      2|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  742|      2|		}
  743|       |
  744|       |		/*
  745|       |		 * Scan ahead until we find something that looks
  746|       |		 * like an odc header.
  747|       |		 */
  748|   894k|		while (p + header_size <= q) {
  ------------------
  |  Branch (748:10): [True: 893k, False: 912]
  ------------------
  749|   893k|			switch (p[5]) {
  750|   217k|			case '7':
  ------------------
  |  Branch (750:4): [True: 217k, False: 676k]
  ------------------
  751|   217k|				if ((memcmp("070707", p, 6) == 0
  ------------------
  |  Branch (751:10): [True: 30.4k, False: 187k]
  ------------------
  752|  30.4k|				    && is_octal(p, odc_header_size))
  ------------------
  |  |   93|  30.4k|#define	odc_header_size 76
  ------------------
  |  Branch (752:12): [True: 1.07k, False: 29.3k]
  ------------------
  753|   216k|				    || (memcmp("070727", p, 6) == 0
  ------------------
  |  Branch (753:13): [True: 51.8k, False: 164k]
  ------------------
  754|  51.8k|				        && is_afio_large(p, q - p))) {
  ------------------
  |  Branch (754:16): [True: 51, False: 51.7k]
  ------------------
  755|  1.12k|					skip = p - (const char *)h;
  756|  1.12k|					__archive_read_consume(a, skip);
  757|  1.12k|					skipped += skip;
  758|  1.12k|					if (p[4] == '2')
  ------------------
  |  Branch (758:10): [True: 51, False: 1.07k]
  ------------------
  759|     51|						a->archive.archive_format =
  760|     51|						    ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  362|     51|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|     51|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  761|  1.12k|					if (skipped > 0) {
  ------------------
  |  Branch (761:10): [True: 1.12k, False: 0]
  ------------------
  762|  1.12k|						archive_set_error(&a->archive,
  763|  1.12k|						    0,
  764|  1.12k|						    "Skipped %ju bytes before "
  765|  1.12k|						    "finding valid header",
  766|  1.12k|						    skipped);
  767|  1.12k|						return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.12k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  768|  1.12k|					}
  769|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  770|  1.12k|				}
  771|   216k|				p += 2;
  772|   216k|				break;
  773|   163k|			case '0':
  ------------------
  |  Branch (773:4): [True: 163k, False: 730k]
  ------------------
  774|   163k|				p++;
  775|   163k|				break;
  776|   512k|			default:
  ------------------
  |  Branch (776:4): [True: 512k, False: 381k]
  ------------------
  777|   512k|				p += 6;
  778|   512k|				break;
  779|   893k|			}
  780|   893k|		}
  781|    912|		skip = p - (const char *)h;
  782|    912|		__archive_read_consume(a, skip);
  783|    912|		skipped += skip;
  784|    912|	}
  785|  1.63k|}
archive_read_support_format_cpio.c:is_octal:
  680|  31.1k|{
  681|   796k|	while (len-- > 0) {
  ------------------
  |  Branch (681:9): [True: 794k, False: 1.43k]
  ------------------
  682|   794k|		if (*p < '0' || *p > '7')
  ------------------
  |  Branch (682:7): [True: 29.0k, False: 765k]
  |  Branch (682:19): [True: 660, False: 765k]
  ------------------
  683|  29.7k|			return (0);
  684|   765k|	        ++p;
  685|   765k|	}
  686|  1.43k|	return (1);
  687|  31.1k|}
archive_read_support_format_cpio.c:is_afio_large:
  691|  52.0k|{
  692|  52.0k|	if (len < afiol_header_size)
  ------------------
  |  |  162|  52.0k|#define afiol_header_size 116
  ------------------
  |  Branch (692:6): [True: 60, False: 51.9k]
  ------------------
  693|     60|		return (0);
  694|  51.9k|	if (h[afiol_ino_m_offset] != 'm'
  ------------------
  |  |  138|  51.9k|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
  |  Branch (694:6): [True: 43.9k, False: 8.02k]
  ------------------
  695|  8.02k|	    || h[afiol_mtime_n_offset] != 'n'
  ------------------
  |  |  151|  8.02k|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
  |  Branch (695:9): [True: 1.05k, False: 6.96k]
  ------------------
  696|  6.96k|	    || h[afiol_xsize_s_offset] != 's'
  ------------------
  |  |  158|  6.96k|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
  |  Branch (696:9): [True: 682, False: 6.28k]
  ------------------
  697|  6.28k|	    || h[afiol_filesize_c_offset] != ':')
  ------------------
  |  |  161|  6.28k|#define	afiol_filesize_c_offset 115	/* ':' */
  ------------------
  |  Branch (697:9): [True: 459, False: 5.82k]
  ------------------
  698|  46.1k|		return (0);
  699|  5.82k|	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  134|  5.82k|#define	afiol_dev_offset 6
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  138|  5.82k|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  134|  5.82k|#define	afiol_dev_offset 6
  ------------------
  |  Branch (699:6): [True: 1.24k, False: 4.57k]
  ------------------
  700|  1.24k|		return (0);
  701|  4.57k|	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  139|  4.57k|#define	afiol_mode_offset 31
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  151|  4.57k|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  139|  4.57k|#define	afiol_mode_offset 31
  ------------------
  |  Branch (701:6): [True: 1.70k, False: 2.87k]
  ------------------
  702|  1.70k|		return (0);
  703|  2.87k|	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  152|  2.87k|#define	afiol_namesize_offset 86
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  158|  2.87k|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  152|  2.87k|#define	afiol_namesize_offset 86
  ------------------
  |  Branch (703:6): [True: 817, False: 2.05k]
  ------------------
  704|    817|		return (0);
  705|  2.05k|	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  159|  2.05k|#define	afiol_filesize_offset 99
  ------------------
              	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  160|  2.05k|#define	afiol_filesize_size 16	/* hex */
  ------------------
  |  Branch (705:6): [True: 2.00k, False: 53]
  ------------------
  706|  2.00k|		return (0);
  707|     53|	return (1);
  708|  2.05k|}
archive_read_support_format_cpio.c:is_hex:
  528|   699k|{
  529|  9.67M|	while (len-- > 0) {
  ------------------
  |  Branch (529:9): [True: 9.66M, False: 14.5k]
  ------------------
  530|  9.66M|		if ((*p >= '0' && *p <= '9')
  ------------------
  |  Branch (530:8): [True: 9.31M, False: 346k]
  |  Branch (530:21): [True: 5.45M, False: 3.85M]
  ------------------
  531|  4.20M|		    || (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (531:11): [True: 2.59M, False: 1.61M]
  |  Branch (531:24): [True: 2.37M, False: 221k]
  ------------------
  532|  1.83M|		    || (*p >= 'A' && *p <= 'F'))
  ------------------
  |  Branch (532:11): [True: 1.48M, False: 346k]
  |  Branch (532:24): [True: 1.15M, False: 337k]
  ------------------
  533|  8.97M|			++p;
  534|   684k|		else
  535|   684k|			return (0);
  536|  9.66M|	}
  537|  14.5k|	return (1);
  538|   699k|}
archive_read_support_format_cpio.c:header_afiol:
  857|     53|{
  858|     53|	int64_t t;
  859|     53|	uint64_t u;
  860|     53|	const void *h;
  861|     53|	const char *header;
  862|       |
  863|     53|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  362|     53|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  356|     53|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  864|     53|	a->archive.archive_format_name = "afio large ASCII";
  865|       |
  866|       |	/* Read fixed-size portion of header. */
  867|     53|	h = __archive_read_ahead(a, afiol_header_size, NULL);
  ------------------
  |  |  162|     53|#define afiol_header_size 116
  ------------------
  868|     53|	if (h == NULL)
  ------------------
  |  Branch (868:6): [True: 0, False: 53]
  ------------------
  869|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  870|       |
  871|       |	/* Parse out octal fields. */
  872|     53|	header = (const char *)h;
  873|       |
  874|     53|	archive_entry_set_dev(entry, 
  875|     53|		(dev_t)atol16(header + afiol_dev_offset, afiol_dev_size));
  ------------------
  |  |  134|     53|#define	afiol_dev_offset 6
  ------------------
              		(dev_t)atol16(header + afiol_dev_offset, afiol_dev_size));
  ------------------
  |  |  135|     53|#define	afiol_dev_size 8	/* hex */
  ------------------
  876|     53|	u = atol16u(header + afiol_ino_offset, afiol_ino_size);
  ------------------
  |  |  136|     53|#define	afiol_ino_offset 14
  ------------------
              	u = atol16u(header + afiol_ino_offset, afiol_ino_size);
  ------------------
  |  |  137|     53|#define	afiol_ino_size 16	/* hex */
  ------------------
  877|     53|#if ARCHIVE_VERSION_NUMBER < 4000000
  878|     53|	archive_entry_set_ino(entry, (int64_t)(u & INT64_MAX));
  879|       |#else
  880|       |	archive_entry_set_ino(entry, u);
  881|       |#endif
  882|     53|	archive_entry_set_mode(entry,
  883|     53|		(mode_t)atol8(header + afiol_mode_offset, afiol_mode_size));
  ------------------
  |  |  139|     53|#define	afiol_mode_offset 31
  ------------------
              		(mode_t)atol8(header + afiol_mode_offset, afiol_mode_size));
  ------------------
  |  |  140|     53|#define	afiol_mode_size 6	/* oct */
  ------------------
  884|     53|	archive_entry_set_uid(entry, atol16(header + afiol_uid_offset, afiol_uid_size));
  ------------------
  |  |  141|     53|#define	afiol_uid_offset 37
  ------------------
              	archive_entry_set_uid(entry, atol16(header + afiol_uid_offset, afiol_uid_size));
  ------------------
  |  |  142|     53|#define	afiol_uid_size 8	/* hex */
  ------------------
  885|     53|	archive_entry_set_gid(entry, atol16(header + afiol_gid_offset, afiol_gid_size));
  ------------------
  |  |  143|     53|#define	afiol_gid_offset 45
  ------------------
              	archive_entry_set_gid(entry, atol16(header + afiol_gid_offset, afiol_gid_size));
  ------------------
  |  |  144|     53|#define	afiol_gid_size 8	/* hex */
  ------------------
  886|     53|	archive_entry_set_nlink(entry,
  887|     53|		(unsigned int)atol16(header + afiol_nlink_offset, afiol_nlink_size));
  ------------------
  |  |  145|     53|#define	afiol_nlink_offset 53
  ------------------
              		(unsigned int)atol16(header + afiol_nlink_offset, afiol_nlink_size));
  ------------------
  |  |  146|     53|#define	afiol_nlink_size 8	/* hex */
  ------------------
  888|     53|	archive_entry_set_rdev(entry,
  889|     53|		(dev_t)atol16(header + afiol_rdev_offset, afiol_rdev_size));
  ------------------
  |  |  147|     53|#define	afiol_rdev_offset 61
  ------------------
              		(dev_t)atol16(header + afiol_rdev_offset, afiol_rdev_size));
  ------------------
  |  |  148|     53|#define	afiol_rdev_size 8	/* hex */
  ------------------
  890|     53|	archive_entry_set_mtime(entry, atol16(header + afiol_mtime_offset, afiol_mtime_size), 0);
  ------------------
  |  |  149|     53|#define	afiol_mtime_offset 69
  ------------------
              	archive_entry_set_mtime(entry, atol16(header + afiol_mtime_offset, afiol_mtime_size), 0);
  ------------------
  |  |  150|     53|#define	afiol_mtime_size 16	/* hex */
  ------------------
  891|     53|	*namelength = (size_t)atol16(header + afiol_namesize_offset, afiol_namesize_size);
  ------------------
  |  |  152|     53|#define	afiol_namesize_offset 86
  ------------------
              	*namelength = (size_t)atol16(header + afiol_namesize_offset, afiol_namesize_size);
  ------------------
  |  |  153|     53|#define	afiol_namesize_size 4	/* hex */
  ------------------
  892|     53|	*name_pad = 0; /* No padding of filename. */
  893|       |
  894|     53|	t = atol16(header + afiol_filesize_offset, afiol_filesize_size);
  ------------------
  |  |  159|     53|#define	afiol_filesize_offset 99
  ------------------
              	t = atol16(header + afiol_filesize_offset, afiol_filesize_size);
  ------------------
  |  |  160|     53|#define	afiol_filesize_size 16	/* hex */
  ------------------
  895|     53|	if (t < 0) {
  ------------------
  |  Branch (895:6): [True: 24, False: 29]
  ------------------
  896|     24|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  897|     24|		    "Nonsensical file size");
  898|     24|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  899|     24|	}
  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|     53|}
archive_read_support_format_cpio.c:atol16:
 1054|  60.2k|{
 1055|  60.2k|	return ((int64_t)atol16u(p, char_cnt));
 1056|  60.2k|}
archive_read_support_format_cpio.c:atol16u:
 1060|  60.2k|{
 1061|  60.2k|	uint64_t l;
 1062|  60.2k|	int digit;
 1063|       |
 1064|  60.2k|	l = 0;
 1065|   543k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1065:9): [True: 483k, False: 60.2k]
  ------------------
 1066|   483k|		if (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (1066:7): [True: 55.3k, False: 427k]
  |  Branch (1066:20): [True: 55.3k, False: 0]
  ------------------
 1067|  55.3k|			digit = *p - 'a' + 10;
 1068|   427k|		else if (*p >= 'A' && *p <= 'F')
  ------------------
  |  Branch (1068:12): [True: 70.7k, False: 357k]
  |  Branch (1068:25): [True: 70.7k, False: 0]
  ------------------
 1069|  70.7k|			digit = *p - 'A' + 10;
 1070|   357k|		else if (*p >= '0' && *p <= '9')
  ------------------
  |  Branch (1070:12): [True: 357k, False: 0]
  |  Branch (1070:25): [True: 357k, False: 0]
  ------------------
 1071|   357k|			digit = *p - '0';
 1072|      0|		else
 1073|      0|			return (l);
 1074|   483k|		p++;
 1075|   483k|		l <<= 4;
 1076|   483k|		l |= digit;
 1077|   483k|	}
 1078|  60.2k|	return (l);
 1079|  60.2k|}
archive_read_support_format_cpio.c:atol8:
 1035|  14.3k|{
 1036|  14.3k|	uint64_t l;
 1037|  14.3k|	int digit;
 1038|       |
 1039|  14.3k|	l = 0;
 1040|   114k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1040:9): [True: 100k, False: 14.3k]
  ------------------
 1041|   100k|		if (*p >= '0' && *p <= '7')
  ------------------
  |  Branch (1041:7): [True: 100k, False: 0]
  |  Branch (1041:20): [True: 100k, False: 53]
  ------------------
 1042|   100k|			digit = *p - '0';
 1043|     53|		else
 1044|     53|			return ((int64_t)l);
 1045|   100k|		p++;
 1046|   100k|		l <<= 3;
 1047|   100k|		l |= digit;
 1048|   100k|	}
 1049|  14.3k|	return ((int64_t)l);
 1050|  14.3k|}
archive_read_support_format_cpio.c:header_newc:
  604|  5.13k|{
  605|  5.13k|	const void *h;
  606|  5.13k|	const char *header;
  607|  5.13k|	int r;
  608|       |
  609|  5.13k|	r = find_newc_header(a);
  610|  5.13k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  5.13k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (610:6): [True: 150, False: 4.98k]
  ------------------
  611|    150|		return (r);
  612|       |
  613|       |	/* Read fixed-size portion of header. */
  614|  4.98k|	h = __archive_read_ahead(a, newc_header_size, NULL);
  ------------------
  |  |  123|  4.98k|#define	newc_header_size 110
  ------------------
  615|  4.98k|	if (h == NULL)
  ------------------
  |  Branch (615:6): [True: 0, False: 4.98k]
  ------------------
  616|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  617|       |
  618|       |	/* Parse out hex fields. */
  619|  4.98k|	header = (const char *)h;
  620|       |
  621|  4.98k|	if (memcmp(header + newc_magic_offset, "070701", 6) == 0) {
  ------------------
  |  |   95|  4.98k|#define	newc_magic_offset 0
  ------------------
  |  Branch (621:6): [True: 4.10k, False: 875]
  ------------------
  622|  4.10k|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC;
  ------------------
  |  |  360|  4.10k|#define	ARCHIVE_FORMAT_CPIO_SVR4_NOCRC		(ARCHIVE_FORMAT_CPIO | 4)
  |  |  ------------------
  |  |  |  |  356|  4.10k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  623|  4.10k|		a->archive.archive_format_name = "ASCII cpio (SVR4 with no CRC)";
  624|  4.10k|	} else if (memcmp(header + newc_magic_offset, "070702", 6) == 0) {
  ------------------
  |  |   95|    875|#define	newc_magic_offset 0
  ------------------
  |  Branch (624:13): [True: 875, False: 0]
  ------------------
  625|    875|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_CRC;
  ------------------
  |  |  361|    875|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC		(ARCHIVE_FORMAT_CPIO | 5)
  |  |  ------------------
  |  |  |  |  356|    875|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  626|    875|		a->archive.archive_format_name = "ASCII cpio (SVR4 with CRC)";
  627|    875|	} else {
  628|       |		/* TODO: Abort here? */
  629|      0|	}
  630|       |
  631|  4.98k|	archive_entry_set_devmajor(entry,
  632|  4.98k|		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  111|  4.98k|#define	newc_devmajor_offset 62
  ------------------
              		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  112|  4.98k|#define	newc_devmajor_size 8
  ------------------
  633|  4.98k|	archive_entry_set_devminor(entry, 
  634|  4.98k|		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  113|  4.98k|#define	newc_devminor_offset 70
  ------------------
              		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  114|  4.98k|#define	newc_devminor_size 8
  ------------------
  635|  4.98k|	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   97|  4.98k|#define	newc_ino_offset 6
  ------------------
              	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   98|  4.98k|#define	newc_ino_size 8
  ------------------
  636|  4.98k|	archive_entry_set_mode(entry, 
  637|  4.98k|		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |   99|  4.98k|#define	newc_mode_offset 14
  ------------------
              		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |  100|  4.98k|#define	newc_mode_size 8
  ------------------
  638|  4.98k|	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  101|  4.98k|#define	newc_uid_offset 22
  ------------------
              	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  102|  4.98k|#define	newc_uid_size 8
  ------------------
  639|  4.98k|	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  103|  4.98k|#define	newc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  104|  4.98k|#define	newc_gid_size 8
  ------------------
  640|  4.98k|	archive_entry_set_nlink(entry,
  641|  4.98k|		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  105|  4.98k|#define	newc_nlink_offset 38
  ------------------
              		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  106|  4.98k|#define	newc_nlink_size 8
  ------------------
  642|  4.98k|	archive_entry_set_rdevmajor(entry,
  643|  4.98k|		(dev_t)atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  115|  4.98k|#define	newc_rdevmajor_offset 78
  ------------------
              		(dev_t)atol16(header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  116|  4.98k|#define	newc_rdevmajor_size 8
  ------------------
  644|  4.98k|	archive_entry_set_rdevminor(entry,
  645|  4.98k|		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  117|  4.98k|#define	newc_rdevminor_offset 86
  ------------------
              		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  118|  4.98k|#define	newc_rdevminor_size 8
  ------------------
  646|  4.98k|	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  107|  4.98k|#define	newc_mtime_offset 46
  ------------------
              	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  108|  4.98k|#define	newc_mtime_size 8
  ------------------
  647|  4.98k|	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  119|  4.98k|#define	newc_namesize_offset 94
  ------------------
              	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  120|  4.98k|#define	newc_namesize_size 8
  ------------------
  648|       |	/* Pad name to 2 more than a multiple of 4. */
  649|  4.98k|	*name_pad = (2 - *namelength) & 3;
  650|       |
  651|       |	/* Make sure that the padded name length fits into size_t. */
  652|  4.98k|	if (*name_pad > SIZE_MAX - *namelength) {
  ------------------
  |  Branch (652:6): [True: 0, False: 4.98k]
  ------------------
  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.98k|	cpio->entry_bytes_remaining =
  664|  4.98k|	    atol16(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  109|  4.98k|#define	newc_filesize_offset 54
  ------------------
              	    atol16(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  110|  4.98k|#define	newc_filesize_size 8
  ------------------
  665|  4.98k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  666|       |	/* Pad file contents to a multiple of 4. */
  667|  4.98k|	cpio->entry_padding = 3 & -cpio->entry_bytes_remaining;
  668|  4.98k|	__archive_read_consume(a, newc_header_size);
  ------------------
  |  |  123|  4.98k|#define	newc_header_size 110
  ------------------
  669|  4.98k|	return (r);
  670|  4.98k|}
archive_read_support_format_cpio.c:find_newc_header:
  542|  5.13k|{
  543|  5.13k|	const void *h;
  544|  5.13k|	const char *p, *q;
  545|  5.13k|	int64_t skip;
  546|  5.13k|	uintmax_t skipped = 0;
  547|  5.13k|	ssize_t bytes;
  548|       |
  549|  53.1k|	for (;;) {
  550|  53.1k|		h = __archive_read_ahead(a, newc_header_size, &bytes);
  ------------------
  |  |  123|  53.1k|#define	newc_header_size 110
  ------------------
  551|  53.1k|		if (h == NULL)
  ------------------
  |  Branch (551:7): [True: 150, False: 53.0k]
  ------------------
  552|    150|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    150|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  553|  53.0k|		p = h;
  554|  53.0k|		q = p + bytes;
  555|       |
  556|       |		/* Try the typical case first, then go into the slow search.*/
  557|  53.0k|		if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (557:7): [True: 2.66k, False: 50.3k]
  ------------------
  558|  2.66k|		    && (p[5] == '1' || p[5] == '2')
  ------------------
  |  Branch (558:11): [True: 1.53k, False: 1.13k]
  |  Branch (558:26): [True: 686, False: 452]
  ------------------
  559|  2.21k|		    && is_hex(p, newc_header_size))
  ------------------
  |  |  123|  2.21k|#define	newc_header_size 110
  ------------------
  |  Branch (559:10): [True: 562, False: 1.65k]
  ------------------
  560|    562|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    562|#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|  28.3M|		while (p + newc_header_size <= q) {
  ------------------
  |  |  123|  28.3M|#define	newc_header_size 110
  ------------------
  |  Branch (566:10): [True: 28.2M, False: 48.0k]
  ------------------
  567|  28.2M|			switch (p[5]) {
  568|  1.40M|			case '1':
  ------------------
  |  Branch (568:4): [True: 1.40M, False: 26.8M]
  ------------------
  569|  1.75M|			case '2':
  ------------------
  |  Branch (569:4): [True: 350k, False: 27.9M]
  ------------------
  570|  1.75M|				if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (570:9): [True: 681k, False: 1.07M]
  ------------------
  571|   681k|				    && is_hex(p, newc_header_size)) {
  ------------------
  |  |  123|   681k|#define	newc_header_size 110
  ------------------
  |  Branch (571:12): [True: 4.42k, False: 677k]
  ------------------
  572|  4.42k|					skip = p - (const char *)h;
  573|  4.42k|					__archive_read_consume(a, skip);
  574|  4.42k|					skipped += skip;
  575|  4.42k|					if (skipped > 0) {
  ------------------
  |  Branch (575:10): [True: 4.42k, False: 0]
  ------------------
  576|  4.42k|						archive_set_error(&a->archive,
  577|  4.42k|						    0,
  578|  4.42k|						    "Skipped %ju bytes before "
  579|  4.42k|						    "finding valid header",
  580|  4.42k|						    skipped);
  581|  4.42k|						return (ARCHIVE_WARN);
  ------------------
  |  |  235|  4.42k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  582|  4.42k|					}
  583|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  584|  4.42k|				}
  585|  1.74M|				p += 2;
  586|  1.74M|				break;
  587|  4.03M|			case '0':
  ------------------
  |  Branch (587:4): [True: 4.03M, False: 24.2M]
  ------------------
  588|  4.03M|				p++;
  589|  4.03M|				break;
  590|  22.5M|			default:
  ------------------
  |  Branch (590:4): [True: 22.5M, False: 5.78M]
  ------------------
  591|  22.5M|				p += 6;
  592|  22.5M|				break;
  593|  28.2M|			}
  594|  28.2M|		}
  595|  48.0k|		skip = p - (const char *)h;
  596|  48.0k|		__archive_read_consume(a, skip);
  597|  48.0k|		skipped += skip;
  598|  48.0k|	}
  599|  5.13k|}
archive_read_support_format_cpio.c:header_bin_be:
  956|    595|{
  957|    595|	const void *h;
  958|    595|	const unsigned char *header;
  959|       |
  960|    595|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_BE;
  ------------------
  |  |  359|    595|#define	ARCHIVE_FORMAT_CPIO_BIN_BE		(ARCHIVE_FORMAT_CPIO | 3)
  |  |  ------------------
  |  |  |  |  356|    595|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  961|    595|	a->archive.archive_format_name = "cpio (big-endian binary)";
  962|       |
  963|       |	/* Read fixed-size portion of header. */
  964|    595|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   69|    595|#define	bin_header_size 26
  ------------------
  965|    595|	if (h == NULL) {
  ------------------
  |  Branch (965:6): [True: 21, False: 574]
  ------------------
  966|     21|	    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     21|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  967|     21|		"End of file trying to read next cpio header");
  968|     21|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     21|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  969|     21|	}
  970|       |
  971|       |	/* Parse out binary fields. */
  972|    574|	header = (const unsigned char *)h;
  973|       |
  974|    574|	archive_entry_set_dev(entry, archive_be16dec(header + bin_dev_offset));
  ------------------
  |  |   49|    574|#define	bin_dev_offset 2
  ------------------
  975|    574|	archive_entry_set_ino(entry, archive_be16dec(header + bin_ino_offset));
  ------------------
  |  |   51|    574|#define	bin_ino_offset 4
  ------------------
  976|    574|	archive_entry_set_mode(entry, archive_be16dec(header + bin_mode_offset));
  ------------------
  |  |   53|    574|#define	bin_mode_offset 6
  ------------------
  977|    574|	if (cpio->option_pwb) {
  ------------------
  |  Branch (977:6): [True: 0, False: 574]
  ------------------
  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|    574|	archive_entry_set_uid(entry, archive_be16dec(header + bin_uid_offset));
  ------------------
  |  |   55|    574|#define	bin_uid_offset 8
  ------------------
  984|    574|	archive_entry_set_gid(entry, archive_be16dec(header + bin_gid_offset));
  ------------------
  |  |   57|    574|#define	bin_gid_offset 10
  ------------------
  985|    574|	archive_entry_set_nlink(entry, archive_be16dec(header + bin_nlink_offset));
  ------------------
  |  |   59|    574|#define	bin_nlink_offset 12
  ------------------
  986|    574|	archive_entry_set_rdev(entry, archive_be16dec(header + bin_rdev_offset));
  ------------------
  |  |   61|    574|#define	bin_rdev_offset 14
  ------------------
  987|    574|	archive_entry_set_mtime(entry, cpio_be32dec(header + bin_mtime_offset), 0);
  ------------------
  |  |   63|    574|#define	bin_mtime_offset 16
  ------------------
  988|    574|	*namelength = archive_be16dec(header + bin_namesize_offset);
  ------------------
  |  |   65|    574|#define	bin_namesize_offset 20
  ------------------
  989|    574|	*name_pad = *namelength & 1; /* Pad to even. */
  990|       |
  991|    574|	cpio->entry_bytes_remaining = cpio_be32dec(header + bin_filesize_offset);
  ------------------
  |  |   67|    574|#define	bin_filesize_offset 22
  ------------------
  992|    574|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  993|    574|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
  994|    574|	    __archive_read_consume(a, bin_header_size);
  ------------------
  |  |   69|    574|#define	bin_header_size 26
  ------------------
  995|    574|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    574|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  996|    595|}
archive_read_support_format_cpio.c:cpio_be32dec:
 1024|  1.14k|{
 1025|  1.14k|	return ((int64_t)archive_be16dec(p) << 16) | archive_be16dec(p + 2);
 1026|  1.14k|}
archive_read_support_format_cpio.c:header_bin_le:
  911|    445|{
  912|    445|	const void *h;
  913|    445|	const unsigned char *header;
  914|       |
  915|    445|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_LE;
  ------------------
  |  |  358|    445|#define	ARCHIVE_FORMAT_CPIO_BIN_LE		(ARCHIVE_FORMAT_CPIO | 2)
  |  |  ------------------
  |  |  |  |  356|    445|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  916|    445|	a->archive.archive_format_name = "cpio (little-endian binary)";
  917|       |
  918|       |	/* Read fixed-size portion of header. */
  919|    445|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   69|    445|#define	bin_header_size 26
  ------------------
  920|    445|	if (h == NULL) {
  ------------------
  |  Branch (920:6): [True: 9, False: 436]
  ------------------
  921|      9|	    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  922|      9|		"End of file trying to read next cpio header");
  923|      9|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  924|      9|	}
  925|       |
  926|       |	/* Parse out binary fields. */
  927|    436|	header = (const unsigned char *)h;
  928|       |
  929|    436|	archive_entry_set_dev(entry, archive_le16dec(header + bin_dev_offset));
  ------------------
  |  |   49|    436|#define	bin_dev_offset 2
  ------------------
  930|    436|	archive_entry_set_ino(entry, archive_le16dec(header + bin_ino_offset));
  ------------------
  |  |   51|    436|#define	bin_ino_offset 4
  ------------------
  931|    436|	archive_entry_set_mode(entry, archive_le16dec(header + bin_mode_offset));
  ------------------
  |  |   53|    436|#define	bin_mode_offset 6
  ------------------
  932|    436|	if (cpio->option_pwb) {
  ------------------
  |  Branch (932:6): [True: 0, False: 436]
  ------------------
  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|    436|	archive_entry_set_uid(entry, archive_le16dec(header + bin_uid_offset));
  ------------------
  |  |   55|    436|#define	bin_uid_offset 8
  ------------------
  939|    436|	archive_entry_set_gid(entry, archive_le16dec(header + bin_gid_offset));
  ------------------
  |  |   57|    436|#define	bin_gid_offset 10
  ------------------
  940|    436|	archive_entry_set_nlink(entry, archive_le16dec(header + bin_nlink_offset));
  ------------------
  |  |   59|    436|#define	bin_nlink_offset 12
  ------------------
  941|    436|	archive_entry_set_rdev(entry, archive_le16dec(header + bin_rdev_offset));
  ------------------
  |  |   61|    436|#define	bin_rdev_offset 14
  ------------------
  942|    436|	archive_entry_set_mtime(entry, cpio_le32dec(header + bin_mtime_offset), 0);
  ------------------
  |  |   63|    436|#define	bin_mtime_offset 16
  ------------------
  943|    436|	*namelength = archive_le16dec(header + bin_namesize_offset);
  ------------------
  |  |   65|    436|#define	bin_namesize_offset 20
  ------------------
  944|    436|	*name_pad = *namelength & 1; /* Pad to even. */
  945|       |
  946|    436|	cpio->entry_bytes_remaining = cpio_le32dec(header + bin_filesize_offset);
  ------------------
  |  |   67|    436|#define	bin_filesize_offset 22
  ------------------
  947|    436|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  948|    436|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
  949|    436|	__archive_read_consume(a, bin_header_size);
  ------------------
  |  |   69|    436|#define	bin_header_size 26
  ------------------
  950|    436|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    436|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  951|    445|}
archive_read_support_format_cpio.c:cpio_le32dec:
 1018|    872|{
 1019|    872|	return ((int64_t)archive_le16dec(p) << 16) | archive_le16dec(p + 2);
 1020|    872|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_header:
  363|  7.80k|{
  364|  7.80k|	struct cpio *cpio = a->format->data;
  365|  7.80k|	const void *h, *hl;
  366|  7.80k|	struct archive_string_conv *sconv;
  367|  7.80k|	size_t namelength;
  368|  7.80k|	size_t name_pad;
  369|  7.80k|	int is_trailer;
  370|  7.80k|	int r;
  371|       |
  372|  7.80k|	sconv = cpio->opt_sconv;
  373|  7.80k|	if (sconv == NULL) {
  ------------------
  |  Branch (373:6): [True: 7.80k, False: 0]
  ------------------
  374|  7.80k|		if (!cpio->init_default_conversion) {
  ------------------
  |  Branch (374:7): [True: 459, False: 7.34k]
  ------------------
  375|    459|			cpio->sconv_default =
  376|    459|			    archive_string_default_conversion_for_read(
  377|    459|			      &(a->archive));
  378|    459|			cpio->init_default_conversion = 1;
  379|    459|		}
  380|  7.80k|		sconv = cpio->sconv_default;
  381|  7.80k|	}
  382|       |	
  383|  7.80k|	r = (cpio->read_header(a, cpio, entry, &namelength, &name_pad));
  384|       |
  385|  7.80k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  7.80k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (385:6): [True: 349, False: 7.45k]
  ------------------
  386|    349|		return (r);
  387|       |
  388|  7.45k|	if (namelength > CPIO_PATHNAME_MAX) {
  ------------------
  |  |  165|  7.45k|#define	CPIO_PATHNAME_MAX	(1024 * 1024)
  ------------------
  |  Branch (388:6): [True: 27, False: 7.42k]
  ------------------
  389|     27|		archive_set_error(&a->archive, ENOMEM,
  390|     27|		    "Rejecting malformed cpio archive: "
  391|     27|		    "pathname exceeds 1 megabyte");
  392|     27|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     27|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  393|     27|	}
  394|       |
  395|       |	/* Read name from buffer. */
  396|  7.42k|	h = __archive_read_ahead(a, namelength, NULL);
  397|  7.42k|	if (h == NULL)
  ------------------
  |  Branch (397:6): [True: 19, False: 7.40k]
  ------------------
  398|     19|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  399|  7.40k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  7.40k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (399:6): [True: 0, False: 7.40k]
  ------------------
  400|  7.40k|	    (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.40k|	is_trailer = (namelength == 11 &&
  ------------------
  |  Branch (412:16): [True: 2.44k, False: 4.96k]
  ------------------
  413|  2.44k|	    memcmp((const char *)h, "TRAILER!!!", 10) == 0);
  ------------------
  |  Branch (413:6): [True: 0, False: 2.44k]
  ------------------
  414|  7.40k|	cpio->entry_offset = 0;
  415|       |
  416|  7.40k|	__archive_read_consume(a, namelength);
  417|  7.40k|	__archive_read_consume(a, name_pad);
  418|       |
  419|       |	/* If this is a symlink, read the link contents. */
  420|  7.40k|	if (archive_entry_filetype(entry) == AE_IFLNK) {
  ------------------
  |  |  217|  7.40k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (420:6): [True: 408, False: 7.00k]
  ------------------
  421|    408|		if (cpio->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (421:7): [True: 1, False: 407]
  ------------------
  422|      1|			archive_set_error(&a->archive, ENOMEM,
  423|      1|			    "Rejecting malformed cpio archive: symlink contents exceed 1 megabyte");
  424|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  425|      1|		}
  426|    407|		hl = __archive_read_ahead(a,
  427|    407|			(size_t)cpio->entry_bytes_remaining, NULL);
  428|    407|		if (hl == NULL)
  ------------------
  |  Branch (428:7): [True: 0, False: 407]
  ------------------
  429|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  430|    407|		if (archive_entry_copy_symlink_l(entry, (const char *)hl,
  ------------------
  |  |   83|    407|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (430:7): [True: 0, False: 407]
  ------------------
  431|    407|		    (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|    407|		__archive_read_consume(a, cpio->entry_bytes_remaining);
  445|    407|		cpio->entry_bytes_remaining = 0;
  446|    407|	}
  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.40k|	if (is_trailer) {
  ------------------
  |  Branch (454:6): [True: 0, False: 7.40k]
  ------------------
  455|       |		/* TODO: Store file location of start of block. */
  456|      0|		archive_clear_error(&a->archive);
  457|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  458|      0|	}
  459|       |
  460|       |	/* Detect and record hardlinks to previously-extracted entries. */
  461|  7.40k|	if (record_hardlink(a, cpio, entry) != ARCHIVE_OK) {
  ------------------
  |  |  233|  7.40k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (461:6): [True: 0, False: 7.40k]
  ------------------
  462|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  463|      0|	}
  464|       |
  465|  7.40k|	return (r);
  466|  7.40k|}
archive_read_support_format_cpio.c:record_hardlink:
 1084|  7.40k|{
 1085|  7.40k|	struct links_entry      *le;
 1086|  7.40k|	dev_t dev;
 1087|  7.40k|	int64_t ino;
 1088|       |
 1089|  7.40k|	if (archive_entry_nlink(entry) <= 1)
  ------------------
  |  Branch (1089:6): [True: 1.75k, False: 5.65k]
  ------------------
 1090|  1.75k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.75k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1091|       |
 1092|  5.65k|	dev = archive_entry_dev(entry);
 1093|  5.65k|	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|  13.7k|	for (le = cpio->links_head; le; le = le->next) {
  ------------------
  |  Branch (1099:30): [True: 11.9k, False: 1.84k]
  ------------------
 1100|  11.9k|		if (le->dev == dev && le->ino == ino) {
  ------------------
  |  Branch (1100:7): [True: 5.88k, False: 6.06k]
  |  Branch (1100:25): [True: 3.81k, False: 2.07k]
  ------------------
 1101|  3.81k|			archive_entry_copy_hardlink(entry, le->name);
 1102|       |
 1103|  3.81k|			if (--le->links <= 0) {
  ------------------
  |  Branch (1103:8): [True: 1.22k, False: 2.59k]
  ------------------
 1104|  1.22k|				if (le->previous != NULL)
  ------------------
  |  Branch (1104:9): [True: 373, False: 848]
  ------------------
 1105|    373|					le->previous->next = le->next;
 1106|  1.22k|				if (le->next != NULL)
  ------------------
  |  Branch (1106:9): [True: 515, False: 706]
  ------------------
 1107|    515|					le->next->previous = le->previous;
 1108|  1.22k|				if (cpio->links_head == le)
  ------------------
  |  Branch (1108:9): [True: 848, False: 373]
  ------------------
 1109|    848|					cpio->links_head = le->next;
 1110|  1.22k|				free(le->name);
 1111|  1.22k|				free(le);
 1112|  1.22k|			}
 1113|       |
 1114|  3.81k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.81k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1115|  3.81k|		}
 1116|  11.9k|	}
 1117|       |
 1118|  1.84k|	le = malloc(sizeof(struct links_entry));
 1119|  1.84k|	if (le == NULL) {
  ------------------
  |  Branch (1119:6): [True: 0, False: 1.84k]
  ------------------
 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.84k|	const char *pathname = archive_entry_pathname(entry);
 1126|  1.84k|	if (pathname == NULL) {
  ------------------
  |  Branch (1126:6): [True: 0, False: 1.84k]
  ------------------
 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.84k|	le->dev = dev;
 1135|  1.84k|	le->ino = ino;
 1136|  1.84k|	le->links = archive_entry_nlink(entry) - 1;
 1137|  1.84k|	le->name = strdup(pathname);
 1138|  1.84k|	if (le->name == NULL) {
  ------------------
  |  Branch (1138:6): [True: 0, False: 1.84k]
  ------------------
 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.84k|	if (cpio->links_head != NULL)
  ------------------
  |  Branch (1145:6): [True: 1.22k, False: 616]
  ------------------
 1146|  1.22k|		cpio->links_head->previous = le;
 1147|  1.84k|	le->next = cpio->links_head;
 1148|  1.84k|	le->previous = NULL;
 1149|  1.84k|	cpio->links_head = le;
 1150|       |
 1151|  1.84k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.84k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1152|  1.84k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_data:
  471|  14.8k|{
  472|  14.8k|	struct cpio *cpio = a->format->data;
  473|  14.8k|	ssize_t bytes_read;
  474|       |
  475|  14.8k|	if (cpio->entry_bytes_unconsumed) {
  ------------------
  |  Branch (475:6): [True: 3.88k, False: 10.9k]
  ------------------
  476|  3.88k|		__archive_read_consume(a, cpio->entry_bytes_unconsumed);
  477|  3.88k|		cpio->entry_bytes_unconsumed = 0;
  478|  3.88k|	}
  479|       |
  480|  14.8k|	if (cpio->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (480:6): [True: 3.95k, False: 10.9k]
  ------------------
  481|  3.95k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  482|  3.95k|		if (bytes_read <= 0)
  ------------------
  |  Branch (482:7): [True: 63, False: 3.88k]
  ------------------
  483|     63|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     63|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  484|  3.88k|		if (bytes_read > cpio->entry_bytes_remaining)
  ------------------
  |  Branch (484:7): [True: 3.58k, False: 303]
  ------------------
  485|  3.58k|			bytes_read = (ssize_t)cpio->entry_bytes_remaining;
  486|  3.88k|		*size = bytes_read;
  487|  3.88k|		cpio->entry_bytes_unconsumed = bytes_read;
  488|  3.88k|		*offset = cpio->entry_offset;
  489|  3.88k|		cpio->entry_offset += bytes_read;
  490|  3.88k|		cpio->entry_bytes_remaining -= bytes_read;
  491|  3.88k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.88k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  492|  10.9k|	} else {
  493|  10.9k|		if (cpio->entry_padding !=
  ------------------
  |  Branch (493:7): [True: 0, False: 10.9k]
  ------------------
  494|  10.9k|			__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|  10.9k|		cpio->entry_padding = 0;
  498|  10.9k|		*buff = NULL;
  499|  10.9k|		*size = 0;
  500|  10.9k|		*offset = cpio->entry_offset;
  501|  10.9k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  10.9k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  502|  10.9k|	}
  503|  14.8k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_skip:
  507|  7.34k|{
  508|  7.34k|	struct cpio *cpio = a->format->data;
  509|  7.34k|	int64_t to_skip = cpio->entry_bytes_remaining + cpio->entry_padding +
  510|  7.34k|		cpio->entry_bytes_unconsumed;
  511|       |
  512|  7.34k|	if (to_skip != __archive_read_consume(a, to_skip)) {
  ------------------
  |  Branch (512:6): [True: 0, False: 7.34k]
  ------------------
  513|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  514|      0|	}
  515|  7.34k|	cpio->entry_bytes_remaining = 0;
  516|  7.34k|	cpio->entry_padding = 0;
  517|  7.34k|	cpio->entry_bytes_unconsumed = 0;
  518|  7.34k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  519|  7.34k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_cleanup:
 1000|  11.9k|{
 1001|  11.9k|	struct cpio *cpio = a->format->data;
 1002|       |
 1003|       |        /* Free inode->name map */
 1004|  12.5k|        while (cpio->links_head != NULL) {
  ------------------
  |  Branch (1004:16): [True: 620, False: 11.9k]
  ------------------
 1005|    620|                struct links_entry *lp = cpio->links_head->next;
 1006|       |
 1007|    620|                free(cpio->links_head->name);
 1008|    620|                free(cpio->links_head);
 1009|    620|                cpio->links_head = lp;
 1010|    620|        }
 1011|  11.9k|	free(cpio);
 1012|  11.9k|	a->format->data = NULL;
 1013|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1014|  11.9k|}

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

archive_read_support_format_iso9660:
  457|  11.9k|{
  458|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  459|  11.9k|	struct iso9660 *iso9660;
  460|  11.9k|	int r;
  461|       |
  462|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  463|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  464|       |
  465|  11.9k|	iso9660 = calloc(1, sizeof(*iso9660));
  466|  11.9k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (466:6): [True: 0, False: 11.9k]
  ------------------
  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|  11.9k|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  324|  11.9k|#define ISO9660_MAGIC   0x96609660
  ------------------
  471|  11.9k|	iso9660->cache_files.first = NULL;
  472|  11.9k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  473|  11.9k|	iso9660->re_files.first = NULL;
  474|  11.9k|	iso9660->re_files.last = &(iso9660->re_files.first);
  475|       |	/* Enable to support Joliet extensions by default.	*/
  476|  11.9k|	iso9660->opt_support_joliet = 1;
  477|       |	/* Enable to support Rock Ridge extensions by default.	*/
  478|  11.9k|	iso9660->opt_support_rockridge = 1;
  479|       |
  480|  11.9k|	r = __archive_read_register_format(a,
  481|  11.9k|	    iso9660,
  482|  11.9k|	    "iso9660",
  483|  11.9k|	    archive_read_format_iso9660_bid,
  484|  11.9k|	    archive_read_format_iso9660_options,
  485|  11.9k|	    archive_read_format_iso9660_read_header,
  486|  11.9k|	    archive_read_format_iso9660_read_data,
  487|  11.9k|	    archive_read_format_iso9660_read_data_skip,
  488|  11.9k|	    NULL,
  489|  11.9k|	    archive_read_format_iso9660_cleanup,
  490|  11.9k|	    NULL,
  491|  11.9k|	    NULL);
  492|       |
  493|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (493:6): [True: 0, False: 11.9k]
  ------------------
  494|      0|		free(iso9660);
  495|  11.9k|	return (r);
  496|  11.9k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  501|  11.7k|{
  502|  11.7k|	struct iso9660 *iso9660 = a->format->data;
  503|  11.7k|	ssize_t bytes_read;
  504|  11.7k|	const unsigned char *p;
  505|  11.7k|	int seenTerminator;
  506|       |
  507|       |	/* If there's already a better bid than we can ever
  508|       |	   make, don't bother testing. */
  509|  11.7k|	if (best_bid > 48)
  ------------------
  |  Branch (509:6): [True: 4.07k, False: 7.68k]
  ------------------
  510|  4.07k|		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|  7.68k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  518|  7.68k|	p = __archive_read_ahead(a,
  519|  7.68k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  517|  7.68k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|  7.68k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  7.68k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   82|  7.68k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  520|  7.68k|	    &bytes_read);
  521|  7.68k|	if (p == NULL)
  ------------------
  |  Branch (521:6): [True: 6.93k, False: 757]
  ------------------
  522|  6.93k|	    return (-1);
  523|       |
  524|       |	/* Skip the reserved area. */
  525|    757|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  517|    757|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    757|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    757|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  526|    757|	p += RESERVED_AREA;
  ------------------
  |  |  517|    757|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    757|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    757|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  527|       |
  528|       |	/* Check each volume descriptor. */
  529|    757|	seenTerminator = 0;
  530|  1.07k|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   82|  1.07k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (530:9): [True: 1.07k, False: 0]
  ------------------
  531|  1.07k|	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    317|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    317|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  532|       |		/* Do not handle undefined Volume Descriptor Type. */
  533|  1.07k|		if (p[0] >= 4 && p[0] <= 254)
  ------------------
  |  Branch (533:7): [True: 572, False: 502]
  |  Branch (533:20): [True: 355, False: 217]
  ------------------
  534|    355|			return (0);
  535|       |		/* Standard Identifier must be "CD001" */
  536|    719|		if (memcmp(p + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (536:7): [True: 109, False: 610]
  ------------------
  537|    109|			return (0);
  538|    610|		if (isPVD(iso9660, p))
  ------------------
  |  Branch (538:7): [True: 208, False: 402]
  ------------------
  539|    208|			continue;
  540|    402|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (540:7): [True: 374, False: 28]
  ------------------
  541|    374|			if (isJolietSVD(iso9660, p))
  ------------------
  |  Branch (541:8): [True: 30, False: 344]
  ------------------
  542|     30|				continue;
  543|    374|		}
  544|    372|		if (isBootRecord(p))
  ------------------
  |  Branch (544:7): [True: 8, False: 364]
  ------------------
  545|      8|			continue;
  546|    364|		if (isEVD(p))
  ------------------
  |  Branch (546:7): [True: 0, False: 364]
  ------------------
  547|      0|			continue;
  548|    364|		if (isSVD(p))
  ------------------
  |  Branch (548:7): [True: 71, False: 293]
  ------------------
  549|     71|			continue;
  550|    293|		if (isVolumePartition(iso9660, p))
  ------------------
  |  Branch (550:7): [True: 0, False: 293]
  ------------------
  551|      0|			continue;
  552|    293|		if (isVDSetTerminator(p)) {
  ------------------
  |  Branch (552:7): [True: 189, False: 104]
  ------------------
  553|    189|			seenTerminator = 1;
  554|    189|			break;
  555|    189|		}
  556|    104|		return (0);
  557|    293|	}
  558|       |	/*
  559|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  560|       |	 * Volume Descriptor Set Terminator.
  561|       |	 */
  562|    189|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (562:6): [True: 189, False: 0]
  |  Branch (562:24): [True: 188, False: 1]
  ------------------
  563|    188|		return (48);
  564|       |
  565|       |	/* We didn't find a valid PVD; return a bid of zero. */
  566|      1|	return (0);
  567|    189|}
archive_read_support_format_iso9660.c:isPVD:
  860|    610|{
  861|    610|	const unsigned char *p;
  862|    610|	ssize_t logical_block_size;
  863|    610|	int32_t volume_block;
  864|    610|	int32_t location;
  865|    610|	int i;
  866|       |
  867|       |	/* Type of the Primary Volume Descriptor must be 1. */
  868|    610|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   86|    610|#define PVD_type_offset 0
  ------------------
  |  Branch (868:6): [True: 365, False: 245]
  ------------------
  869|    365|		return (0);
  870|       |
  871|       |	/* PVD version must be 1. */
  872|    245|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   90|    245|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    245|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    245|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    245|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    245|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (872:6): [True: 1, False: 244]
  ------------------
  873|      1|		return (0);
  874|       |
  875|       |	/* Reserved field must be 0. */
  876|    244|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|    244|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    244|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    244|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    244|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    244|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|    244|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|    244|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (876:6): [True: 1, False: 243]
  ------------------
  877|      1|		return (0);
  878|       |
  879|       |	/* Reserved field must be 0. */
  880|    243|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    243|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    243|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    243|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    243|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    243|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    243|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    243|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    243|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    243|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    243|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    243|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    243|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|    243|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|    243|#define PVD_reserved2_size 8
  ------------------
  |  Branch (880:6): [True: 2, False: 241]
  ------------------
  881|      2|		return (0);
  882|       |
  883|       |	/* Volume space size must be encoded according to 7.3.3 */
  884|    241|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |  100|    241|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    241|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    241|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    241|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    241|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    241|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    241|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    241|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    241|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    241|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    241|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    241|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    241|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    241|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    241|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (884:6): [True: 3, False: 238]
  ------------------
  885|      3|		return (0);
  886|      3|	}
  887|    238|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|    238|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    238|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    238|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    238|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    238|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    238|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    238|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    238|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    238|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    238|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    238|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    238|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    238|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    238|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    238|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  888|    238|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    238|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (888:6): [True: 1, False: 237]
  ------------------
  889|      1|		return (0);
  890|       |
  891|       |	/* Reserved field must be 0. */
  892|    237|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    237|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    237|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    237|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    237|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    237|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    237|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    237|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    237|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    237|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    237|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    237|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    237|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    237|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    237|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    237|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    237|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|    237|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|    237|#define PVD_reserved3_size 32
  ------------------
  |  Branch (892:6): [True: 2, False: 235]
  ------------------
  893|      2|		return (0);
  894|       |
  895|       |	/* Volume set size must be encoded according to 7.2.3 */
  896|    235|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  104|    235|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    235|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    235|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    235|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    235|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    235|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    235|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    235|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    235|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    235|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    235|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    235|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    235|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    235|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    235|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    235|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    235|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    235|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  103|    235|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (896:6): [True: 2, False: 233]
  ------------------
  897|      2|		return (0);
  898|      2|	}
  899|       |
  900|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  901|    233|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  106|    233|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    233|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    233|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|    233|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|    233|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|    233|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    233|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    233|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    233|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    233|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    233|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    233|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    233|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    233|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    233|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    233|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    233|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    233|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    233|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    233|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  105|    233|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (901:6): [True: 1, False: 232]
  ------------------
  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|    232|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  108|    232|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    232|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    232|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    232|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    232|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    232|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    232|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    232|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    232|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    232|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    232|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    232|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    232|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    232|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    232|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    232|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    232|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    232|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    232|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    232|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    232|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    232|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    232|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (908:6): [True: 1, False: 231]
  ------------------
  909|      1|		return (0);
  910|      1|	}
  911|    231|	logical_block_size =
  912|    231|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|    231|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    231|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    231|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    231|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    231|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    231|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    231|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    231|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    231|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    231|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    231|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    231|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    231|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    231|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    231|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    231|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    231|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    231|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    231|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    231|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    231|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    231|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    231|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  913|    231|	if (logical_block_size <= 0)
  ------------------
  |  Branch (913:6): [True: 1, False: 230]
  ------------------
  914|      1|		return (0);
  915|       |
  916|       |	/* Path Table size must be encoded according to 7.3.3 */
  917|    230|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  110|    230|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    230|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    230|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    230|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    230|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    230|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    230|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    230|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    230|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    230|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    230|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    230|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    230|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    230|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    230|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    230|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    230|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    230|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    230|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    230|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    230|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    230|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    230|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    230|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  109|    230|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (917:6): [True: 4, False: 226]
  ------------------
  918|      4|		return (0);
  919|      4|	}
  920|       |
  921|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  922|    226|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  144|    226|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    226|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    226|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    226|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    226|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    226|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    226|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    226|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    226|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    226|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    226|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    226|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    226|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    226|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    226|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    226|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    226|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    226|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    226|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    226|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    226|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    226|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    226|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    226|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    226|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    226|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    226|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    226|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    226|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    226|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    226|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    226|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    226|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    226|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    226|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    226|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    226|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    226|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    226|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    226|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    226|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    226|#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|    226|#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|    226|#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|    226|#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|    226|#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|    226|#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|    226|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    226|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    226|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    226|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    226|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    226|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    226|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    226|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    226|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    226|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    226|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|    226|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (922:6): [True: 2, False: 224]
  ------------------
  923|      2|		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|    224|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|    224|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    224|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    224|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    224|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    224|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    224|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    224|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    224|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    224|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    224|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    224|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    224|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    224|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    224|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    224|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    224|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    224|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    224|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    224|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    224|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    224|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    224|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|    224|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|    224|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    224|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    224|#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|    224|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  929|    224|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    224|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (929:6): [True: 1, False: 223]
  |  Branch (929:40): [True: 1, False: 222]
  ------------------
  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|    222|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|    222|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|    222|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    222|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    222|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    222|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    222|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    222|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    222|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    222|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    222|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    222|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    222|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    222|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    222|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    222|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    222|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    222|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    222|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    222|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    222|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    222|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    222|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    222|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    222|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    222|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    222|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|    222|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|    222|#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|    222|#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|    222|#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|    222|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  938|    222|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    220|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (938:7): [True: 220, False: 2]
  |  Branch (938:23): [True: 1, False: 219]
  ------------------
  939|    221|	    || location >= volume_block)
  ------------------
  |  Branch (939:9): [True: 1, False: 220]
  ------------------
  940|      2|		return (0);
  941|       |
  942|       |	/* Reserved field must be 0. */
  943|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  944|    439|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  147|    439|#define PVD_reserved4_size 1
  ------------------
  |  Branch (944:14): [True: 220, False: 219]
  ------------------
  945|    220|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  146|    220|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    220|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    220|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    220|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    220|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    220|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    220|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    220|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    220|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    220|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    220|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    220|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    220|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    220|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    220|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    220|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    220|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    220|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    220|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    220|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    220|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    220|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    220|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    220|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    220|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    220|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    220|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    220|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    220|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    220|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    220|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    220|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    220|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    220|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    220|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    220|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    220|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    220|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    220|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    220|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    220|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    220|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    220|#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|    220|#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|    220|#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|    220|#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|    220|#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|    220|#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|    220|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    220|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    220|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    220|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    220|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    220|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    220|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    220|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|    220|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|    220|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|    220|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|    220|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|    220|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (945:7): [True: 63, False: 157]
  ------------------
  946|     63|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  146|     63|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     63|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     63|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     63|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     63|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     63|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     63|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     63|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     63|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     63|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     63|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     63|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     63|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     63|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     63|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     63|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     63|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     63|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     63|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     63|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     63|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     63|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     63|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     63|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     63|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     63|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     63|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     63|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     63|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     63|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     63|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     63|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     63|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     63|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     63|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     63|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     63|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     63|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     63|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     63|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     63|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     63|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     63|#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|     63|#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|     63|#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|     63|#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|     63|#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|     63|#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|     63|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     63|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     63|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     63|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     63|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     63|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     63|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     63|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     63|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     63|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     63|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     63|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     63|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (946:10): [True: 1, False: 62]
  ------------------
  947|      1|			return (0);
  948|       |
  949|       |	/* Reserved field must be 0. */
  950|    219|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    219|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    219|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    219|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    219|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    219|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    219|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    219|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    219|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    219|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    219|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    219|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    219|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    219|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    219|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    219|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    219|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    219|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    219|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    219|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    219|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    219|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    219|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    219|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    219|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    219|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    219|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    219|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    219|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    219|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    219|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    219|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    219|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    219|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    219|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    219|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    219|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    219|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    219|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    219|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    219|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    219|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    219|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    219|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    219|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    219|#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|    219|#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|    219|#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|    219|#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|    219|#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|    219|#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|    219|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    219|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    219|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    219|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    219|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    219|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    219|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    219|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    219|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    219|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    219|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    219|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    219|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    219|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|    219|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|    219|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|    219|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    219|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    219|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    219|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    219|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    219|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    219|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    219|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    219|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    219|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    219|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    219|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    219|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    219|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    219|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    219|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    219|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    219|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    219|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    219|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    219|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    219|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    219|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    219|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    219|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    219|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    219|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    219|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    219|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    219|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    219|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    219|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    219|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    219|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    219|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    219|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    219|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    219|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    219|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    219|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    219|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    219|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    219|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    219|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    219|#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|    219|#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|    219|#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|    219|#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|    219|#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|    219|#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|    219|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    219|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    219|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    219|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    219|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    219|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    219|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    219|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    219|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    219|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|    219|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|    219|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|    219|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|    219|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|    219|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (950:6): [True: 2, False: 217]
  ------------------
  951|      2|		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|    217|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|    217|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|    217|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    217|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|    217|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    217|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    217|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    217|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    217|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    217|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    217|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    217|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    217|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    217|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    217|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    217|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    217|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    217|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    217|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    217|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    217|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    217|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    217|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    217|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    217|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    217|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    217|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    217|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    217|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    217|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    217|#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|    217|#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|    217|#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|    217|#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|    217|#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|    217|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  958|    217|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (958:6): [True: 9, False: 208]
  ------------------
  959|      9|		return (0);
  960|      9|	}
  961|       |
  962|    208|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (962:6): [True: 207, False: 1]
  ------------------
  963|    207|		iso9660->logical_block_size = logical_block_size;
  964|    207|		iso9660->volume_block = volume_block;
  965|    207|		iso9660->volume_size =
  966|    207|		    logical_block_size * (uint64_t)volume_block;
  967|    207|		iso9660->primary.location =
  968|    207|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|    207|#define DR_extent_offset 2
  ------------------
  969|    207|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|    207|#define DR_size_offset 10
  ------------------
  970|    207|	}
  971|       |
  972|    208|	return (48);
  973|    217|}
archive_read_support_format_iso9660.c:isNull:
  599|  1.77k|{
  600|  1.77k|	if (bytes == 0)
  ------------------
  |  Branch (600:6): [True: 0, False: 1.77k]
  ------------------
  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.77k|	return (h[offset] == 0 &&
  ------------------
  |  Branch (607:10): [True: 1.75k, False: 26]
  ------------------
  608|  1.75k|	    (bytes == 1 ||
  ------------------
  |  Branch (608:7): [True: 273, False: 1.47k]
  ------------------
  609|  1.47k|	    memcmp(h + offset, h + offset + 1, bytes - 1) == 0));
  ------------------
  |  Branch (609:6): [True: 1.43k, False: 40]
  ------------------
  610|  1.77k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3242|  1.28k|{
 3243|  1.28k|	return (p[0] == p[7]
  ------------------
  |  Branch (3243:10): [True: 1.28k, False: 6]
  ------------------
 3244|  1.28k|		&& p[1] == p[6]
  ------------------
  |  Branch (3244:6): [True: 1.27k, False: 7]
  ------------------
 3245|  1.27k|		&& p[2] == p[5]
  ------------------
  |  Branch (3245:6): [True: 1.26k, False: 8]
  ------------------
 3246|  1.26k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3246:6): [True: 1.26k, False: 5]
  ------------------
 3247|  1.28k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3236|  1.09k|isValid723Integer(const unsigned char *p) {
 3237|  1.09k|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3237:10): [True: 1.08k, False: 6]
  |  Branch (3237:26): [True: 1.08k, False: 2]
  ------------------
 3238|  1.09k|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  976|    422|isRootDirectoryRecord(const unsigned char *p) {
  977|    422|	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|    422|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    422|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    417|#define DR_length_offset 0
  ------------------
  |  Branch (981:6): [True: 5, False: 417]
  |  Branch (981:34): [True: 4, False: 413]
  ------------------
  982|      9|		return (0);
  983|      9|	}
  984|       |
  985|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
  986|    413|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  200|    413|#define DR_extent_offset 2
  ------------------
  |  Branch (986:6): [True: 10, False: 403]
  ------------------
  987|     10|		return (0);
  988|     10|	}
  989|       |
  990|       |	/* The root directory size must be a 7.3.3 integer. */
  991|    403|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  202|    403|#define DR_size_offset 10
  ------------------
  |  Branch (991:6): [True: 9, False: 394]
  ------------------
  992|      9|		return (0);
  993|      9|	}
  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|    394|	flags = p[DR_flags_offset];
  ------------------
  |  |  206|    394|#define DR_flags_offset 25
  ------------------
 1002|    394|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1002:6): [True: 3, False: 391]
  ------------------
 1003|      3|		return (0);
 1004|      3|	}
 1005|       |
 1006|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1007|    391|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  212|    391|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1007:6): [True: 4, False: 387]
  ------------------
 1008|      4|		return (0);
 1009|      4|	}
 1010|       |
 1011|       |	/* Root directory name is a single zero byte... */
 1012|    387|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  214|    387|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  216|    384|#define DR_name_offset 33
  ------------------
  |  Branch (1012:6): [True: 3, False: 384]
  |  Branch (1012:36): [True: 4, False: 380]
  ------------------
 1013|      7|		return (0);
 1014|      7|	}
 1015|       |
 1016|       |	/* Nothing looked wrong, so let's accept it. */
 1017|    380|	return (1);
 1018|    387|}
archive_read_support_format_iso9660.c:isJolietSVD:
  674|    374|{
  675|    374|	const unsigned char *p;
  676|    374|	ssize_t logical_block_size;
  677|    374|	int32_t volume_block;
  678|       |
  679|       |	/* Check if current sector is a kind of Supplementary Volume
  680|       |	 * Descriptor. */
  681|    374|	if (!isSVD(h))
  ------------------
  |  Branch (681:6): [True: 273, False: 101]
  ------------------
  682|    273|		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: 94, False: 7]
  |  Branch (689:21): [True: 40, False: 54]
  ------------------
  690|     40|		int level = 0;
  691|       |
  692|     40|		if (p[2] == '@')
  ------------------
  |  Branch (692:7): [True: 9, False: 31]
  ------------------
  693|      9|			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: 20, False: 10]
  ------------------
  697|     20|			level = 3;
  698|     10|		else /* not joliet */
  699|     10|			return (0);
  700|       |
  701|     30|		iso9660->seenJoliet = level;
  702|       |
  703|     30|	} else /* not joliet */
  704|     61|		return (0);
  705|       |
  706|     30|	logical_block_size =
  707|     30|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|     30|#define SVD_logical_block_size_offset 128
  ------------------
  708|     30|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|     30|#define SVD_volume_space_size_offset 80
  ------------------
  709|       |
  710|     30|	iso9660->logical_block_size = logical_block_size;
  711|     30|	iso9660->volume_block = volume_block;
  712|     30|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  713|       |	/* Read Root Directory Record in Volume Descriptor. */
  714|     30|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|     30|#define SVD_root_directory_record_offset 156
  ------------------
  715|     30|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|     30|#define DR_extent_offset 2
  ------------------
  716|     30|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|     30|#define DR_size_offset 10
  ------------------
  717|       |
  718|     30|	return (48);
  719|    101|}
archive_read_support_format_iso9660.c:isBootRecord:
  614|    372|{
  615|       |
  616|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  617|    372|	if (h[0] != 0)
  ------------------
  |  Branch (617:6): [True: 363, False: 9]
  ------------------
  618|    363|		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|    364|{
  783|    364|	const unsigned char *p;
  784|    364|	ssize_t logical_block_size;
  785|    364|	int32_t volume_block;
  786|    364|	int32_t location;
  787|       |
  788|       |
  789|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  790|    364|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   86|    364|#define PVD_type_offset 0
  ------------------
  |  Branch (790:6): [True: 236, False: 128]
  ------------------
  791|    236|		return (0);
  792|       |
  793|       |	/* EVD version must be 2. */
  794|    128|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   90|    128|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    128|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    128|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    128|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    128|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (794:6): [True: 99, False: 29]
  ------------------
  795|     99|		return (0);
  796|       |
  797|       |	/* Reserved field must be 0. */
  798|     29|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|     29|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|     29|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|     29|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|     29|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|     29|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|     29|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|     29|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (798:6): [True: 1, False: 28]
  ------------------
  799|      1|		return (0);
  800|       |
  801|       |	/* Reserved field must be 0. */
  802|     28|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|     28|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|     28|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|     28|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|     28|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|     28|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|     28|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     28|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     28|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|     28|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|     28|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|     28|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     28|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|     28|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|     28|#define PVD_reserved2_size 8
  ------------------
  |  Branch (802:6): [True: 2, False: 26]
  ------------------
  803|      2|		return (0);
  804|       |
  805|       |	/* Reserved field must be 0. */
  806|     26|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|     26|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|     26|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|     26|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|     26|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|     26|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|     26|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     26|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     26|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     26|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     26|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     26|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     26|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|     26|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|     26|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|     26|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     26|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|     26|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|     26|#define PVD_reserved3_size 32
  ------------------
  |  Branch (806:6): [True: 4, False: 22]
  ------------------
  807|      4|		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|     22|	logical_block_size =
  813|     22|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  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
  |  |  ------------------
  ------------------
  814|     22|	if (logical_block_size <= 0)
  ------------------
  |  Branch (814:6): [True: 1, False: 21]
  ------------------
  815|      1|		return (0);
  816|       |
  817|     21|	volume_block =
  818|     21|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  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
  |  |  ------------------
  ------------------
  819|     21|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|     21|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (819:6): [True: 2, False: 19]
  ------------------
  820|      2|		return (0);
  821|       |
  822|       |	/* File structure version must be 2 for ISO9660:1999. */
  823|     19|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  144|     19|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|     19|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|     19|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|     19|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     19|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|     19|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     19|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     19|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     19|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     19|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     19|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     19|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     19|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     19|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     19|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     19|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     19|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     19|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     19|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     19|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     19|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     19|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     19|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     19|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     19|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     19|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     19|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     19|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     19|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     19|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     19|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     19|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     19|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     19|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     19|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     19|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     19|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     19|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     19|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     19|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     19|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     19|#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|     19|#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|     19|#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|     19|#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|     19|#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|     19|#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|     19|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     19|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     19|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     19|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     19|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     19|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     19|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|     19|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|     19|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|     19|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|     19|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|     19|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (823:6): [True: 2, False: 17]
  ------------------
  824|      2|		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|     17|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|     17|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|     17|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     17|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|     17|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|     17|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|     17|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     17|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     17|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     17|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     17|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     17|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     17|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     17|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     17|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     17|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     17|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     17|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     17|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     17|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     17|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     17|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     17|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|     17|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|     17|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|     17|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|     17|#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|     17|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  830|     17|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|     17|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (830:6): [True: 2, False: 15]
  |  Branch (830:40): [True: 1, False: 14]
  ------------------
  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|     14|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|     14|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|     14|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|     14|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|     14|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|     14|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|     14|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     14|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     14|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     14|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     14|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     14|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     14|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     14|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     14|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     14|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     14|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     14|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     14|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     14|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     14|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     14|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     14|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     14|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     14|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     14|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     14|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|     14|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|     14|#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|     14|#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|     14|#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|     14|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  837|     14|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|     11|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (837:7): [True: 11, False: 3]
  |  Branch (837:23): [True: 1, False: 10]
  ------------------
  838|     13|	    || location >= volume_block)
  ------------------
  |  Branch (838:9): [True: 1, False: 12]
  ------------------
  839|      2|		return (0);
  840|       |
  841|       |	/* Reserved field must be 0. */
  842|     12|	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|     12|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     12|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     12|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     12|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     12|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     12|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     12|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     12|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     12|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     12|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     12|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     12|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     12|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     12|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     12|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     12|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     12|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     12|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     12|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     12|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     12|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     12|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     12|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     12|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     12|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     12|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     12|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     12|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     12|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     12|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     12|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     12|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     12|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     12|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     12|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     12|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     12|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     12|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     12|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     12|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     12|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     12|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     12|#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|     12|#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|     12|#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|     12|#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|     12|#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|     12|#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|     12|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     12|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     12|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     12|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     12|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     12|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     12|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     12|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     12|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     12|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     12|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     12|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     12|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  147|     12|#define PVD_reserved4_size 1
  ------------------
  |  Branch (842:6): [True: 1, False: 11]
  ------------------
  843|      1|		return (0);
  844|       |
  845|       |	/* Reserved field must be 0. */
  846|     11|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|     11|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|     11|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|     11|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|     11|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|     11|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|     11|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|     11|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|     11|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     11|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     11|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     11|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     11|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     11|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     11|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     11|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     11|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     11|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     11|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     11|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     11|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     11|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     11|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     11|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     11|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     11|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     11|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     11|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     11|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     11|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     11|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     11|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     11|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     11|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     11|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     11|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     11|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     11|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     11|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     11|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     11|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     11|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     11|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     11|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     11|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     11|#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|     11|#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|     11|#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|     11|#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|     11|#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|     11|#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|     11|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     11|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     11|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     11|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     11|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     11|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     11|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     11|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|     11|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|     11|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|     11|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|     11|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|     11|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|     11|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|     11|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|     11|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|     11|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|     11|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|     11|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|     11|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|     11|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|     11|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|     11|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|     11|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     11|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     11|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     11|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     11|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     11|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     11|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     11|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     11|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     11|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     11|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     11|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     11|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     11|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     11|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     11|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     11|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     11|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     11|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     11|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     11|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     11|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     11|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     11|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     11|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     11|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     11|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     11|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     11|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     11|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     11|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     11|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     11|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     11|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     11|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     11|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     11|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     11|#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|     11|#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|     11|#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|     11|#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|     11|#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|     11|#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|     11|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     11|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     11|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     11|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     11|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     11|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     11|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     11|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|     11|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|     11|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|     11|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|     11|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|     11|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|     11|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|     11|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (846:6): [True: 3, False: 8]
  ------------------
  847|      3|		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|    738|{
  724|    738|	const unsigned char *p;
  725|    738|	ssize_t logical_block_size;
  726|    738|	int32_t volume_block;
  727|    738|	int32_t location;
  728|       |
  729|       |
  730|       |	/* Type 2 means it's a SVD. */
  731|    738|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  162|    738|#define SVD_type_offset 0
  ------------------
  |  Branch (731:6): [True: 461, False: 277]
  ------------------
  732|    461|		return (0);
  733|       |
  734|       |	/* Reserved field must be 0. */
  735|    277|	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    277|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  170|    277|#define SVD_reserved1_size	8
  ------------------
  |  Branch (735:6): [True: 8, False: 269]
  ------------------
  736|      8|		return (0);
  737|    269|	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    269|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  185|    269|#define SVD_reserved2_size	1
  ------------------
  |  Branch (737:6): [True: 7, False: 262]
  ------------------
  738|      7|		return (0);
  739|    262|	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    262|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  187|    262|#define SVD_reserved3_size	653
  ------------------
  |  Branch (739:6): [True: 31, False: 231]
  ------------------
  740|     31|		return (0);
  741|       |
  742|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  743|    231|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  183|    231|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (743:6): [True: 19, False: 212]
  ------------------
  744|     19|		return (0);
  745|       |
  746|    212|	logical_block_size =
  747|    212|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|    212|#define SVD_logical_block_size_offset 128
  ------------------
  748|    212|	if (logical_block_size <= 0)
  ------------------
  |  Branch (748:6): [True: 3, False: 209]
  ------------------
  749|      3|		return (0);
  750|       |
  751|    209|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|    209|#define SVD_volume_space_size_offset 80
  ------------------
  752|    209|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    209|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (752:6): [True: 2, False: 207]
  ------------------
  753|      2|		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|    207|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  178|    207|#define SVD_type_L_path_table_offset 140
  ------------------
  759|    207|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    207|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (759:6): [True: 2, False: 205]
  |  Branch (759:40): [True: 3, False: 202]
  ------------------
  760|      5|		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: 25, False: 172]
  ------------------
  774|     25|		return (0);
  775|     25|	}
  776|       |
  777|    172|	return (48);
  778|    197|}
archive_read_support_format_iso9660.c:isVolumePartition:
  629|    293|{
  630|    293|	int32_t location;
  631|       |
  632|       |	/* Type of the Volume Partition Descriptor must be 3. */
  633|    293|	if (h[0] != 3)
  ------------------
  |  Branch (633:6): [True: 289, False: 4]
  ------------------
  634|    289|		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|    293|{
  656|       |
  657|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  658|    293|	if (h[0] != 255)
  ------------------
  |  Branch (658:6): [True: 99, False: 194]
  ------------------
  659|     99|		return (0);
  660|       |
  661|       |	/* Volume Descriptor Version must be 1. */
  662|    194|	if (h[6] != 1)
  ------------------
  |  Branch (662:6): [True: 1, False: 193]
  ------------------
  663|      1|		return (0);
  664|       |
  665|       |	/* Reserved field must be 0. */
  666|    193|	if (!isNull(h, 7, 2048-7))
  ------------------
  |  Branch (666:6): [True: 4, False: 189]
  ------------------
  667|      4|		return (0);
  668|       |
  669|    189|	return (1);
  670|    193|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1234|    841|{
 1235|    841|	struct iso9660 *iso9660 = a->format->data;
 1236|    841|	struct file_info *file;
 1237|    841|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  233|    841|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1238|       |
 1239|    841|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1239:6): [True: 188, False: 653]
  ------------------
 1240|    188|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  372|    188|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1241|    188|		a->archive.archive_format_name = "ISO9660";
 1242|    188|	}
 1243|       |
 1244|    841|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1244:6): [True: 188, False: 653]
  ------------------
 1245|    188|		r = choose_volume(a, iso9660);
 1246|    188|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    188|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1246:7): [True: 19, False: 169]
  ------------------
 1247|     19|			return (r);
 1248|    188|	}
 1249|       |
 1250|    822|	file = NULL;/* Eliminate a warning. */
 1251|       |	/* Get the next entry that appears after the current offset. */
 1252|    822|	r = next_entry_seek(a, iso9660, &file);
 1253|    822|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    822|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1253:6): [True: 212, False: 610]
  ------------------
 1254|    212|		return (r);
 1255|       |
 1256|    610|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1256:6): [True: 11, False: 599]
  ------------------
 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|    599|	} else {
 1315|    599|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1316|    599|		if (path == NULL) {
  ------------------
  |  Branch (1316:7): [True: 0, False: 599]
  ------------------
 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|    599|		} else {
 1322|    599|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    599|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1323|    599|			archive_entry_set_pathname(entry, path);
 1324|    599|		}
 1325|    599|	}
 1326|       |
 1327|    610|	iso9660->entry_bytes_remaining = file->size;
 1328|       |	/* Offset for sparse-file-aware clients. */
 1329|    610|	iso9660->entry_sparse_offset = 0;
 1330|       |
 1331|    610|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1331:6): [True: 87, False: 523]
  ------------------
 1332|     87|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     87|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1333|     87|		    "File is beyond end-of-media: %s",
 1334|     87|		    archive_entry_pathname(entry));
 1335|     87|		iso9660->entry_bytes_remaining = 0;
 1336|     87|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     87|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1337|     87|	}
 1338|       |
 1339|       |	/* Set up the entry structure with information about this entry. */
 1340|    523|	archive_entry_set_mode(entry, file->mode);
 1341|    523|	archive_entry_set_uid(entry, file->uid);
 1342|    523|	archive_entry_set_gid(entry, file->gid);
 1343|    523|	archive_entry_set_nlink(entry, file->nlinks);
 1344|    523|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  311|    523|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1344:6): [True: 1, False: 522]
  ------------------
 1345|      1|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1346|    522|	else
 1347|    522|		archive_entry_unset_birthtime(entry);
 1348|    523|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  312|    523|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1348:6): [True: 210, False: 313]
  ------------------
 1349|    210|		archive_entry_set_mtime(entry, file->mtime, 0);
 1350|    313|	else
 1351|    313|		archive_entry_unset_mtime(entry);
 1352|    523|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  314|    523|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1352:6): [True: 209, False: 314]
  ------------------
 1353|    209|		archive_entry_set_ctime(entry, file->ctime, 0);
 1354|    314|	else
 1355|    314|		archive_entry_unset_ctime(entry);
 1356|    523|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  313|    523|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1356:6): [True: 211, False: 312]
  ------------------
 1357|    211|		archive_entry_set_atime(entry, file->atime, 0);
 1358|    312|	else
 1359|    312|		archive_entry_unset_atime(entry);
 1360|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1361|    523|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1362|    523|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1363|    523|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1363:6): [True: 18, False: 505]
  ------------------
 1364|     18|		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|    523|	if (file->number != -1 &&
  ------------------
  |  Branch (1370:6): [True: 391, False: 132]
  ------------------
 1371|    391|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1371:6): [True: 69, False: 322]
  ------------------
 1372|     69|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1372:7): [True: 1, False: 68]
  ------------------
 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|     68|			archive_entry_set_hardlink(entry,
 1393|     68|			    iso9660->previous_pathname.s);
 1394|     69|		archive_entry_unset_size(entry);
 1395|     69|		iso9660->entry_bytes_remaining = 0;
 1396|     69|		return (rd_r);
 1397|     69|	}
 1398|       |
 1399|    454|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  215|    454|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  221|    908|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1399:6): [True: 306, False: 148]
  ------------------
 1400|    306|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1400:6): [True: 75, False: 231]
  ------------------
 1401|     75|		int64_t r64;
 1402|       |
 1403|     75|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1404|     75|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1404:7): [True: 0, False: 75]
  ------------------
 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|     75|		iso9660->current_position = (uint64_t)r64;
 1423|     75|	}
 1424|       |
 1425|       |	/* Initialize zisofs variables. */
 1426|    454|	iso9660->entry_zisofs.pz = file->pz;
 1427|    454|	if (file->pz) {
  ------------------
  |  Branch (1427:6): [True: 0, False: 454]
  ------------------
 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|    454|	iso9660->previous_number = file->number;
 1444|    454|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1444:6): [True: 10, False: 444]
  ------------------
 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|    454|		archive_strcpy(
  ------------------
  |  |  165|    444|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    888|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 444]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1450|    454|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1451|       |
 1452|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1453|    454|	iso9660->entry_content = file->contents.first;
 1454|    454|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1454:6): [True: 17, False: 437]
  ------------------
 1455|     17|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1456|       |
 1457|    454|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    454|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1457:6): [True: 148, False: 306]
  ------------------
 1458|       |		/* Overwrite nlinks by proper link number which is
 1459|       |		 * calculated from number of sub directories. */
 1460|    148|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1461|       |		/* Directory data has been read completely. */
 1462|    148|		iso9660->entry_bytes_remaining = 0;
 1463|    148|	}
 1464|       |
 1465|    454|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  233|    454|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1465:6): [True: 3, False: 451]
  ------------------
 1466|      3|		return (rd_r);
 1467|    451|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    451|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1468|    454|}
archive_read_support_format_iso9660.c:choose_volume:
 1145|    188|{
 1146|    188|	struct file_info *file;
 1147|    188|	int64_t skipsize;
 1148|    188|	struct vd *vd;
 1149|    188|	const void *block;
 1150|    188|	char seenJoliet;
 1151|       |
 1152|    188|	vd = &(iso9660->primary);
 1153|    188|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1153:6): [True: 0, False: 188]
  ------------------
 1154|      0|		iso9660->seenJoliet = 0;
 1155|    188|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1155:6): [True: 19, False: 169]
  ------------------
 1156|     19|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1156:3): [True: 3, False: 16]
  ------------------
 1157|       |		/* This condition is unlikely; by way of caution. */
 1158|      3|		vd = &(iso9660->joliet);
 1159|       |
 1160|    188|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|    188|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1161|    188|	skipsize = __archive_read_consume(a, skipsize);
 1162|    188|	if (skipsize < 0)
  ------------------
  |  Branch (1162:6): [True: 4, False: 184]
  ------------------
 1163|      4|		return ((int)skipsize);
 1164|    184|	iso9660->current_position = skipsize;
 1165|       |
 1166|    184|	block = __archive_read_ahead(a, vd->size, NULL);
 1167|    184|	if (block == NULL) {
  ------------------
  |  Branch (1167:6): [True: 0, False: 184]
  ------------------
 1168|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1169|      0|		    "Failed to read full block when scanning "
 1170|      0|		    "ISO9660 directory list");
 1171|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1172|      0|	}
 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|    184|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1180|    184|	iso9660->seenJoliet = 0;
 1181|    184|	file = parse_file_info(a, NULL, block, vd->size);
 1182|    184|	if (file == NULL)
  ------------------
  |  Branch (1182:6): [True: 12, False: 172]
  ------------------
 1183|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1184|    172|	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|    172|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1190:6): [True: 170, False: 2]
  |  Branch (1190:35): [True: 70, False: 100]
  ------------------
 1191|     70|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1191:9): [True: 0, False: 70]
  ------------------
 1192|      0|		iso9660->seenJoliet = 0;
 1193|       |
 1194|    172|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1194:6): [True: 170, False: 2]
  |  Branch (1194:35): [True: 100, False: 70]
  ------------------
 1195|    100|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1195:9): [True: 15, False: 85]
  ------------------
 1196|       |		/* Switch reading data from primary to joliet. */
 1197|     15|		vd = &(iso9660->joliet);
 1198|     15|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|     15|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1199|     15|		skipsize -= iso9660->current_position;
 1200|     15|		skipsize = __archive_read_consume(a, skipsize);
 1201|     15|		if (skipsize < 0)
  ------------------
  |  Branch (1201:7): [True: 2, False: 13]
  ------------------
 1202|      2|			return ((int)skipsize);
 1203|     13|		iso9660->current_position += skipsize;
 1204|       |
 1205|     13|		block = __archive_read_ahead(a, vd->size, NULL);
 1206|     13|		if (block == NULL) {
  ------------------
  |  Branch (1206:7): [True: 0, False: 13]
  ------------------
 1207|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1208|      0|			    "Failed to read full block when scanning "
 1209|      0|			    "ISO9660 directory list");
 1210|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1211|      0|		}
 1212|     13|		iso9660->seenJoliet = 0;
 1213|     13|		file = parse_file_info(a, NULL, block, vd->size);
 1214|     13|		if (file == NULL)
  ------------------
  |  Branch (1214:7): [True: 1, False: 12]
  ------------------
 1215|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1216|     12|		iso9660->seenJoliet = seenJoliet;
 1217|     12|	}
 1218|       |
 1219|       |	/* Store the root directory in the pending list. */
 1220|    169|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  451|    169|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  233|    169|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1220:6): [True: 0, False: 169]
  ------------------
 1221|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1222|    169|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1222:6): [True: 70, False: 99]
  ------------------
 1223|     70|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  373|     70|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  372|     70|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1224|     70|		a->archive.archive_format_name =
 1225|     70|		    "ISO9660 with Rockridge extensions";
 1226|     70|	}
 1227|       |
 1228|    169|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    169|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1229|    169|}
archive_read_support_format_iso9660.c:parse_file_info:
 1821|    954|{
 1822|    954|	struct iso9660 *iso9660 = a->format->data;
 1823|    954|	struct file_info *file, *filep;
 1824|    954|	size_t name_len;
 1825|    954|	const unsigned char *rr_start, *rr_end;
 1826|    954|	const unsigned char *p;
 1827|    954|	size_t dr_len = 0;
 1828|    954|	uint64_t fsize, offset;
 1829|    954|	int32_t location;
 1830|    954|	int flags;
 1831|       |
 1832|    954|	if (reclen != 0)
  ------------------
  |  Branch (1832:6): [True: 953, False: 1]
  ------------------
 1833|    953|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  196|    953|#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|    954|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1838:6): [True: 1, False: 953]
  |  Branch (1838:21): [True: 0, False: 953]
  |  Branch (1838:40): [True: 10, False: 943]
  ------------------
 1839|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1840|     11|			"Invalid length of directory record");
 1841|     11|		return (NULL);
 1842|     11|	}
 1843|    943|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  214|    943|#define DR_name_len_offset 32
  ------------------
 1844|    943|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  200|    943|#define DR_extent_offset 2
  ------------------
 1845|    943|	fsize = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  202|    943|#define DR_size_offset 10
  ------------------
 1846|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1847|    943|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1847:6): [True: 4, False: 939]
  |  Branch (1847:32): [True: 4, False: 935]
  ------------------
 1848|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1849|      8|		    "Invalid length of file identifier");
 1850|      8|		return (NULL);
 1851|      8|	}
 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|    935|	if (location > 0 &&
  ------------------
  |  Branch (1858:6): [True: 421, False: 514]
  ------------------
 1859|    421|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1859:6): [True: 2, False: 419]
  ------------------
 1860|    421|	       / iso9660->logical_block_size))
 1861|    421|			> (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|    933|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1868:6): [True: 558, False: 375]
  |  Branch (1868:20): [True: 5, False: 553]
  ------------------
 1869|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1870|      5|		    "Invalid location of extent of file");
 1871|      5|		return (NULL);
 1872|      5|	}
 1873|       |
 1874|       |	/* Sanity check that this entry does not create a cycle. */
 1875|    928|	offset = iso9660->logical_block_size * (uint64_t)location;
 1876|  1.85k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1876:23): [True: 932, False: 927]
  ------------------
 1877|    932|		if (filep->offset == offset) {
  ------------------
  |  Branch (1877:7): [True: 1, False: 931]
  ------------------
 1878|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1879|      1|			    "Directory structure contains loop");
 1880|      1|			return (NULL);
 1881|      1|		}
 1882|    932|	}
 1883|       |
 1884|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1885|    927|	file = calloc(1, sizeof(*file));
 1886|    927|	if (file == NULL) {
  ------------------
  |  Branch (1886:6): [True: 0, False: 927]
  ------------------
 1887|      0|		archive_set_error(&a->archive, ENOMEM,
 1888|      0|		    "No memory for file entry");
 1889|      0|		return (NULL);
 1890|      0|	}
 1891|    927|	file->parent = parent;
 1892|    927|	file->offset = offset;
 1893|    927|	file->size = fsize;
 1894|    927|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  204|    927|#define DR_date_offset 18
  ------------------
  |  Branch (1894:6): [True: 359, False: 568]
  ------------------
 1895|    359|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    359|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    359|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  314|    359|#define CTIME_IS_SET 8
  ------------------
 1896|    359|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  204|    359|#define DR_date_offset 18
  ------------------
 1897|    359|		file->ctime = file->atime = file->mtime;
 1898|    359|	}
 1899|    927|	file->rede_files.first = NULL;
 1900|    927|	file->rede_files.last = &(file->rede_files.first);
 1901|       |
 1902|    927|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  216|    927|#define DR_name_offset 33
  ------------------
 1903|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1904|       |	 * before fidgeting the name_len below. */
 1905|    927|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1905:29): [True: 238, False: 689]
  ------------------
 1906|    927|	rr_end = isodirrec + dr_len;
 1907|       |
 1908|    927|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1908:6): [True: 21, False: 906]
  ------------------
 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|    906|	} else {
 1945|       |		/* Chop off trailing ';1' from files. */
 1946|    906|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1946:7): [True: 727, False: 179]
  |  Branch (1946:23): [True: 344, False: 383]
  ------------------
 1947|    344|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1947:5): [True: 307, False: 37]
  ------------------
 1948|    307|			name_len -= 2;
 1949|       |		/* Chop off trailing '.' from filenames. */
 1950|    906|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1950:7): [True: 727, False: 179]
  |  Branch (1950:23): [True: 7, False: 720]
  ------------------
 1951|      7|			--name_len;
 1952|       |
 1953|    906|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    906|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1954|    906|	}
 1955|       |
 1956|    927|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  206|    927|#define DR_flags_offset 25
  ------------------
 1957|    927|	if (flags & 0x02)
  ------------------
  |  Branch (1957:6): [True: 377, False: 550]
  ------------------
 1958|    377|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    377|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1959|    550|	else
 1960|    550|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    550|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1961|    927|	if (flags & 0x80)
  ------------------
  |  Branch (1961:6): [True: 98, False: 829]
  ------------------
 1962|     98|		file->multi_extent = 1;
 1963|    829|	else
 1964|    829|		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|    927|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1974:6): [True: 375, False: 552]
  |  Branch (1974:25): [True: 234, False: 141]
  ------------------
 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|    234|		file->number = -1;
 1981|       |		/* Do not appear before any directory entries. */
 1982|    234|		file->offset = -1;
 1983|    234|	} else
 1984|    693|		file->number = (int64_t)(uint32_t)location;
 1985|       |
 1986|       |	/* Rockridge extensions overwrite information from above. */
 1987|    927|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (1987:6): [True: 174, False: 753]
  ------------------
 1988|    174|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (1988:7): [True: 174, False: 0]
  |  Branch (1988:25): [True: 90, False: 84]
  ------------------
 1989|     90|			p = rr_start;
 1990|     90|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (1990:8): [True: 86, False: 4]
  ------------------
 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|     86|				iso9660->suspOffset = p[6];
 2008|     86|				iso9660->seenSUSP = 1;
 2009|     86|				rr_start += 7;
 2010|     86|			}
 2011|     90|		}
 2012|    174|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2012:7): [True: 86, False: 88]
  ------------------
 2013|     86|			int r;
 2014|       |
 2015|     86|			file->name_continues = 0;
 2016|     86|			file->symlink_continues = 0;
 2017|     86|			rr_start += iso9660->suspOffset;
 2018|     86|			r = parse_rockridge(a, file, rr_start, rr_end);
 2019|     86|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     86|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2019:8): [True: 1, False: 85]
  ------------------
 2020|      1|				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|     85|			if (file->size > 0 &&
  ------------------
  |  Branch (2028:8): [True: 8, False: 77]
  ------------------
 2029|      8|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|      8|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|      8|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2029:8): [True: 0, False: 8]
  ------------------
 2030|      0|				file->size = 0;
 2031|      0|				file->number = -1;
 2032|      0|				file->offset = -1;
 2033|      0|			}
 2034|     85|		} else
 2035|       |			/* If there isn't SUSP, disable parsing
 2036|       |			 * rock ridge extensions. */
 2037|     88|			iso9660->opt_support_rockridge = 0;
 2038|    174|	}
 2039|       |
 2040|    926|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2041|       |	/* Tell file's parent how many children that parent has. */
 2042|    926|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2042:6): [True: 741, False: 185]
  |  Branch (2042:24): [True: 282, False: 459]
  ------------------
 2043|    282|		parent->subdirs++;
 2044|       |
 2045|    926|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2045:6): [True: 71, False: 855]
  ------------------
 2046|     71|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2046:7): [True: 0, False: 71]
  |  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|     71|		} else if (file->re) {
  ------------------
  |  Branch (2056:14): [True: 1, False: 70]
  ------------------
 2057|       |			/*
 2058|       |			 * Sanity check: file's parent is rr_moved.
 2059|       |			 */
 2060|      1|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2060:8): [True: 1, False: 0]
  |  Branch (2060:26): [True: 0, False: 0]
  ------------------
 2061|      1|				archive_set_error(&a->archive,
 2062|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2063|      1|				    "Invalid Rockridge RE");
 2064|      1|				goto fail;
 2065|      1|			}
 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|     70|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2084:14): [True: 0, False: 70]
  |  Branch (2084:32): [True: 0, False: 0]
  ------------------
 2085|      0|			file->rr_moved_has_re_only = 0;
 2086|     70|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2086:12): [True: 0, False: 70]
  |  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|     70|		if (file->cl_offset) {
  ------------------
  |  Branch (2089:7): [True: 0, False: 70]
  ------------------
 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|     70|	}
 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|    925|	register_file(iso9660, file);
 2161|    925|	return (file);
 2162|      2|fail:
 2163|      2|	archive_string_free(&file->name);
 2164|      2|	free(file);
 2165|       |	return (NULL);
 2166|    926|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3251|    973|{
 3252|    973|	int year = v[0];
 3253|    973|	int month = v[1];
 3254|    973|	int day = v[2];
 3255|    973|	int hour = v[3];
 3256|    973|	int minute = v[4];
 3257|    973|	int second = v[5];
 3258|    973|	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|    973|	if (year == 0
  ------------------
  |  Branch (3262:6): [True: 421, False: 552]
  ------------------
 3263|    421|	    && month == 0
  ------------------
  |  Branch (3263:9): [True: 380, False: 41]
  ------------------
 3264|    380|	    && day == 0
  ------------------
  |  Branch (3264:9): [True: 367, False: 13]
  ------------------
 3265|    367|	    && hour == 0
  ------------------
  |  Branch (3265:9): [True: 360, False: 7]
  ------------------
 3266|    360|	    && minute == 0
  ------------------
  |  Branch (3266:9): [True: 352, False: 8]
  ------------------
 3267|    352|	    && second == 0
  ------------------
  |  Branch (3267:9): [True: 333, False: 19]
  ------------------
 3268|    333|	    && gmt_off == 0)
  ------------------
  |  Branch (3268:9): [True: 288, False: 45]
  ------------------
 3269|    288|		return 0;
 3270|       |	/*
 3271|       |	 * Sanity-test each individual field
 3272|       |	 */
 3273|       |	/* Year can have any value */
 3274|       |	/* Month must be 1-12 */
 3275|    685|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3275:6): [True: 103, False: 582]
  |  Branch (3275:19): [True: 53, False: 529]
  ------------------
 3276|    156|		return 0;
 3277|       |	/* Day must be 1-31 */
 3278|    529|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3278:6): [True: 62, False: 467]
  |  Branch (3278:17): [True: 47, False: 420]
  ------------------
 3279|    109|		return 0;
 3280|       |	/* Hour must be 0-23 */
 3281|    420|	if (hour > 23)
  ------------------
  |  Branch (3281:6): [True: 19, False: 401]
  ------------------
 3282|     19|		return 0;
 3283|       |	/* Minute must be 0-59 */
 3284|    401|	if (minute > 59)
  ------------------
  |  Branch (3284:6): [True: 13, False: 388]
  ------------------
 3285|     13|		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|    388|	if (second > 61)
  ------------------
  |  Branch (3289:6): [True: 10, False: 378]
  ------------------
 3290|     10|		return 0;
 3291|       |	/* Offset from GMT must be -48 to +52 */
 3292|    378|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3292:6): [True: 3, False: 375]
  |  Branch (3292:23): [True: 9, False: 366]
  ------------------
 3293|     12|		return 0;
 3294|       |
 3295|       |	/* All tests pass, this is OK */
 3296|    366|	return 1;
 3297|    378|}
archive_read_support_format_iso9660.c:isodate7:
 3301|    366|{
 3302|    366|	struct tm tm;
 3303|    366|	int offset;
 3304|    366|	time_t t;
 3305|       |
 3306|    366|	memset(&tm, 0, sizeof(tm));
 3307|    366|	tm.tm_year = v[0];
 3308|    366|	tm.tm_mon = v[1] - 1;
 3309|    366|	tm.tm_mday = v[2];
 3310|    366|	tm.tm_hour = v[3];
 3311|    366|	tm.tm_min = v[4];
 3312|    366|	tm.tm_sec = v[5];
 3313|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3314|    366|	offset = ((const signed char *)v)[6];
 3315|    366|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3315:6): [True: 363, False: 3]
  |  Branch (3315:22): [True: 359, False: 4]
  ------------------
 3316|    359|		tm.tm_hour -= offset / 4;
 3317|    359|		tm.tm_min -= (offset % 4) * 15;
 3318|    359|	}
 3319|    366|	t = time_from_tm(&tm);
 3320|    366|	if (t == (time_t)-1)
  ------------------
  |  Branch (3320:6): [True: 0, False: 366]
  ------------------
 3321|      0|		return ((time_t)0);
 3322|    366|	return (t);
 3323|    366|}
archive_read_support_format_iso9660.c:time_from_tm:
 3416|    372|{
 3417|       |#if HAVE__MKGMTIME
 3418|       |        return _mkgmtime(t);
 3419|       |#elif HAVE_TIMEGM
 3420|       |        /* Use platform timegm() if available. */
 3421|    372|        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|    372|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2171|     86|{
 2172|     86|	struct iso9660 *iso9660 = a->format->data;
 2173|     86|	int entry_seen = 0;
 2174|       |
 2175|    212|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2175:9): [True: 204, False: 8]
  ------------------
 2176|    204|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2176:9): [True: 153, False: 51]
  |  Branch (2176:24): [True: 135, False: 18]
  ------------------
 2177|    135|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2177:9): [True: 133, False: 2]
  |  Branch (2177:24): [True: 129, False: 4]
  ------------------
 2178|    129|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2178:9): [True: 128, False: 1]
  ------------------
 2179|    128|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2179:9): [True: 127, False: 1]
  ------------------
 2180|    127|		const unsigned char *data = p + 4;
 2181|    127|		int data_length = p[2] - 4;
 2182|    127|		int version = p[3];
 2183|       |
 2184|    127|		switch(p[0]) {
 2185|      3|		case 'C':
  ------------------
  |  Branch (2185:3): [True: 3, False: 124]
  ------------------
 2186|      3|			if (p[1] == 'E') {
  ------------------
  |  Branch (2186:8): [True: 1, False: 2]
  ------------------
 2187|      1|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 1]
  |  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|      1|			}
 2205|      2|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2205:13): [True: 1, False: 1]
  ------------------
 2206|      1|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2206:9): [True: 0, False: 1]
  |  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|      1|			}
 2213|      3|			break;
 2214|      6|		case 'N':
  ------------------
  |  Branch (2214:3): [True: 6, False: 121]
  ------------------
 2215|      6|			if (p[1] == 'M') {
  ------------------
  |  Branch (2215:8): [True: 5, False: 1]
  ------------------
 2216|      5|				if (version == 1) {
  ------------------
  |  Branch (2216:9): [True: 5, False: 0]
  ------------------
 2217|      5|					parse_rockridge_NM1(file,
 2218|      5|					    data, data_length);
 2219|      5|					iso9660->seenRockridge = 1;
 2220|      5|				}
 2221|      5|			}
 2222|      6|			break;
 2223|      7|		case 'P':
  ------------------
  |  Branch (2223:3): [True: 7, False: 120]
  ------------------
 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|      7|			if (p[1] == 'N') {
  ------------------
  |  Branch (2231:8): [True: 1, False: 6]
  ------------------
 2232|      1|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2232:9): [True: 0, False: 1]
  |  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|      1|			}
 2240|      6|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2240:13): [True: 3, False: 3]
  ------------------
 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|      3|				if (version == 1) {
  ------------------
  |  Branch (2249:9): [True: 0, False: 3]
  ------------------
 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|      3|			}
 2268|      7|			break;
 2269|      4|		case 'R':
  ------------------
  |  Branch (2269:3): [True: 4, False: 123]
  ------------------
 2270|      4|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2270:8): [True: 1, False: 3]
  |  Branch (2270:23): [True: 1, False: 0]
  ------------------
 2271|      1|				file->re = 1;
 2272|      1|				iso9660->seenRockridge = 1;
 2273|      1|			}
 2274|      3|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2274:13): [True: 0, False: 3]
  |  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|      4|			break;
 2283|     55|		case 'S':
  ------------------
  |  Branch (2283:3): [True: 55, False: 72]
  ------------------
 2284|     55|			if (p[1] == 'L') {
  ------------------
  |  Branch (2284:8): [True: 21, False: 34]
  ------------------
 2285|     21|				if (version == 1) {
  ------------------
  |  Branch (2285:9): [True: 20, False: 1]
  ------------------
 2286|     20|					parse_rockridge_SL1(file,
 2287|     20|					    data, data_length);
 2288|     20|					iso9660->seenRockridge = 1;
 2289|     20|				}
 2290|     21|			}
 2291|     34|			else if (p[1] == 'T'
  ------------------
  |  Branch (2291:13): [True: 2, False: 32]
  ------------------
 2292|      2|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2292:11): [True: 2, False: 0]
  |  Branch (2292:31): [True: 1, False: 1]
  ------------------
 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|      1|				iso9660->seenSUSP = 0;
 2303|      1|				iso9660->seenRockridge = 0;
 2304|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2305|      1|			}
 2306|     54|			break;
 2307|     54|		case 'T':
  ------------------
  |  Branch (2307:3): [True: 46, False: 81]
  ------------------
 2308|     46|			if (p[1] == 'F') {
  ------------------
  |  Branch (2308:8): [True: 45, False: 1]
  ------------------
 2309|     45|				if (version == 1) {
  ------------------
  |  Branch (2309:9): [True: 45, False: 0]
  ------------------
 2310|     45|					parse_rockridge_TF1(file,
 2311|     45|					    data, data_length);
 2312|     45|					iso9660->seenRockridge = 1;
 2313|     45|				}
 2314|     45|			}
 2315|     46|			break;
 2316|      3|		case 'Z':
  ------------------
  |  Branch (2316:3): [True: 3, False: 124]
  ------------------
 2317|      3|			if (p[1] == 'F') {
  ------------------
  |  Branch (2317:8): [True: 2, False: 1]
  ------------------
 2318|      2|				if (version == 1)
  ------------------
  |  Branch (2318:9): [True: 1, False: 1]
  ------------------
 2319|      1|					parse_rockridge_ZF1(file,
 2320|      1|					    data, data_length);
 2321|      2|			}
 2322|      3|			break;
 2323|      3|		default:
  ------------------
  |  Branch (2323:3): [True: 3, False: 124]
  ------------------
 2324|      3|			break;
 2325|    127|		}
 2326|       |
 2327|    126|		p += p[2];
 2328|    126|		entry_seen = 1;
 2329|    126|	}
 2330|       |
 2331|     85|	if (entry_seen)
  ------------------
  |  Branch (2331:6): [True: 84, False: 1]
  ------------------
 2332|     84|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     84|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2333|      1|	else {
 2334|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2335|      1|				  "Tried to parse Rockridge extensions, but none found");
 2336|      1|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2337|      1|	}
 2338|     85|}
archive_read_support_format_iso9660.c:parse_rockridge_NM1:
 2511|      5|{
 2512|      5|	if (!file->name_continues)
  ------------------
  |  Branch (2512:6): [True: 5, False: 0]
  ------------------
 2513|      5|		archive_string_empty(&file->name);
  ------------------
  |  |  181|      5|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2514|      5|	file->name_continues = 0;
 2515|      5|	if (data_length < 1)
  ------------------
  |  Branch (2515:6): [True: 1, False: 4]
  ------------------
 2516|      1|		return;
 2517|       |	/*
 2518|       |	 * NM version 1 extension comprises:
 2519|       |	 *   1 byte flag, value is one of:
 2520|       |	 *     = 0: remainder is name
 2521|       |	 *     = 1: remainder is name, next NM entry continues name
 2522|       |	 *     = 2: "."
 2523|       |	 *     = 4: ".."
 2524|       |	 *     = 32: Implementation specific
 2525|       |	 *     All other values are reserved.
 2526|       |	 */
 2527|      4|	switch(data[0]) {
 2528|      2|	case 0:
  ------------------
  |  Branch (2528:2): [True: 2, False: 2]
  ------------------
 2529|      2|		if (data_length < 2)
  ------------------
  |  Branch (2529:7): [True: 1, False: 1]
  ------------------
 2530|      1|			return;
 2531|      1|		archive_strncat(&file->name,
 2532|      1|		    (const char *)data + 1, data_length - 1);
 2533|      1|		break;
 2534|      1|	case 1:
  ------------------
  |  Branch (2534:2): [True: 1, False: 3]
  ------------------
 2535|      1|		if (data_length < 2)
  ------------------
  |  Branch (2535:7): [True: 1, False: 0]
  ------------------
 2536|      1|			return;
 2537|      0|		archive_strncat(&file->name,
 2538|      0|		    (const char *)data + 1, data_length - 1);
 2539|      0|		file->name_continues = 1;
 2540|      0|		break;
 2541|      0|	case 2:
  ------------------
  |  Branch (2541:2): [True: 0, False: 4]
  ------------------
 2542|      0|		archive_strcat(&file->name, ".");
 2543|      0|		break;
 2544|      0|	case 4:
  ------------------
  |  Branch (2544:2): [True: 0, False: 4]
  ------------------
 2545|      0|		archive_strcat(&file->name, "..");
 2546|      0|		break;
 2547|      1|	default:
  ------------------
  |  Branch (2547:2): [True: 1, False: 3]
  ------------------
 2548|      1|		return;
 2549|      4|	}
 2550|       |
 2551|      4|}
archive_read_support_format_iso9660.c:parse_rockridge_SL1:
 2651|     20|{
 2652|     20|	const char *separator = "";
 2653|       |
 2654|     20|	if (!file->symlink_continues || file->symlink.length < 1)
  ------------------
  |  Branch (2654:6): [True: 20, False: 0]
  |  Branch (2654:34): [True: 0, False: 0]
  ------------------
 2655|     20|		archive_string_empty(&file->symlink);
  ------------------
  |  |  181|     20|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2656|     20|	file->symlink_continues = 0;
 2657|       |
 2658|       |	/*
 2659|       |	 * Defined flag values:
 2660|       |	 *  0: This is the last SL record for this symbolic link
 2661|       |	 *  1: this symbolic link field continues in next SL entry
 2662|       |	 *  All other values are reserved.
 2663|       |	 */
 2664|     20|	if (data_length < 1)
  ------------------
  |  Branch (2664:6): [True: 1, False: 19]
  ------------------
 2665|      1|		return;
 2666|     19|	switch(*data) {
 2667|     15|	case 0:
  ------------------
  |  Branch (2667:2): [True: 15, False: 4]
  ------------------
 2668|     15|		break;
 2669|      3|	case 1:
  ------------------
  |  Branch (2669:2): [True: 3, False: 16]
  ------------------
 2670|      3|		file->symlink_continues = 1;
 2671|      3|		break;
 2672|      1|	default:
  ------------------
  |  Branch (2672:2): [True: 1, False: 18]
  ------------------
 2673|      1|		return;
 2674|     19|	}
 2675|     18|	++data;  /* Skip flag byte. */
 2676|     18|	--data_length;
 2677|       |
 2678|       |	/*
 2679|       |	 * SL extension body stores "components".
 2680|       |	 * Basically, this is a complicated way of storing
 2681|       |	 * a POSIX path.  It also interferes with using
 2682|       |	 * symlinks for storing non-path data. <sigh>
 2683|       |	 *
 2684|       |	 * Each component is 2 bytes (flag and length)
 2685|       |	 * possibly followed by name data.
 2686|       |	 */
 2687|     94|	while (data_length >= 2) {
  ------------------
  |  Branch (2687:9): [True: 81, False: 13]
  ------------------
 2688|     81|		unsigned char flag = *data++;
 2689|     81|		unsigned char nlen = *data++;
 2690|     81|		data_length -= 2;
 2691|       |
 2692|     81|		archive_strcat(&file->symlink, separator);
 2693|     81|		separator = "/";
 2694|       |
 2695|     81|		switch(flag) {
 2696|     32|		case 0: /* Usual case, this is text. */
  ------------------
  |  Branch (2696:3): [True: 32, False: 49]
  ------------------
 2697|     32|			if (data_length < nlen)
  ------------------
  |  Branch (2697:8): [True: 1, False: 31]
  ------------------
 2698|      1|				return;
 2699|     31|			archive_strncat(&file->symlink,
 2700|     31|			    (const char *)data, nlen);
 2701|     31|			break;
 2702|     23|		case 0x01: /* Text continues in next component. */
  ------------------
  |  Branch (2702:3): [True: 23, False: 58]
  ------------------
 2703|     23|			if (data_length < nlen)
  ------------------
  |  Branch (2703:8): [True: 2, False: 21]
  ------------------
 2704|      2|				return;
 2705|     21|			archive_strncat(&file->symlink,
 2706|     21|			    (const char *)data, nlen);
 2707|     21|			separator = "";
 2708|     21|			break;
 2709|     10|		case 0x02: /* Current dir. */
  ------------------
  |  Branch (2709:3): [True: 10, False: 71]
  ------------------
 2710|     10|			archive_strcat(&file->symlink, ".");
 2711|     10|			break;
 2712|      6|		case 0x04: /* Parent dir. */
  ------------------
  |  Branch (2712:3): [True: 6, False: 75]
  ------------------
 2713|      6|			archive_strcat(&file->symlink, "..");
 2714|      6|			break;
 2715|      1|		case 0x08: /* Root of filesystem. */
  ------------------
  |  Branch (2715:3): [True: 1, False: 80]
  ------------------
 2716|      1|			archive_strcat(&file->symlink, "/");
 2717|      1|			separator = "";
 2718|      1|			break;
 2719|      4|		case 0x10: /* Undefined (historically "volume root" */
  ------------------
  |  Branch (2719:3): [True: 4, False: 77]
  ------------------
 2720|      4|			archive_string_empty(&file->symlink);
  ------------------
  |  |  181|      4|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2721|      4|			archive_strcat(&file->symlink, "ROOT");
 2722|      4|			break;
 2723|      3|		case 0x20: /* Undefined (historically "hostname") */
  ------------------
  |  Branch (2723:3): [True: 3, False: 78]
  ------------------
 2724|      3|			archive_strcat(&file->symlink, "hostname");
 2725|      3|			break;
 2726|      2|		default:
  ------------------
  |  Branch (2726:3): [True: 2, False: 79]
  ------------------
 2727|       |			/* TODO: issue a warning ? */
 2728|      2|			return;
 2729|     81|		}
 2730|     76|		data += nlen;
 2731|     76|		data_length -= nlen;
 2732|     76|	}
 2733|     18|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2556|     45|{
 2557|     45|	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|     45|	if (data_length < 1)
  ------------------
  |  Branch (2568:6): [True: 1, False: 44]
  ------------------
 2569|      1|		return;
 2570|     44|	flag = data[0];
 2571|     44|	++data;
 2572|     44|	--data_length;
 2573|     44|	if (flag & 0x80) {
  ------------------
  |  Branch (2573:6): [True: 27, False: 17]
  ------------------
 2574|       |		/* Use 17-byte time format. */
 2575|     27|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2575:7): [True: 23, False: 4]
  |  Branch (2575:21): [True: 23, False: 0]
  ------------------
 2576|       |			/* Create time. */
 2577|     23|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2577:8): [True: 0, False: 23]
  ------------------
 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|     23|			data += 17;
 2582|     23|			data_length -= 17;
 2583|     23|		}
 2584|     27|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2584:7): [True: 22, False: 5]
  |  Branch (2584:21): [True: 22, False: 0]
  ------------------
 2585|       |			/* Modify time. */
 2586|     22|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2586:8): [True: 2, False: 20]
  ------------------
 2587|      2|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      2|#define MTIME_IS_SET 2
  ------------------
 2588|      2|				file->mtime = isodate17(data);
 2589|      2|			}
 2590|     22|			data += 17;
 2591|     22|			data_length -= 17;
 2592|     22|		}
 2593|     27|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2593:7): [True: 22, False: 5]
  |  Branch (2593:21): [True: 20, False: 2]
  ------------------
 2594|       |			/* Access time. */
 2595|     20|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2595:8): [True: 3, False: 17]
  ------------------
 2596|      3|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      3|#define ATIME_IS_SET 4
  ------------------
 2597|      3|				file->atime = isodate17(data);
 2598|      3|			}
 2599|     20|			data += 17;
 2600|     20|			data_length -= 17;
 2601|     20|		}
 2602|     27|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2602:7): [True: 22, False: 5]
  |  Branch (2602:21): [True: 18, False: 4]
  ------------------
 2603|       |			/* Attribute change time. */
 2604|     18|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2604:8): [True: 1, False: 17]
  ------------------
 2605|      1|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      1|#define CTIME_IS_SET 8
  ------------------
 2606|      1|				file->ctime = isodate17(data);
 2607|      1|			}
 2608|     18|		}
 2609|     27|	} else {
 2610|       |		/* Use 7-byte time format. */
 2611|     17|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2611:7): [True: 10, False: 7]
  |  Branch (2611:21): [True: 9, False: 1]
  ------------------
 2612|       |			/* Create time. */
 2613|      9|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2613:8): [True: 1, False: 8]
  ------------------
 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|      9|			data += 7;
 2618|      9|			data_length -= 7;
 2619|      9|		}
 2620|     17|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2620:7): [True: 11, False: 6]
  |  Branch (2620:21): [True: 10, False: 1]
  ------------------
 2621|       |			/* Modify time. */
 2622|     10|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2622:8): [True: 2, False: 8]
  ------------------
 2623|      2|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      2|#define MTIME_IS_SET 2
  ------------------
 2624|      2|				file->mtime = isodate7(data);
 2625|      2|			}
 2626|     10|			data += 7;
 2627|     10|			data_length -= 7;
 2628|     10|		}
 2629|     17|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2629:7): [True: 16, False: 1]
  |  Branch (2629:21): [True: 15, False: 1]
  ------------------
 2630|       |			/* Access time. */
 2631|     15|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2631:8): [True: 2, False: 13]
  ------------------
 2632|      2|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      2|#define ATIME_IS_SET 4
  ------------------
 2633|      2|				file->atime = isodate7(data);
 2634|      2|			}
 2635|     15|			data += 7;
 2636|     15|			data_length -= 7;
 2637|     15|		}
 2638|     17|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2638:7): [True: 13, False: 4]
  |  Branch (2638:21): [True: 12, False: 1]
  ------------------
 2639|       |			/* Attribute change time. */
 2640|     12|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2640:8): [True: 2, False: 10]
  ------------------
 2641|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      2|#define CTIME_IS_SET 8
  ------------------
 2642|      2|				file->ctime = isodate7(data);
 2643|      2|			}
 2644|     12|		}
 2645|     17|	}
 2646|     44|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3327|     83|{
 3328|       |	/* First 16 bytes are all ASCII digits */
 3329|    736|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3329:18): [True: 703, False: 33]
  ------------------
 3330|    703|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3330:7): [True: 17, False: 686]
  |  Branch (3330:21): [True: 33, False: 653]
  ------------------
 3331|     50|			return 0;
 3332|    703|	}
 3333|       |
 3334|     33|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3335|     33|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3336|     33|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3337|     33|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3338|     33|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3339|     33|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3340|     33|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3341|     33|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3342|     33|	int gmt_off = (signed char)v[16];
 3343|       |
 3344|     33|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3344:6): [True: 12, False: 21]
  |  Branch (3344:19): [True: 11, False: 1]
  |  Branch (3344:33): [True: 10, False: 1]
  ------------------
 3345|     10|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3345:9): [True: 10, False: 0]
  |  Branch (3345:22): [True: 7, False: 3]
  |  Branch (3345:37): [True: 7, False: 0]
  ------------------
 3346|      7|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3346:9): [True: 7, False: 0]
  |  Branch (3346:28): [True: 1, False: 6]
  ------------------
 3347|      1|		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|     32|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3355:6): [True: 13, False: 19]
  |  Branch (3355:21): [True: 3, False: 16]
  ------------------
 3356|     16|		return 0;
 3357|       |	/* Month must be 1-12 */
 3358|     16|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3358:6): [True: 0, False: 16]
  |  Branch (3358:19): [True: 7, False: 9]
  ------------------
 3359|      7|		return 0;
 3360|       |	/* Day must be 1-31 */
 3361|      9|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3361:6): [True: 1, False: 8]
  |  Branch (3361:17): [True: 0, False: 8]
  ------------------
 3362|      1|		return 0;
 3363|       |	/* Hour must be 0-23 */
 3364|      8|	if (hour > 23)
  ------------------
  |  Branch (3364:6): [True: 0, False: 8]
  ------------------
 3365|      0|		return 0;
 3366|       |	/* Minute must be 0-59 */
 3367|      8|	if (minute > 59)
  ------------------
  |  Branch (3367:6): [True: 0, False: 8]
  ------------------
 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|      8|	if (second > 61)
  ------------------
  |  Branch (3372:6): [True: 1, False: 7]
  ------------------
 3373|      1|		return 0;
 3374|       |	/* Hundredths must be 0-99 */
 3375|      7|	if (hundredths > 99)
  ------------------
  |  Branch (3375:6): [True: 0, False: 7]
  ------------------
 3376|      0|		return 0;
 3377|       |	/* Offset from GMT must be -48 to +52 */
 3378|      7|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3378:6): [True: 0, False: 7]
  |  Branch (3378:23): [True: 1, False: 6]
  ------------------
 3379|      1|		return 0;
 3380|       |
 3381|       |	/* All tests pass, this is OK */
 3382|      6|	return 1;
 3383|       |
 3384|      7|}
archive_read_support_format_iso9660.c:isodate17:
 3388|      6|{
 3389|      6|	struct tm tm;
 3390|      6|	int offset;
 3391|      6|	time_t t;
 3392|       |
 3393|      6|	memset(&tm, 0, sizeof(tm));
 3394|      6|	tm.tm_year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3395|      6|	    + (v[2] - '0') * 10 + (v[3] - '0')
 3396|      6|	    - 1900;
 3397|      6|	tm.tm_mon = (v[4] - '0') * 10 + (v[5] - '0') - 1;
 3398|      6|	tm.tm_mday = (v[6] - '0') * 10 + (v[7] - '0');
 3399|      6|	tm.tm_hour = (v[8] - '0') * 10 + (v[9] - '0');
 3400|      6|	tm.tm_min = (v[10] - '0') * 10 + (v[11] - '0');
 3401|      6|	tm.tm_sec = (v[12] - '0') * 10 + (v[13] - '0');
 3402|       |	/* v[16] is the signed timezone offset, in 1/4-hour increments. */
 3403|      6|	offset = ((const signed char *)v)[16];
 3404|      6|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3404:6): [True: 6, False: 0]
  |  Branch (3404:22): [True: 6, False: 0]
  ------------------
 3405|      6|		tm.tm_hour -= offset / 4;
 3406|      6|		tm.tm_min -= (offset % 4) * 15;
 3407|      6|	}
 3408|      6|	t = time_from_tm(&tm);
 3409|      6|	if (t == (time_t)-1)
  ------------------
  |  Branch (3409:6): [True: 0, False: 6]
  ------------------
 3410|      0|		return ((time_t)0);
 3411|      6|	return (t);
 3412|      6|}
archive_read_support_format_iso9660.c:parse_rockridge_ZF1:
 2738|      1|{
 2739|       |
 2740|      1|	if (data_length == 12 && data[0] == 0x70 && data[1] == 0x7a) {
  ------------------
  |  Branch (2740:6): [True: 0, False: 1]
  |  Branch (2740:27): [True: 0, False: 0]
  |  Branch (2740:46): [True: 0, False: 0]
  ------------------
 2741|       |        /* paged zlib */
 2742|      0|        file->pz = 1;
 2743|      0|        file->pz_log2_bs = data[3];
 2744|      0|        if (file->pz_log2_bs < 15 || file->pz_log2_bs > 17) {
  ------------------
  |  Branch (2744:13): [True: 0, False: 0]
  |  Branch (2744:38): [True: 0, False: 0]
  ------------------
 2745|       |            /* TODO: Return an error here instead of silently
 2746|       |             * disabling zisofs. That requires propagating an
 2747|       |             * error return through parse_rockridge() and its
 2748|       |             * callers. */
 2749|      0|            file->pz = 0;
 2750|      0|            return;
 2751|      0|        }
 2752|      0|        file->pz_uncompressed_size = archive_le32dec(&data[4]);
 2753|      0|    }
 2754|      1|}
archive_read_support_format_iso9660.c:register_file:
 2758|    925|{
 2759|       |
 2760|    925|	file->use_next = iso9660->use_files;
 2761|    925|	iso9660->use_files = file;
 2762|    925|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3117|    838|{
 3118|    838|	uint64_t file_key, parent_key;
 3119|    838|	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|    838|	key <<= 16;
 3124|    838|	key += heap->used & 0xFFFF;
 3125|       |
 3126|       |	/* Expand our pending files list as necessary. */
 3127|    838|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3127:6): [True: 169, False: 669]
  ------------------
 3128|    169|		struct file_info **new_pending_files;
 3129|    169|		size_t new_size;
 3130|       |
 3131|    169|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3131:7): [True: 169, False: 0]
  ------------------
 3132|    169|			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|    169|		new_pending_files = (struct file_info **)
 3140|    169|		    calloc(new_size, sizeof(new_pending_files[0]));
 3141|    169|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3141:7): [True: 0, False: 169]
  ------------------
 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|    169|		if (heap->allocated)
  ------------------
  |  Branch (3146:7): [True: 0, False: 169]
  ------------------
 3147|      0|			memcpy(new_pending_files, heap->files,
 3148|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3149|    169|		free(heap->files);
 3150|    169|		heap->files = new_pending_files;
 3151|    169|		heap->allocated = new_size;
 3152|    169|	}
 3153|       |
 3154|    838|	file_key = file->key = key;
 3155|       |
 3156|       |	/*
 3157|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3158|       |	 */
 3159|    838|	hole = heap->used++;
 3160|  1.19k|	while (hole > 0) {
  ------------------
  |  Branch (3160:9): [True: 862, False: 337]
  ------------------
 3161|    862|		parent = (hole - 1) / 2;
 3162|    862|		parent_key = heap->files[parent]->key;
 3163|    862|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3163:7): [True: 501, False: 361]
  ------------------
 3164|    501|			heap->files[hole] = file;
 3165|    501|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    501|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3166|    501|		}
 3167|       |		/* Move parent into hole <==> move hole up tree. */
 3168|    361|		heap->files[hole] = heap->files[parent];
 3169|    361|		hole = parent;
 3170|    361|	}
 3171|    337|	heap->files[0] = file;
 3172|       |
 3173|    337|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    337|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3174|    838|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2791|    822|{
 2792|    822|	struct file_info *file;
 2793|    822|	int r;
 2794|       |
 2795|    822|	r = next_cache_entry(a, iso9660, pfile);
 2796|    822|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    822|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2796:6): [True: 196, False: 626]
  ------------------
 2797|    196|		return (r);
 2798|    626|	file = *pfile;
 2799|       |
 2800|       |	/* Don't waste time seeking for zero-length bodies. */
 2801|    626|	if (file->size == 0)
  ------------------
  |  Branch (2801:6): [True: 233, False: 393]
  ------------------
 2802|    233|		file->offset = iso9660->current_position;
 2803|       |
 2804|       |	/* flush any remaining bytes from the last round to ensure
 2805|       |	 * we're positioned */
 2806|    626|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2806:6): [True: 0, False: 626]
  ------------------
 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|    626|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2812:6): [True: 27, False: 599]
  ------------------
 2813|     27|		int64_t step;
 2814|       |
 2815|     27|		step = file->offset - iso9660->current_position;
 2816|     27|		step = __archive_read_consume(a, step);
 2817|     27|		if (step < 0)
  ------------------
  |  Branch (2817:7): [True: 16, False: 11]
  ------------------
 2818|     16|			return ((int)step);
 2819|     11|		iso9660->current_position = file->offset;
 2820|     11|	}
 2821|       |
 2822|       |	/* We found body of file; handle it now. */
 2823|    610|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    610|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2824|    626|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2829|    822|{
 2830|    822|	struct file_info *file;
 2831|    822|	struct {
 2832|    822|		struct file_info	*first;
 2833|    822|		struct file_info	**last;
 2834|    822|	}	empty_files;
 2835|    822|	int64_t number;
 2836|    822|	int count;
 2837|       |
 2838|    822|	file = cache_get_entry(iso9660);
 2839|    822|	if (file != NULL) {
  ------------------
  |  Branch (2839:6): [True: 247, False: 575]
  ------------------
 2840|    247|		*pfile = file;
 2841|    247|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    247|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2842|    247|	}
 2843|       |
 2844|    575|	for (;;) {
 2845|    575|		struct file_info *re, *d;
 2846|       |
 2847|    575|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  453|    575|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2848|    575|		if (file == NULL) {
  ------------------
  |  Branch (2848:7): [True: 120, False: 455]
  ------------------
 2849|       |			/*
 2850|       |			 * If directory entries all which are descendant of
 2851|       |			 * rr_moved are still remaining, expose their.
 2852|       |			 */
 2853|    120|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2853:8): [True: 0, False: 120]
  ------------------
 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|    120|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2858:11): [True: 0, False: 120]
  ------------------
 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|    120|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2863:8): [True: 0, False: 120]
  ------------------
 2864|      0|				return (next_cache_entry(a, iso9660, pfile));
 2865|    120|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    120|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2866|    120|		}
 2867|       |
 2868|    455|		if (file->cl_offset) {
  ------------------
  |  Branch (2868:7): [True: 0, False: 455]
  ------------------
 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|    455|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|    455|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|    455|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2918:14): [True: 211, False: 244]
  ------------------
 2919|    211|			int r;
 2920|       |
 2921|       |			/* Read file entries in this dir. */
 2922|    211|			r = read_children(a, file);
 2923|    211|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    211|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2923:8): [True: 76, False: 135]
  ------------------
 2924|     76|				return (r);
 2925|       |
 2926|       |			/*
 2927|       |			 * Handle a special dir of Rockridge extensions,
 2928|       |			 * "rr_moved".
 2929|       |			 */
 2930|    135|			if (file->rr_moved) {
  ------------------
  |  Branch (2930:8): [True: 0, False: 135]
  ------------------
 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|    135|			} else if (file->re) {
  ------------------
  |  Branch (2938:15): [True: 0, False: 135]
  ------------------
 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|    135|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2946:15): [True: 0, False: 135]
  ------------------
 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|    135|		}
 2960|    379|		break;
 2961|    455|	}
 2962|       |
 2963|    379|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  215|    379|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  216|    758|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2963:6): [True: 135, False: 244]
  |  Branch (2963:44): [True: 23, False: 221]
  ------------------
 2964|    158|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    158|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2965|       |
 2966|    221|	count = 0;
 2967|    221|	number = file->number;
 2968|    221|	iso9660->cache_files.first = NULL;
 2969|    221|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2970|    221|	empty_files.first = NULL;
 2971|    221|	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|    497|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2975:9): [True: 375, False: 122]
  ------------------
 2976|    375|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2976:7): [True: 123, False: 252]
  ------------------
 2977|    276|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2977:7): [True: 153, False: 99]
  ------------------
 2978|    276|		if (file->number == -1) {
  ------------------
  |  Branch (2978:7): [True: 93, False: 183]
  ------------------
 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|     93|			file->next = NULL;
 2988|     93|			*empty_files.last = file;
 2989|     93|			empty_files.last = &(file->next);
 2990|    183|		} else {
 2991|    183|			count++;
 2992|    183|			cache_add_entry(iso9660, file);
 2993|    183|		}
 2994|    276|		file = next_entry(iso9660);
  ------------------
  |  |  453|    276|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2995|    276|	}
 2996|       |
 2997|    221|	if (count == 0) {
  ------------------
  |  Branch (2997:6): [True: 130, False: 91]
  ------------------
 2998|    130|		*pfile = file;
 2999|    130|		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|    130|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2999:11): [True: 0, False: 130]
  ------------------
 3000|    130|	}
 3001|     91|	if (file->number == -1) {
  ------------------
  |  Branch (3001:6): [True: 30, False: 61]
  ------------------
 3002|     30|		file->next = NULL;
 3003|     30|		*empty_files.last = file;
 3004|     30|		empty_files.last = &(file->next);
 3005|     61|	} else {
 3006|     61|		count++;
 3007|     61|		cache_add_entry(iso9660, file);
 3008|     61|	}
 3009|       |
 3010|     91|	if (count > 1) {
  ------------------
  |  Branch (3010:6): [True: 70, False: 21]
  ------------------
 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|     70|		for (file = iso9660->cache_files.first;
 3016|    293|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3016:7): [True: 223, False: 70]
  ------------------
 3017|    223|			file->nlinks = count;
 3018|     70|	}
 3019|       |	/* If there are empty files, that files are added
 3020|       |	 * to the tail of the cache_files. */
 3021|     91|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3021:6): [True: 30, False: 61]
  ------------------
 3022|     30|		*iso9660->cache_files.last = empty_files.first;
 3023|     30|		iso9660->cache_files.last = empty_files.last;
 3024|     30|	}
 3025|     91|	*pfile = cache_get_entry(iso9660);
 3026|     91|	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|     91|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3026:10): [True: 0, False: 91]
  ------------------
 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|    221|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3102|    913|{
 3103|    913|	struct file_info *file;
 3104|       |
 3105|    913|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3105:6): [True: 338, False: 575]
  ------------------
 3106|    338|		iso9660->cache_files.first = file->next;
 3107|    338|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3107:7): [True: 73, False: 265]
  ------------------
 3108|     73|			iso9660->cache_files.last =
 3109|     73|			    &(iso9660->cache_files.first);
 3110|    338|	}
 3111|    913|	return (file);
 3112|    913|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3178|    851|{
 3179|    851|	uint64_t a_key, b_key, c_key;
 3180|    851|	size_t a, b, c;
 3181|    851|	struct file_info *r, *tmp;
 3182|       |
 3183|    851|	if (heap->used < 1)
  ------------------
  |  Branch (3183:6): [True: 120, False: 731]
  ------------------
 3184|    120|		return (NULL);
 3185|       |
 3186|       |	/*
 3187|       |	 * The first file in the list is the earliest; we'll return this.
 3188|       |	 */
 3189|    731|	r = heap->files[0];
 3190|       |
 3191|       |	/*
 3192|       |	 * Move the last item in the heap to the root of the tree
 3193|       |	 */
 3194|    731|	heap->files[0] = heap->files[--(heap->used)];
 3195|       |
 3196|       |	/*
 3197|       |	 * Rebalance the heap.
 3198|       |	 */
 3199|    731|	a = 0; /* Starting element and its heap key */
 3200|    731|	a_key = heap->files[a]->key;
 3201|  1.48k|	for (;;) {
 3202|  1.48k|		b = a + a + 1; /* First child */
 3203|  1.48k|		if (b >= heap->used)
  ------------------
  |  Branch (3203:7): [True: 620, False: 861]
  ------------------
 3204|    620|			return (r);
 3205|    861|		b_key = heap->files[b]->key;
 3206|    861|		c = b + 1; /* Use second child if it is smaller. */
 3207|    861|		if (c < heap->used) {
  ------------------
  |  Branch (3207:7): [True: 720, False: 141]
  ------------------
 3208|    720|			c_key = heap->files[c]->key;
 3209|    720|			if (c_key < b_key) {
  ------------------
  |  Branch (3209:8): [True: 283, False: 437]
  ------------------
 3210|    283|				b = c;
 3211|    283|				b_key = c_key;
 3212|    283|			}
 3213|    720|		}
 3214|    861|		if (a_key <= b_key)
  ------------------
  |  Branch (3214:7): [True: 111, False: 750]
  ------------------
 3215|    111|			return (r);
 3216|    750|		tmp = heap->files[a];
 3217|    750|		heap->files[a] = heap->files[b];
 3218|    750|		heap->files[b] = tmp;
 3219|    750|		a = b;
 3220|    750|	}
 3221|    731|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3094|    244|{
 3095|       |	file->next = NULL;
 3096|    244|	*iso9660->cache_files.last = file;
 3097|    244|	iso9660->cache_files.last = &(file->next);
 3098|    244|}
archive_read_support_format_iso9660.c:re_get_entry:
 3046|    120|{
 3047|    120|	struct file_info *file;
 3048|       |
 3049|    120|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3049:6): [True: 0, False: 120]
  ------------------
 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|    120|	return (file);
 3056|    120|}
archive_read_support_format_iso9660.c:read_children:
 1022|    211|{
 1023|    211|	struct iso9660 *iso9660 = a->format->data;
 1024|    211|	const unsigned char *b, *p;
 1025|    211|	struct file_info *multi;
 1026|    211|	size_t step, skip_size;
 1027|       |
 1028|       |	/* flush any remaining bytes from the last round to ensure
 1029|       |	 * we're positioned */
 1030|    211|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1030:6): [True: 0, False: 211]
  ------------------
 1031|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1032|      0|		iso9660->entry_bytes_unconsumed = 0;
 1033|      0|	}
 1034|    211|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1034:6): [True: 23, False: 188]
  ------------------
 1035|     23|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     23|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1036|     23|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1037|     23|		    parent->name.s,
 1038|     23|		    (intmax_t)iso9660->current_position,
 1039|     23|		    (intmax_t)parent->offset);
 1040|     23|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     23|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1041|     23|	}
 1042|    188|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1042:6): [True: 29, False: 159]
  ------------------
 1043|     29|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     29|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1044|     29|		    "Directory is beyond end-of-media: %s",
 1045|     29|		    parent->name.s);
 1046|     29|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     29|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1047|     29|	}
 1048|    159|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1048:6): [True: 74, False: 85]
  ------------------
 1049|     74|		int64_t skipsize;
 1050|       |
 1051|     74|		skipsize = parent->offset - iso9660->current_position;
 1052|     74|		skipsize = __archive_read_consume(a, skipsize);
 1053|     74|		if (skipsize < 0)
  ------------------
  |  Branch (1053:7): [True: 4, False: 70]
  ------------------
 1054|      4|			return ((int)skipsize);
 1055|     70|		iso9660->current_position = parent->offset;
 1056|     70|	}
 1057|       |
 1058|    155|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1059|    155|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1060|    155|	b = __archive_read_ahead(a, step, NULL);
 1061|    155|	if (b == NULL) {
  ------------------
  |  Branch (1061:6): [True: 4, False: 151]
  ------------------
 1062|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1063|      4|		    "Failed to read full block when scanning "
 1064|      4|		    "ISO9660 directory list");
 1065|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1066|      4|	}
 1067|    151|	iso9660->current_position += step;
 1068|    151|	multi = NULL;
 1069|    151|	skip_size = step;
 1070|    518|	while (step) {
  ------------------
  |  Branch (1070:9): [True: 383, False: 135]
  ------------------
 1071|    383|		p = b;
 1072|    383|		b += iso9660->logical_block_size;
 1073|    383|		step -= iso9660->logical_block_size;
 1074|   232k|		for (; p < b && b - p > DR_name_offset && *p != 0 && *p <= b - p;
  ------------------
  |  |  216|   464k|#define DR_name_offset 33
  ------------------
  |  Branch (1074:10): [True: 232k, False: 0]
  |  Branch (1074:19): [True: 232k, False: 112]
  |  Branch (1074:45): [True: 231k, False: 255]
  |  Branch (1074:56): [True: 231k, False: 0]
  ------------------
 1075|   231k|			p += *p) {
 1076|   231k|			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|   231k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   231k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1084:8): [True: 231k, False: 666]
  ------------------
 1085|   231k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  216|   231k|#define DR_name_offset 33
  ------------------
  |  Branch (1085:11): [True: 81, False: 231k]
  ------------------
 1086|     81|				continue;
 1087|       |			/* Skip '..' entry. */
 1088|   231k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   231k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1088:8): [True: 231k, False: 666]
  ------------------
 1089|   231k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  216|   231k|#define DR_name_offset 33
  ------------------
  |  Branch (1089:11): [True: 230k, False: 91]
  ------------------
 1090|   230k|				continue;
 1091|    757|			child = parse_file_info(a, parent, p, b - p);
 1092|    757|			if (child == NULL) {
  ------------------
  |  Branch (1092:8): [True: 16, False: 741]
  ------------------
 1093|     16|				__archive_read_consume(a, skip_size);
 1094|     16|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1095|     16|			}
 1096|    741|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1096:8): [True: 741, False: 0]
  ------------------
 1097|    741|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1097:9): [True: 97, False: 644]
  |  Branch (1097:32): [True: 34, False: 610]
  ------------------
 1098|    131|				struct content *con;
 1099|       |
 1100|    131|				if (multi == NULL) {
  ------------------
  |  Branch (1100:9): [True: 59, False: 72]
  ------------------
 1101|     59|					multi = child;
 1102|     59|					multi->contents.first = NULL;
 1103|     59|					multi->contents.last =
 1104|     59|					    &(multi->contents.first);
 1105|     59|				}
 1106|    131|				con = malloc(sizeof(struct content));
 1107|    131|				if (con == NULL) {
  ------------------
  |  Branch (1107:9): [True: 0, False: 131]
  ------------------
 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|    131|				con->offset = child->offset;
 1115|    131|				con->size = child->size;
 1116|    131|				con->next = NULL;
 1117|    131|				*multi->contents.last = con;
 1118|    131|				multi->contents.last = &(con->next);
 1119|    131|				if (multi == child) {
  ------------------
  |  Branch (1119:9): [True: 59, False: 72]
  ------------------
 1120|     59|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  451|     59|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1120:10): [True: 0, False: 59]
  ------------------
 1121|     59|					    != ARCHIVE_OK)
  ------------------
  |  |  233|     59|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1122|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1123|     72|				} else {
 1124|     72|					multi->size += child->size;
 1125|     72|					if (!child->multi_extent)
  ------------------
  |  Branch (1125:10): [True: 34, False: 38]
  ------------------
 1126|     34|						multi = NULL;
 1127|     72|				}
 1128|    131|			} else
 1129|    610|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  451|    610|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  233|    610|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1129:9): [True: 0, False: 610]
  ------------------
 1130|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1131|    741|		}
 1132|    383|	}
 1133|       |
 1134|    135|	__archive_read_consume(a, skip_size);
 1135|       |
 1136|       |	/* Read data which recorded by RRIP "CE" extension. */
 1137|    135|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  233|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1137:6): [True: 0, False: 135]
  ------------------
 1138|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1139|       |
 1140|    135|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1141|    135|}
archive_read_support_format_iso9660.c:read_CE:
 2454|    135|{
 2455|    135|	struct read_ce_queue *heap;
 2456|    135|	const unsigned char *b, *p, *end;
 2457|    135|	struct file_info *file;
 2458|    135|	size_t step;
 2459|    135|	uint64_t ce_start, ce_end;
 2460|    135|	int r;
 2461|       |
 2462|       |	/* Read data which RRIP "CE" extension points. */
 2463|    135|	heap = &(iso9660->read_ce_req);
 2464|    135|	step = iso9660->logical_block_size;
 2465|    135|	while (heap->cnt &&
  ------------------
  |  Branch (2465:9): [True: 0, False: 135]
  ------------------
 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|    135|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2506|    135|}
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|    770|{
 3442|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3443|       |	// to 1000, then something is very, very wrong.
 3444|    770|	if (depth > 1000) {
  ------------------
  |  Branch (3444:6): [True: 0, False: 770]
  ------------------
 3445|      0|		return NULL;
 3446|      0|	}
 3447|    770|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    573|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3447:6): [True: 573, False: 197]
  |  Branch (3447:30): [True: 171, False: 402]
  ------------------
 3448|    171|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3448:7): [True: 0, False: 171]
  ------------------
 3449|      0|			return NULL;
 3450|      0|		}
 3451|    171|		archive_strcat(as, "/");
 3452|    171|	}
 3453|    770|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    770|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3453:6): [True: 67, False: 703]
  ------------------
 3454|     67|		archive_strcat(as, ".");
 3455|    703|	else
 3456|    703|		archive_string_concat(as, &file->name);
 3457|    770|	return (as->s);
 3458|    770|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1472|    653|{
 1473|       |	/* Because read_next_header always does an explicit skip
 1474|       |	 * to the next entry, we don't need to do anything here. */
 1475|    653|	(void)a; /* UNUSED */
 1476|    653|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    653|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1477|    653|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1722|    851|{
 1723|    851|	struct iso9660 *iso9660 = a->format->data;
 1724|    851|	ssize_t bytes_read;
 1725|       |
 1726|    851|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1726:6): [True: 92, False: 759]
  ------------------
 1727|     92|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1728|     92|		iso9660->entry_bytes_unconsumed = 0;
 1729|     92|	}
 1730|       |
 1731|    851|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1731:6): [True: 755, False: 96]
  ------------------
 1732|    755|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1732:7): [True: 19, False: 736]
  ------------------
 1733|     19|			iso9660->entry_content = iso9660->entry_content->next;
 1734|    755|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1734:7): [True: 745, False: 10]
  ------------------
 1735|    745|			*buff = NULL;
 1736|    745|			*size = 0;
 1737|    745|			*offset = iso9660->entry_sparse_offset;
 1738|    745|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    745|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1739|    745|		}
 1740|       |		/* Seek forward to the start of the entry. */
 1741|     10|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1741:7): [True: 5, False: 5]
  ------------------
 1742|      5|			int64_t step;
 1743|       |
 1744|      5|			step = iso9660->entry_content->offset -
 1745|      5|			    iso9660->current_position;
 1746|      5|			step = __archive_read_consume(a, step);
 1747|      5|			if (step < 0)
  ------------------
  |  Branch (1747:8): [True: 1, False: 4]
  ------------------
 1748|      1|				return ((int)step);
 1749|      4|			iso9660->current_position =
 1750|      4|			    iso9660->entry_content->offset;
 1751|      4|		}
 1752|      9|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1752:7): [True: 5, False: 4]
  ------------------
 1753|      5|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1754|      5|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1755|      5|			    iso9660->pathname.s,
 1756|      5|			    (intmax_t)iso9660->entry_content->offset,
 1757|      5|			    (intmax_t)iso9660->current_position);
 1758|      5|			*buff = NULL;
 1759|      5|			*size = 0;
 1760|      5|			*offset = iso9660->entry_sparse_offset;
 1761|      5|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      5|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1762|      5|		}
 1763|      4|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1764|      4|	}
 1765|    100|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1765:6): [True: 0, False: 100]
  ------------------
 1766|      0|		return (zisofs_read_data(a, buff, size, offset));
 1767|       |
 1768|    100|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1769|    100|	if (bytes_read == 0)
  ------------------
  |  Branch (1769:6): [True: 8, False: 92]
  ------------------
 1770|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1771|      8|		    "Truncated input file");
 1772|    100|	if (*buff == NULL)
  ------------------
  |  Branch (1772:6): [True: 8, False: 92]
  ------------------
 1773|      8|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1774|     92|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1774:6): [True: 84, False: 8]
  ------------------
 1775|     84|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1776|     92|	*size = bytes_read;
 1777|     92|	*offset = iso9660->entry_sparse_offset;
 1778|     92|	iso9660->entry_sparse_offset += bytes_read;
 1779|     92|	iso9660->entry_bytes_remaining -= bytes_read;
 1780|     92|	iso9660->entry_bytes_unconsumed = bytes_read;
 1781|     92|	iso9660->current_position += bytes_read;
 1782|     92|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     92|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1783|    100|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1787|  11.9k|{
 1788|  11.9k|	struct iso9660 *iso9660 = a->format->data;
 1789|  11.9k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1790|       |
 1791|  11.9k|	release_files(iso9660);
 1792|  11.9k|	free(iso9660->read_ce_req.reqs);
 1793|  11.9k|	archive_string_free(&iso9660->pathname);
 1794|  11.9k|	archive_string_free(&iso9660->previous_pathname);
 1795|  11.9k|	free(iso9660->pending_files.files);
 1796|  11.9k|#ifdef HAVE_ZLIB_H
 1797|  11.9k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1798|  11.9k|	free(iso9660->entry_zisofs.block_pointers);
 1799|  11.9k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1799:6): [True: 0, False: 11.9k]
  ------------------
 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|  11.9k|#endif
 1807|  11.9k|	free(iso9660->utf16be_path);
 1808|  11.9k|	free(iso9660->utf16be_previous_path);
 1809|  11.9k|	free(iso9660);
 1810|       |	a->format->data = NULL;
 1811|  11.9k|	return (r);
 1812|  11.9k|}
archive_read_support_format_iso9660.c:release_files:
 2766|  11.9k|{
 2767|  11.9k|	struct content *con, *connext;
 2768|  11.9k|	struct file_info *file;
 2769|       |
 2770|  11.9k|	file = iso9660->use_files;
 2771|  12.8k|	while (file != NULL) {
  ------------------
  |  Branch (2771:9): [True: 925, False: 11.9k]
  ------------------
 2772|    925|		struct file_info *next = file->use_next;
 2773|       |
 2774|    925|		archive_string_free(&file->name);
 2775|    925|		archive_string_free(&file->symlink);
 2776|    925|		free(file->utf16be_name);
 2777|    925|		con = file->contents.first;
 2778|  1.05k|		while (con != NULL) {
  ------------------
  |  Branch (2778:10): [True: 131, False: 925]
  ------------------
 2779|    131|			connext = con->next;
 2780|    131|			free(con);
 2781|    131|			con = connext;
 2782|    131|		}
 2783|    925|		free(file);
 2784|    925|		file = next;
 2785|    925|	}
 2786|  11.9k|}

archive_read_support_format_lha:
  257|  11.9k|{
  258|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  259|  11.9k|	struct lha *lha;
  260|  11.9k|	int r;
  261|       |
  262|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  263|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_lha");
  264|       |
  265|  11.9k|	lha = calloc(1, sizeof(*lha));
  266|  11.9k|	if (lha == NULL) {
  ------------------
  |  Branch (266:6): [True: 0, False: 11.9k]
  ------------------
  267|      0|		archive_set_error(_a, ENOMEM, "Can't allocate lha data");
  268|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  269|      0|	}
  270|  11.9k|	archive_string_init(&lha->ws);
  ------------------
  |  |   71|  11.9k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  271|       |
  272|  11.9k|	r = __archive_read_register_format(a,
  273|  11.9k|	    lha,
  274|  11.9k|	    "lha",
  275|  11.9k|	    archive_read_format_lha_bid,
  276|  11.9k|	    archive_read_format_lha_options,
  277|  11.9k|	    archive_read_format_lha_read_header,
  278|  11.9k|	    archive_read_format_lha_read_data,
  279|  11.9k|	    archive_read_format_lha_read_data_skip,
  280|  11.9k|	    NULL,
  281|  11.9k|	    archive_read_format_lha_cleanup,
  282|  11.9k|	    NULL,
  283|  11.9k|	    NULL);
  284|       |
  285|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (285:6): [True: 0, False: 11.9k]
  ------------------
  286|      0|		free(lha);
  287|  11.9k|	return (r);
  288|  11.9k|}
archive_read_support_format_lha.c:archive_read_format_lha_bid:
  345|  11.7k|{
  346|  11.7k|	const char *p;
  347|  11.7k|	const void *buff;
  348|  11.7k|	ssize_t bytes_avail, offset, window;
  349|  11.7k|	size_t next;
  350|       |
  351|       |	/* If there's already a better bid than we can ever
  352|       |	   make, don't bother testing. */
  353|  11.7k|	if (best_bid > 30)
  ------------------
  |  Branch (353:6): [True: 555, False: 11.2k]
  ------------------
  354|    555|		return (-1);
  355|       |
  356|  11.2k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL)
  ------------------
  |  |  211|  11.2k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (356:6): [True: 44, False: 11.1k]
  ------------------
  357|     44|		return (-1);
  358|       |
  359|  11.1k|	if (lha_check_header_format(p) == 0)
  ------------------
  |  Branch (359:6): [True: 275, False: 10.8k]
  ------------------
  360|    275|		return (30);
  361|       |
  362|  10.8k|	if (p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (362:6): [True: 688, False: 10.1k]
  |  Branch (362:21): [True: 466, False: 222]
  ------------------
  363|       |		/* PE file */
  364|    466|		offset = 0;
  365|    466|		window = 4096;
  366|  2.66k|		while (offset < (1024 * 20)) {
  ------------------
  |  Branch (366:10): [True: 2.60k, False: 63]
  ------------------
  367|  2.60k|			buff = __archive_read_ahead(a, offset + window,
  368|  2.60k|			    &bytes_avail);
  369|  2.60k|			if (buff == NULL) {
  ------------------
  |  Branch (369:8): [True: 2.12k, False: 477]
  ------------------
  370|       |				/* Remaining bytes are less than window. */
  371|  2.12k|				window >>= 1;
  372|  2.12k|				if (window < (H_SIZE + 3))
  ------------------
  |  |  211|  2.12k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (372:9): [True: 206, False: 1.92k]
  ------------------
  373|    206|					return (0);
  374|  1.92k|				continue;
  375|  2.12k|			}
  376|    477|			p = (const char *)buff + offset;
  377|  2.61M|			while (p + H_SIZE < (const char *)buff + bytes_avail) {
  ------------------
  |  |  211|  2.61M|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (377:11): [True: 2.61M, False: 280]
  ------------------
  378|  2.61M|				if ((next = lha_check_header_format(p)) == 0)
  ------------------
  |  Branch (378:9): [True: 197, False: 2.61M]
  ------------------
  379|    197|					return (30);
  380|  2.61M|				p += next;
  381|  2.61M|			}
  382|    280|			offset = p - (const char *)buff;
  383|    280|		}
  384|    466|	}
  385|  10.4k|	return (0);
  386|  10.8k|}
archive_read_support_format_lha.c:lha_check_header_format:
  292|  2.64M|{
  293|  2.64M|	const unsigned char *p = h;
  294|  2.64M|	size_t next_skip_bytes;
  295|       |
  296|  2.64M|	switch (p[H_METHOD_OFFSET+3]) {
  ------------------
  |  |  208|  2.64M|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  297|       |	/*
  298|       |	 * "-lh0-" ... "-lh7-" "-lhd-"
  299|       |	 * "-lzs-" "-lz5-"
  300|       |	 */
  301|  86.1k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (301:2): [True: 21.9k, False: 2.62M]
  |  Branch (301:12): [True: 22.6k, False: 2.62M]
  |  Branch (301:22): [True: 38.5k, False: 2.60M]
  |  Branch (301:32): [True: 3.05k, False: 2.64M]
  ------------------
  302|   125k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (302:2): [True: 12.1k, False: 2.63M]
  |  Branch (302:12): [True: 13.8k, False: 2.63M]
  |  Branch (302:22): [True: 4.20k, False: 2.64M]
  |  Branch (302:32): [True: 8.82k, False: 2.63M]
  ------------------
  303|   167k|	case 'd':
  ------------------
  |  Branch (303:2): [True: 42.3k, False: 2.60M]
  ------------------
  304|   198k|	case 's':
  ------------------
  |  Branch (304:2): [True: 31.2k, False: 2.61M]
  ------------------
  305|   198k|		next_skip_bytes = 4;
  306|       |
  307|       |		/* b0 == 0 means the end of an LHa archive file.	*/
  308|   198k|		if (p[0] == 0)
  ------------------
  |  Branch (308:7): [True: 9.14k, False: 189k]
  ------------------
  309|  9.14k|			break;
  310|   189k|		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  208|   189k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
              		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  208|  21.7k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (310:7): [True: 167k, False: 21.7k]
  |  Branch (310:36): [True: 606, False: 21.1k]
  ------------------
  311|  21.1k|		    ||  p[H_METHOD_OFFSET+4] != '-')
  ------------------
  |  |  208|  21.1k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (311:11): [True: 47, False: 21.0k]
  ------------------
  312|   168k|			break;
  313|       |
  314|  21.0k|		if (p[H_METHOD_OFFSET+2] == 'h') {
  ------------------
  |  |  208|  21.0k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (314:7): [True: 20.8k, False: 263]
  ------------------
  315|       |			/* "-lh?-" */
  316|  20.8k|			if (p[H_METHOD_OFFSET+3] == 's')
  ------------------
  |  |  208|  20.8k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (316:8): [True: 12.3k, False: 8.43k]
  ------------------
  317|  12.3k|				break;
  318|  8.43k|			if (p[H_LEVEL_OFFSET] == 0)
  ------------------
  |  |  210|  8.43k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (318:8): [True: 316, False: 8.11k]
  ------------------
  319|    316|				return (0);
  320|  8.11k|			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  210|  8.11k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
              			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  209|  6.29k|#define H_ATTR_OFFSET	19	/* DOS attribute. */
  ------------------
  |  Branch (320:8): [True: 6.29k, False: 1.82k]
  |  Branch (320:34): [True: 6.04k, False: 253]
  ------------------
  321|  6.04k|				return (0);
  322|  8.11k|		}
  323|  2.33k|		if (p[H_METHOD_OFFSET+2] == 'z') {
  ------------------
  |  |  208|  2.33k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (323:7): [True: 261, False: 2.07k]
  ------------------
  324|       |			/* LArc extensions: -lzs-,-lz4- and -lz5- */
  325|    261|			if (p[H_LEVEL_OFFSET] != 0)
  ------------------
  |  |  210|    261|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (325:8): [True: 40, False: 221]
  ------------------
  326|     40|				break;
  327|    221|			if (p[H_METHOD_OFFSET+3] == 's'
  ------------------
  |  |  208|    221|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (327:8): [True: 0, False: 221]
  ------------------
  328|    221|			    || p[H_METHOD_OFFSET+3] == '4'
  ------------------
  |  |  208|    221|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (328:11): [True: 0, False: 221]
  ------------------
  329|    221|			    || p[H_METHOD_OFFSET+3] == '5')
  ------------------
  |  |  208|    221|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (329:11): [True: 0, False: 221]
  ------------------
  330|      0|				return (0);
  331|    221|		}
  332|  2.29k|		break;
  333|  4.64k|	case 'h': next_skip_bytes = 1; break;
  ------------------
  |  Branch (333:2): [True: 4.64k, False: 2.64M]
  ------------------
  334|  13.8k|	case 'z': next_skip_bytes = 1; break;
  ------------------
  |  Branch (334:2): [True: 13.8k, False: 2.63M]
  ------------------
  335|  20.3k|	case 'l': next_skip_bytes = 2; break;
  ------------------
  |  Branch (335:2): [True: 20.3k, False: 2.62M]
  ------------------
  336|  3.67k|	case '-': next_skip_bytes = 3; break;
  ------------------
  |  Branch (336:2): [True: 3.67k, False: 2.64M]
  ------------------
  337|  2.40M|	default : next_skip_bytes = 4; break;
  ------------------
  |  Branch (337:2): [True: 2.40M, False: 241k]
  ------------------
  338|  2.64M|	}
  339|       |
  340|  2.63M|	return (next_skip_bytes);
  341|  2.64M|}
archive_read_support_format_lha.c:archive_read_format_lha_read_header:
  472|  5.85k|{
  473|  5.85k|	struct lha *lha = a->format->data;
  474|  5.85k|	struct archive_wstring linkname;
  475|  5.85k|	struct archive_wstring pathname;
  476|  5.85k|	const unsigned char *p;
  477|  5.85k|	const char *signature;
  478|  5.85k|	int err;
  479|  5.85k|	struct archive_mstring conv_buffer;
  480|  5.85k|	const wchar_t *conv_buffer_p;
  481|       |
  482|  5.85k|	a->archive.archive_format = ARCHIVE_FORMAT_LHA;
  ------------------
  |  |  382|  5.85k|#define	ARCHIVE_FORMAT_LHA			0xB0000
  ------------------
  483|  5.85k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (483:6): [True: 462, False: 5.39k]
  ------------------
  484|    462|		a->archive.archive_format_name = "lha";
  485|       |
  486|  5.85k|	lha->decompress_init = 0;
  487|  5.85k|	lha->end_of_entry = 0;
  488|  5.85k|	lha->end_of_entry_cleanup = 0;
  489|  5.85k|	lha->entry_unconsumed = 0;
  490|       |
  491|  5.85k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL) {
  ------------------
  |  |  211|  5.85k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (491:6): [True: 96, False: 5.75k]
  ------------------
  492|       |		/*
  493|       |		 * LHa archiver added 0 to the tail of its archive file as
  494|       |		 * the mark of the end of the archive.
  495|       |		 */
  496|     96|		signature = __archive_read_ahead(a, sizeof(signature[0]), NULL);
  497|     96|		if (signature == NULL || signature[0] == 0)
  ------------------
  |  Branch (497:7): [True: 6, False: 90]
  |  Branch (497:28): [True: 4, False: 86]
  ------------------
  498|     10|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     10|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  499|     86|		return (truncated_error(a));
  500|     96|	}
  501|       |
  502|  5.75k|	signature = (const char *)p;
  503|  5.75k|	if (lha->found_first_header == 0 &&
  ------------------
  |  Branch (503:6): [True: 462, False: 5.29k]
  ------------------
  504|    462|	    signature[0] == 'M' && signature[1] == 'Z') {
  ------------------
  |  Branch (504:6): [True: 187, False: 275]
  |  Branch (504:29): [True: 187, False: 0]
  ------------------
  505|       |                /* This is an executable?  Must be self-extracting... 	*/
  506|    187|		err = lha_skip_sfx(a);
  507|    187|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|    187|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (507:7): [True: 0, False: 187]
  ------------------
  508|      0|			return (err);
  509|       |
  510|    187|		if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
  ------------------
  |  Branch (510:7): [True: 0, False: 187]
  ------------------
  511|      0|			return (truncated_error(a));
  512|    187|		signature = (const char *)p;
  513|    187|	}
  514|       |	/* signature[0] == 0 means the end of an LHa archive file. */
  515|  5.75k|	if (signature[0] == 0)
  ------------------
  |  Branch (515:6): [True: 10, False: 5.74k]
  ------------------
  516|     10|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     10|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  517|       |
  518|       |	/*
  519|       |	 * Check the header format and method type.
  520|       |	 */
  521|  5.74k|	if (lha_check_header_format(p) != 0) {
  ------------------
  |  Branch (521:6): [True: 49, False: 5.70k]
  ------------------
  522|     49|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     49|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  523|     49|		    "Bad LHa file");
  524|     49|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     49|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  525|     49|	}
  526|       |
  527|       |	/* We've found the first header. */
  528|  5.70k|	lha->found_first_header = 1;
  529|       |	/* Set a default value and common data */
  530|  5.70k|	lha->header_size = 0;
  531|  5.70k|	lha->level = p[H_LEVEL_OFFSET];
  ------------------
  |  |  210|  5.70k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  532|  5.70k|	lha->method[0] = p[H_METHOD_OFFSET+1];
  ------------------
  |  |  208|  5.70k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  533|  5.70k|	lha->method[1] = p[H_METHOD_OFFSET+2];
  ------------------
  |  |  208|  5.70k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  534|  5.70k|	lha->method[2] = p[H_METHOD_OFFSET+3];
  ------------------
  |  |  208|  5.70k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  535|  5.70k|	if (memcmp(lha->method, "lhd", 3) == 0)
  ------------------
  |  Branch (535:6): [True: 375, False: 5.32k]
  ------------------
  536|    375|		lha->directory = 1;
  537|  5.32k|	else
  538|  5.32k|		lha->directory = 0;
  539|  5.70k|	if (memcmp(lha->method, "lh0", 3) == 0 ||
  ------------------
  |  Branch (539:6): [True: 571, False: 5.12k]
  ------------------
  540|  5.12k|	    memcmp(lha->method, "lz4", 3) == 0)
  ------------------
  |  Branch (540:6): [True: 0, False: 5.12k]
  ------------------
  541|    571|		lha->entry_is_compressed = 0;
  542|  5.12k|	else
  543|  5.12k|		lha->entry_is_compressed = 1;
  544|       |
  545|  5.70k|	lha->compsize = 0;
  546|  5.70k|	lha->origsize = 0;
  547|  5.70k|	lha->setflag = 0;
  548|  5.70k|	lha->birthtime = 0;
  549|  5.70k|	lha->birthtime_tv_nsec = 0;
  550|  5.70k|	lha->mtime = 0;
  551|  5.70k|	lha->mtime_tv_nsec = 0;
  552|  5.70k|	lha->atime = 0;
  553|  5.70k|	lha->atime_tv_nsec = 0;
  554|  5.70k|	lha->mode = (lha->directory)? 0777 : 0666;
  ------------------
  |  Branch (554:14): [True: 375, False: 5.32k]
  ------------------
  555|  5.70k|	lha->uid = 0;
  556|  5.70k|	lha->gid = 0;
  557|  5.70k|	archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|  5.70k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  558|  5.70k|	archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  5.70k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  559|  5.70k|	lha->dos_attr = 0;
  560|  5.70k|	if (lha->opt_sconv != NULL) {
  ------------------
  |  Branch (560:6): [True: 0, False: 5.70k]
  ------------------
  561|      0|		lha->sconv_dir = lha->opt_sconv;
  562|      0|		lha->sconv_fname = lha->opt_sconv;
  563|  5.70k|	} else {
  564|  5.70k|		lha->sconv_dir = NULL;
  565|  5.70k|		lha->sconv_fname = NULL;
  566|  5.70k|	}
  567|       |
  568|  5.70k|	switch (p[H_LEVEL_OFFSET]) {
  ------------------
  |  |  210|  5.70k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  569|    287|	case 0:
  ------------------
  |  Branch (569:2): [True: 287, False: 5.41k]
  ------------------
  570|    287|		err = lha_read_file_header_0(a, lha);
  571|    287|		break;
  572|    117|	case 1:
  ------------------
  |  Branch (572:2): [True: 117, False: 5.58k]
  ------------------
  573|    117|		err = lha_read_file_header_1(a, lha);
  574|    117|		break;
  575|  5.28k|	case 2:
  ------------------
  |  Branch (575:2): [True: 5.28k, False: 413]
  ------------------
  576|  5.28k|		err = lha_read_file_header_2(a, lha);
  577|  5.28k|		break;
  578|      9|	case 3:
  ------------------
  |  Branch (578:2): [True: 9, False: 5.69k]
  ------------------
  579|      9|		err = lha_read_file_header_3(a, lha);
  580|      9|		break;
  581|      0|	default:
  ------------------
  |  Branch (581:2): [True: 0, False: 5.70k]
  ------------------
  582|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  583|      0|		    "Unsupported LHa header level %d", p[H_LEVEL_OFFSET]);
  ------------------
  |  |  210|      0|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  584|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  585|      0|		break;
  586|  5.70k|	}
  587|  5.70k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  5.70k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (587:6): [True: 174, False: 5.52k]
  ------------------
  588|    174|		return (err);
  589|       |
  590|       |
  591|  5.52k|	if (!lha->directory && archive_strlen(&lha->filename) == 0)
  ------------------
  |  |  178|  5.17k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (591:6): [True: 5.17k, False: 353]
  |  Branch (591:25): [True: 3, False: 5.17k]
  ------------------
  592|       |		/* The filename has not been set */
  593|      3|		return (truncated_error(a));
  594|       |
  595|       |	/*
  596|       |	 * Make a pathname from a dirname and a filename, after converting to Unicode.
  597|       |	 * This is because codepages might differ between dirname and filename.
  598|       |	*/
  599|  5.52k|	archive_string_init(&pathname);
  ------------------
  |  |   71|  5.52k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.52k]
  |  |  ------------------
  ------------------
  600|  5.52k|	archive_string_init(&linkname);
  ------------------
  |  |   71|  5.52k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.52k]
  |  |  ------------------
  ------------------
  601|  5.52k|	archive_string_init(&conv_buffer.aes_mbs);
  ------------------
  |  |   71|  5.52k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.52k]
  |  |  ------------------
  ------------------
  602|  5.52k|	archive_string_init(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |   71|  5.52k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.52k]
  |  |  ------------------
  ------------------
  603|  5.52k|	archive_string_init(&conv_buffer.aes_utf8);
  ------------------
  |  |   71|  5.52k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.52k]
  |  |  ------------------
  ------------------
  604|  5.52k|	archive_string_init(&conv_buffer.aes_wcs);
  ------------------
  |  |   71|  5.52k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.52k]
  |  |  ------------------
  ------------------
  605|  5.52k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->dirname.s, lha->dirname.length, lha->sconv_dir)) {
  ------------------
  |  Branch (605:6): [True: 1, False: 5.52k]
  ------------------
  606|      1|		archive_set_error(&a->archive,
  607|      1|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  608|      1|			"Pathname cannot be converted "
  609|      1|			"from %s to Unicode",
  610|      1|			archive_string_conversion_charset_name(lha->sconv_dir));
  611|      1|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  612|  5.52k|	} else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (612:13): [True: 0, False: 5.52k]
  ------------------
  613|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  614|  5.52k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  5.52k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (614:6): [True: 1, False: 5.52k]
  ------------------
  615|      1|		archive_mstring_clean(&conv_buffer);
  616|      1|		archive_wstring_free(&pathname);
  617|      1|		archive_wstring_free(&linkname);
  618|      1|		return (err);
  619|      1|	}
  620|  5.52k|	archive_wstring_copy(&pathname, &conv_buffer.aes_wcs);
  ------------------
  |  |  135|  5.52k|	((dest)->length = 0, archive_wstring_concat((dest), (src)))
  ------------------
  621|       |
  622|  5.52k|	archive_string_empty(&conv_buffer.aes_mbs);
  ------------------
  |  |  181|  5.52k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  623|  5.52k|	archive_string_empty(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |  181|  5.52k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  624|  5.52k|	archive_string_empty(&conv_buffer.aes_utf8);
  ------------------
  |  |  181|  5.52k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  625|  5.52k|	archive_wstring_empty(&conv_buffer.aes_wcs);
  ------------------
  |  |  182|  5.52k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
  626|  5.52k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->filename.s, lha->filename.length, lha->sconv_fname)) {
  ------------------
  |  Branch (626:6): [True: 9, False: 5.51k]
  ------------------
  627|      9|		archive_set_error(&a->archive,
  628|      9|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  629|      9|			"Pathname cannot be converted "
  630|      9|			"from %s to Unicode",
  631|      9|			archive_string_conversion_charset_name(lha->sconv_fname));
  632|      9|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  633|      9|	}
  634|  5.51k|	else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (634:11): [True: 1, False: 5.51k]
  ------------------
  635|      1|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  636|  5.52k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  5.52k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (636:6): [True: 10, False: 5.51k]
  ------------------
  637|     10|		archive_mstring_clean(&conv_buffer);
  638|     10|		archive_wstring_free(&pathname);
  639|     10|		archive_wstring_free(&linkname);
  640|     10|		return (err);
  641|     10|	}
  642|  5.51k|	archive_wstring_concat(&pathname, &conv_buffer.aes_wcs);
  643|  5.51k|	archive_mstring_clean(&conv_buffer);
  644|       |
  645|  5.51k|	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  5.51k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  5.51k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (645:6): [True: 23, False: 5.48k]
  ------------------
  646|       |		/*
  647|       |	 	 * Extract the symlink-name if it's included in the pathname.
  648|       |	 	 */
  649|     23|		if (!lha_parse_linkname(&linkname, &pathname)) {
  ------------------
  |  Branch (649:7): [True: 0, False: 23]
  ------------------
  650|       |			/* We couldn't get the symlink-name. */
  651|      0|			archive_set_error(&a->archive,
  652|      0|		    	    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  653|      0|			    "Unknown symlink-name");
  654|      0|			archive_wstring_free(&pathname);
  655|      0|			archive_wstring_free(&linkname);
  656|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  657|      0|		}
  658|  5.48k|	} else {
  659|       |		/*
  660|       |		 * Make sure a file-type is set.
  661|       |		 * The mode has been overridden if it is in the extended data.
  662|       |		 */
  663|  5.48k|		lha->mode = (lha->mode & ~AE_IFMT) |
  ------------------
  |  |  215|  5.48k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  664|  5.48k|		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  221|    353|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
              		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  216|  5.13k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (664:8): [True: 353, False: 5.13k]
  ------------------
  665|  5.48k|	}
  666|  5.51k|	if ((lha->setflag & UNIX_MODE_IS_SET) == 0 &&
  ------------------
  |  |  163|  5.51k|#define UNIX_MODE_IS_SET	4
  ------------------
  |  Branch (666:6): [True: 5.48k, False: 29]
  ------------------
  667|  5.48k|	    (lha->dos_attr & 1) != 0)
  ------------------
  |  Branch (667:6): [True: 26, False: 5.45k]
  ------------------
  668|     26|		lha->mode &= ~(0222);/* read only. */
  669|       |
  670|       |	/*
  671|       |	 * Set basic file parameters.
  672|       |	 */
  673|  5.51k|	archive_entry_copy_pathname_w(entry, pathname.s);
  674|  5.51k|	archive_wstring_free(&pathname);
  675|  5.51k|	if (archive_strlen(&linkname) > 0) {
  ------------------
  |  |  178|  5.51k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (675:6): [True: 22, False: 5.49k]
  ------------------
  676|     22|		archive_entry_copy_symlink_w(entry, linkname.s);
  677|     22|	} else
  678|  5.49k|		archive_entry_set_symlink(entry, NULL);
  679|  5.51k|	archive_wstring_free(&linkname);
  680|       |	/*
  681|       |	 * When a header level is 0, there is a possibility that
  682|       |	 * a pathname and a symlink has '\' character, a directory
  683|       |	 * separator in DOS/Windows. So we should convert it to '/'.
  684|       |	 */
  685|  5.51k|	if (lha->level == 0)
  ------------------
  |  Branch (685:6): [True: 270, False: 5.24k]
  ------------------
  686|    270|		lha_replace_path_separator(lha, entry);
  687|       |
  688|  5.51k|	archive_entry_set_mode(entry, lha->mode);
  689|  5.51k|	archive_entry_set_uid(entry, lha->uid);
  690|  5.51k|	archive_entry_set_gid(entry, lha->gid);
  691|  5.51k|	if (archive_strlen(&lha->uname) > 0)
  ------------------
  |  |  178|  5.51k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (691:6): [True: 237, False: 5.27k]
  ------------------
  692|    237|		archive_entry_set_uname(entry, lha->uname.s);
  693|  5.51k|	if (archive_strlen(&lha->gname) > 0)
  ------------------
  |  |  178|  5.51k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (693:6): [True: 523, False: 4.98k]
  ------------------
  694|    523|		archive_entry_set_gname(entry, lha->gname.s);
  695|  5.51k|	if (lha->setflag & BIRTHTIME_IS_SET) {
  ------------------
  |  |  161|  5.51k|#define BIRTHTIME_IS_SET	1
  ------------------
  |  Branch (695:6): [True: 0, False: 5.51k]
  ------------------
  696|      0|		archive_entry_set_birthtime(entry, lha->birthtime,
  697|      0|		    lha->birthtime_tv_nsec);
  698|      0|		archive_entry_set_ctime(entry, lha->birthtime,
  699|      0|		    lha->birthtime_tv_nsec);
  700|  5.51k|	} else {
  701|  5.51k|		archive_entry_unset_birthtime(entry);
  702|  5.51k|		archive_entry_unset_ctime(entry);
  703|  5.51k|	}
  704|  5.51k|	archive_entry_set_mtime(entry, lha->mtime, lha->mtime_tv_nsec);
  705|  5.51k|	if (lha->setflag & ATIME_IS_SET)
  ------------------
  |  |  162|  5.51k|#define ATIME_IS_SET		2
  ------------------
  |  Branch (705:6): [True: 0, False: 5.51k]
  ------------------
  706|      0|		archive_entry_set_atime(entry, lha->atime,
  707|      0|		    lha->atime_tv_nsec);
  708|  5.51k|	else
  709|  5.51k|		archive_entry_unset_atime(entry);
  710|  5.51k|	if (lha->directory || archive_entry_symlink(entry) != NULL)
  ------------------
  |  Branch (710:6): [True: 353, False: 5.15k]
  |  Branch (710:24): [True: 22, False: 5.13k]
  ------------------
  711|    375|		archive_entry_unset_size(entry);
  712|  5.13k|	else
  713|  5.13k|		archive_entry_set_size(entry, lha->origsize);
  714|       |
  715|       |	/*
  716|       |	 * Prepare variables used to read a file content.
  717|       |	 */
  718|  5.51k|	lha->entry_bytes_remaining = lha->compsize;
  719|  5.51k|	if (lha->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (719:6): [True: 0, False: 5.51k]
  ------------------
  720|      0|		archive_set_error(&a->archive,
  721|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  722|      0|		    "Invalid LHa entry size");
  723|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  724|      0|	}
  725|  5.51k|	lha->entry_offset = 0;
  726|  5.51k|	lha->entry_crc_calculated = 0;
  727|       |
  728|       |	/*
  729|       |	 * This file does not have a content.
  730|       |	 */
  731|  5.51k|	if (lha->directory || lha->compsize == 0)
  ------------------
  |  Branch (731:6): [True: 353, False: 5.15k]
  |  Branch (731:24): [True: 22, False: 5.13k]
  ------------------
  732|    375|		lha->end_of_entry = 1;
  733|       |
  734|  5.51k|	snprintf(lha->format_name, sizeof(lha->format_name), "lha -%c%c%c-",
  735|  5.51k|	    lha->method[0], lha->method[1], lha->method[2]);
  736|  5.51k|	a->archive.archive_format_name = lha->format_name;
  737|       |
  738|  5.51k|	return (err);
  739|  5.51k|}
archive_read_support_format_lha.c:truncated_error:
  463|    185|{
  464|    185|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    185|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  465|    185|	    "Truncated LHa header");
  466|    185|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    185|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  467|    185|}
archive_read_support_format_lha.c:lha_skip_sfx:
  419|    187|{
  420|    187|	const void *h;
  421|    187|	const char *p, *q;
  422|    187|	size_t next, skip;
  423|    187|	ssize_t bytes, window;
  424|       |
  425|    187|	window = 4096;
  426|    655|	for (;;) {
  427|    655|		h = __archive_read_ahead(a, window, &bytes);
  428|    655|		if (h == NULL) {
  ------------------
  |  Branch (428:7): [True: 468, False: 187]
  ------------------
  429|       |			/* Remaining bytes are less than window. */
  430|    468|			window >>= 1;
  431|    468|			if (window < (H_SIZE + 3))
  ------------------
  |  |  211|    468|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (431:8): [True: 0, False: 468]
  ------------------
  432|      0|				goto fatal;
  433|    468|			continue;
  434|    468|		}
  435|    187|		if (bytes < H_SIZE)
  ------------------
  |  |  211|    187|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (435:7): [True: 0, False: 187]
  ------------------
  436|      0|			goto fatal;
  437|    187|		p = h;
  438|    187|		q = p + bytes;
  439|       |
  440|       |		/*
  441|       |		 * Scan ahead until we find something that looks
  442|       |		 * like the lha header.
  443|       |		 */
  444|  10.4k|		while (p + H_SIZE < q) {
  ------------------
  |  |  211|  10.4k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (444:10): [True: 10.4k, False: 0]
  ------------------
  445|  10.4k|			if ((next = lha_check_header_format(p)) == 0) {
  ------------------
  |  Branch (445:8): [True: 187, False: 10.2k]
  ------------------
  446|    187|				skip = p - (const char *)h;
  447|    187|				__archive_read_consume(a, skip);
  448|    187|				return (ARCHIVE_OK);
  ------------------
  |  |  233|    187|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  449|    187|			}
  450|  10.2k|			p += next;
  451|  10.2k|		}
  452|      0|		skip = p - (const char *)h;
  453|      0|		__archive_read_consume(a, skip);
  454|      0|	}
  455|      0|fatal:
  456|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  457|      0|	    "Couldn't find out LHa header");
  458|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  459|    187|}
archive_read_support_format_lha.c:lha_read_file_header_0:
  803|    287|{
  804|    287|	const unsigned char *p;
  805|    287|	int extdsize, namelen;
  806|    287|	unsigned char headersum, sum_calculated;
  807|       |
  808|    287|	if ((p = __archive_read_ahead(a, H0_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  800|    287|#define H0_FIXED_SIZE		24
  ------------------
  |  Branch (808:6): [True: 0, False: 287]
  ------------------
  809|      0|		return (truncated_error(a));
  810|    287|	lha->header_size = p[H0_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  793|    287|#define H0_HEADER_SIZE_OFFSET	0
  ------------------
  811|    287|	headersum = p[H0_HEADER_SUM_OFFSET];
  ------------------
  |  |  794|    287|#define H0_HEADER_SUM_OFFSET	1
  ------------------
  812|    287|	lha->compsize = archive_le32dec(p + H0_COMP_SIZE_OFFSET);
  ------------------
  |  |  795|    287|#define H0_COMP_SIZE_OFFSET	7
  ------------------
  813|    287|	lha->origsize = archive_le32dec(p + H0_ORIG_SIZE_OFFSET);
  ------------------
  |  |  796|    287|#define H0_ORIG_SIZE_OFFSET	11
  ------------------
  814|    287|	lha->mtime = dos_to_unix(archive_le32dec(p + H0_DOS_TIME_OFFSET));
  ------------------
  |  |  797|    287|#define H0_DOS_TIME_OFFSET	15
  ------------------
  815|    287|	namelen = p[H0_NAME_LEN_OFFSET];
  ------------------
  |  |  798|    287|#define H0_NAME_LEN_OFFSET	21
  ------------------
  816|    287|	extdsize = (int)lha->header_size - H0_FIXED_SIZE - namelen;
  ------------------
  |  |  800|    287|#define H0_FIXED_SIZE		24
  ------------------
  817|    287|	if ((namelen > 221 || extdsize < 0) && extdsize != -2) {
  ------------------
  |  Branch (817:7): [True: 0, False: 287]
  |  Branch (817:24): [True: 259, False: 28]
  |  Branch (817:41): [True: 7, False: 252]
  ------------------
  818|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  819|      7|		    "Invalid LHa header");
  820|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  821|      7|	}
  822|    280|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (822:6): [True: 0, False: 280]
  ------------------
  823|      0|		return (truncated_error(a));
  824|       |
  825|    280|	archive_strncpy(&lha->filename, p + H0_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|    280|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  826|       |	/* When extdsize == -2, A CRC16 value is not present in the header. */
  827|    280|	if (extdsize >= 0) {
  ------------------
  |  Branch (827:6): [True: 28, False: 252]
  ------------------
  828|     28|		lha->crc = archive_le16dec(p + H0_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  799|     28|#define H0_FILE_NAME_OFFSET	22
  ------------------
  829|     28|		lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|     28|#define CRC_IS_SET		8
  ------------------
  830|     28|	}
  831|    280|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  832|       |
  833|       |	/* Read an extended header */
  834|    280|	if (extdsize > 0) {
  ------------------
  |  Branch (834:6): [True: 28, False: 252]
  ------------------
  835|       |		/* This extended data is set by 'LHa for UNIX' only.
  836|       |		 * Maybe fixed size.
  837|       |		 */
  838|     28|		p += H0_FILE_NAME_OFFSET + namelen + 2;
  ------------------
  |  |  799|     28|#define H0_FILE_NAME_OFFSET	22
  ------------------
  839|     28|		if (p[0] == 'U' && extdsize == 12) {
  ------------------
  |  Branch (839:7): [True: 7, False: 21]
  |  Branch (839:22): [True: 7, False: 0]
  ------------------
  840|       |			/* p[1] is a minor version. */
  841|      7|			lha->mtime = archive_le32dec(&p[2]);
  842|      7|			lha->mode = archive_le16dec(&p[6]);
  843|      7|			lha->uid = archive_le16dec(&p[8]);
  844|      7|			lha->gid = archive_le16dec(&p[10]);
  845|      7|			lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|      7|#define UNIX_MODE_IS_SET	4
  ------------------
  846|      7|		}
  847|     28|	}
  848|    280|	__archive_read_consume(a, lha->header_size);
  849|       |
  850|    280|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (850:6): [True: 10, False: 270]
  ------------------
  851|     10|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  852|     10|		    "LHa header sum error");
  853|     10|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  854|     10|	}
  855|       |
  856|    270|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    270|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  857|    280|}
archive_read_support_format_lha.c:lha_calcsum:
 1716|    394|{
 1717|    394|	unsigned char const *p = (unsigned char const *)pp;
 1718|       |
 1719|    394|	p += offset;
 1720|  10.8k|	for (;size > 0; --size)
  ------------------
  |  Branch (1720:8): [True: 10.4k, False: 394]
  ------------------
 1721|  10.4k|		sum += *p++;
 1722|    394|	return (sum);
 1723|    394|}
archive_read_support_format_lha.c:lha_read_file_header_1:
  897|    117|{
  898|    117|	const unsigned char *p;
  899|    117|	size_t extdsize;
  900|    117|	int err, err2;
  901|    117|	int namelen, padding;
  902|    117|	unsigned char headersum, sum_calculated;
  903|       |
  904|    117|	err = ARCHIVE_OK;
  ------------------
  |  |  233|    117|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  905|       |
  906|    117|	if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  894|    117|#define H1_FIXED_SIZE		27
  ------------------
  |  Branch (906:6): [True: 0, False: 117]
  ------------------
  907|      0|		return (truncated_error(a));
  908|       |
  909|    117|	lha->header_size = p[H1_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  887|    117|#define H1_HEADER_SIZE_OFFSET	0
  ------------------
  910|    117|	headersum = p[H1_HEADER_SUM_OFFSET];
  ------------------
  |  |  888|    117|#define H1_HEADER_SUM_OFFSET	1
  ------------------
  911|       |	/* Note: An extended header size is included in a compsize. */
  912|    117|	lha->compsize = archive_le32dec(p + H1_COMP_SIZE_OFFSET);
  ------------------
  |  |  889|    117|#define H1_COMP_SIZE_OFFSET	7
  ------------------
  913|    117|	lha->origsize = archive_le32dec(p + H1_ORIG_SIZE_OFFSET);
  ------------------
  |  |  890|    117|#define H1_ORIG_SIZE_OFFSET	11
  ------------------
  914|    117|	lha->mtime = dos_to_unix(archive_le32dec(p + H1_DOS_TIME_OFFSET));
  ------------------
  |  |  891|    117|#define H1_DOS_TIME_OFFSET	15
  ------------------
  915|    117|	namelen = p[H1_NAME_LEN_OFFSET];
  ------------------
  |  |  892|    117|#define H1_NAME_LEN_OFFSET	21
  ------------------
  916|       |	/* Calculate a padding size. The result will be normally 0 only(?) */
  917|    117|	padding = ((int)lha->header_size) - H1_FIXED_SIZE - namelen;
  ------------------
  |  |  894|    117|#define H1_FIXED_SIZE		27
  ------------------
  918|       |
  919|    117|	if (namelen > 230 || padding < 0)
  ------------------
  |  Branch (919:6): [True: 0, False: 117]
  |  Branch (919:23): [True: 1, False: 116]
  ------------------
  920|      1|		goto invalid;
  921|       |
  922|    116|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (922:6): [True: 2, False: 114]
  ------------------
  923|      2|		return (truncated_error(a));
  924|       |
  925|    114|	if (memchr(p + H1_FILE_NAME_OFFSET, 0xff,
  ------------------
  |  |  893|    114|#define H1_FILE_NAME_OFFSET	22
  ------------------
  |  Branch (925:6): [True: 0, False: 114]
  ------------------
  926|    114|	    (size_t)namelen) != NULL)
  927|      0|		goto invalid; /* Invalid filename. */
  928|    114|	archive_strncpy(&lha->filename, p + H1_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|    114|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  929|    114|	lha->crc = archive_le16dec(p + H1_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  893|    114|#define H1_FILE_NAME_OFFSET	22
  ------------------
  930|    114|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|    114|#define CRC_IS_SET		8
  ------------------
  931|       |
  932|    114|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  933|       |	/* Consume used bytes but not include `next header size' data
  934|       |	 * since it will be consumed in lha_read_file_extended_header(). */
  935|    114|	__archive_read_consume(a, lha->header_size - 2);
  936|       |
  937|       |	/* Read extended headers */
  938|    114|	err2 = lha_read_file_extended_header(a, lha, NULL, 2,
  939|    114|	    (uint64_t)(lha->compsize + 2), &extdsize);
  940|    114|	if (err2 < ARCHIVE_WARN)
  ------------------
  |  |  235|    114|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (940:6): [True: 37, False: 77]
  ------------------
  941|     37|		return (err2);
  942|     77|	if (err2 < err)
  ------------------
  |  Branch (942:6): [True: 0, False: 77]
  ------------------
  943|      0|		err = err2;
  944|       |	/* Get a real compressed file size. */
  945|     77|	lha->compsize -= extdsize - 2;
  946|       |
  947|     77|	if (lha->compsize < 0)
  ------------------
  |  Branch (947:6): [True: 0, False: 77]
  ------------------
  948|      0|		goto invalid;	/* Invalid compressed file size */
  949|       |
  950|     77|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (950:6): [True: 4, False: 73]
  ------------------
  951|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  952|      4|		    "LHa header sum error");
  953|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  954|      4|	}
  955|     73|	return (err);
  956|      1|invalid:
  957|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  958|      1|	    "Invalid LHa header");
  959|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  960|     77|}
archive_read_support_format_lha.c:lha_read_file_extended_header:
 1140|  5.40k|{
 1141|  5.40k|	const void *h;
 1142|  5.40k|	const unsigned char *extdheader;
 1143|  5.40k|	size_t	extdsize;
 1144|  5.40k|	size_t	datasize;
 1145|  5.40k|	unsigned int i;
 1146|  5.40k|	unsigned char extdtype;
 1147|       |
 1148|  5.40k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
 1149|  5.40k|#define EXT_FILENAME		0x01		/* Filename 		    */
 1150|  5.40k|#define EXT_DIRECTORY		0x02		/* Directory name	    */
 1151|  5.40k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
 1152|  5.40k|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
 1153|  5.40k|#define EXT_FILESIZE		0x42		/* Large file size	    */
 1154|  5.40k|#define EXT_TIMEZONE		0x43		/* Time zone		    */
 1155|  5.40k|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
 1156|  5.40k|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
 1157|  5.40k|#define EXT_CODEPAGE		0x46		/* Codepage		    */
 1158|  5.40k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
 1159|  5.40k|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
 1160|  5.40k|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
 1161|  5.40k|#define EXT_UNIX_UNAME		0x53		/* User name		    */
 1162|  5.40k|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
 1163|  5.40k|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
 1164|  5.40k|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
 1165|       |
 1166|  5.40k|	*total_size = sizefield_length;
 1167|       |
 1168|  26.6k|	for (;;) {
 1169|       |		/* Read an extended header size. */
 1170|  26.6k|		if ((h =
  ------------------
  |  Branch (1170:7): [True: 23, False: 26.5k]
  ------------------
 1171|  26.6k|		    __archive_read_ahead(a, sizefield_length, NULL)) == NULL)
 1172|     23|			return (truncated_error(a));
 1173|       |		/* Check if the size is the zero indicates the end of the
 1174|       |		 * extended header. */
 1175|  26.5k|		if (sizefield_length == sizeof(uint16_t))
  ------------------
  |  Branch (1175:7): [True: 26.5k, False: 31]
  ------------------
 1176|  26.5k|			extdsize = archive_le16dec(h);
 1177|     31|		else
 1178|     31|			extdsize = archive_le32dec(h);
 1179|  26.5k|		if (extdsize == 0) {
  ------------------
  |  Branch (1179:7): [True: 5.26k, False: 21.3k]
  ------------------
 1180|       |			/* End of extended header */
 1181|  5.26k|			if (crc != NULL)
  ------------------
  |  Branch (1181:8): [True: 5.18k, False: 77]
  ------------------
 1182|  5.18k|				*crc = lha_crc16(*crc, h, sizefield_length);
 1183|  5.26k|			__archive_read_consume(a, sizefield_length);
 1184|  5.26k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.26k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1185|  5.26k|		}
 1186|       |
 1187|       |		/* Sanity check to the extended header size. */
 1188|  21.3k|		if (((uint64_t)*total_size + extdsize) > limitsize ||
  ------------------
  |  Branch (1188:7): [True: 40, False: 21.2k]
  ------------------
 1189|  21.2k|		    extdsize <= (size_t)sizefield_length)
  ------------------
  |  Branch (1189:7): [True: 1, False: 21.2k]
  ------------------
 1190|     41|			goto invalid;
 1191|       |
 1192|       |		/* Read the extended header. */
 1193|  21.2k|		if ((h = __archive_read_ahead(a, extdsize, NULL)) == NULL)
  ------------------
  |  Branch (1193:7): [True: 65, False: 21.2k]
  ------------------
 1194|     65|			return (truncated_error(a));
 1195|  21.2k|		*total_size += extdsize;
 1196|       |
 1197|  21.2k|		extdheader = (const unsigned char *)h;
 1198|       |		/* Get the extended header type. */
 1199|  21.2k|		extdtype = extdheader[sizefield_length];
 1200|       |		/* Calculate an extended data size. */
 1201|  21.2k|		datasize = extdsize - (1 + sizefield_length);
 1202|       |		/* Skip an extended header size field and type field. */
 1203|  21.2k|		extdheader += sizefield_length + 1;
 1204|       |
 1205|  21.2k|		if (crc != NULL && extdtype != EXT_HEADER_CRC)
  ------------------
  |  | 1148|  19.6k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1205:7): [True: 19.6k, False: 1.59k]
  |  Branch (1205:22): [True: 14.8k, False: 4.76k]
  ------------------
 1206|  14.8k|			*crc = lha_crc16(*crc, h, extdsize);
 1207|  21.2k|		switch (extdtype) {
 1208|  5.21k|		case EXT_HEADER_CRC:
  ------------------
  |  | 1148|  5.21k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1208:3): [True: 5.21k, False: 16.0k]
  ------------------
 1209|       |			/* We only use a header CRC. Following data will not
 1210|       |			 * be used. */
 1211|  5.21k|			if (datasize >= 2) {
  ------------------
  |  Branch (1211:8): [True: 5.21k, False: 0]
  ------------------
 1212|  5.21k|				lha->header_crc = archive_le16dec(extdheader);
 1213|  5.21k|				if (crc != NULL) {
  ------------------
  |  Branch (1213:9): [True: 4.76k, False: 448]
  ------------------
 1214|  4.76k|					static const char zeros[2] = {0, 0};
 1215|  4.76k|					*crc = lha_crc16(*crc, h,
 1216|  4.76k|					    extdsize - datasize);
 1217|       |					/* CRC value itself as zero */
 1218|  4.76k|					*crc = lha_crc16(*crc, zeros, 2);
 1219|  4.76k|					*crc = lha_crc16(*crc,
 1220|  4.76k|					    extdheader+2, datasize - 2);
 1221|  4.76k|				}
 1222|  5.21k|			}
 1223|  5.21k|			break;
 1224|  6.70k|		case EXT_FILENAME:
  ------------------
  |  | 1149|  6.70k|#define EXT_FILENAME		0x01		/* Filename 		    */
  ------------------
  |  Branch (1224:3): [True: 6.70k, False: 14.5k]
  ------------------
 1225|  6.70k|			if (datasize == 0) {
  ------------------
  |  Branch (1225:8): [True: 1.31k, False: 5.38k]
  ------------------
 1226|       |				/* maybe directory header */
 1227|  1.31k|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  1.31k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1228|  1.31k|				break;
 1229|  1.31k|			}
 1230|  5.38k|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1230:8): [True: 1, False: 5.38k]
  ------------------
 1231|      1|				goto invalid;
 1232|  5.38k|			archive_strncpy(&lha->filename,
  ------------------
  |  |  173|  5.38k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1233|  5.38k|			    (const char *)extdheader, datasize);
 1234|  5.38k|			break;
 1235|  1.05k|		case EXT_UTF16_FILENAME:
  ------------------
  |  | 1155|  1.05k|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
  ------------------
  |  Branch (1235:3): [True: 1.05k, False: 20.1k]
  ------------------
 1236|  1.05k|			if (datasize == 0) {
  ------------------
  |  Branch (1236:8): [True: 722, False: 330]
  ------------------
 1237|       |				/* maybe directory header */
 1238|    722|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|    722|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1239|    722|				break;
 1240|    722|			} else if (datasize & 1) {
  ------------------
  |  Branch (1240:15): [True: 0, False: 330]
  ------------------
 1241|       |				/* UTF-16 characters take always 2 or 4 bytes */
 1242|      0|				goto invalid;
 1243|      0|			}
 1244|    330|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1244:8): [True: 0, False: 330]
  ------------------
 1245|      0|				goto invalid;
 1246|    330|			archive_string_empty(&lha->filename);
  ------------------
  |  |  181|    330|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1247|    330|			archive_array_append(&lha->filename,
 1248|    330|				(const char *)extdheader, datasize);
 1249|       |			/* Setup a string conversion for a filename. */
 1250|    330|			lha->sconv_fname =
 1251|    330|			    archive_string_conversion_from_charset(&a->archive,
 1252|    330|			        "UTF-16LE", 1);
 1253|    330|			if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1253:8): [True: 0, False: 330]
  ------------------
 1254|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1255|    330|			break;
 1256|    330|		case EXT_DIRECTORY:
  ------------------
  |  | 1150|     62|#define EXT_DIRECTORY		0x02		/* Directory name	    */
  ------------------
  |  Branch (1256:3): [True: 62, False: 21.1k]
  ------------------
 1257|     62|			if (datasize == 0 || extdheader[0] == '\0')
  ------------------
  |  Branch (1257:8): [True: 1, False: 61]
  |  Branch (1257:25): [True: 0, False: 61]
  ------------------
 1258|       |				/* no directory name data. exit this case. */
 1259|      1|				goto invalid;
 1260|       |
 1261|     61|			archive_strncpy(&lha->dirname,
  ------------------
  |  |  173|     61|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1262|     61|		  	    (const char *)extdheader, datasize);
 1263|       |			/*
 1264|       |			 * Convert directory delimiter from 0xFF
 1265|       |			 * to '/' for local system.
 1266|       |	 		 */
 1267|    676|			for (i = 0; i < lha->dirname.length; i++) {
  ------------------
  |  Branch (1267:16): [True: 615, False: 61]
  ------------------
 1268|    615|				if ((unsigned char)lha->dirname.s[i] == 0xFF)
  ------------------
  |  Branch (1268:9): [True: 392, False: 223]
  ------------------
 1269|    392|					lha->dirname.s[i] = '/';
 1270|    615|			}
 1271|       |			/* Is last character directory separator? */
 1272|     61|			if (lha->dirname.s[lha->dirname.length-1] != '/')
  ------------------
  |  Branch (1272:8): [True: 3, False: 58]
  ------------------
 1273|       |				/* invalid directory data */
 1274|      3|				goto invalid;
 1275|     58|			break;
 1276|     58|		case EXT_UTF16_DIRECTORY:
  ------------------
  |  | 1156|     18|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
  ------------------
  |  Branch (1276:3): [True: 18, False: 21.2k]
  ------------------
 1277|       |			/* UTF-16 characters take always 2 or 4 bytes */
 1278|     18|			if (datasize == 0 || (datasize & 1) ||
  ------------------
  |  Branch (1278:8): [True: 0, False: 18]
  |  Branch (1278:25): [True: 0, False: 18]
  ------------------
 1279|     18|			    extdheader[0] == '\0') {
  ------------------
  |  Branch (1279:8): [True: 1, False: 17]
  ------------------
 1280|       |				/* no directory name data. exit this case. */
 1281|      1|				goto invalid;
 1282|      1|			}
 1283|       |
 1284|     17|			archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|     17|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1285|     17|			archive_array_append(&lha->dirname,
 1286|     17|				(const char *)extdheader, datasize);
 1287|     17|			lha->sconv_dir =
 1288|     17|			    archive_string_conversion_from_charset(&a->archive,
 1289|     17|			        "UTF-16LE", 1);
 1290|     17|			if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1290:8): [True: 0, False: 17]
  ------------------
 1291|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1292|     17|			else {
 1293|       |				/*
 1294|       |				 * Convert directory delimiter from 0xFFFF
 1295|       |				 * to '/' for local system.
 1296|       |				 */
 1297|     17|				uint16_t dirSep;
 1298|     17|				uint16_t d = 1;
 1299|     17|				if (archive_be16dec(&d) == 1)
  ------------------
  |  Branch (1299:9): [True: 0, False: 17]
  ------------------
 1300|      0|					dirSep = 0x2F00;
 1301|     17|				else
 1302|     17|					dirSep = 0x002F;
 1303|       |
 1304|       |				/* UTF-16LE character */
 1305|     17|				uint16_t *utf16name =
 1306|     17|				    (uint16_t *)lha->dirname.s;
 1307|  1.83k|				for (i = 0; i < lha->dirname.length / 2; i++) {
  ------------------
  |  Branch (1307:17): [True: 1.81k, False: 17]
  ------------------
 1308|  1.81k|					if (utf16name[i] == 0xFFFF) {
  ------------------
  |  Branch (1308:10): [True: 259, False: 1.55k]
  ------------------
 1309|    259|						utf16name[i] = dirSep;
 1310|    259|					}
 1311|  1.81k|				}
 1312|       |				/* Is last character directory separator? */
 1313|     17|				if (utf16name[lha->dirname.length / 2 - 1] !=
  ------------------
  |  Branch (1313:9): [True: 7, False: 10]
  ------------------
 1314|     17|				    dirSep) {
 1315|       |					/* invalid directory data */
 1316|      7|					goto invalid;
 1317|      7|				}
 1318|     17|			}
 1319|     10|			break;
 1320|  1.35k|		case EXT_DOS_ATTR:
  ------------------
  |  | 1151|  1.35k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
  ------------------
  |  Branch (1320:3): [True: 1.35k, False: 19.8k]
  ------------------
 1321|  1.35k|			if (datasize == 2)
  ------------------
  |  Branch (1321:8): [True: 135, False: 1.21k]
  ------------------
 1322|    135|				lha->dos_attr = (unsigned char)
 1323|    135|				    (archive_le16dec(extdheader) & 0xff);
 1324|  1.35k|			break;
 1325|    110|		case EXT_TIMESTAMP:
  ------------------
  |  | 1152|    110|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
  ------------------
  |  Branch (1325:3): [True: 110, False: 21.1k]
  ------------------
 1326|    110|			if (datasize == (sizeof(uint64_t) * 3)) {
  ------------------
  |  Branch (1326:8): [True: 48, False: 62]
  ------------------
 1327|     48|				ntfs_to_unix(archive_le64dec(extdheader),
 1328|     48|					&lha->birthtime,
 1329|     48|				    &lha->birthtime_tv_nsec);
 1330|     48|				extdheader += sizeof(uint64_t);
 1331|     48|				ntfs_to_unix(archive_le64dec(extdheader),
 1332|     48|					&lha->mtime,
 1333|     48|				    &lha->mtime_tv_nsec);
 1334|     48|				extdheader += sizeof(uint64_t);
 1335|     48|				ntfs_to_unix(archive_le64dec(extdheader),
 1336|     48|					&lha->atime,
 1337|     48|				    &lha->atime_tv_nsec);
 1338|     48|				lha->setflag |= BIRTHTIME_IS_SET |
  ------------------
  |  |  161|     48|#define BIRTHTIME_IS_SET	1
  ------------------
 1339|     48|				    ATIME_IS_SET;
  ------------------
  |  |  162|     48|#define ATIME_IS_SET		2
  ------------------
 1340|     48|			}
 1341|    110|			break;
 1342|    301|		case EXT_FILESIZE:
  ------------------
  |  | 1153|    301|#define EXT_FILESIZE		0x42		/* Large file size	    */
  ------------------
  |  Branch (1342:3): [True: 301, False: 20.9k]
  ------------------
 1343|    301|			if (datasize == sizeof(uint64_t) * 2) {
  ------------------
  |  Branch (1343:8): [True: 232, False: 69]
  ------------------
 1344|    232|				lha->compsize = archive_le64dec(extdheader);
 1345|    232|				extdheader += sizeof(uint64_t);
 1346|    232|				lha->origsize = archive_le64dec(extdheader);
 1347|    232|				if (lha->compsize < 0 || lha->origsize < 0)
  ------------------
  |  Branch (1347:9): [True: 1, False: 231]
  |  Branch (1347:30): [True: 1, False: 230]
  ------------------
 1348|      2|					goto invalid;
 1349|    232|			}
 1350|    299|			break;
 1351|    961|		case EXT_CODEPAGE:
  ------------------
  |  | 1157|    961|#define EXT_CODEPAGE		0x46		/* Codepage		    */
  ------------------
  |  Branch (1351:3): [True: 961, False: 20.2k]
  ------------------
 1352|       |			/* Get an archived filename charset from codepage.
 1353|       |			 * This overwrites the charset specified by
 1354|       |			 * hdrcharset option. */
 1355|    961|			if (datasize == sizeof(uint32_t)) {
  ------------------
  |  Branch (1355:8): [True: 878, False: 83]
  ------------------
 1356|    878|				struct archive_string cp;
 1357|    878|				const char *charset;
 1358|       |
 1359|    878|				archive_string_init(&cp);
  ------------------
  |  |   71|    878|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 878]
  |  |  ------------------
  ------------------
 1360|    878|				switch (archive_le32dec(extdheader)) {
 1361|    330|				case 65001: /* UTF-8 */
  ------------------
  |  Branch (1361:5): [True: 330, False: 548]
  ------------------
 1362|    330|					charset = "UTF-8";
 1363|    330|					break;
 1364|    548|				default:
  ------------------
  |  Branch (1364:5): [True: 548, False: 330]
  ------------------
 1365|    548|					archive_string_sprintf(&cp, "CP%d",
 1366|    548|					    (int)archive_le32dec(extdheader));
 1367|    548|					charset = cp.s;
 1368|    548|					break;
 1369|    878|				}
 1370|    878|				lha->sconv_dir =
 1371|    878|				    archive_string_conversion_from_charset(
 1372|    878|					&(a->archive), charset, 1);
 1373|    878|				lha->sconv_fname =
 1374|    878|				    archive_string_conversion_from_charset(
 1375|    878|					&(a->archive), charset, 1);
 1376|    878|				archive_string_free(&cp);
 1377|    878|				if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1377:9): [True: 0, False: 878]
  ------------------
 1378|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1379|    878|				if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 878]
  ------------------
 1380|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1381|    878|			}
 1382|    961|			break;
 1383|  2.22k|		case EXT_UNIX_MODE:
  ------------------
  |  | 1158|  2.22k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
  ------------------
  |  Branch (1383:3): [True: 2.22k, False: 19.0k]
  ------------------
 1384|  2.22k|			if (datasize == sizeof(uint16_t)) {
  ------------------
  |  Branch (1384:8): [True: 2.01k, False: 202]
  ------------------
 1385|  2.01k|				lha->mode = archive_le16dec(extdheader);
 1386|  2.01k|				lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|  2.01k|#define UNIX_MODE_IS_SET	4
  ------------------
 1387|  2.01k|			}
 1388|  2.22k|			break;
 1389|    308|		case EXT_UNIX_GID_UID:
  ------------------
  |  | 1159|    308|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
  ------------------
  |  Branch (1389:3): [True: 308, False: 20.9k]
  ------------------
 1390|    308|			if (datasize == (sizeof(uint16_t) * 2)) {
  ------------------
  |  Branch (1390:8): [True: 238, False: 70]
  ------------------
 1391|    238|				lha->gid = archive_le16dec(extdheader);
 1392|    238|				lha->uid = archive_le16dec(extdheader+2);
 1393|    238|			}
 1394|    308|			break;
 1395|    483|		case EXT_UNIX_GNAME:
  ------------------
  |  | 1160|    483|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
  ------------------
  |  Branch (1395:3): [True: 483, False: 20.7k]
  ------------------
 1396|    483|			if (datasize > 0)
  ------------------
  |  Branch (1396:8): [True: 232, False: 251]
  ------------------
 1397|    232|				archive_strncpy(&lha->gname,
  ------------------
  |  |  173|    232|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1398|    483|				    (const char *)extdheader, datasize);
 1399|    483|			break;
 1400|    536|		case EXT_UNIX_UNAME:
  ------------------
  |  | 1161|    536|#define EXT_UNIX_UNAME		0x53		/* User name		    */
  ------------------
  |  Branch (1400:3): [True: 536, False: 20.6k]
  ------------------
 1401|    536|			if (datasize > 0)
  ------------------
  |  Branch (1401:8): [True: 90, False: 446]
  ------------------
 1402|     90|				archive_strncpy(&lha->uname,
  ------------------
  |  |  173|     90|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1403|    536|				    (const char *)extdheader, datasize);
 1404|    536|			break;
 1405|     34|		case EXT_UNIX_MTIME:
  ------------------
  |  | 1162|     34|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
  ------------------
  |  Branch (1405:3): [True: 34, False: 21.1k]
  ------------------
 1406|     34|			if (datasize == sizeof(uint32_t))
  ------------------
  |  Branch (1406:8): [True: 34, False: 0]
  ------------------
 1407|     34|				lha->mtime = archive_le32dec(extdheader);
 1408|     34|			break;
 1409|    381|		case EXT_OS2_NEW_ATTR:
  ------------------
  |  | 1163|    381|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
  ------------------
  |  Branch (1409:3): [True: 381, False: 20.8k]
  ------------------
 1410|       |			/* This extended header is OS/2 depend. */
 1411|    381|			if (datasize == 16) {
  ------------------
  |  Branch (1411:8): [True: 13, False: 368]
  ------------------
 1412|     13|				lha->dos_attr = (unsigned char)
 1413|     13|				    (archive_le16dec(extdheader) & 0xff);
 1414|     13|				lha->mode = archive_le16dec(extdheader+2);
 1415|     13|				lha->gid = archive_le16dec(extdheader+4);
 1416|     13|				lha->uid = archive_le16dec(extdheader+6);
 1417|     13|				lha->birthtime = archive_le32dec(extdheader+8);
 1418|     13|				lha->atime = archive_le32dec(extdheader+12);
 1419|     13|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|     13|#define UNIX_MODE_IS_SET	4
  ------------------
 1420|     13|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|     13|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|     13|#define ATIME_IS_SET		2
  ------------------
 1421|     13|			}
 1422|    381|			break;
 1423|    103|		case EXT_NEW_ATTR:
  ------------------
  |  | 1164|    103|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
  ------------------
  |  Branch (1423:3): [True: 103, False: 21.1k]
  ------------------
 1424|    103|			if (datasize == 20) {
  ------------------
  |  Branch (1424:8): [True: 78, False: 25]
  ------------------
 1425|     78|				lha->mode = (mode_t)archive_le32dec(extdheader);
 1426|     78|				lha->gid = archive_le32dec(extdheader+4);
 1427|     78|				lha->uid = archive_le32dec(extdheader+8);
 1428|     78|				lha->birthtime = archive_le32dec(extdheader+12);
 1429|     78|				lha->atime = archive_le32dec(extdheader+16);
 1430|     78|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|     78|#define UNIX_MODE_IS_SET	4
  ------------------
 1431|     78|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|     78|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|     78|#define ATIME_IS_SET		2
  ------------------
 1432|     78|			}
 1433|    103|			break;
 1434|      0|		case EXT_TIMEZONE:		/* Not supported */
  ------------------
  |  | 1154|      0|#define EXT_TIMEZONE		0x43		/* Time zone		    */
  ------------------
  |  Branch (1434:3): [True: 0, False: 21.2k]
  ------------------
 1435|      0|			break;
 1436|  1.39k|		default:
  ------------------
  |  Branch (1436:3): [True: 1.39k, False: 19.8k]
  ------------------
 1437|  1.39k|			break;
 1438|  21.2k|		}
 1439|       |
 1440|  21.2k|		__archive_read_consume(a, extdsize);
 1441|  21.2k|	}
 1442|     56|invalid:
 1443|     56|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     56|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1444|     56|	    "Invalid extended LHa header");
 1445|     56|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     56|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1446|  5.40k|}
archive_read_support_format_lha.c:lha_crc16:
 1808|  59.4k|{
 1809|  59.4k|	const unsigned char *p = (const unsigned char *)pp;
 1810|  59.4k|	const uint16_t *buff;
 1811|  59.4k|	const union {
 1812|  59.4k|		uint32_t i;
 1813|  59.4k|		char c[4];
 1814|  59.4k|	} u = { 0x01020304 };
 1815|       |
 1816|  59.4k|	if (len == 0)
  ------------------
  |  Branch (1816:6): [True: 4.74k, False: 54.7k]
  ------------------
 1817|  4.74k|		return crc;
 1818|       |
 1819|       |	/* Process unaligned address. */
 1820|  54.7k|	if (((uintptr_t)p) & (uintptr_t)0x1) {
  ------------------
  |  Branch (1820:6): [True: 18.4k, False: 36.3k]
  ------------------
 1821|  18.4k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1822|  18.4k|		len--;
 1823|  18.4k|	}
 1824|  54.7k|	buff = (const uint16_t *)p;
 1825|       |	/*
 1826|       |	 * Modern C compiler such as GCC does not unroll automatically yet
 1827|       |	 * without unrolling pragma, and Clang is so. So we should
 1828|       |	 * unroll this loop for its performance.
 1829|       |	 */
 1830|   310M|	for (;len >= 8; len -= 8) {
  ------------------
  |  Branch (1830:8): [True: 310M, False: 54.7k]
  ------------------
 1831|       |		/* This if statement expects compiler optimization will
 1832|       |		 * remove the statement which will not be executed. */
 1833|   310M|#undef bswap16
 1834|       |#ifndef __has_builtin
 1835|       |#define __has_builtin(x) 0
 1836|       |#endif
 1837|       |#if defined(_MSC_VER) && _MSC_VER >= 1400  /* Visual Studio */
 1838|       |#  define bswap16(x) _byteswap_ushort(x)
 1839|       |#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
 1840|       |/* GCC 4.8 and later has __builtin_bswap16() */
 1841|       |#  define bswap16(x) __builtin_bswap16(x)
 1842|       |#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
 1843|       |/* Newer clang versions have __builtin_bswap16() */
 1844|   310M|#  define bswap16(x) __builtin_bswap16(x)
 1845|       |#else
 1846|       |#  define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
 1847|       |#endif
 1848|   310M|#define CRC16W	do { 	\
 1849|   310M|		if(u.c[0] == 1) { /* Big endian */		\
 1850|   310M|			crc ^= bswap16(*buff); buff++;		\
 1851|   310M|		} else						\
 1852|   310M|			crc ^= *buff++;				\
 1853|   310M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
 1854|   310M|} while (0)
 1855|   310M|		CRC16W;
  ------------------
  |  | 1848|   310M|#define CRC16W	do { 	\
  |  | 1849|   310M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1849:6): [True: 0, False: 310M]
  |  |  ------------------
  |  | 1850|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1844|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1851|      0|		} else						\
  |  | 1852|   310M|			crc ^= *buff++;				\
  |  | 1853|   310M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1854|   310M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1854:10): [Folded, False: 310M]
  |  |  ------------------
  ------------------
 1856|   310M|		CRC16W;
  ------------------
  |  | 1848|   310M|#define CRC16W	do { 	\
  |  | 1849|   310M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1849:6): [True: 0, False: 310M]
  |  |  ------------------
  |  | 1850|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1844|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1851|      0|		} else						\
  |  | 1852|   310M|			crc ^= *buff++;				\
  |  | 1853|   310M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1854|   310M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1854:10): [Folded, False: 310M]
  |  |  ------------------
  ------------------
 1857|   310M|		CRC16W;
  ------------------
  |  | 1848|   310M|#define CRC16W	do { 	\
  |  | 1849|   310M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1849:6): [True: 0, False: 310M]
  |  |  ------------------
  |  | 1850|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1844|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1851|      0|		} else						\
  |  | 1852|   310M|			crc ^= *buff++;				\
  |  | 1853|   310M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1854|   310M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1854:10): [Folded, False: 310M]
  |  |  ------------------
  ------------------
 1858|   310M|		CRC16W;
  ------------------
  |  | 1848|   310M|#define CRC16W	do { 	\
  |  | 1849|   310M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1849:6): [True: 0, False: 310M]
  |  |  ------------------
  |  | 1850|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1844|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1851|      0|		} else						\
  |  | 1852|   310M|			crc ^= *buff++;				\
  |  | 1853|   310M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1854|   310M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1854:10): [Folded, False: 310M]
  |  |  ------------------
  ------------------
 1859|   310M|#undef CRC16W
 1860|   310M|#undef bswap16
 1861|   310M|	}
 1862|       |
 1863|  54.7k|	p = (const unsigned char *)buff;
 1864|   166k|	for (;len; len--) {
  ------------------
  |  Branch (1864:8): [True: 111k, False: 54.7k]
  ------------------
 1865|   111k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1866|   111k|	}
 1867|  54.7k|	return crc;
 1868|  59.4k|}
archive_read_support_format_lha.c:lha_read_file_header_2:
  992|  5.28k|{
  993|  5.28k|	const unsigned char *p;
  994|  5.28k|	size_t extdsize;
  995|  5.28k|	int err, padding;
  996|  5.28k|	uint16_t header_crc;
  997|       |
  998|  5.28k|	if ((p = __archive_read_ahead(a, H2_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  989|  5.28k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (998:6): [True: 3, False: 5.28k]
  ------------------
  999|      3|		return (truncated_error(a));
 1000|       |
 1001|  5.28k|	lha->header_size =archive_le16dec(p + H2_HEADER_SIZE_OFFSET);
  ------------------
  |  |  984|  5.28k|#define H2_HEADER_SIZE_OFFSET	0
  ------------------
 1002|  5.28k|	lha->compsize = archive_le32dec(p + H2_COMP_SIZE_OFFSET);
  ------------------
  |  |  985|  5.28k|#define H2_COMP_SIZE_OFFSET	7
  ------------------
 1003|  5.28k|	lha->origsize = archive_le32dec(p + H2_ORIG_SIZE_OFFSET);
  ------------------
  |  |  986|  5.28k|#define H2_ORIG_SIZE_OFFSET	11
  ------------------
 1004|  5.28k|	lha->mtime = archive_le32dec(p + H2_TIME_OFFSET);
  ------------------
  |  |  987|  5.28k|#define H2_TIME_OFFSET		15
  ------------------
 1005|  5.28k|	lha->crc = archive_le16dec(p + H2_CRC_OFFSET);
  ------------------
  |  |  988|  5.28k|#define H2_CRC_OFFSET		21
  ------------------
 1006|  5.28k|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|  5.28k|#define CRC_IS_SET		8
  ------------------
 1007|       |
 1008|  5.28k|	if (lha->header_size < H2_FIXED_SIZE) {
  ------------------
  |  |  989|  5.28k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1008:6): [True: 0, False: 5.28k]
  ------------------
 1009|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1010|      0|		    "Invalid LHa header size");
 1011|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1012|      0|	}
 1013|       |
 1014|  5.28k|	header_crc = lha_crc16(0, p, H2_FIXED_SIZE);
  ------------------
  |  |  989|  5.28k|#define H2_FIXED_SIZE		24
  ------------------
 1015|  5.28k|	__archive_read_consume(a, H2_FIXED_SIZE);
  ------------------
  |  |  989|  5.28k|#define H2_FIXED_SIZE		24
  ------------------
 1016|       |
 1017|       |	/* Read extended headers */
 1018|  5.28k|	err = lha_read_file_extended_header(a, lha, &header_crc, 2,
 1019|  5.28k|		  lha->header_size - H2_FIXED_SIZE, &extdsize);
  ------------------
  |  |  989|  5.28k|#define H2_FIXED_SIZE		24
  ------------------
 1020|  5.28k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  5.28k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1020:6): [True: 105, False: 5.17k]
  ------------------
 1021|    105|		return (err);
 1022|       |
 1023|       |	/* Calculate a padding size. The result will be normally 0 or 1. */
 1024|  5.17k|	padding = (int)lha->header_size - (int)(H2_FIXED_SIZE + extdsize);
  ------------------
  |  |  989|  5.17k|#define H2_FIXED_SIZE		24
  ------------------
 1025|  5.17k|	if (padding > 0) {
  ------------------
  |  Branch (1025:6): [True: 43, False: 5.13k]
  ------------------
 1026|     43|		if ((p = __archive_read_ahead(a, padding, NULL)) == NULL)
  ------------------
  |  Branch (1026:7): [True: 3, False: 40]
  ------------------
 1027|      3|			return (truncated_error(a));
 1028|     40|		header_crc = lha_crc16(header_crc, p, padding);
 1029|     40|		__archive_read_consume(a, padding);
 1030|     40|	}
 1031|       |
 1032|  5.17k|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1032:6): [True: 2.94k, False: 2.22k]
  ------------------
 1033|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1034|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1035|       |		    "LHa header CRC error");
 1036|       |		return (ARCHIVE_FATAL);
 1037|       |#endif
 1038|  2.94k|	}
 1039|  5.17k|	return (err);
 1040|  5.17k|}
archive_read_support_format_lha.c:lha_read_file_header_3:
 1073|      9|{
 1074|      9|	const unsigned char *p;
 1075|      9|	size_t extdsize;
 1076|      9|	int err;
 1077|      9|	uint16_t header_crc;
 1078|       |
 1079|      9|	if ((p = __archive_read_ahead(a, H3_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  | 1070|      9|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1079:6): [True: 0, False: 9]
  ------------------
 1080|      0|		return (truncated_error(a));
 1081|       |
 1082|      9|	if (archive_le16dec(p + H3_FIELD_LEN_OFFSET) != 4)
  ------------------
  |  | 1064|      9|#define H3_FIELD_LEN_OFFSET	0
  ------------------
  |  Branch (1082:6): [True: 0, False: 9]
  ------------------
 1083|      0|		goto invalid;
 1084|      9|	lha->header_size = archive_le32dec(p + H3_HEADER_SIZE_OFFSET);
  ------------------
  |  | 1069|      9|#define H3_HEADER_SIZE_OFFSET	24
  ------------------
 1085|      9|	lha->compsize = archive_le32dec(p + H3_COMP_SIZE_OFFSET);
  ------------------
  |  | 1065|      9|#define H3_COMP_SIZE_OFFSET	7
  ------------------
 1086|      9|	lha->origsize = archive_le32dec(p + H3_ORIG_SIZE_OFFSET);
  ------------------
  |  | 1066|      9|#define H3_ORIG_SIZE_OFFSET	11
  ------------------
 1087|      9|	lha->mtime = archive_le32dec(p + H3_TIME_OFFSET);
  ------------------
  |  | 1067|      9|#define H3_TIME_OFFSET		15
  ------------------
 1088|      9|	lha->crc = archive_le16dec(p + H3_CRC_OFFSET);
  ------------------
  |  | 1068|      9|#define H3_CRC_OFFSET		21
  ------------------
 1089|      9|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|      9|#define CRC_IS_SET		8
  ------------------
 1090|       |
 1091|      9|	if (lha->header_size < H3_FIXED_SIZE + 4)
  ------------------
  |  | 1070|      9|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1091:6): [True: 0, False: 9]
  ------------------
 1092|      0|		goto invalid;
 1093|      9|	header_crc = lha_crc16(0, p, H3_FIXED_SIZE);
  ------------------
  |  | 1070|      9|#define H3_FIXED_SIZE		28
  ------------------
 1094|      9|	__archive_read_consume(a, H3_FIXED_SIZE);
  ------------------
  |  | 1070|      9|#define H3_FIXED_SIZE		28
  ------------------
 1095|       |
 1096|       |	/* Reject ridiculously large header */
 1097|      9|	if (lha->header_size > 65536) {
  ------------------
  |  Branch (1097:6): [True: 0, False: 9]
  ------------------
 1098|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1099|      0|		    "LHa header size too large");
 1100|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1101|      0|	}
 1102|       |
 1103|       |	/* Read extended headers */
 1104|      9|	err = lha_read_file_extended_header(a, lha, &header_crc, 4,
 1105|      9|		  lha->header_size - H3_FIXED_SIZE, &extdsize);
  ------------------
  |  | 1070|      9|#define H3_FIXED_SIZE		28
  ------------------
 1106|      9|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|      9|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1106:6): [True: 2, False: 7]
  ------------------
 1107|      2|		return (err);
 1108|       |
 1109|      7|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1109:6): [True: 7, False: 0]
  ------------------
 1110|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1111|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1112|       |		    "LHa header CRC error");
 1113|       |		return (ARCHIVE_FATAL);
 1114|       |#endif
 1115|      7|	}
 1116|      7|	return (err);
 1117|      0|invalid:
 1118|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1119|      0|	    "Invalid LHa header");
 1120|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1121|      9|}
archive_read_support_format_lha.c:lha_parse_linkname:
 1697|     23|{
 1698|     23|	wchar_t *	linkptr;
 1699|     23|	size_t 	symlen;
 1700|       |
 1701|     23|	linkptr = wcschr(pathname->s, L'|');
 1702|     23|	if (linkptr != NULL) {
  ------------------
  |  Branch (1702:6): [True: 23, False: 0]
  ------------------
 1703|     23|		symlen = wcslen(linkptr + 1);
 1704|     23|		archive_wstrncpy(linkname, linkptr+1, symlen);
  ------------------
  |  |  175|     23|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 1705|       |
 1706|     23|		*linkptr = 0;
 1707|     23|		pathname->length = wcslen(pathname->s);
 1708|       |
 1709|     23|		return (1);
 1710|     23|	}
 1711|      0|	return (0);
 1712|     23|}
archive_read_support_format_lha.c:lha_replace_path_separator:
  747|    270|{
  748|    270|	const wchar_t *wp;
  749|    270|	size_t i;
  750|       |
  751|    270|	if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (751:6): [True: 270, False: 0]
  ------------------
  752|    270|		archive_wstrcpy(&(lha->ws), wp);
  ------------------
  |  |  167|    270|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|    540|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 270]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|    319|		for (i = 0; i < archive_strlen(&(lha->ws)); i++) {
  ------------------
  |  |  178|    319|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (753:15): [True: 49, False: 270]
  ------------------
  754|     49|			if (lha->ws.s[i] == L'\\')
  ------------------
  |  Branch (754:8): [True: 4, False: 45]
  ------------------
  755|      4|				lha->ws.s[i] = L'/';
  756|     49|		}
  757|    270|		archive_entry_copy_pathname_w(entry, lha->ws.s);
  758|    270|	}
  759|       |
  760|    270|	if ((wp = archive_entry_symlink_w(entry)) != NULL) {
  ------------------
  |  Branch (760:6): [True: 0, False: 270]
  ------------------
  761|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  762|      0|		for (i = 0; i < archive_strlen(&(lha->ws)); i++) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (762:15): [True: 0, False: 0]
  ------------------
  763|      0|			if (lha->ws.s[i] == L'\\')
  ------------------
  |  Branch (763:8): [True: 0, False: 0]
  ------------------
  764|      0|				lha->ws.s[i] = L'/';
  765|      0|		}
  766|      0|		archive_entry_copy_symlink_w(entry, lha->ws.s);
  767|      0|	}
  768|    270|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data:
 1471|  25.3k|{
 1472|  25.3k|	struct lha *lha = a->format->data;
 1473|  25.3k|	int r;
 1474|       |
 1475|  25.3k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1475:6): [True: 1.45k, False: 23.9k]
  ------------------
 1476|       |		/* Consume as much as the decompressor actually used. */
 1477|  1.45k|		__archive_read_consume(a, lha->entry_unconsumed);
 1478|  1.45k|		lha->entry_unconsumed = 0;
 1479|  1.45k|	}
 1480|  25.3k|	if (lha->end_of_entry) {
  ------------------
  |  Branch (1480:6): [True: 889, False: 24.4k]
  ------------------
 1481|    889|		*offset = lha->entry_offset;
 1482|    889|		*size = 0;
 1483|    889|		*buff = NULL;
 1484|    889|		return (lha_end_of_entry(a));
 1485|    889|	}
 1486|       |
 1487|  24.4k|	if (lha->entry_is_compressed)
  ------------------
  |  Branch (1487:6): [True: 23.9k, False: 524]
  ------------------
 1488|  23.9k|		r =  lha_read_data_lzh(a, buff, size, offset);
 1489|    524|	else
 1490|       |		/* No compression. */
 1491|    524|		r =  lha_read_data_none(a, buff, size, offset);
 1492|  24.4k|	return (r);
 1493|  25.3k|}
archive_read_support_format_lha.c:lha_end_of_entry:
 1450|  1.22k|{
 1451|  1.22k|	struct lha *lha = a->format->data;
 1452|  1.22k|	int r = ARCHIVE_EOF;
  ------------------
  |  |  232|  1.22k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1453|       |
 1454|  1.22k|	if (!lha->end_of_entry_cleanup) {
  ------------------
  |  Branch (1454:6): [True: 1.21k, False: 10]
  ------------------
 1455|  1.21k|		if ((lha->setflag & CRC_IS_SET) &&
  ------------------
  |  |  164|  1.21k|#define CRC_IS_SET		8
  ------------------
  |  Branch (1455:7): [True: 966, False: 252]
  ------------------
 1456|    966|		    lha->crc != lha->entry_crc_calculated) {
  ------------------
  |  Branch (1456:7): [True: 938, False: 28]
  ------------------
 1457|    938|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    938|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1458|    938|			    "LHa data CRC error");
 1459|    938|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|    938|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1460|    938|		}
 1461|       |
 1462|       |		/* End-of-entry cleanup done. */
 1463|  1.21k|		lha->end_of_entry_cleanup = 1;
 1464|  1.21k|	}
 1465|  1.22k|	return (r);
 1466|  1.22k|}
archive_read_support_format_lha.c:lha_read_data_lzh:
 1551|  23.9k|{
 1552|  23.9k|	struct lha *lha = a->format->data;
 1553|  23.9k|	ssize_t bytes_avail;
 1554|  23.9k|	int r;
 1555|       |
 1556|       |	/* If we haven't yet read any data, initialize the decompressor. */
 1557|  23.9k|	if (!lha->decompress_init) {
  ------------------
  |  Branch (1557:6): [True: 4.62k, False: 19.3k]
  ------------------
 1558|  4.62k|		r = lzh_decode_init(&(lha->strm), lha->method);
 1559|  4.62k|		switch (r) {
 1560|  4.25k|		case ARCHIVE_OK:
  ------------------
  |  |  233|  4.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1560:3): [True: 4.25k, False: 366]
  ------------------
 1561|  4.25k|			break;
 1562|    366|		case ARCHIVE_FAILED:
  ------------------
  |  |  237|    366|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1562:3): [True: 366, False: 4.25k]
  ------------------
 1563|       |        		/* Unsupported compression. */
 1564|    366|			*buff = NULL;
 1565|    366|			*size = 0;
 1566|    366|			*offset = 0;
 1567|    366|			archive_set_error(&a->archive,
 1568|    366|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    366|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1569|    366|			    "Unsupported lzh compression method -%c%c%c-",
 1570|    366|			    lha->method[0], lha->method[1], lha->method[2]);
 1571|       |			/* We know compressed size; just skip it. */
 1572|    366|			archive_read_format_lha_read_data_skip(a);
 1573|    366|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|    366|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1574|      0|		default:
  ------------------
  |  Branch (1574:3): [True: 0, False: 4.62k]
  ------------------
 1575|      0|			archive_set_error(&a->archive, ENOMEM,
 1576|      0|			    "Couldn't allocate memory "
 1577|      0|			    "for lzh decompression");
 1578|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1579|  4.62k|		}
 1580|       |		/* We've initialized decompression for this stream. */
 1581|  4.25k|		lha->decompress_init = 1;
 1582|  4.25k|		lha->strm.avail_out = 0;
 1583|  4.25k|	}
 1584|       |
 1585|       |	/*
 1586|       |	 * Note: '1' here is a performance optimization.
 1587|       |	 * Recall that the decompression layer returns a count of
 1588|       |	 * available bytes; asking for more than that forces the
 1589|       |	 * decompressor to combine reads by copying data.
 1590|       |	 */
 1591|  23.5k|	lha->strm.next_in = __archive_read_ahead(a, 1, &bytes_avail);
 1592|  23.5k|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1592:6): [True: 80, False: 23.5k]
  ------------------
 1593|     80|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     80|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1594|     80|		    "Truncated LHa file body");
 1595|     80|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     80|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1596|     80|	}
 1597|  23.5k|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1597:6): [True: 22.9k, False: 513]
  ------------------
 1598|  22.9k|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1599|       |
 1600|  23.5k|	lha->strm.avail_in = (int)bytes_avail;
 1601|  23.5k|	lha->strm.total_in = 0;
 1602|  23.5k|	lha->strm.avail_out = 0;
 1603|       |
 1604|  23.5k|	r = lzh_decode(&(lha->strm), bytes_avail == lha->entry_bytes_remaining);
 1605|  23.5k|	switch (r) {
 1606|  19.3k|	case ARCHIVE_OK:
  ------------------
  |  |  233|  19.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1606:2): [True: 19.3k, False: 4.17k]
  ------------------
 1607|  19.3k|		break;
 1608|    339|	case ARCHIVE_EOF:
  ------------------
  |  |  232|    339|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1608:2): [True: 339, False: 23.1k]
  ------------------
 1609|    339|		lha->end_of_entry = 1;
 1610|    339|		break;
 1611|  3.83k|	default:
  ------------------
  |  Branch (1611:2): [True: 3.83k, False: 19.6k]
  ------------------
 1612|  3.83k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.83k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1613|  3.83k|		    "Bad lzh data");
 1614|  3.83k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.83k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1615|  23.5k|	}
 1616|  19.6k|	lha->entry_unconsumed = lha->strm.total_in;
 1617|  19.6k|	lha->entry_bytes_remaining -= lha->strm.total_in;
 1618|       |
 1619|  19.6k|	if (lha->strm.avail_out) {
  ------------------
  |  Branch (1619:6): [True: 19.2k, False: 417]
  ------------------
 1620|  19.2k|		*offset = lha->entry_offset;
 1621|  19.2k|		*size = lha->strm.avail_out;
 1622|  19.2k|		*buff = lha->strm.ref_ptr;
 1623|  19.2k|		lha->entry_crc_calculated =
 1624|  19.2k|		    lha_crc16(lha->entry_crc_calculated, *buff, *size);
 1625|  19.2k|		lha->entry_offset += *size;
 1626|  19.2k|	} else {
 1627|    417|		*offset = lha->entry_offset;
 1628|    417|		*size = 0;
 1629|    417|		*buff = NULL;
 1630|    417|		if (lha->end_of_entry)
  ------------------
  |  Branch (1630:7): [True: 339, False: 78]
  ------------------
 1631|    339|			return (lha_end_of_entry(a));
 1632|    417|	}
 1633|  19.3k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  19.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1634|  19.6k|}
archive_read_support_format_lha.c:lzh_decode_init:
 1880|  4.62k|{
 1881|  4.62k|	struct lzh_dec *ds;
 1882|  4.62k|	int w_bits, w_size;
 1883|       |
 1884|  4.62k|	if (strm->ds == NULL) {
  ------------------
  |  Branch (1884:6): [True: 296, False: 4.32k]
  ------------------
 1885|    296|		strm->ds = calloc(1, sizeof(*strm->ds));
 1886|    296|		if (strm->ds == NULL)
  ------------------
  |  Branch (1886:7): [True: 0, False: 296]
  ------------------
 1887|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1888|    296|	}
 1889|  4.62k|	ds = strm->ds;
 1890|  4.62k|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|  4.62k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1891|  4.62k|	if (method == NULL || method[0] != 'l' || method[1] != 'h')
  ------------------
  |  Branch (1891:6): [True: 0, False: 4.62k]
  |  Branch (1891:24): [True: 0, False: 4.62k]
  |  Branch (1891:44): [True: 0, False: 4.62k]
  ------------------
 1892|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1893|  4.62k|	switch (method[2]) {
 1894|  4.08k|	case '5':
  ------------------
  |  Branch (1894:2): [True: 4.08k, False: 535]
  ------------------
 1895|  4.08k|		w_bits = 13;/* 8KiB for window */
 1896|  4.08k|		break;
 1897|    132|	case '6':
  ------------------
  |  Branch (1897:2): [True: 132, False: 4.49k]
  ------------------
 1898|    132|		w_bits = 15;/* 32KiB for window */
 1899|    132|		break;
 1900|     37|	case '7':
  ------------------
  |  Branch (1900:2): [True: 37, False: 4.58k]
  ------------------
 1901|     37|		w_bits = 16;/* 64KiB for window */
 1902|     37|		break;
 1903|    366|	default:
  ------------------
  |  Branch (1903:2): [True: 366, False: 4.25k]
  ------------------
 1904|    366|		return (ARCHIVE_FAILED);/* Not supported. */
  ------------------
  |  |  237|    366|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1905|  4.62k|	}
 1906|  4.25k|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|  4.25k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1907|       |	/* Expand a window size up to 128 KiB for decompressing process
 1908|       |	 * performance whatever its original window size is. */
 1909|  4.25k|	ds->w_size = 1U << 17;
 1910|  4.25k|	ds->w_mask = ds->w_size -1;
 1911|  4.25k|	if (ds->w_buff == NULL) {
  ------------------
  |  Branch (1911:6): [True: 289, False: 3.96k]
  ------------------
 1912|    289|		ds->w_buff = malloc(ds->w_size);
 1913|    289|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (1913:7): [True: 0, False: 289]
  ------------------
 1914|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1915|    289|	}
 1916|  4.25k|	w_size = 1U << w_bits;
 1917|  4.25k|	memset(ds->w_buff + ds->w_size - w_size, 0x20, w_size);
 1918|  4.25k|	ds->w_pos = 0;
 1919|  4.25k|	ds->state = 0;
 1920|  4.25k|	ds->pos_pt_len_size = w_bits + 1;
 1921|  4.25k|	ds->pos_pt_len_bits = (w_bits == 15 || w_bits == 16)? 5: 4;
  ------------------
  |  Branch (1921:25): [True: 132, False: 4.12k]
  |  Branch (1921:41): [True: 37, False: 4.08k]
  ------------------
 1922|  4.25k|	ds->literal_pt_len_size = PT_BITLEN_SIZE;
  ------------------
  |  |   65|  4.25k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
 1923|  4.25k|	ds->literal_pt_len_bits = 5;
 1924|  4.25k|	ds->br.cache_buffer = 0;
 1925|  4.25k|	ds->br.cache_avail = 0;
 1926|       |
 1927|  4.25k|	if (lzh_huffman_init(&(ds->lt), LT_BITLEN_SIZE, 16)
  ------------------
  |  |   62|  4.25k|#define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   50|  4.25k|#define MAXMATCH		256	/* Maximum match length. */
  |  |  ------------------
  |  |               #define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   51|  4.25k|#define MINMATCH		3	/* Minimum match length. */
  |  |  ------------------
  ------------------
  |  Branch (1927:6): [True: 0, False: 4.25k]
  ------------------
 1928|  4.25k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  4.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1929|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1930|  4.25k|	ds->lt.len_bits = 9;
 1931|  4.25k|	if (lzh_huffman_init(&(ds->pt), PT_BITLEN_SIZE, 16)
  ------------------
  |  |   65|  4.25k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
  |  Branch (1931:6): [True: 0, False: 4.25k]
  ------------------
 1932|  4.25k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  4.25k|#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.25k|	ds->error = 0;
 1935|       |
 1936|  4.25k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1937|  4.25k|}
archive_read_support_format_lha.c:lzh_huffman_init:
 2561|  8.51k|{
 2562|  8.51k|	int bits;
 2563|       |
 2564|  8.51k|	if (hf->bitlen == NULL) {
  ------------------
  |  Branch (2564:6): [True: 578, False: 7.93k]
  ------------------
 2565|    578|		hf->bitlen = malloc(len_size * sizeof(hf->bitlen[0]));
 2566|    578|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (2566:7): [True: 0, False: 578]
  ------------------
 2567|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2568|    578|	}
 2569|  8.51k|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (2569:6): [True: 578, False: 7.93k]
  ------------------
 2570|    578|		if (tbl_bits < HTBL_BITS)
  ------------------
  |  |  114|    578|#define HTBL_BITS	10
  ------------------
  |  Branch (2570:7): [True: 0, False: 578]
  ------------------
 2571|      0|			bits = tbl_bits;
 2572|    578|		else
 2573|    578|			bits = HTBL_BITS;
  ------------------
  |  |  114|    578|#define HTBL_BITS	10
  ------------------
 2574|    578|		hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
 2575|    578|		if (hf->tbl == NULL)
  ------------------
  |  Branch (2575:7): [True: 0, False: 578]
  ------------------
 2576|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2577|    578|	}
 2578|  8.51k|	if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
  ------------------
  |  |  114|    578|#define HTBL_BITS	10
  ------------------
  |  Branch (2578:6): [True: 578, False: 7.93k]
  |  Branch (2578:26): [True: 578, False: 0]
  ------------------
 2579|    578|		hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
  ------------------
  |  |  114|    578|#define HTBL_BITS	10
  ------------------
 2580|    578|		hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
 2581|    578|		if (hf->tree == NULL)
  ------------------
  |  Branch (2581:7): [True: 0, False: 578]
  ------------------
 2582|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2583|    578|	}
 2584|  8.51k|	hf->len_size = (int)len_size;
 2585|  8.51k|	hf->tbl_bits = tbl_bits;
 2586|  8.51k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  8.51k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2587|  8.51k|}
archive_read_support_format_lha.c:lzh_decode:
 2108|  23.5k|{
 2109|  23.5k|	struct lzh_dec *ds = strm->ds;
 2110|  23.5k|	int avail_in;
 2111|  23.5k|	int r;
 2112|       |
 2113|  23.5k|	if (ds->error)
  ------------------
  |  Branch (2113:6): [True: 0, False: 23.5k]
  ------------------
 2114|      0|		return (ds->error);
 2115|       |
 2116|  23.5k|	avail_in = strm->avail_in;
 2117|  30.8k|	do {
 2118|  30.8k|		if (ds->state < ST_GET_LITERAL)
  ------------------
  |  | 2101|  30.8k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2118:7): [True: 7.94k, False: 22.9k]
  ------------------
 2119|  7.94k|			r = lzh_read_blocks(strm, last);
 2120|  22.9k|		else
 2121|  22.9k|			r = lzh_decode_blocks(strm, last);
 2122|  30.8k|	} while (r == 100);
  ------------------
  |  Branch (2122:11): [True: 7.38k, False: 23.5k]
  ------------------
 2123|  23.5k|	strm->total_in += avail_in - strm->avail_in;
 2124|  23.5k|	return (r);
 2125|  23.5k|}
archive_read_support_format_lha.c:lzh_read_blocks:
 2136|  7.94k|{
 2137|  7.94k|	struct lzh_dec *ds = strm->ds;
 2138|  7.94k|	struct lzh_br *br = &(ds->br);
 2139|  7.94k|	int c = 0, i;
 2140|  7.94k|	unsigned rbits;
 2141|       |
 2142|  22.7k|	for (;;) {
 2143|  22.7k|		switch (ds->state) {
  ------------------
  |  Branch (2143:11): [True: 22.7k, False: 0]
  ------------------
 2144|  7.94k|		case ST_RD_BLOCK:
  ------------------
  |  | 2092|  7.94k|#define ST_RD_BLOCK		0
  ------------------
  |  Branch (2144:3): [True: 7.94k, False: 14.8k]
  ------------------
 2145|       |			/*
 2146|       |			 * Read a block number indicates how many blocks
 2147|       |			 * we will handle. The block is composed of a
 2148|       |			 * literal and a match, sometimes a literal only
 2149|       |			 * in particular, there are no reference data at
 2150|       |			 * the beginning of the decompression.
 2151|       |			 */
 2152|  7.94k|			if (!lzh_br_read_ahead_0(strm, br, 16)) {
  ------------------
  |  | 1973|  7.94k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  ------------------
  |  |  |  | 1959|  15.8k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 2.88k, False: 5.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1973:26): [True: 4.29k, False: 764]
  |  |  ------------------
  ------------------
 2153|    764|				if (!last)
  ------------------
  |  Branch (2153:9): [True: 16, False: 748]
  ------------------
 2154|       |					/* We need following data. */
 2155|     16|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2156|    748|				if (lzh_br_has(br, 8)) {
  ------------------
  |  | 1959|    748|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (1959:27): [True: 70, False: 678]
  |  |  ------------------
  ------------------
 2157|       |					/*
 2158|       |					 * It seems there are extra bits.
 2159|       |					 *  1. Compressed data is broken.
 2160|       |					 *  2. `last' flag does not properly
 2161|       |					 *     set.
 2162|       |					 */
 2163|     70|					goto failed;
 2164|     70|				}
 2165|    678|				if (ds->w_pos > 0) {
  ------------------
  |  Branch (2165:9): [True: 339, False: 339]
  ------------------
 2166|    339|					lzh_emit_window(strm, ds->w_pos);
 2167|    339|					ds->w_pos = 0;
 2168|    339|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    339|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2169|    339|				}
 2170|       |				/* End of compressed data; we have completely
 2171|       |				 * handled all compressed data. */
 2172|    339|				return (ARCHIVE_EOF);
  ------------------
  |  |  232|    339|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2173|    678|			}
 2174|  7.18k|			ds->blocks_avail = lzh_br_bits(br, 16);
  ------------------
  |  | 1962|  7.18k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  7.18k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2175|  7.18k|			if (ds->blocks_avail == 0)
  ------------------
  |  Branch (2175:8): [True: 65, False: 7.11k]
  ------------------
 2176|     65|				goto failed;
 2177|  7.11k|			lzh_br_consume(br, 16);
  ------------------
  |  | 1981|  7.11k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2178|       |			/*
 2179|       |			 * Read a literal table compressed in huffman
 2180|       |			 * coding.
 2181|       |			 */
 2182|  7.11k|			ds->pt.len_size = ds->literal_pt_len_size;
 2183|  7.11k|			ds->pt.len_bits = ds->literal_pt_len_bits;
 2184|  7.11k|			ds->reading_position = 0;
 2185|       |			/* FALL THROUGH */
 2186|  11.6k|		case ST_RD_PT_1:
  ------------------
  |  | 2093|  11.6k|#define ST_RD_PT_1		1
  ------------------
  |  Branch (2186:3): [True: 4.52k, False: 18.2k]
  ------------------
 2187|       |			/* Note: ST_RD_PT_1, ST_RD_PT_2 and ST_RD_PT_4 are
 2188|       |			 * used in reading both a literal table and a
 2189|       |			 * position table. */
 2190|  11.6k|			if (!lzh_br_read_ahead(strm, br, ds->pt.len_bits)) {
  ------------------
  |  | 1978|  11.6k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  23.2k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  23.2k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 11.5k, False: 115]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 42, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|     73|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 59, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2191|     14|				if (last)
  ------------------
  |  Branch (2191:9): [True: 14, False: 0]
  ------------------
 2192|     14|					goto failed;/* Truncated data. */
 2193|      0|				ds->state = ST_RD_PT_1;
  ------------------
  |  | 2093|      0|#define ST_RD_PT_1		1
  ------------------
 2194|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2195|     14|			}
 2196|  11.6k|			ds->pt.len_avail = lzh_br_bits(br, ds->pt.len_bits);
  ------------------
  |  | 1962|  11.6k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  11.6k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2197|  11.6k|			lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1981|  11.6k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2198|       |			/* FALL THROUGH */
 2199|  11.6k|		case ST_RD_PT_2:
  ------------------
  |  | 2094|  11.6k|#define ST_RD_PT_2		2
  ------------------
  |  Branch (2199:3): [True: 0, False: 22.7k]
  ------------------
 2200|  11.6k|			if (ds->pt.len_avail == 0) {
  ------------------
  |  Branch (2200:8): [True: 2.06k, False: 9.56k]
  ------------------
 2201|       |				/* There is no bitlen. */
 2202|  2.06k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1978|  2.06k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  4.13k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  4.13k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 2.01k, False: 55]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 0, False: 55]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|     55|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 45, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|  2.06k|				    ds->pt.len_bits)) {
 2204|     10|					if (last)
  ------------------
  |  Branch (2204:10): [True: 10, False: 0]
  ------------------
 2205|     10|						goto failed;/* Truncated data.*/
 2206|      0|					ds->state = ST_RD_PT_2;
  ------------------
  |  | 2094|      0|#define ST_RD_PT_2		2
  ------------------
 2207|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2208|     10|				}
 2209|  2.05k|				if (!lzh_make_fake_table(&(ds->pt),
  ------------------
  |  Branch (2209:9): [True: 52, False: 2.00k]
  ------------------
 2210|  2.05k|				    lzh_br_bits(br, ds->pt.len_bits)))
  ------------------
  |  | 1962|  2.05k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  2.05k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2211|     52|					goto failed;/* Invalid data. */
 2212|  2.00k|				lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1981|  2.00k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2213|  2.00k|				if (ds->reading_position)
  ------------------
  |  Branch (2213:9): [True: 657, False: 1.34k]
  ------------------
 2214|    657|					ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2101|    657|#define ST_GET_LITERAL		9
  ------------------
 2215|  1.34k|				else
 2216|  1.34k|					ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2097|  1.34k|#define ST_RD_LITERAL_1		5
  ------------------
 2217|  2.00k|				break;
 2218|  9.56k|			} else if (ds->pt.len_avail > ds->pt.len_size)
  ------------------
  |  Branch (2218:15): [True: 164, False: 9.40k]
  ------------------
 2219|    164|				goto failed;/* Invalid data. */
 2220|  9.40k|			ds->loop = 0;
 2221|  9.40k|			memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 2222|  9.40k|			if (ds->pt.len_avail < 3 ||
  ------------------
  |  Branch (2222:8): [True: 29, False: 9.37k]
  ------------------
 2223|  9.37k|			    ds->pt.len_size == ds->pos_pt_len_size) {
  ------------------
  |  Branch (2223:8): [True: 3.84k, False: 5.53k]
  ------------------
 2224|  3.87k|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2096|  3.87k|#define ST_RD_PT_4		4
  ------------------
 2225|  3.87k|				break;
 2226|  3.87k|			}
 2227|       |			/* FALL THROUGH */
 2228|  5.53k|		case ST_RD_PT_3:
  ------------------
  |  | 2095|  5.53k|#define ST_RD_PT_3		3
  ------------------
  |  Branch (2228:3): [True: 0, False: 22.7k]
  ------------------
 2229|  5.53k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop, 3);
 2230|  5.53k|			if (ds->loop < 3) {
  ------------------
  |  Branch (2230:8): [True: 22, False: 5.50k]
  ------------------
 2231|     22|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2231:9): [True: 10, False: 12]
  |  Branch (2231:25): [True: 11, False: 1]
  ------------------
 2232|     21|					goto failed;/* Invalid data. */
 2233|       |				/* Not completed, get following data. */
 2234|      1|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2095|      1|#define ST_RD_PT_3		3
  ------------------
 2235|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2236|     22|			}
 2237|       |			/* There are some null in bitlen of the literal. */
 2238|  5.50k|			if (!lzh_br_read_ahead(strm, br, 2)) {
  ------------------
  |  | 1978|  5.50k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  11.0k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  11.0k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 5.43k, False: 73]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 9, False: 64]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|     64|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 63, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2239|      1|				if (last)
  ------------------
  |  Branch (2239:9): [True: 1, False: 0]
  ------------------
 2240|      1|					goto failed;/* Truncated data. */
 2241|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2095|      0|#define ST_RD_PT_3		3
  ------------------
 2242|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2243|      1|			}
 2244|  5.50k|			c = lzh_br_bits(br, 2);
  ------------------
  |  | 1962|  5.50k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  5.50k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2245|  5.50k|			lzh_br_consume(br, 2);
  ------------------
  |  | 1981|  5.50k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2246|  5.50k|			if (c > ds->pt.len_avail - 3)
  ------------------
  |  Branch (2246:8): [True: 7, False: 5.50k]
  ------------------
 2247|      7|				goto failed;/* Invalid data. */
 2248|  14.4k|			for (i = 3; c-- > 0 ;)
  ------------------
  |  Branch (2248:16): [True: 8.97k, False: 5.50k]
  ------------------
 2249|  8.97k|				ds->pt.bitlen[i++] = 0;
 2250|  5.50k|			ds->loop = i;
 2251|       |			/* FALL THROUGH */
 2252|  9.37k|		case ST_RD_PT_4:
  ------------------
  |  | 2096|  9.37k|#define ST_RD_PT_4		4
  ------------------
  |  Branch (2252:3): [True: 3.87k, False: 18.9k]
  ------------------
 2253|  9.37k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop,
 2254|  9.37k|			    ds->pt.len_avail);
 2255|  9.37k|			if (ds->loop < ds->pt.len_avail) {
  ------------------
  |  Branch (2255:8): [True: 437, False: 8.93k]
  ------------------
 2256|    437|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2256:9): [True: 229, False: 208]
  |  Branch (2256:25): [True: 203, False: 5]
  ------------------
 2257|    432|					goto failed;/* Invalid data. */
 2258|       |				/* Not completed, get following data. */
 2259|      5|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2096|      5|#define ST_RD_PT_4		4
  ------------------
 2260|      5|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2261|    437|			}
 2262|  8.93k|			if (!lzh_make_huffman_table(&(ds->pt)))
  ------------------
  |  Branch (2262:8): [True: 1.54k, False: 7.38k]
  ------------------
 2263|  1.54k|				goto failed;/* Invalid data */
 2264|  7.38k|			if (ds->reading_position) {
  ------------------
  |  Branch (2264:8): [True: 3.38k, False: 4.00k]
  ------------------
 2265|  3.38k|				ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2101|  3.38k|#define ST_GET_LITERAL		9
  ------------------
 2266|  3.38k|				break;
 2267|  3.38k|			}
 2268|       |			/* FALL THROUGH */
 2269|  5.35k|		case ST_RD_LITERAL_1:
  ------------------
  |  | 2097|  5.35k|#define ST_RD_LITERAL_1		5
  ------------------
  |  Branch (2269:3): [True: 1.34k, False: 21.4k]
  ------------------
 2270|  5.35k|			if (!lzh_br_read_ahead(strm, br, ds->lt.len_bits)) {
  ------------------
  |  | 1978|  5.35k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  10.7k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  10.7k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 4.92k, False: 426]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 4, False: 422]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|    422|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 342, False: 80]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2271|     80|				if (last)
  ------------------
  |  Branch (2271:9): [True: 80, False: 0]
  ------------------
 2272|     80|					goto failed;/* Truncated data. */
 2273|      0|				ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2097|      0|#define ST_RD_LITERAL_1		5
  ------------------
 2274|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2275|     80|			}
 2276|  5.27k|			ds->lt.len_avail = lzh_br_bits(br, ds->lt.len_bits);
  ------------------
  |  | 1962|  5.27k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  5.27k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2277|  5.27k|			lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1981|  5.27k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2278|       |			/* FALL THROUGH */
 2279|  5.27k|		case ST_RD_LITERAL_2:
  ------------------
  |  | 2098|  5.27k|#define ST_RD_LITERAL_2		6
  ------------------
  |  Branch (2279:3): [True: 0, False: 22.7k]
  ------------------
 2280|  5.27k|			if (ds->lt.len_avail == 0) {
  ------------------
  |  Branch (2280:8): [True: 1.07k, False: 4.19k]
  ------------------
 2281|       |				/* There is no bitlen. */
 2282|  1.07k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1978|  1.07k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  2.14k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  2.14k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 447, False: 627]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 251, False: 376]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|    376|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 375, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2283|  1.07k|				    ds->lt.len_bits)) {
 2284|      1|					if (last)
  ------------------
  |  Branch (2284:10): [True: 1, False: 0]
  ------------------
 2285|      1|						goto failed;/* Truncated data.*/
 2286|      0|					ds->state = ST_RD_LITERAL_2;
  ------------------
  |  | 2098|      0|#define ST_RD_LITERAL_2		6
  ------------------
 2287|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2288|      1|				}
 2289|  1.07k|				if (!lzh_make_fake_table(&(ds->lt),
  ------------------
  |  Branch (2289:9): [True: 18, False: 1.05k]
  ------------------
 2290|  1.07k|				    lzh_br_bits(br, ds->lt.len_bits)))
  ------------------
  |  | 1962|  1.07k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  1.07k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2291|     18|					goto failed;/* Invalid data */
 2292|  1.05k|				lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1981|  1.05k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2293|  1.05k|				ds->state = ST_RD_POS_DATA_1;
  ------------------
  |  | 2100|  1.05k|#define ST_RD_POS_DATA_1	8
  ------------------
 2294|  1.05k|				break;
 2295|  4.19k|			} else if (ds->lt.len_avail > ds->lt.len_size)
  ------------------
  |  Branch (2295:15): [True: 54, False: 4.14k]
  ------------------
 2296|     54|				goto failed;/* Invalid data */
 2297|  4.14k|			ds->loop = 0;
 2298|  4.14k|			memset(ds->lt.freq, 0, sizeof(ds->lt.freq));
 2299|       |			/* FALL THROUGH */
 2300|  4.14k|		case ST_RD_LITERAL_3:
  ------------------
  |  | 2099|  4.14k|#define ST_RD_LITERAL_3		7
  ------------------
  |  Branch (2300:3): [True: 0, False: 22.7k]
  ------------------
 2301|  4.14k|			i = ds->loop;
 2302|   197k|			while (i < ds->lt.len_avail) {
  ------------------
  |  Branch (2302:11): [True: 194k, False: 3.56k]
  ------------------
 2303|   194k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1978|   194k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|   388k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|   388k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 182k, False: 11.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 11.1k, False: 358]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|    358|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 166, False: 192]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2304|   194k|				    ds->pt.max_bits)) {
 2305|    192|					if (last)
  ------------------
  |  Branch (2305:10): [True: 182, False: 10]
  ------------------
 2306|    182|						goto failed;/* Truncated data.*/
 2307|     10|					ds->loop = i;
 2308|     10|					ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2099|     10|#define ST_RD_LITERAL_3		7
  ------------------
 2309|     10|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     10|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2310|    192|				}
 2311|   194k|				rbits = lzh_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 1962|   194k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|   194k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2312|   194k|				c = lzh_decode_huffman(&(ds->pt), rbits);
 2313|   194k|				if (c > 2) {
  ------------------
  |  Branch (2313:9): [True: 131k, False: 62.5k]
  ------------------
 2314|       |					/* Note: 'c' will never be more than
 2315|       |					 * eighteen since it's limited by
 2316|       |					 * PT_BITLEN_SIZE, which is being set
 2317|       |					 * to ds->pt.len_size through
 2318|       |					 * ds->literal_pt_len_size. */
 2319|   131k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1981|   131k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2320|   131k|					c -= 2;
 2321|   131k|					ds->lt.freq[c]++;
 2322|   131k|					ds->lt.bitlen[i++] = c;
 2323|   131k|				} else if (c == 0) {
  ------------------
  |  Branch (2323:16): [True: 23.1k, False: 39.4k]
  ------------------
 2324|  23.1k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1981|  23.1k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2325|  23.1k|					ds->lt.bitlen[i++] = 0;
 2326|  39.4k|				} else {
 2327|       |					/* c == 1 or c == 2 */
 2328|  39.4k|					int n = (c == 1)?4:9;
  ------------------
  |  Branch (2328:14): [True: 31.7k, False: 7.69k]
  ------------------
 2329|  39.4k|					if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1978|  39.4k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  78.8k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  78.8k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 39.0k, False: 406]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 93, False: 313]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|    313|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 136, False: 177]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2330|  39.4k|					     ds->pt.bitlen[c] + n)) {
 2331|    177|						if (last) /* Truncated data. */
  ------------------
  |  Branch (2331:11): [True: 171, False: 6]
  ------------------
 2332|    171|							goto failed;
 2333|      6|						ds->loop = i;
 2334|      6|						ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2099|      6|#define ST_RD_LITERAL_3		7
  ------------------
 2335|      6|						return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2336|    177|					}
 2337|  39.2k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1981|  39.2k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2338|  39.2k|					c = lzh_br_bits(br, n);
  ------------------
  |  | 1962|  39.2k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  39.2k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2339|  39.2k|					lzh_br_consume(br, n);
  ------------------
  |  | 1981|  39.2k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2340|  39.2k|					c += (n == 4)?3:20;
  ------------------
  |  Branch (2340:11): [True: 31.6k, False: 7.62k]
  ------------------
 2341|  39.2k|					if (i + c > ds->lt.len_avail)
  ------------------
  |  Branch (2341:10): [True: 211, False: 39.0k]
  ------------------
 2342|    211|						goto failed;/* Invalid data */
 2343|  39.0k|					memset(&(ds->lt.bitlen[i]), 0, c);
 2344|  39.0k|					i += c;
 2345|  39.0k|				}
 2346|   194k|			}
 2347|  3.56k|			if (i > ds->lt.len_avail ||
  ------------------
  |  Branch (2347:8): [True: 0, False: 3.56k]
  ------------------
 2348|  3.56k|			    !lzh_make_huffman_table(&(ds->lt)))
  ------------------
  |  Branch (2348:8): [True: 92, False: 3.47k]
  ------------------
 2349|     92|				goto failed;/* Invalid data */
 2350|       |			/* FALL THROUGH */
 2351|  4.52k|		case ST_RD_POS_DATA_1:
  ------------------
  |  | 2100|  4.52k|#define ST_RD_POS_DATA_1	8
  ------------------
  |  Branch (2351:3): [True: 1.05k, False: 21.7k]
  ------------------
 2352|       |			/*
 2353|       |			 * Read a position table compressed in huffman
 2354|       |			 * coding.
 2355|       |			 */
 2356|  4.52k|			ds->pt.len_size = ds->pos_pt_len_size;
 2357|  4.52k|			ds->pt.len_bits = ds->pos_pt_len_bits;
 2358|  4.52k|			ds->reading_position = 1;
 2359|  4.52k|			ds->state = ST_RD_PT_1;
  ------------------
  |  | 2093|  4.52k|#define ST_RD_PT_1		1
  ------------------
 2360|  4.52k|			break;
 2361|  4.03k|		case ST_GET_LITERAL:
  ------------------
  |  | 2101|  4.03k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2361:3): [True: 4.03k, False: 18.7k]
  ------------------
 2362|  4.03k|			return (100);
 2363|  22.7k|		}
 2364|  22.7k|	}
 2365|  3.19k|failed:
 2366|  3.19k|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.19k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2367|  7.94k|}
archive_read_support_format_lha.c:lzh_br_fillup:
 2001|  54.9k|{
 2002|  54.9k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   92|  54.9k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2003|       |
 2004|  65.1k|	for (;;) {
 2005|  65.1k|		const int x = n >> 3;
 2006|  65.1k|		if (strm->avail_in >= x) {
  ------------------
  |  Branch (2006:7): [True: 48.1k, False: 16.9k]
  ------------------
 2007|  48.1k|			switch (x) {
 2008|  8.65k|			case 8:
  ------------------
  |  Branch (2008:4): [True: 8.65k, False: 39.5k]
  ------------------
 2009|  8.65k|				br->cache_buffer =
 2010|  8.65k|				    ((uint64_t)strm->next_in[0]) << 56 |
 2011|  8.65k|				    ((uint64_t)strm->next_in[1]) << 48 |
 2012|  8.65k|				    ((uint64_t)strm->next_in[2]) << 40 |
 2013|  8.65k|				    ((uint64_t)strm->next_in[3]) << 32 |
 2014|  8.65k|				    ((uint32_t)strm->next_in[4]) << 24 |
 2015|  8.65k|				    ((uint32_t)strm->next_in[5]) << 16 |
 2016|  8.65k|				    ((uint32_t)strm->next_in[6]) << 8 |
 2017|  8.65k|				     (uint32_t)strm->next_in[7];
 2018|  8.65k|				strm->next_in += 8;
 2019|  8.65k|				strm->avail_in -= 8;
 2020|  8.65k|				br->cache_avail += 8 * 8;
 2021|  8.65k|				return (1);
 2022|  39.1k|			case 7:
  ------------------
  |  Branch (2022:4): [True: 39.1k, False: 9.07k]
  ------------------
 2023|  39.1k|				br->cache_buffer =
 2024|  39.1k|		 		   (br->cache_buffer << 56) |
 2025|  39.1k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2026|  39.1k|				    ((uint64_t)strm->next_in[1]) << 40 |
 2027|  39.1k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2028|  39.1k|				    ((uint64_t)strm->next_in[3]) << 24 |
 2029|  39.1k|				    ((uint64_t)strm->next_in[4]) << 16 |
 2030|  39.1k|				    ((uint64_t)strm->next_in[5]) << 8 |
 2031|  39.1k|				     (uint64_t)strm->next_in[6];
 2032|  39.1k|				strm->next_in += 7;
 2033|  39.1k|				strm->avail_in -= 7;
 2034|  39.1k|				br->cache_avail += 7 * 8;
 2035|  39.1k|				return (1);
 2036|    418|			case 6:
  ------------------
  |  Branch (2036:4): [True: 418, False: 47.7k]
  ------------------
 2037|    418|				br->cache_buffer =
 2038|    418|		 		   (br->cache_buffer << 48) |
 2039|    418|				    ((uint64_t)strm->next_in[0]) << 40 |
 2040|    418|				    ((uint64_t)strm->next_in[1]) << 32 |
 2041|    418|				    ((uint64_t)strm->next_in[2]) << 24 |
 2042|    418|				    ((uint64_t)strm->next_in[3]) << 16 |
 2043|    418|				    ((uint64_t)strm->next_in[4]) << 8 |
 2044|    418|				     (uint64_t)strm->next_in[5];
 2045|    418|				strm->next_in += 6;
 2046|    418|				strm->avail_in -= 6;
 2047|    418|				br->cache_avail += 6 * 8;
 2048|    418|				return (1);
 2049|      0|			case 0:
  ------------------
  |  Branch (2049:4): [True: 0, False: 48.1k]
  ------------------
 2050|       |				/* We have enough compressed data in
 2051|       |				 * the cache buffer.*/
 2052|      0|				return (1);
 2053|      0|			default:
  ------------------
  |  Branch (2053:4): [True: 0, False: 48.1k]
  ------------------
 2054|      0|				break;
 2055|  48.1k|			}
 2056|  48.1k|		}
 2057|  16.9k|		if (strm->avail_in == 0) {
  ------------------
  |  Branch (2057:7): [True: 6.80k, False: 10.1k]
  ------------------
 2058|       |			/* There is not enough compressed data to fill up the
 2059|       |			 * cache buffer. */
 2060|  6.80k|			return (0);
 2061|  6.80k|		}
 2062|  10.1k|		br->cache_buffer =
 2063|  10.1k|		   (br->cache_buffer << 8) | *strm->next_in++;
 2064|  10.1k|		strm->avail_in--;
 2065|  10.1k|		br->cache_avail += 8;
 2066|  10.1k|		n -= 8;
 2067|  10.1k|	}
 2068|  54.9k|}
archive_read_support_format_lha.c:lzh_emit_window:
 2129|  19.2k|{
 2130|  19.2k|	strm->ref_ptr = strm->ds->w_buff;
 2131|  19.2k|	strm->avail_out = (int)s;
 2132|  19.2k|}
archive_read_support_format_lha.c:lzh_make_fake_table:
 2703|  3.12k|{
 2704|  3.12k|	if (c >= hf->len_size)
  ------------------
  |  Branch (2704:6): [True: 70, False: 3.05k]
  ------------------
 2705|     70|		return (0);
 2706|  3.05k|	hf->tbl[0] = c;
 2707|  3.05k|	hf->max_bits = 0;
 2708|  3.05k|	hf->shift_bits = 0;
 2709|  3.05k|	hf->bitlen[hf->tbl[0]] = 0;
 2710|  3.05k|	return (1);
 2711|  3.12k|}
archive_read_support_format_lha.c:lzh_read_pt_bitlen:
 2665|  14.9k|{
 2666|  14.9k|	struct lzh_dec *ds = strm->ds;
 2667|  14.9k|	struct lzh_br *br = &(ds->br);
 2668|  14.9k|	int c, i;
 2669|       |
 2670|  89.8k|	for (i = start; i < end; ) {
  ------------------
  |  Branch (2670:18): [True: 75.3k, False: 14.4k]
  ------------------
 2671|       |		/*
 2672|       |		 *  bit pattern     the number we need
 2673|       |		 *     000           ->  0
 2674|       |		 *     001           ->  1
 2675|       |		 *     010           ->  2
 2676|       |		 *     ...
 2677|       |		 *     110           ->  6
 2678|       |		 *     1110          ->  7
 2679|       |		 *     11110         ->  8
 2680|       |		 *     ...
 2681|       |		 *     1111111111110 ->  16
 2682|       |		 */
 2683|  75.3k|		if (!lzh_br_read_ahead(strm, br, 3))
  ------------------
  |  | 1978|  75.3k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|   150k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|   150k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 70.6k, False: 4.67k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 3.46k, False: 1.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|  1.21k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 1.10k, False: 110]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2684|    110|			return (i);
 2685|  75.2k|		if ((c = lzh_br_bits(br, 3)) == 7) {
  ------------------
  |  | 1962|  75.2k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  75.2k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2685:7): [True: 1.04k, False: 74.2k]
  ------------------
 2686|  1.04k|			if (!lzh_br_read_ahead(strm, br, 13))
  ------------------
  |  | 1978|  1.04k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  2.08k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  2.08k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 619, False: 422]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 85, False: 337]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|    337|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 227, False: 110]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2687|    110|				return (i);
 2688|    931|			c = bitlen_tbl[lzh_br_bits(br, 13) & 0x3FF];
  ------------------
  |  | 1962|    931|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|    931|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2689|    931|			if (c)
  ------------------
  |  Branch (2689:8): [True: 692, False: 239]
  ------------------
 2690|    692|				lzh_br_consume(br, c - 3);
  ------------------
  |  | 1981|    692|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2691|    239|			else
 2692|    239|				return (-1);/* Invalid data. */
 2693|    931|		} else
 2694|  74.2k|			lzh_br_consume(br, 3);
  ------------------
  |  | 1981|  74.2k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2695|  74.9k|		ds->pt.bitlen[i++] = c;
 2696|  74.9k|		ds->pt.freq[c]++;
 2697|  74.9k|	}
 2698|  14.4k|	return (i);
 2699|  14.9k|}
archive_read_support_format_lha.c:lzh_make_huffman_table:
 2718|  12.5k|{
 2719|  12.5k|	uint16_t *tbl;
 2720|  12.5k|	const unsigned char *bitlen;
 2721|  12.5k|	int bitptn[17], weight[17];
 2722|  12.5k|	int i, maxbits = 0, ptn, tbl_size, w;
 2723|  12.5k|	int diffbits, len_avail;
 2724|       |
 2725|       |	/*
 2726|       |	 * Initialize bit patterns.
 2727|       |	 */
 2728|  12.5k|	ptn = 0;
 2729|   212k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (2729:27): [True: 200k, False: 12.5k]
  ------------------
 2730|   200k|		bitptn[i] = ptn;
 2731|   200k|		weight[i] = w;
 2732|   200k|		if (hf->freq[i]) {
  ------------------
  |  Branch (2732:7): [True: 42.1k, False: 157k]
  ------------------
 2733|  42.1k|			ptn += hf->freq[i] * w;
 2734|  42.1k|			maxbits = i;
 2735|  42.1k|		}
 2736|   200k|	}
 2737|  12.5k|	if (ptn != 0x10000 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (2737:6): [True: 1.64k, False: 10.8k]
  |  Branch (2737:24): [True: 0, False: 10.8k]
  ------------------
 2738|  1.64k|		return (0);/* Invalid */
 2739|       |
 2740|  10.8k|	hf->max_bits = maxbits;
 2741|       |
 2742|       |	/*
 2743|       |	 * Cut out extra bits which we won't house in the table.
 2744|       |	 * This preparation reduces the same calculation in the for-loop
 2745|       |	 * making the table.
 2746|       |	 */
 2747|  10.8k|	if (maxbits < 16) {
  ------------------
  |  Branch (2747:6): [True: 10.8k, False: 0]
  ------------------
 2748|  10.8k|		int ebits = 16 - maxbits;
 2749|  61.6k|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (2749:15): [True: 50.7k, False: 10.8k]
  ------------------
 2750|  50.7k|			bitptn[i] >>= ebits;
 2751|  50.7k|			weight[i] >>= ebits;
 2752|  50.7k|		}
 2753|  10.8k|	}
 2754|  10.8k|	if (maxbits > HTBL_BITS) {
  ------------------
  |  |  114|  10.8k|#define HTBL_BITS	10
  ------------------
  |  Branch (2754:6): [True: 0, False: 10.8k]
  ------------------
 2755|      0|		unsigned htbl_max;
 2756|      0|		uint16_t *p;
 2757|       |
 2758|      0|		diffbits = maxbits - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2759|      0|		for (i = 1; i <= HTBL_BITS; i++) {
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2759:15): [True: 0, False: 0]
  ------------------
 2760|      0|			bitptn[i] >>= diffbits;
 2761|      0|			weight[i] >>= diffbits;
 2762|      0|		}
 2763|      0|		htbl_max = bitptn[HTBL_BITS] +
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2764|      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
  ------------------
 2765|      0|		p = &(hf->tbl[htbl_max]);
 2766|      0|		while (p < &hf->tbl[1U<<HTBL_BITS])
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2766:10): [True: 0, False: 0]
  ------------------
 2767|      0|			*p++ = 0;
 2768|      0|	} else
 2769|  10.8k|		diffbits = 0;
 2770|  10.8k|	hf->shift_bits = diffbits;
 2771|       |
 2772|       |	/*
 2773|       |	 * Make the table.
 2774|       |	 */
 2775|  10.8k|	tbl_size = 1 << HTBL_BITS;
  ------------------
  |  |  114|  10.8k|#define HTBL_BITS	10
  ------------------
 2776|  10.8k|	tbl = hf->tbl;
 2777|  10.8k|	bitlen = hf->bitlen;
 2778|  10.8k|	len_avail = hf->len_avail;
 2779|  10.8k|	hf->tree_used = 0;
 2780|   980k|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (2780:14): [True: 969k, False: 10.8k]
  ------------------
 2781|   969k|		uint16_t *p;
 2782|   969k|		int len, cnt;
 2783|   969k|		uint16_t bit;
 2784|   969k|		int extlen;
 2785|   969k|		struct htree_t *ht;
 2786|       |
 2787|   969k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (2787:7): [True: 813k, False: 156k]
  ------------------
 2788|   813k|			continue;
 2789|       |		/* Get a bit pattern */
 2790|   156k|		len = bitlen[i];
 2791|   156k|		ptn = bitptn[len];
 2792|   156k|		cnt = weight[len];
 2793|   156k|		if (len <= HTBL_BITS) {
  ------------------
  |  |  114|   156k|#define HTBL_BITS	10
  ------------------
  |  Branch (2793:7): [True: 156k, False: 0]
  ------------------
 2794|       |			/* Calculate next bit pattern */
 2795|   156k|			if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (2795:8): [True: 0, False: 156k]
  ------------------
 2796|      0|				return (0);/* Invalid */
 2797|       |			/* Update the table */
 2798|   156k|			p = &(tbl[ptn]);
 2799|   156k|			if (cnt > 7) {
  ------------------
  |  Branch (2799:8): [True: 24.7k, False: 131k]
  ------------------
 2800|  24.7k|				uint16_t *pc;
 2801|       |
 2802|  24.7k|				cnt -= 8;
 2803|  24.7k|				pc = &p[cnt];
 2804|  24.7k|				pc[0] = (uint16_t)i;
 2805|  24.7k|				pc[1] = (uint16_t)i;
 2806|  24.7k|				pc[2] = (uint16_t)i;
 2807|  24.7k|				pc[3] = (uint16_t)i;
 2808|  24.7k|				pc[4] = (uint16_t)i;
 2809|  24.7k|				pc[5] = (uint16_t)i;
 2810|  24.7k|				pc[6] = (uint16_t)i;
 2811|  24.7k|				pc[7] = (uint16_t)i;
 2812|  24.7k|				if (cnt > 7) {
  ------------------
  |  Branch (2812:9): [True: 10.8k, False: 13.9k]
  ------------------
 2813|  10.8k|					cnt -= 8;
 2814|  10.8k|					memcpy(&p[cnt], pc,
 2815|  10.8k|						8 * sizeof(uint16_t));
 2816|  10.8k|					pc = &p[cnt];
 2817|  10.8k|					while (cnt > 15) {
  ------------------
  |  Branch (2817:13): [True: 32, False: 10.8k]
  ------------------
 2818|     32|						cnt -= 16;
 2819|     32|						memcpy(&p[cnt], pc,
 2820|     32|							16 * sizeof(uint16_t));
 2821|     32|					}
 2822|  10.8k|				}
 2823|  24.7k|				if (cnt)
  ------------------
  |  Branch (2823:9): [True: 0, False: 24.7k]
  ------------------
 2824|      0|					memcpy(p, pc, cnt * sizeof(uint16_t));
 2825|   131k|			} else {
 2826|   269k|				while (cnt > 1) {
  ------------------
  |  Branch (2826:12): [True: 138k, False: 131k]
  ------------------
 2827|   138k|					p[--cnt] = (uint16_t)i;
 2828|   138k|					p[--cnt] = (uint16_t)i;
 2829|   138k|				}
 2830|   131k|				if (cnt)
  ------------------
  |  Branch (2830:9): [True: 21.7k, False: 109k]
  ------------------
 2831|  21.7k|					p[--cnt] = (uint16_t)i;
 2832|   131k|			}
 2833|   156k|			continue;
 2834|   156k|		}
 2835|       |
 2836|       |		/*
 2837|       |		 * A bit length is too big to be housed to a direct table,
 2838|       |		 * so we use a tree model for its extra bits.
 2839|       |		 */
 2840|      0|		bitptn[len] = ptn + cnt;
 2841|      0|		bit = 1U << (diffbits -1);
 2842|      0|		extlen = len - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2843|       |		
 2844|      0|		p = &(tbl[ptn >> diffbits]);
 2845|      0|		if (*p == 0) {
  ------------------
  |  Branch (2845:7): [True: 0, False: 0]
  ------------------
 2846|      0|			*p = len_avail + hf->tree_used;
 2847|      0|			ht = &(hf->tree[hf->tree_used++]);
 2848|      0|			if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2848:8): [True: 0, False: 0]
  ------------------
 2849|      0|				return (0);/* Invalid */
 2850|      0|			ht->left = 0;
 2851|      0|			ht->right = 0;
 2852|      0|		} else {
 2853|      0|			if (*p < len_avail ||
  ------------------
  |  Branch (2853:8): [True: 0, False: 0]
  ------------------
 2854|      0|			    *p >= (len_avail + hf->tree_used))
  ------------------
  |  Branch (2854:8): [True: 0, False: 0]
  ------------------
 2855|      0|				return (0);/* Invalid */
 2856|      0|			ht = &(hf->tree[*p - len_avail]);
 2857|      0|		}
 2858|      0|		while (--extlen > 0) {
  ------------------
  |  Branch (2858:10): [True: 0, False: 0]
  ------------------
 2859|      0|			if (ptn & bit) {
  ------------------
  |  Branch (2859:8): [True: 0, False: 0]
  ------------------
 2860|      0|				if (ht->left < len_avail) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 0]
  ------------------
 2861|      0|					ht->left = len_avail + hf->tree_used;
 2862|      0|					ht = &(hf->tree[hf->tree_used++]);
 2863|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2863:10): [True: 0, False: 0]
  ------------------
 2864|      0|						return (0);/* Invalid */
 2865|      0|					ht->left = 0;
 2866|      0|					ht->right = 0;
 2867|      0|				} else {
 2868|      0|					ht = &(hf->tree[ht->left - len_avail]);
 2869|      0|				}
 2870|      0|			} else {
 2871|      0|				if (ht->right < len_avail) {
  ------------------
  |  Branch (2871:9): [True: 0, False: 0]
  ------------------
 2872|      0|					ht->right = len_avail + hf->tree_used;
 2873|      0|					ht = &(hf->tree[hf->tree_used++]);
 2874|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2874:10): [True: 0, False: 0]
  ------------------
 2875|      0|						return (0);/* Invalid */
 2876|      0|					ht->left = 0;
 2877|      0|					ht->right = 0;
 2878|      0|				} else {
 2879|      0|					ht = &(hf->tree[ht->right - len_avail]);
 2880|      0|				}
 2881|      0|			}
 2882|      0|			bit >>= 1;
 2883|      0|		}
 2884|      0|		if (ptn & bit) {
  ------------------
  |  Branch (2884:7): [True: 0, False: 0]
  ------------------
 2885|      0|			if (ht->left != 0)
  ------------------
  |  Branch (2885:8): [True: 0, False: 0]
  ------------------
 2886|      0|				return (0);/* Invalid */
 2887|      0|			ht->left = (uint16_t)i;
 2888|      0|		} else {
 2889|      0|			if (ht->right != 0)
  ------------------
  |  Branch (2889:8): [True: 0, False: 0]
  ------------------
 2890|      0|				return (0);/* Invalid */
 2891|      0|			ht->right = (uint16_t)i;
 2892|      0|		}
 2893|      0|	}
 2894|  10.8k|	return (1);
 2895|  10.8k|}
archive_read_support_format_lha.c:lzh_decode_huffman:
 2919|  41.7M|{
 2920|  41.7M|	int c;
 2921|       |	/*
 2922|       |	 * At first search an index table for a bit pattern.
 2923|       |	 * If it fails, search a huffman tree for.
 2924|       |	 */
 2925|  41.7M|	c = hf->tbl[rbits >> hf->shift_bits];
 2926|  41.7M|	if (c < hf->len_avail || hf->len_avail == 0)
  ------------------
  |  Branch (2926:6): [True: 618k, False: 41.1M]
  |  Branch (2926:27): [True: 41.1M, False: 0]
  ------------------
 2927|  41.7M|		return (c);
 2928|       |	/* This bit pattern needs to be found out at a huffman tree. */
 2929|      0|	return (lzh_decode_huffman_tree(hf, rbits, c));
 2930|  41.7M|}
archive_read_support_format_lha.c:lzh_decode_blocks:
 2371|  22.9k|{
 2372|  22.9k|	struct lzh_dec *ds = strm->ds;
 2373|  22.9k|	struct lzh_br bre = ds->br;
 2374|  22.9k|	struct huffman *lt = &(ds->lt);
 2375|  22.9k|	struct huffman *pt = &(ds->pt);
 2376|  22.9k|	unsigned char *w_buff = ds->w_buff;
 2377|  22.9k|	unsigned char *lt_bitlen = lt->bitlen;
 2378|  22.9k|	unsigned char *pt_bitlen = pt->bitlen;
 2379|  22.9k|	int blocks_avail = ds->blocks_avail, c = 0;
 2380|  22.9k|	int copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2381|  22.9k|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2382|  22.9k|	int lt_max_bits = lt->max_bits, pt_max_bits = pt->max_bits;
 2383|  22.9k|	int state = ds->state;
 2384|       |
 2385|  17.2M|	for (;;) {
 2386|  17.2M|		switch (state) {
  ------------------
  |  Branch (2386:11): [True: 17.2M, False: 0]
  ------------------
 2387|  17.2M|		case ST_GET_LITERAL:
  ------------------
  |  | 2101|  17.2M|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2387:3): [True: 17.2M, False: 18.4k]
  ------------------
 2388|  24.3M|			for (;;) {
 2389|  24.3M|				if (blocks_avail == 0) {
  ------------------
  |  Branch (2389:9): [True: 3.35k, False: 24.2M]
  ------------------
 2390|       |					/* We have decoded all blocks.
 2391|       |					 * Let's handle next blocks. */
 2392|  3.35k|					ds->state = ST_RD_BLOCK;
  ------------------
  |  | 2092|  3.35k|#define ST_RD_BLOCK		0
  ------------------
 2393|  3.35k|					ds->br = bre;
 2394|  3.35k|					ds->blocks_avail = 0;
 2395|  3.35k|					ds->w_pos = w_pos;
 2396|  3.35k|					ds->copy_pos = 0;
 2397|  3.35k|					return (100);
 2398|  3.35k|				}
 2399|       |
 2400|       |				/* lzh_br_read_ahead() always tries to fill the
 2401|       |				 * cache buffer up. In specific situation we
 2402|       |				 * are close to the end of the data, the cache
 2403|       |				 * buffer will not be full and thus we have to
 2404|       |				 * determine if the cache buffer has some bits
 2405|       |				 * as much as we need after lzh_br_read_ahead()
 2406|       |				 * failed. */
 2407|  24.2M|				if (!lzh_br_read_ahead(strm, &bre,
  ------------------
  |  | 1978|  24.2M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  48.5M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  48.5M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 24.2M, False: 24.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 22.2k, False: 2.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|  2.60k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 772, False: 1.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2408|  24.2M|				    lt_max_bits)) {
 2409|  1.83k|					if (!last)
  ------------------
  |  Branch (2409:10): [True: 21, False: 1.80k]
  ------------------
 2410|     21|						goto next_data;
 2411|       |					/* Remaining bits are less than
 2412|       |					 * maximum bits(lt.max_bits) but maybe
 2413|       |					 * it still remains as much as we need,
 2414|       |					 * so we should try to use it with
 2415|       |					 * dummy bits. */
 2416|  1.80k|					c = lzh_decode_huffman(lt,
 2417|  1.80k|					      lzh_br_bits_forced(&bre,
  ------------------
  |  | 1965|  1.80k|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1966|  1.80k|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2418|  1.80k|					        lt_max_bits));
 2419|  1.80k|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1981|  1.80k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2420|  1.80k|					if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1959|  1.80k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2420:10): [True: 582, False: 1.22k]
  ------------------
 2421|    582|						goto failed;/* Over read. */
 2422|  24.2M|				} else {
 2423|  24.2M|					c = lzh_decode_huffman(lt,
 2424|  24.2M|					      lzh_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 1962|  24.2M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  24.2M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2425|  24.2M|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1981|  24.2M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2426|  24.2M|				}
 2427|  24.2M|				blocks_avail--;
 2428|  24.2M|				if ((unsigned int)c > UCHAR_MAX)
  ------------------
  |  Branch (2428:9): [True: 17.2M, False: 7.04M]
  ------------------
 2429|       |					/* Current block is a match data. */
 2430|  17.2M|					break;
 2431|       |				/*
 2432|       |				 * 'c' is exactly a literal code.
 2433|       |				 */
 2434|       |				/* Save a decoded code to reference it
 2435|       |				 * afterward. */
 2436|  7.04M|				w_buff[w_pos] = c;
 2437|  7.04M|				if (++w_pos >= w_size) {
  ------------------
  |  Branch (2437:9): [True: 7, False: 7.04M]
  ------------------
 2438|      7|					w_pos = 0;
 2439|      7|					lzh_emit_window(strm, w_size);
 2440|      7|					goto next_data;
 2441|      7|				}
 2442|  7.04M|			}
 2443|       |			/* 'c' is the length of a match pattern we have
 2444|       |			 * already extracted, which has be stored in
 2445|       |			 * window(ds->w_buff). */
 2446|  17.2M|			copy_len = c - (UCHAR_MAX + 1) + MINMATCH;
  ------------------
  |  |   51|  17.2M|#define MINMATCH		3	/* Minimum match length. */
  ------------------
 2447|       |			/* FALL THROUGH */
 2448|  17.2M|		case ST_GET_POS_1:
  ------------------
  |  | 2102|  17.2M|#define ST_GET_POS_1		10
  ------------------
  |  Branch (2448:3): [True: 0, False: 17.2M]
  ------------------
 2449|       |			/*
 2450|       |			 * Get a reference position. 
 2451|       |			 */
 2452|  17.2M|			if (!lzh_br_read_ahead(strm, &bre, pt_max_bits)) {
  ------------------
  |  | 1978|  17.2M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|  34.5M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|  34.5M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 17.2M, False: 4.34k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 4.19k, False: 156]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|    156|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 101, False: 55]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2453|     55|				if (!last) {
  ------------------
  |  Branch (2453:9): [True: 8, False: 47]
  ------------------
 2454|      8|					state = ST_GET_POS_1;
  ------------------
  |  | 2102|      8|#define ST_GET_POS_1		10
  ------------------
 2455|      8|					ds->copy_len = copy_len;
 2456|      8|					goto next_data;
 2457|      8|				}
 2458|     47|				copy_pos = lzh_decode_huffman(pt,
 2459|     47|				    lzh_br_bits_forced(&bre, pt_max_bits));
  ------------------
  |  | 1965|     47|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1966|     47|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2460|     47|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1981|     47|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2461|     47|				if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1959|     47|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2461:9): [True: 37, False: 10]
  ------------------
 2462|     37|					goto failed;/* Over read. */
 2463|  17.2M|			} else {
 2464|  17.2M|				copy_pos = lzh_decode_huffman(pt,
 2465|  17.2M|				    lzh_br_bits(&bre, pt_max_bits));
  ------------------
  |  | 1962|  17.2M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  17.2M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2466|  17.2M|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1981|  17.2M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2467|  17.2M|			}
 2468|       |			/* FALL THROUGH */
 2469|  17.2M|		case ST_GET_POS_2:
  ------------------
  |  | 2103|  17.2M|#define ST_GET_POS_2		11
  ------------------
  |  Branch (2469:3): [True: 0, False: 17.2M]
  ------------------
 2470|  17.2M|			if (copy_pos > 1) {
  ------------------
  |  Branch (2470:8): [True: 53.2k, False: 17.2M]
  ------------------
 2471|       |				/* We need an additional adjustment number to
 2472|       |				 * the position. */
 2473|  53.2k|				int p = copy_pos - 1;
 2474|  53.2k|				if (!lzh_br_read_ahead(strm, &bre, p)) {
  ------------------
  |  | 1978|  53.2k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1973|   106k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1959|   106k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1959:27): [True: 50.9k, False: 2.36k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1973:26): [True: 2.29k, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1959|     69|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1959:27): [True: 32, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2475|     37|					if (last)
  ------------------
  |  Branch (2475:10): [True: 26, False: 11]
  ------------------
 2476|     26|						goto failed;/* Truncated data.*/
 2477|     11|					state = ST_GET_POS_2;
  ------------------
  |  | 2103|     11|#define ST_GET_POS_2		11
  ------------------
 2478|     11|					ds->copy_len = copy_len;
 2479|     11|					ds->copy_pos = copy_pos;
 2480|     11|					goto next_data;
 2481|     37|				}
 2482|  53.2k|				copy_pos = (1 << p) + lzh_br_bits(&bre, p);
  ------------------
  |  | 1962|  53.2k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1963|  53.2k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2483|  53.2k|				lzh_br_consume(&bre, p);
  ------------------
  |  | 1981|  53.2k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2484|  53.2k|			}
 2485|       |			/* The position is actually a distance from the last
 2486|       |			 * code we had extracted and thus we have to convert
 2487|       |			 * it to a position of the window. */
 2488|  17.2M|			copy_pos = (w_pos - copy_pos - 1) & w_mask;
 2489|       |			/* FALL THROUGH */
 2490|  17.2M|		case ST_COPY_DATA:
  ------------------
  |  | 2104|  17.2M|#define ST_COPY_DATA		12
  ------------------
  |  Branch (2490:3): [True: 18.4k, False: 17.2M]
  ------------------
 2491|       |			/*
 2492|       |			 * Copy `copy_len' bytes as extracted data from
 2493|       |			 * the window into the output buffer.
 2494|       |			 */
 2495|  17.2M|			for (;;) {
 2496|  17.2M|				int l;
 2497|       |
 2498|  17.2M|				l = copy_len;
 2499|  17.2M|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2499:9): [True: 21.6k, False: 17.2M]
  ------------------
 2500|  21.6k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2500:10): [True: 19.6k, False: 1.97k]
  ------------------
 2501|  19.6k|						l = w_size - copy_pos;
 2502|  17.2M|				} else {
 2503|  17.2M|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2503:10): [True: 18.4k, False: 17.2M]
  ------------------
 2504|  18.4k|						l = w_size - w_pos;
 2505|  17.2M|				}
 2506|  17.2M|				if ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2506:9): [True: 8.68k, False: 17.2M]
  ------------------
 2507|  17.2M|				    || (w_pos + l < copy_pos)) {
  ------------------
  |  Branch (2507:12): [True: 21.6k, False: 17.2M]
  ------------------
 2508|       |					/* No overlap. */
 2509|  30.3k|					memcpy(w_buff + w_pos,
 2510|  30.3k|					    w_buff + copy_pos, l);
 2511|  17.2M|				} else {
 2512|  17.2M|					const unsigned char *s;
 2513|  17.2M|					unsigned char *d;
 2514|  17.2M|					int li;
 2515|       |
 2516|  17.2M|					d = w_buff + w_pos;
 2517|  17.2M|					s = w_buff + copy_pos;
 2518|  1.25G|					for (li = 0; li < l-1;) {
  ------------------
  |  Branch (2518:19): [True: 1.23G, False: 17.2M]
  ------------------
 2519|  1.23G|						d[li] = s[li];li++;
 2520|  1.23G|						d[li] = s[li];li++;
 2521|  1.23G|					}
 2522|  17.2M|					if (li < l)
  ------------------
  |  Branch (2522:10): [True: 17.1M, False: 157k]
  ------------------
 2523|  17.1M|						d[li] = s[li];
 2524|  17.2M|				}
 2525|  17.2M|				w_pos += l;
 2526|  17.2M|				if (w_pos == w_size) {
  ------------------
  |  Branch (2526:9): [True: 18.9k, False: 17.2M]
  ------------------
 2527|  18.9k|					w_pos = 0;
 2528|  18.9k|					lzh_emit_window(strm, w_size);
 2529|  18.9k|					if (copy_len <= l)
  ------------------
  |  Branch (2529:10): [True: 479, False: 18.4k]
  ------------------
 2530|    479|						state = ST_GET_LITERAL;
  ------------------
  |  | 2101|    479|#define ST_GET_LITERAL		9
  ------------------
 2531|  18.4k|					else {
 2532|  18.4k|						state = ST_COPY_DATA;
  ------------------
  |  | 2104|  18.4k|#define ST_COPY_DATA		12
  ------------------
 2533|  18.4k|						ds->copy_len = copy_len - l;
 2534|  18.4k|						ds->copy_pos =
 2535|  18.4k|						    (copy_pos + l) & w_mask;
 2536|  18.4k|					}
 2537|  18.9k|					goto next_data;
 2538|  18.9k|				}
 2539|  17.2M|				if (copy_len <= l)
  ------------------
  |  Branch (2539:9): [True: 17.2M, False: 19.6k]
  ------------------
 2540|       |					/* A copy of current pattern ended. */
 2541|  17.2M|					break;
 2542|  19.6k|				copy_len -= l;
 2543|  19.6k|				copy_pos = (copy_pos + l) & w_mask;
 2544|  19.6k|			}
 2545|  17.2M|			state = ST_GET_LITERAL;
  ------------------
  |  | 2101|  17.2M|#define ST_GET_LITERAL		9
  ------------------
 2546|  17.2M|			break;
 2547|  17.2M|		}
 2548|  17.2M|	}
 2549|    645|failed:
 2550|    645|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|    645|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2551|  18.9k|next_data:
 2552|  18.9k|	ds->br = bre;
 2553|  18.9k|	ds->blocks_avail = blocks_avail;
 2554|  18.9k|	ds->state = state;
 2555|  18.9k|	ds->w_pos = w_pos;
 2556|  18.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  18.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2557|  22.9k|}
archive_read_support_format_lha.c:lha_read_data_none:
 1504|    524|{
 1505|    524|	struct lha *lha = a->format->data;
 1506|    524|	ssize_t bytes_avail;
 1507|       |
 1508|    524|	if (lha->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1508:6): [True: 0, False: 524]
  ------------------
 1509|      0|		*buff = NULL;
 1510|      0|		*size = 0;
 1511|      0|		*offset = lha->entry_offset;
 1512|      0|		lha->end_of_entry = 1;
 1513|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1514|      0|	}
 1515|       |	/*
 1516|       |	 * Note: '1' here is a performance optimization.
 1517|       |	 * Recall that the decompression layer returns a count of
 1518|       |	 * available bytes; asking for more than that forces the
 1519|       |	 * decompressor to combine reads by copying data.
 1520|       |	 */
 1521|    524|	*buff = __archive_read_ahead(a, 1, &bytes_avail);
 1522|    524|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1522:6): [True: 10, False: 514]
  ------------------
 1523|     10|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1524|     10|		    "Truncated LHa file data");
 1525|     10|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1526|     10|	}
 1527|    514|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1527:6): [True: 504, False: 10]
  ------------------
 1528|    504|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1529|    514|	lha->entry_crc_calculated =
 1530|    514|	    lha_crc16(lha->entry_crc_calculated, *buff, bytes_avail);
 1531|    514|	*size = bytes_avail;
 1532|    514|	*offset = lha->entry_offset;
 1533|    514|	lha->entry_offset += bytes_avail;
 1534|    514|	lha->entry_bytes_remaining -= bytes_avail;
 1535|    514|	if (lha->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1535:6): [True: 504, False: 10]
  ------------------
 1536|    504|		lha->end_of_entry = 1;
 1537|    514|	lha->entry_unconsumed = bytes_avail;
 1538|    514|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    514|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1539|    524|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data_skip:
 1641|  5.78k|{
 1642|  5.78k|	struct lha *lha = a->format->data;
 1643|  5.78k|	int64_t bytes_skipped;
 1644|       |
 1645|  5.78k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1645:6): [True: 0, False: 5.78k]
  ------------------
 1646|       |		/* Consume as much as the decompressor actually used. */
 1647|      0|		__archive_read_consume(a, lha->entry_unconsumed);
 1648|      0|		lha->entry_unconsumed = 0;
 1649|      0|	}
 1650|       |
 1651|       |	/* if we've already read to end of data, we're done. */
 1652|  5.78k|	if (lha->end_of_entry_cleanup)
  ------------------
  |  Branch (1652:6): [True: 1.58k, False: 4.20k]
  ------------------
 1653|  1.58k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1654|       |
 1655|       |	/*
 1656|       |	 * If the length is at the beginning, we can skip the
 1657|       |	 * compressed data much more quickly.
 1658|       |	 */
 1659|  4.20k|	bytes_skipped = __archive_read_consume(a, lha->entry_bytes_remaining);
 1660|  4.20k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1660:6): [True: 32, False: 4.17k]
  ------------------
 1661|     32|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     32|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1662|       |
 1663|       |	/* This entry is finished and done. */
 1664|  4.17k|	lha->end_of_entry_cleanup = lha->end_of_entry = 1;
 1665|  4.17k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1666|  4.20k|}
archive_read_support_format_lha.c:archive_read_format_lha_cleanup:
 1670|  11.9k|{
 1671|  11.9k|	struct lha *lha = a->format->data;
 1672|       |
 1673|  11.9k|	lzh_decode_free(&(lha->strm));
 1674|  11.9k|	archive_string_free(&(lha->dirname));
 1675|  11.9k|	archive_string_free(&(lha->filename));
 1676|  11.9k|	archive_string_free(&(lha->uname));
 1677|  11.9k|	archive_string_free(&(lha->gname));
 1678|  11.9k|	archive_wstring_free(&(lha->ws));
 1679|  11.9k|	free(lha);
 1680|  11.9k|	a->format->data = NULL;
 1681|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1682|  11.9k|}
archive_read_support_format_lha.c:lzh_decode_free:
 1944|  11.9k|{
 1945|       |
 1946|  11.9k|	if (strm->ds == NULL)
  ------------------
  |  Branch (1946:6): [True: 11.6k, False: 296]
  ------------------
 1947|  11.6k|		return;
 1948|    296|	free(strm->ds->w_buff);
 1949|    296|	lzh_huffman_free(&(strm->ds->lt));
 1950|    296|	lzh_huffman_free(&(strm->ds->pt));
 1951|    296|	free(strm->ds);
 1952|       |	strm->ds = NULL;
 1953|    296|}
archive_read_support_format_lha.c:lzh_huffman_free:
 2591|    592|{
 2592|    592|	free(hf->bitlen);
 2593|    592|	free(hf->tbl);
 2594|    592|	free(hf->tree);
 2595|    592|}

archive_read_support_format_mtree:
  214|  11.9k|{
  215|  11.9k|	static const struct archive_rb_tree_ops rb_ops = {
  216|  11.9k|		mtree_cmp_node, mtree_cmp_key,
  217|  11.9k|	};
  218|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  219|  11.9k|	struct mtree *mtree;
  220|  11.9k|	int r;
  221|       |
  222|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  223|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
  224|       |
  225|  11.9k|	mtree = calloc(1, sizeof(*mtree));
  226|  11.9k|	if (mtree == NULL) {
  ------------------
  |  Branch (226:6): [True: 0, False: 11.9k]
  ------------------
  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|  11.9k|	mtree->checkfs = 0;
  231|  11.9k|	mtree->fd = -1;
  232|       |
  233|  11.9k|	__archive_rb_tree_init(&mtree->rbtree, &rb_ops);
  234|       |
  235|  11.9k|	r = __archive_read_register_format(a,
  236|  11.9k|	    mtree,
  237|  11.9k|	    "mtree",
  238|  11.9k|	    mtree_bid,
  239|  11.9k|	    archive_read_format_mtree_options,
  240|  11.9k|	    read_header,
  241|  11.9k|	    read_data,
  242|  11.9k|	    skip,
  243|  11.9k|	    NULL,
  244|  11.9k|	    cleanup,
  245|  11.9k|	    NULL,
  246|  11.9k|	    NULL);
  247|       |
  248|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (248:6): [True: 0, False: 11.9k]
  ------------------
  249|      0|		free(mtree);
  250|  11.9k|	return (r);
  251|  11.9k|}
archive_read_support_format_mtree.c:mtree_cmp_node:
  197|  13.3k|{
  198|  13.3k|	const struct mtree_entry *e1 = (const struct mtree_entry *)n1;
  199|  13.3k|	const struct mtree_entry *e2 = (const struct mtree_entry *)n2;
  200|       |
  201|  13.3k|	return (strcmp(e1->name, e2->name));
  202|  13.3k|}
archive_read_support_format_mtree.c:mtree_cmp_key:
  206|  13.8k|{
  207|  13.8k|	const struct mtree_entry *e = (const struct mtree_entry *)n;
  208|       |
  209|  13.8k|	return (strcmp(e->name, key));
  210|  13.8k|}
archive_read_support_format_mtree.c:cleanup:
  255|  11.9k|{
  256|  11.9k|	struct mtree *mtree = a->format->data;
  257|  11.9k|	struct mtree_entry *p, *q;
  258|       |
  259|       |	/* Close any dangling file descriptor before freeing */
  260|  11.9k|    if (mtree->fd >= 0) {
  ------------------
  |  Branch (260:9): [True: 0, False: 11.9k]
  ------------------
  261|      0|        close(mtree->fd);
  262|      0|        mtree->fd = -1;
  263|      0|    }
  264|  11.9k|	p = mtree->entries;
  265|  53.5k|	while (p != NULL) {
  ------------------
  |  Branch (265:9): [True: 41.6k, False: 11.9k]
  ------------------
  266|  41.6k|		q = p->next;
  267|  41.6k|		free(p->name);
  268|  41.6k|		free_options(p->options);
  269|  41.6k|		free(p);
  270|  41.6k|		p = q;
  271|  41.6k|	}
  272|  11.9k|	archive_string_free(&mtree->line);
  273|  11.9k|	archive_string_free(&mtree->current_dir);
  274|  11.9k|	archive_string_free(&mtree->contents_name);
  275|  11.9k|	archive_entry_linkresolver_free(mtree->resolver);
  276|       |
  277|  11.9k|	free(mtree->buff);
  278|  11.9k|	free(mtree);
  279|  11.9k|	a->format->data = NULL;
  280|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  281|  11.9k|}
archive_read_support_format_mtree.c:free_options:
  184|  42.9k|{
  185|  42.9k|	struct mtree_option *next;
  186|       |
  187|   109k|	for (; head != NULL; head = next) {
  ------------------
  |  Branch (187:9): [True: 66.7k, False: 42.9k]
  ------------------
  188|  66.7k|		next = head->next;
  189|  66.7k|		free(head->value);
  190|  66.7k|		free(head);
  191|  66.7k|	}
  192|  42.9k|}
archive_read_support_format_mtree.c:mtree_bid:
  630|  11.7k|{
  631|  11.7k|	const char *signature = "#mtree";
  632|  11.7k|	const char *p;
  633|       |
  634|  11.7k|	(void)best_bid; /* UNUSED */
  635|       |
  636|       |	/* Now let's look at the actual header and see if it matches. */
  637|  11.7k|	p = __archive_read_ahead(a, strlen(signature), NULL);
  638|  11.7k|	if (p == NULL)
  ------------------
  |  Branch (638:6): [True: 25, False: 11.7k]
  ------------------
  639|     25|		return (-1);
  640|       |
  641|  11.7k|	if (memcmp(p, signature, strlen(signature)) == 0)
  ------------------
  |  Branch (641:6): [True: 30, False: 11.7k]
  ------------------
  642|     30|		return (8 * (int)strlen(signature));
  643|       |
  644|       |	/*
  645|       |	 * There is not a mtree signature. Let's try to detect mtree format.
  646|       |	 */
  647|  11.7k|	return (detect_form(a, NULL));
  648|  11.7k|}
archive_read_support_format_mtree.c:detect_form:
  652|  12.3k|{
  653|  12.3k|	const char *p;
  654|  12.3k|	ssize_t avail, ravail;
  655|  12.3k|	ssize_t len, nl;
  656|  12.3k|	int entry_cnt = 0, multiline = 0;
  657|  12.3k|	int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
  658|       |			* (In this source we call it `form D') . */
  659|       |
  660|  12.3k|	if (is_form_d != NULL)
  ------------------
  |  Branch (660:6): [True: 606, False: 11.7k]
  ------------------
  661|    606|		*is_form_d = 0;
  662|  12.3k|	p = __archive_read_ahead(a, 1, &avail);
  663|  12.3k|	if (p == NULL)
  ------------------
  |  Branch (663:6): [True: 0, False: 12.3k]
  ------------------
  664|      0|		return (-1);
  665|  12.3k|	ravail = avail;
  666|  46.6M|	for (;;) {
  667|  46.6M|		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|  46.6M|		if (len <= 0 || nl == 0)
  ------------------
  |  Branch (670:7): [True: 10.2k, False: 46.6M]
  |  Branch (670:19): [True: 10, False: 46.6M]
  ------------------
  671|  10.2k|			break;
  672|  46.6M|		if (!multiline) {
  ------------------
  |  Branch (672:7): [True: 46.6M, False: 1.60k]
  ------------------
  673|       |			/* Leading whitespace is never significant,
  674|       |			 * ignore it. */
  675|  46.6M|			while (len > 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (675:11): [True: 46.6M, False: 0]
  |  Branch (675:23): [True: 833, False: 46.6M]
  |  Branch (675:36): [True: 243, False: 46.6M]
  ------------------
  676|  1.07k|				++p;
  677|  1.07k|				--avail;
  678|  1.07k|				--len;
  679|  1.07k|			}
  680|       |			/* Skip comment or empty line. */ 
  681|  46.6M|			if (p[0] == '#' || p[0] == '\n' || p[0] == '\r') {
  ------------------
  |  Branch (681:8): [True: 1.36k, False: 46.6M]
  |  Branch (681:23): [True: 218k, False: 46.4M]
  |  Branch (681:39): [True: 46.3M, False: 9.34k]
  ------------------
  682|  46.6M|				p += len;
  683|  46.6M|				avail -= len;
  684|  46.6M|				continue;
  685|  46.6M|			}
  686|  46.6M|		} else {
  687|       |			/* A continuance line; the terminal
  688|       |			 * character of previous line was '\' character. */
  689|  1.60k|			if (bid_keyword_list(p, len, 0, 0) <= 0)
  ------------------
  |  Branch (689:8): [True: 6, False: 1.60k]
  ------------------
  690|      6|				break;
  691|  1.60k|			if (p[len-nl-1] != '\\') {
  ------------------
  |  Branch (691:8): [True: 814, False: 789]
  ------------------
  692|    814|				if (multiline == 1 &&
  ------------------
  |  Branch (692:9): [True: 24, False: 790]
  ------------------
  693|     24|				    ++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  626|     24|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (693:9): [True: 2, False: 22]
  ------------------
  694|      2|					break;
  695|    812|				multiline = 0;
  696|    812|			}
  697|  1.60k|			p += len;
  698|  1.60k|			avail -= len;
  699|  1.60k|			continue;
  700|  1.60k|		}
  701|  9.34k|		if (p[0] != '/') {
  ------------------
  |  Branch (701:7): [True: 5.18k, False: 4.16k]
  ------------------
  702|  5.18k|			int last_is_path, keywords;
  703|       |
  704|  5.18k|			keywords = bid_entry(p, len, nl, &last_is_path);
  705|  5.18k|			if (keywords >= 0) {
  ------------------
  |  Branch (705:8): [True: 4.44k, False: 735]
  ------------------
  706|  4.44k|				if (form_D == 0) {
  ------------------
  |  Branch (706:9): [True: 3.94k, False: 498]
  ------------------
  707|  3.94k|					if (last_is_path)
  ------------------
  |  Branch (707:10): [True: 60, False: 3.88k]
  ------------------
  708|     60|						form_D = 1;
  709|  3.88k|					else if (keywords > 0)
  ------------------
  |  Branch (709:15): [True: 348, False: 3.54k]
  ------------------
  710|       |						/* This line is not `form D'. */
  711|    348|						form_D = -1;
  712|  3.94k|				} else if (form_D == 1) {
  ------------------
  |  Branch (712:16): [True: 66, False: 432]
  ------------------
  713|     66|					if (!last_is_path && keywords > 0)
  ------------------
  |  Branch (713:10): [True: 36, False: 30]
  |  Branch (713:27): [True: 0, False: 36]
  ------------------
  714|       |						/* This this is not `form D'
  715|       |						 * and we cannot accept mixed
  716|       |						 * format. */
  717|      0|						break;
  718|     66|				}
  719|  4.44k|				if (!last_is_path && p[len-nl-1] == '\\')
  ------------------
  |  Branch (719:9): [True: 4.34k, False: 104]
  |  Branch (719:26): [True: 35, False: 4.30k]
  ------------------
  720|       |					/* This line continues. */
  721|     35|					multiline = 1;
  722|  4.41k|				else {
  723|       |					/* We've got plenty of correct lines
  724|       |					 * to assume that this file is an mtree
  725|       |					 * format. */
  726|  4.41k|					if (++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  626|  4.41k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (726:10): [True: 1.14k, False: 3.26k]
  ------------------
  727|  1.14k|						break;
  728|  4.41k|				}
  729|  4.44k|			} else
  730|    735|				break;
  731|  5.18k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (731:14): [True: 4.12k, False: 40]
  |  Branch (731:25): [True: 1.67k, False: 2.44k]
  ------------------
  732|  1.67k|			if (bid_keyword_list(p+4, len-4, 0, 0) <= 0)
  ------------------
  |  Branch (732:8): [True: 20, False: 1.65k]
  ------------------
  733|     20|				break;
  734|       |			/* This line continues. */
  735|  1.65k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (735:8): [True: 24, False: 1.62k]
  ------------------
  736|     24|				multiline = 2;
  737|  2.48k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (737:14): [True: 2.44k, False: 42]
  |  Branch (737:25): [True: 2.38k, False: 63]
  ------------------
  738|  2.38k|			if (bid_keyword_list(p+6, len-6, 1, 0) <= 0)
  ------------------
  |  Branch (738:8): [True: 5, False: 2.37k]
  ------------------
  739|      5|				break;
  740|       |			/* This line continues. */
  741|  2.37k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (741:8): [True: 770, False: 1.60k]
  ------------------
  742|    770|				multiline = 2;
  743|  2.37k|		} else
  744|    105|			break;
  745|       |
  746|       |		/* Test next line. */
  747|  7.33k|		p += len;
  748|  7.33k|		avail -= len;
  749|  7.33k|	}
  750|  12.3k|	if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) {
  ------------------
  |  |  626|  24.6k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (750:6): [True: 1.14k, False: 11.1k]
  |  Branch (750:37): [True: 819, False: 10.3k]
  |  Branch (750:54): [True: 88, False: 731]
  ------------------
  751|  1.23k|		if (is_form_d != NULL) {
  ------------------
  |  Branch (751:7): [True: 583, False: 650]
  ------------------
  752|    583|			if (form_D == 1)
  ------------------
  |  Branch (752:8): [True: 30, False: 553]
  ------------------
  753|     30|				*is_form_d = 1;
  754|    583|		}
  755|  1.23k|		return (32);
  756|  1.23k|	}
  757|       |
  758|  11.0k|	return (0);
  759|  12.3k|}
archive_read_support_format_mtree.c:next_line:
  329|  46.6M|{
  330|  46.6M|	ssize_t len;
  331|  46.6M|	int quit;
  332|       |	
  333|  46.6M|	quit = 0;
  334|  46.6M|	if (*avail == 0) {
  ------------------
  |  Branch (334:6): [True: 73, False: 46.6M]
  ------------------
  335|     73|		*nl = 0;
  336|     73|		len = 0;
  337|     73|	} else
  338|  46.6M|		len = get_line_size(*b, *avail, nl);
  339|       |	/*
  340|       |	 * Read bytes more while it does not reach the end of line.
  341|       |	 */
  342|  46.6M|	while (*nl == 0 && len == *avail && !quit) {
  ------------------
  |  Branch (342:9): [True: 10.4k, False: 46.6M]
  |  Branch (342:21): [True: 377, False: 10.0k]
  |  Branch (342:38): [True: 367, False: 10]
  ------------------
  343|    367|		ssize_t diff = *ravail - *avail;
  344|    367|		size_t nbytes_req = ((size_t)*ravail + 1023) & ~1023U;
  345|    367|		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|    367|		if (len >= MAX_LINE_LEN)
  ------------------
  |  |   84|    367|#define	MAX_LINE_LEN		(1024 * 1024)
  ------------------
  |  Branch (352:7): [True: 10, False: 357]
  ------------------
  353|     10|			return (-1);
  354|       |
  355|       |		/* Increase reading bytes if it is not enough for at least
  356|       |		 * two new lines. */
  357|    357|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (357:7): [True: 150, False: 207]
  ------------------
  358|    150|			nbytes_req <<= 1;
  359|       |
  360|    357|		*b = __archive_read_ahead(a, nbytes_req, avail);
  361|    357|		if (*b == NULL) {
  ------------------
  |  Branch (361:7): [True: 241, False: 116]
  ------------------
  362|    241|			if (*ravail >= *avail)
  ------------------
  |  Branch (362:8): [True: 224, False: 17]
  ------------------
  363|    224|				return (0);
  364|       |			/* Reading bytes reaches the end of file. */
  365|     17|			*b = __archive_read_ahead(a, *avail, avail);
  366|     17|			quit = 1;
  367|     17|		}
  368|    133|		*ravail = *avail;
  369|    133|		*b += diff;
  370|    133|		*avail -= diff;
  371|    133|		tested = len;/* Skip some bytes we already determined. */
  372|    133|		len = get_line_size(*b + len, *avail - len, nl);
  373|    133|		if (len >= 0)
  ------------------
  |  Branch (373:7): [True: 125, False: 8]
  ------------------
  374|    125|			len += tested;
  375|    133|	}
  376|  46.6M|	return (len);
  377|  46.6M|}
archive_read_support_format_mtree.c:get_line_size:
  285|  46.6M|{
  286|  46.6M|	ssize_t len;
  287|       |
  288|  46.6M|	len = 0;
  289|  67.7M|	while (len < avail) {
  ------------------
  |  Branch (289:9): [True: 67.7M, False: 304]
  ------------------
  290|  67.7M|		switch (*b) {
  291|  10.0k|		case '\0':/* Non-ascii character or control character. */
  ------------------
  |  Branch (291:3): [True: 10.0k, False: 67.7M]
  ------------------
  292|  10.0k|			if (nlsize != NULL)
  ------------------
  |  Branch (292:8): [True: 10.0k, False: 0]
  ------------------
  293|  10.0k|				*nlsize = 0;
  294|  10.0k|			return (-1);
  295|  46.4M|		case '\r':
  ------------------
  |  Branch (295:3): [True: 46.4M, False: 21.3M]
  ------------------
  296|  46.4M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (296:8): [True: 46.4M, False: 40]
  |  Branch (296:25): [True: 1.65k, False: 46.4M]
  ------------------
  297|  1.65k|				if (nlsize != NULL)
  ------------------
  |  Branch (297:9): [True: 1.65k, False: 0]
  ------------------
  298|  1.65k|					*nlsize = 2;
  299|  1.65k|				return (len+2);
  300|  1.65k|			}
  301|       |			/* FALL THROUGH */
  302|  46.6M|		case '\n':
  ------------------
  |  Branch (302:3): [True: 226k, False: 67.5M]
  ------------------
  303|  46.6M|			if (nlsize != NULL)
  ------------------
  |  Branch (303:8): [True: 46.6M, False: 0]
  ------------------
  304|  46.6M|				*nlsize = 1;
  305|  46.6M|			return (len+1);
  306|  21.1M|		default:
  ------------------
  |  Branch (306:3): [True: 21.1M, False: 46.6M]
  ------------------
  307|  21.1M|			b++;
  308|  21.1M|			len++;
  309|  21.1M|			break;
  310|  67.7M|		}
  311|  67.7M|	}
  312|    304|	if (nlsize != NULL)
  ------------------
  |  Branch (312:6): [True: 304, False: 0]
  ------------------
  313|    304|		*nlsize = 0;
  314|    304|	return (avail);
  315|  46.6M|}
archive_read_support_format_mtree.c:bid_keyword_list:
  486|  10.2k|{
  487|  10.2k|	int l;
  488|  10.2k|	int keycnt = 0;
  489|       |
  490|  15.3k|	while (len > 0 && *p) {
  ------------------
  |  Branch (490:9): [True: 13.7k, False: 1.54k]
  |  Branch (490:20): [True: 13.7k, False: 0]
  ------------------
  491|  13.7k|		int blank = 0;
  492|       |
  493|       |		/* Test whether there are blank characters in the line. */
  494|  27.2k|		while (len >0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (494:10): [True: 27.1k, False: 104]
  |  Branch (494:21): [True: 10.7k, False: 16.4k]
  |  Branch (494:34): [True: 2.73k, False: 13.6k]
  ------------------
  495|  13.4k|			++p;
  496|  13.4k|			--len;
  497|  13.4k|			blank = 1;
  498|  13.4k|		}
  499|  13.7k|		if (*p == '\n' || *p == '\r')
  ------------------
  |  Branch (499:7): [True: 3.70k, False: 10.0k]
  |  Branch (499:21): [True: 1.63k, False: 8.43k]
  ------------------
  500|  5.34k|			break;
  501|  8.43k|		if (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r'))
  ------------------
  |  Branch (501:7): [True: 789, False: 7.64k]
  |  Branch (501:24): [True: 522, False: 267]
  |  Branch (501:40): [True: 267, False: 0]
  ------------------
  502|    789|			break;
  503|  7.64k|		if (!blank && !last_is_path) /* No blank character. */
  ------------------
  |  Branch (503:7): [True: 109, False: 7.53k]
  |  Branch (503:17): [True: 2, False: 107]
  ------------------
  504|      2|			return (-1);
  505|  7.63k|		if (last_is_path && len == 0)
  ------------------
  |  Branch (505:7): [True: 217, False: 7.42k]
  |  Branch (505:23): [True: 104, False: 113]
  ------------------
  506|    104|				return (keycnt);
  507|       |
  508|  7.53k|		if (unset) {
  ------------------
  |  Branch (508:7): [True: 2.53k, False: 5.00k]
  ------------------
  509|  2.53k|			l = bid_keycmp(p, "all", len);
  510|  2.53k|			if (l > 0)
  ------------------
  |  Branch (510:8): [True: 2.29k, False: 241]
  ------------------
  511|  2.29k|				return (1);
  512|  2.53k|		}
  513|       |		/* Test whether there is a correct key in the line. */
  514|  5.24k|		l = bid_keyword(p, len);
  515|  5.24k|		if (l == 0)
  ------------------
  |  Branch (515:7): [True: 135, False: 5.10k]
  ------------------
  516|    135|			return (-1);/* Unknown keyword was found. */
  517|  5.10k|		p += l;
  518|  5.10k|		len -= l;
  519|  5.10k|		keycnt++;
  520|       |
  521|       |		/* Skip value */
  522|  5.10k|		if (*p == '=') {
  ------------------
  |  Branch (522:7): [True: 2.30k, False: 2.80k]
  ------------------
  523|  2.30k|			int value = 0;
  524|  2.30k|			++p;
  525|  2.30k|			--len;
  526|  29.1k|			while (len > 0 && *p != ' ' && *p != '\t') {
  ------------------
  |  Branch (526:11): [True: 27.6k, False: 1.54k]
  |  Branch (526:22): [True: 27.2k, False: 445]
  |  Branch (526:35): [True: 26.8k, False: 312]
  ------------------
  527|  26.8k|				++p;
  528|  26.8k|				--len;
  529|  26.8k|				value = 1;
  530|  26.8k|			}
  531|       |			/* A keyword should have a value unless this is
  532|       |			 * an "/unset" operation. */ 
  533|  2.30k|			if (!unset && value == 0)
  ------------------
  |  Branch (533:8): [True: 2.06k, False: 237]
  |  Branch (533:18): [True: 0, False: 2.06k]
  ------------------
  534|      0|				return (-1);
  535|  2.30k|		}
  536|  5.10k|	}
  537|  7.68k|	return (keycnt);
  538|  10.2k|}
archive_read_support_format_mtree.c:bid_keycmp:
  386|  9.65k|{
  387|  9.65k|	int match_len = 0;
  388|       |
  389|  41.2k|	while (len > 0 && *p && *key) {
  ------------------
  |  Branch (389:9): [True: 41.2k, False: 0]
  |  Branch (389:20): [True: 41.2k, False: 0]
  |  Branch (389:26): [True: 33.6k, False: 7.61k]
  ------------------
  390|  33.6k|		if (*p == *key) {
  ------------------
  |  Branch (390:7): [True: 31.5k, False: 2.04k]
  ------------------
  391|  31.5k|			--len;
  392|  31.5k|			++p;
  393|  31.5k|			++key;
  394|  31.5k|			++match_len;
  395|  31.5k|			continue;
  396|  31.5k|		}
  397|  2.04k|		return (0);/* Not match */
  398|  33.6k|	}
  399|  7.61k|	if (*key != '\0')
  ------------------
  |  Branch (399:6): [True: 0, False: 7.61k]
  ------------------
  400|      0|		return (0);/* Not match */
  401|       |
  402|       |	/* A following character should be specified characters */
  403|  7.61k|	if (p[0] == '=' || p[0] == ' ' || p[0] == '\t' ||
  ------------------
  |  Branch (403:6): [True: 2.40k, False: 5.20k]
  |  Branch (403:21): [True: 358, False: 4.85k]
  |  Branch (403:36): [True: 817, False: 4.03k]
  ------------------
  404|  4.03k|	    p[0] == '\n' || p[0] == '\r' ||
  ------------------
  |  Branch (404:6): [True: 1.47k, False: 2.55k]
  |  Branch (404:22): [True: 780, False: 1.77k]
  ------------------
  405|  1.77k|	   (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r')))
  ------------------
  |  Branch (405:6): [True: 1.56k, False: 216]
  |  Branch (405:23): [True: 1.24k, False: 316]
  |  Branch (405:39): [True: 315, False: 1]
  ------------------
  406|  7.40k|		return (match_len);
  407|    217|	return (0);/* Not match */
  408|  7.61k|}
archive_read_support_format_mtree.c:bid_keyword:
  417|  5.24k|{
  418|  5.24k|	static const char * const keys_c[] = {
  419|  5.24k|		"content", "contents", "cksum", NULL
  420|  5.24k|	};
  421|  5.24k|	static const char * const keys_df[] = {
  422|  5.24k|		"device", "flags", NULL
  423|  5.24k|	};
  424|  5.24k|	static const char * const keys_g[] = {
  425|  5.24k|		"gid", "gname", NULL
  426|  5.24k|	};
  427|  5.24k|	static const char * const keys_il[] = {
  428|  5.24k|		"ignore", "inode", "link", NULL
  429|  5.24k|	};
  430|  5.24k|	static const char * const keys_m[] = {
  431|  5.24k|		"md5", "md5digest", "mode", NULL
  432|  5.24k|	};
  433|  5.24k|	static const char * const keys_no[] = {
  434|  5.24k|		"nlink", "nochange", "optional", NULL
  435|  5.24k|	};
  436|  5.24k|	static const char * const keys_r[] = {
  437|  5.24k|		"resdevice", "rmd160", "rmd160digest", NULL
  438|  5.24k|	};
  439|  5.24k|	static const char * const keys_s[] = {
  440|  5.24k|		"sha1", "sha1digest",
  441|  5.24k|		"sha256", "sha256digest",
  442|  5.24k|		"sha384", "sha384digest",
  443|  5.24k|		"sha512", "sha512digest",
  444|  5.24k|		"size", NULL
  445|  5.24k|	};
  446|  5.24k|	static const char * const keys_t[] = {
  447|  5.24k|		"tags", "time", "type", NULL
  448|  5.24k|	};
  449|  5.24k|	static const char * const keys_u[] = {
  450|  5.24k|		"uid", "uname",	NULL
  451|  5.24k|	};
  452|  5.24k|	const char * const *keys;
  453|  5.24k|	int i;
  454|       |
  455|  5.24k|	switch (*p) {
  456|     95|	case 'c': keys = keys_c; break;
  ------------------
  |  Branch (456:2): [True: 95, False: 5.14k]
  ------------------
  457|    280|	case 'd': case 'f': keys = keys_df; break;
  ------------------
  |  Branch (457:2): [True: 196, False: 5.04k]
  |  Branch (457:12): [True: 84, False: 5.15k]
  ------------------
  458|  3.27k|	case 'g': keys = keys_g; break;
  ------------------
  |  Branch (458:2): [True: 3.27k, False: 1.96k]
  ------------------
  459|    157|	case 'i': case 'l': keys = keys_il; break;
  ------------------
  |  Branch (459:2): [True: 143, False: 5.09k]
  |  Branch (459:12): [True: 14, False: 5.22k]
  ------------------
  460|     48|	case 'm': keys = keys_m; break;
  ------------------
  |  Branch (460:2): [True: 48, False: 5.19k]
  ------------------
  461|     49|	case 'n': case 'o': keys = keys_no; break;
  ------------------
  |  Branch (461:2): [True: 40, False: 5.20k]
  |  Branch (461:12): [True: 9, False: 5.23k]
  ------------------
  462|    315|	case 'r': keys = keys_r; break;
  ------------------
  |  Branch (462:2): [True: 315, False: 4.92k]
  ------------------
  463|    276|	case 's': keys = keys_s; break;
  ------------------
  |  Branch (463:2): [True: 276, False: 4.96k]
  ------------------
  464|    319|	case 't': keys = keys_t; break;
  ------------------
  |  Branch (464:2): [True: 319, False: 4.92k]
  ------------------
  465|    342|	case 'u': keys = keys_u; break;
  ------------------
  |  Branch (465:2): [True: 342, False: 4.90k]
  ------------------
  466|     82|	default: return (0);/* Unknown key */
  ------------------
  |  Branch (466:2): [True: 82, False: 5.16k]
  ------------------
  467|  5.24k|	}
  468|       |
  469|  7.17k|	for (i = 0; keys[i] != NULL; i++) {
  ------------------
  |  Branch (469:14): [True: 7.12k, False: 53]
  ------------------
  470|  7.12k|		int l = bid_keycmp(p, keys[i], len);
  471|  7.12k|		if (l > 0)
  ------------------
  |  Branch (471:7): [True: 5.10k, False: 2.01k]
  ------------------
  472|  5.10k|			return (l);
  473|  7.12k|	}
  474|     53|	return (0);/* Unknown key */
  475|  5.16k|}
archive_read_support_format_mtree.c:bid_entry:
  542|  5.18k|{
  543|  5.18k|	int f = 0;
  544|  5.18k|	static const unsigned char safe_char[256] = {
  545|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
  546|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
  547|       |		/* !"$%&'()*+,-./  EXCLUSION:( )(#) */
  548|  5.18k|		0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
  549|       |		/* 0123456789:;<>?  EXCLUSION:(=) */
  550|  5.18k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
  551|       |		/* @ABCDEFGHIJKLMNO */
  552|  5.18k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
  553|       |		/* PQRSTUVWXYZ[\]^_  */
  554|  5.18k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
  555|       |		/* `abcdefghijklmno */
  556|  5.18k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
  557|       |		/* pqrstuvwxyz{|}~ */
  558|  5.18k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
  559|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
  560|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
  561|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
  562|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
  563|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
  564|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
  565|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
  566|  5.18k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
  567|  5.18k|	};
  568|  5.18k|	ssize_t ll;
  569|  5.18k|	const char *pp = p;
  570|  5.18k|	const char * const pp_end = pp + len;
  571|       |
  572|  5.18k|	*last_is_path = 0;
  573|       |	/*
  574|       |	 * Skip the path-name which is quoted.
  575|       |	 */
  576|  1.60M|	for (;pp < pp_end; ++pp) {
  ------------------
  |  Branch (576:8): [True: 1.60M, False: 0]
  ------------------
  577|  1.60M|		if (!safe_char[*(const unsigned char *)pp]) {
  ------------------
  |  Branch (577:7): [True: 5.18k, False: 1.60M]
  ------------------
  578|  5.18k|			if (*pp != ' ' && *pp != '\t' && *pp != '\r'
  ------------------
  |  Branch (578:8): [True: 4.81k, False: 370]
  |  Branch (578:22): [True: 4.30k, False: 507]
  |  Branch (578:37): [True: 3.41k, False: 890]
  ------------------
  579|  3.41k|			    && *pp != '\n')
  ------------------
  |  Branch (579:11): [True: 736, False: 2.67k]
  ------------------
  580|    736|				f = 0;
  581|  5.18k|			break;
  582|  5.18k|		}
  583|  1.60M|		f = 1;
  584|  1.60M|	}
  585|  5.18k|	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|  5.18k|	if (f == 0) {
  ------------------
  |  Branch (590:6): [True: 736, False: 4.44k]
  ------------------
  591|    736|		const char *pb = p + len - nl;
  592|    736|		int name_len = 0;
  593|    736|		int slash;
  594|       |
  595|       |		/* The form D accepts only a single line for an entry. */
  596|    736|		if (pb-2 >= p &&
  ------------------
  |  Branch (596:7): [True: 729, False: 7]
  ------------------
  597|    729|		    pb[-1] == '\\' && (pb[-2] == ' ' || pb[-2] == '\t'))
  ------------------
  |  Branch (597:7): [True: 1, False: 728]
  |  Branch (597:26): [True: 0, False: 1]
  |  Branch (597:43): [True: 0, False: 1]
  ------------------
  598|      0|			return (-1);
  599|    736|		if (pb-1 >= p && pb[-1] == '\\')
  ------------------
  |  Branch (599:7): [True: 736, False: 0]
  |  Branch (599:20): [True: 1, False: 735]
  ------------------
  600|      1|			return (-1);
  601|       |
  602|    735|		slash = 0;
  603|   752k|		while (p <= --pb && *pb != ' ' && *pb != '\t') {
  ------------------
  |  Branch (603:10): [True: 752k, False: 0]
  |  Branch (603:23): [True: 752k, False: 41]
  |  Branch (603:37): [True: 752k, False: 105]
  ------------------
  604|   752k|			if (!safe_char[*(const unsigned char *)pb])
  ------------------
  |  Branch (604:8): [True: 589, False: 751k]
  ------------------
  605|    589|				return (-1);
  606|   751k|			name_len++;
  607|       |			/* The pathname should have a slash in this
  608|       |			 * format. */
  609|   751k|			if (*pb == '/')
  ------------------
  |  Branch (609:8): [True: 411, False: 751k]
  ------------------
  610|    411|				slash = 1;
  611|   751k|		}
  612|    146|		if (name_len == 0 || slash == 0)
  ------------------
  |  Branch (612:7): [True: 23, False: 123]
  |  Branch (612:24): [True: 16, False: 107]
  ------------------
  613|     39|			return (-1);
  614|       |		/* If '/' is placed at the first in this field, this is not
  615|       |		 * a valid filename. */
  616|    107|		if (pb[1] == '/')
  ------------------
  |  Branch (616:7): [True: 0, False: 107]
  ------------------
  617|      0|			return (-1);
  618|    107|		ll = len - nl - name_len;
  619|    107|		pp = p;
  620|    107|		*last_is_path = 1;
  621|    107|	}
  622|       |
  623|  4.55k|	return (bid_keyword_list(pp, ll, 0, *last_is_path));
  624|  5.18k|}
archive_read_support_format_mtree.c:read_header:
 1077|  35.9k|{
 1078|  35.9k|	struct mtree *mtree = a->format->data;
 1079|  35.9k|	int r, use_next;
 1080|       |
 1081|  35.9k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1081:6): [True: 0, False: 35.9k]
  ------------------
 1082|      0|		close(mtree->fd);
 1083|      0|		mtree->fd = -1;
 1084|      0|	}
 1085|       |
 1086|  35.9k|	if (mtree->entries == NULL) {
  ------------------
  |  Branch (1086:6): [True: 606, False: 35.2k]
  ------------------
 1087|    606|		mtree->resolver = archive_entry_linkresolver_new();
 1088|    606|		if (mtree->resolver == NULL)
  ------------------
  |  Branch (1088:7): [True: 0, False: 606]
  ------------------
 1089|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1090|    606|		archive_entry_linkresolver_set_strategy(mtree->resolver,
 1091|    606|		    ARCHIVE_FORMAT_MTREE);
  ------------------
  |  |  379|    606|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1092|    606|		r = read_mtree(a, mtree);
 1093|    606|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    606|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1093:7): [True: 50, False: 556]
  ------------------
 1094|     50|			return (r);
 1095|    606|	}
 1096|       |
 1097|  35.8k|	a->archive.archive_format = mtree->archive_format;
 1098|  35.8k|	a->archive.archive_format_name = mtree->archive_format_name;
 1099|       |
 1100|  76.1k|	for (;;) {
 1101|  76.1k|		if (mtree->this_entry == NULL)
  ------------------
  |  Branch (1101:7): [True: 556, False: 75.6k]
  ------------------
 1102|    556|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    556|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1103|  75.6k|		if (strcmp(mtree->this_entry->name, "..") == 0) {
  ------------------
  |  Branch (1103:7): [True: 1.83k, False: 73.7k]
  ------------------
 1104|  1.83k|			mtree->this_entry->used = 1;
 1105|  1.83k|			if (archive_strlen(&mtree->current_dir) > 0) {
  ------------------
  |  |  178|  1.83k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1105:8): [True: 1.60k, False: 233]
  ------------------
 1106|       |				/* Roll back current path. */
 1107|  1.60k|				archive_string_dirname(&mtree->current_dir);
 1108|  1.60k|				if (strcmp(mtree->current_dir.s, ".") == 0)
  ------------------
  |  Branch (1108:9): [True: 784, False: 821]
  ------------------
 1109|    784|					archive_string_empty(&mtree->current_dir);
  ------------------
  |  |  181|    784|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1110|  1.60k|			}
 1111|  1.83k|		}
 1112|  75.6k|		if (!mtree->this_entry->used) {
  ------------------
  |  Branch (1112:7): [True: 35.2k, False: 40.3k]
  ------------------
 1113|  35.2k|			use_next = 0;
 1114|  35.2k|			r = parse_file(a, entry, mtree, mtree->this_entry,
 1115|  35.2k|				&use_next);
 1116|  35.2k|			if (use_next == 0)
  ------------------
  |  Branch (1116:8): [True: 35.2k, False: 0]
  ------------------
 1117|  35.2k|				return (r);
 1118|  35.2k|		}
 1119|  40.3k|		mtree->this_entry = mtree->this_entry->next;
 1120|  40.3k|	}
 1121|  35.8k|}
archive_read_support_format_mtree.c:read_mtree:
  996|    606|{
  997|    606|	ssize_t len;
  998|    606|	uintmax_t counter;
  999|    606|	char *p, *s;
 1000|    606|	struct mtree_option *global;
 1001|    606|	struct mtree_entry *last_entry;
 1002|    606|	int r, is_form_d;
 1003|       |
 1004|    606|	mtree->archive_format = ARCHIVE_FORMAT_MTREE;
  ------------------
  |  |  379|    606|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1005|    606|	mtree->archive_format_name = "mtree";
 1006|       |
 1007|    606|	global = NULL;
 1008|    606|	last_entry = NULL;
 1009|       |
 1010|    606|	(void)detect_form(a, &is_form_d);
 1011|       |
 1012|   210k|	for (counter = 1; ; ++counter) {
 1013|   210k|		r = ARCHIVE_OK;
  ------------------
  |  |  233|   210k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1014|   210k|		len = readline(a, mtree, &p, 65536);
 1015|   210k|		if (len == 0) {
  ------------------
  |  Branch (1015:7): [True: 556, False: 209k]
  ------------------
 1016|    556|			mtree->this_entry = mtree->entries;
 1017|    556|			free_options(global);
 1018|    556|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    556|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1019|    556|		}
 1020|   209k|		if (len < 0) {
  ------------------
  |  Branch (1020:7): [True: 8, False: 209k]
  ------------------
 1021|      8|			free_options(global);
 1022|      8|			return ((int)len);
 1023|      8|		}
 1024|       |		/* Leading whitespace is never significant, ignore it. */
 1025|   210k|		while (*p == ' ' || *p == '\t') {
  ------------------
  |  Branch (1025:10): [True: 276, False: 210k]
  |  Branch (1025:23): [True: 168, False: 209k]
  ------------------
 1026|    444|			++p;
 1027|    444|			--len;
 1028|    444|		}
 1029|       |		/* Skip content lines and blank lines. */
 1030|   209k|		if (*p == '#')
  ------------------
  |  Branch (1030:7): [True: 672, False: 209k]
  ------------------
 1031|    672|			continue;
 1032|   209k|		if (*p == '\r' || *p == '\n' || *p == '\0')
  ------------------
  |  Branch (1032:7): [True: 3, False: 209k]
  |  Branch (1032:21): [True: 164k, False: 45.0k]
  |  Branch (1032:35): [True: 0, False: 45.0k]
  ------------------
 1033|   164k|			continue;
 1034|       |		/* Non-printable characters are not allowed */
 1035|  1.54M|		for (s = p;s < p + len - 1; s++) {
  ------------------
  |  Branch (1035:14): [True: 1.50M, False: 45.0k]
  ------------------
 1036|  1.50M|			if (!isprint((unsigned char)*s) && *s != '\t') {
  ------------------
  |  Branch (1036:8): [True: 12.8k, False: 1.48M]
  |  Branch (1036:39): [True: 28, False: 12.8k]
  ------------------
 1037|     28|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     28|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1038|     28|					"Non-printable character 0x%02X", (unsigned char)(*s));
 1039|     28|				r = ARCHIVE_FATAL;
  ------------------
  |  |  239|     28|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1040|     28|				break;
 1041|     28|			}
 1042|  1.50M|		}
 1043|  45.0k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  45.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1043:7): [True: 28, False: 45.0k]
  ------------------
 1044|     28|			break;
 1045|  45.0k|		if (*p != '/') {
  ------------------
  |  Branch (1045:7): [True: 41.6k, False: 3.39k]
  ------------------
 1046|  41.6k|			r = process_add_entry(a, mtree, &global, p, len,
 1047|  41.6k|			    &last_entry, is_form_d);
 1048|  41.6k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (1048:14): [True: 3.39k, False: 1]
  |  Branch (1048:25): [True: 2.03k, False: 1.36k]
  ------------------
 1049|  2.03k|			if (p[4] != ' ' && p[4] != '\t')
  ------------------
  |  Branch (1049:8): [True: 669, False: 1.36k]
  |  Branch (1049:23): [True: 0, False: 669]
  ------------------
 1050|      0|				break;
 1051|  2.03k|			r = process_global_set(a, &global, p);
 1052|  2.03k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (1052:14): [True: 1.35k, False: 2]
  |  Branch (1052:25): [True: 1.35k, False: 6]
  ------------------
 1053|  1.35k|			if (p[6] != ' ' && p[6] != '\t')
  ------------------
  |  Branch (1053:8): [True: 124, False: 1.22k]
  |  Branch (1053:23): [True: 0, False: 124]
  ------------------
 1054|      0|				break;
 1055|  1.35k|			r = process_global_unset(a, &global, p);
 1056|  1.35k|		} else
 1057|      8|			break;
 1058|       |
 1059|  45.0k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  45.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1059:7): [True: 6, False: 45.0k]
  ------------------
 1060|      6|			free_options(global);
 1061|      6|			return r;
 1062|      6|		}
 1063|  45.0k|	}
 1064|       |
 1065|     36|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     36|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1066|     36|	    "Can't parse line %ju", counter);
 1067|     36|	free_options(global);
 1068|     36|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1069|    606|}
archive_read_support_format_mtree.c:readline:
 2041|   210k|{
 2042|   210k|	ssize_t bytes_read;
 2043|   210k|	ssize_t total_size = 0;
 2044|   210k|	ssize_t find_off = 0;
 2045|   210k|	const void *nl, *t;
 2046|   210k|	char *u;
 2047|       |
 2048|       |	/* Accumulate line in a line buffer. */
 2049|   216k|	for (;;) {
 2050|       |		/* Read some more. */
 2051|   216k|		t = __archive_read_ahead(a, 1, &bytes_read);
 2052|   216k|		if (t == NULL)
  ------------------
  |  Branch (2052:7): [True: 556, False: 216k]
  ------------------
 2053|    556|			return (0);
 2054|   216k|		if (bytes_read < 0)
  ------------------
  |  Branch (2054:7): [True: 0, False: 216k]
  ------------------
 2055|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2056|   216k|		nl = memchr(t, '\n', bytes_read);
 2057|       |		/* If we found '\n', trim the read to end exactly there. */
 2058|   216k|		if (nl != NULL) {
  ------------------
  |  Branch (2058:7): [True: 215k, False: 393]
  ------------------
 2059|   215k|			bytes_read = ((const char *)nl) - ((const char *)t) + 1;
 2060|   215k|		}
 2061|   216k|		if (total_size + bytes_read + 1 > limit) {
  ------------------
  |  Branch (2061:7): [True: 8, False: 216k]
  ------------------
 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|   216k|		if (archive_string_ensure(&mtree->line,
  ------------------
  |  Branch (2067:7): [True: 0, False: 216k]
  ------------------
 2068|   216k|			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|   216k|		memcpy(mtree->line.s + total_size, t, bytes_read);
 2075|   216k|		__archive_read_consume(a, bytes_read);
 2076|   216k|		total_size += bytes_read;
 2077|   216k|		mtree->line.s[total_size] = '\0';
 2078|       |
 2079|  2.01M|		for (u = mtree->line.s + find_off; *u; ++u) {
  ------------------
  |  Branch (2079:38): [True: 2.00M, False: 5.37k]
  ------------------
 2080|  2.00M|			if (u[0] == '\n') {
  ------------------
  |  Branch (2080:8): [True: 209k, False: 1.79M]
  ------------------
 2081|       |				/* Ends with unescaped newline. */
 2082|       |				/* Check if preceded by '\r' for CRLF handling */
 2083|   209k|				if (u > mtree->line.s && u[-1] == '\r') {
  ------------------
  |  Branch (2083:9): [True: 45.7k, False: 164k]
  |  Branch (2083:30): [True: 315, False: 45.4k]
  ------------------
 2084|       |					/* CRLF ending - remove the '\r' */
 2085|    315|					u[-1] = '\n';
 2086|    315|					u[0] = '\0';
 2087|    315|					total_size--;
 2088|    315|				}
 2089|   209k|				*start = mtree->line.s;
 2090|   209k|				return total_size;
 2091|  1.79M|			} else if (u[0] == '#') {
  ------------------
  |  Branch (2091:15): [True: 10.5k, False: 1.78M]
  ------------------
 2092|       |				/* Ends with comment sequence #...\n */
 2093|  10.5k|				if (nl == NULL) {
  ------------------
  |  Branch (2093:9): [True: 3, False: 10.5k]
  ------------------
 2094|       |					/* But we've not found the \n yet */
 2095|      3|					break;
 2096|      3|				}
 2097|  1.78M|			} else if (u[0] == '\\') {
  ------------------
  |  Branch (2097:15): [True: 6.54k, False: 1.77M]
  ------------------
 2098|  6.54k|				if (u[1] == '\n') {
  ------------------
  |  Branch (2098:9): [True: 679, False: 5.86k]
  ------------------
 2099|       |					/* Trim escaped newline. */
 2100|    679|					total_size -= 2;
 2101|    679|					mtree->line.s[total_size] = '\0';
 2102|    679|					break;
 2103|  5.86k|				} else if (u[1] == '\r' && u[2] == '\n') {
  ------------------
  |  Branch (2103:16): [True: 344, False: 5.51k]
  |  Branch (2103:32): [True: 157, False: 187]
  ------------------
 2104|       |					/* Trim escaped CRLF. */
 2105|    157|					total_size -= 3;
 2106|    157|					mtree->line.s[total_size] = '\0';
 2107|    157|					break;
 2108|  5.70k|				} else if (u[1] != '\0') {
  ------------------
  |  Branch (2108:16): [True: 5.70k, False: 3]
  ------------------
 2109|       |					/* Skip the two-char escape sequence */
 2110|  5.70k|					++u;
 2111|  5.70k|				}
 2112|  6.54k|			}
 2113|  2.00M|		}
 2114|  6.21k|		find_off = u - mtree->line.s;
 2115|  6.21k|	}
 2116|   210k|}
archive_read_support_format_mtree.c:process_add_entry:
  882|  41.6k|{
  883|  41.6k|	struct mtree_entry *entry;
  884|  41.6k|	struct mtree_option *iter;
  885|  41.6k|	const char *next, *eq, *name, *end;
  886|  41.6k|	size_t name_len, len;
  887|  41.6k|	int r, i;
  888|       |
  889|  41.6k|	if ((entry = malloc(sizeof(*entry))) == NULL) {
  ------------------
  |  Branch (889:6): [True: 0, False: 41.6k]
  ------------------
  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|  41.6k|	entry->next = NULL;
  894|  41.6k|	entry->options = NULL;
  895|  41.6k|	entry->name = NULL;
  896|  41.6k|	entry->used = 0;
  897|  41.6k|	entry->full = 0;
  898|       |
  899|       |	/* Add this entry to list. */
  900|  41.6k|	if (*last_entry == NULL)
  ------------------
  |  Branch (900:6): [True: 589, False: 41.0k]
  ------------------
  901|    589|		mtree->entries = entry;
  902|  41.0k|	else
  903|  41.0k|		(*last_entry)->next = entry;
  904|  41.6k|	*last_entry = entry;
  905|       |
  906|  41.6k|	if (is_form_d) {
  ------------------
  |  Branch (906:6): [True: 1.28k, False: 40.3k]
  ------------------
  907|       |		/* Filename is last item on line. */
  908|       |		/* Adjust line_len to trim trailing whitespace */
  909|  2.87k|		while (line_len > 0) {
  ------------------
  |  Branch (909:10): [True: 2.87k, False: 0]
  ------------------
  910|  2.87k|			char last_character = line[line_len - 1];
  911|  2.87k|			if (last_character == '\r'
  ------------------
  |  Branch (911:8): [True: 0, False: 2.87k]
  ------------------
  912|  2.87k|			    || last_character == '\n'
  ------------------
  |  Branch (912:11): [True: 1.28k, False: 1.58k]
  ------------------
  913|  1.58k|			    || last_character == '\t'
  ------------------
  |  Branch (913:11): [True: 152, False: 1.43k]
  ------------------
  914|  1.58k|			    || last_character == ' ') {
  ------------------
  |  Branch (914:11): [True: 144, False: 1.28k]
  ------------------
  915|  1.58k|				line_len--;
  916|  1.58k|			} else {
  917|  1.28k|				break;
  918|  1.28k|			}
  919|  2.87k|		}
  920|       |		/* Name starts after the last whitespace separator */
  921|  1.28k|		name = line;
  922|  13.9k|		for (i = 0; i < line_len; i++) {
  ------------------
  |  Branch (922:15): [True: 12.7k, False: 1.28k]
  ------------------
  923|  12.7k|			if (line[i] == '\r'
  ------------------
  |  Branch (923:8): [True: 0, False: 12.7k]
  ------------------
  924|  12.7k|			    || line[i] == '\n'
  ------------------
  |  Branch (924:11): [True: 0, False: 12.7k]
  ------------------
  925|  12.7k|			    || line[i] == '\t'
  ------------------
  |  Branch (925:11): [True: 713, False: 11.9k]
  ------------------
  926|  11.9k|			    || line[i] == ' ') {
  ------------------
  |  Branch (926:11): [True: 521, False: 11.4k]
  ------------------
  927|  1.23k|				name = line + i + 1;
  928|  1.23k|			}
  929|  12.7k|		}
  930|  1.28k|		name_len = line + line_len - name;
  931|  1.28k|		end = name;
  932|  40.3k|	} else {
  933|       |		/* Filename is first item on line */
  934|  40.3k|		name_len = strcspn(line, " \t\r\n");
  935|  40.3k|		name = line;
  936|  40.3k|		line += name_len;
  937|  40.3k|		end = line + line_len;
  938|  40.3k|	}
  939|       |	/* name/name_len is the name within the line. */
  940|       |	/* line..end brackets the entire line except the name */
  941|       |
  942|  41.6k|	if ((entry->name = malloc(name_len + 1)) == NULL) {
  ------------------
  |  Branch (942:6): [True: 0, False: 41.6k]
  ------------------
  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|  41.6k|	memcpy(entry->name, name, name_len);
  948|  41.6k|	entry->name[name_len] = '\0';
  949|  41.6k|	parse_escapes(entry->name, entry);
  950|       |
  951|  41.6k|	entry->next_dup = NULL;
  952|  41.6k|	if (entry->full) {
  ------------------
  |  Branch (952:6): [True: 5.22k, False: 36.4k]
  ------------------
  953|  5.22k|		if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) {
  ------------------
  |  Branch (953:7): [True: 3.23k, False: 1.98k]
  ------------------
  954|  3.23k|			struct mtree_entry *alt;
  955|  3.23k|			alt = (struct mtree_entry *)__archive_rb_tree_find_node(
  956|  3.23k|			    &mtree->rbtree, entry->name);
  957|  3.23k|			if (alt != NULL) {
  ------------------
  |  Branch (957:8): [True: 3.23k, False: 0]
  ------------------
  958|   155k|				while (alt->next_dup)
  ------------------
  |  Branch (958:12): [True: 152k, False: 3.23k]
  ------------------
  959|   152k|					alt = alt->next_dup;
  960|  3.23k|				alt->next_dup = entry;
  961|  3.23k|			}
  962|  3.23k|		}
  963|  5.22k|	}
  964|       |
  965|  87.1k|	for (iter = *global; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (965:23): [True: 45.5k, False: 41.6k]
  ------------------
  966|  45.5k|		r = add_option(a, &entry->options, iter->value,
  967|  45.5k|		    strlen(iter->value));
  968|  45.5k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  45.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (968:7): [True: 0, False: 45.5k]
  ------------------
  969|      0|			return (r);
  970|  45.5k|	}
  971|       |
  972|  67.5k|	for (;;) {
  973|  67.5k|		next = line + strspn(line, " \t\r\n");
  974|  67.5k|		if (*next == '\0')
  ------------------
  |  Branch (974:7): [True: 40.3k, False: 27.1k]
  ------------------
  975|  40.3k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  40.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  976|  27.1k|		if (next >= end)
  ------------------
  |  Branch (976:7): [True: 1.28k, False: 25.8k]
  ------------------
  977|  1.28k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  978|  25.8k|		line = next;
  979|  25.8k|		next = line + strcspn(line, " \t\r\n");
  980|  25.8k|		eq = strchr(line, '=');
  981|  25.8k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (981:7): [True: 15.7k, False: 10.0k]
  |  Branch (981:21): [True: 551, False: 9.53k]
  ------------------
  982|  16.3k|			len = next - line;
  983|  9.53k|		else
  984|  9.53k|			len = eq - line;
  985|       |
  986|  25.8k|		remove_option(&entry->options, line, len);
  987|  25.8k|		r = add_option(a, &entry->options, line, next - line);
  988|  25.8k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  25.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (988:7): [True: 0, False: 25.8k]
  ------------------
  989|      0|			return (r);
  990|  25.8k|		line = next;
  991|  25.8k|	}
  992|  41.6k|}
archive_read_support_format_mtree.c:parse_escapes:
 1898|  42.3k|{
 1899|  42.3k|	char *dest = src;
 1900|  42.3k|	char c;
 1901|       |
 1902|  42.3k|	if (mentry != NULL && strcmp(src, ".") == 0)
  ------------------
  |  Branch (1902:6): [True: 41.6k, False: 700]
  |  Branch (1902:24): [True: 228, False: 41.4k]
  ------------------
 1903|    228|		mentry->full = 1;
 1904|       |
 1905|   504k|	while (*src != '\0') {
  ------------------
  |  Branch (1905:9): [True: 462k, False: 42.3k]
  ------------------
 1906|   462k|		c = *src++;
 1907|   462k|		if (c == '/' && mentry != NULL)
  ------------------
  |  Branch (1907:7): [True: 6.60k, False: 455k]
  |  Branch (1907:19): [True: 6.34k, False: 261]
  ------------------
 1908|  6.34k|			mentry->full = 1;
 1909|   462k|		if (c == '\\') {
  ------------------
  |  Branch (1909:7): [True: 5.22k, False: 457k]
  ------------------
 1910|  5.22k|			switch (src[0]) {
  ------------------
  |  Branch (1910:12): [True: 4.18k, False: 1.04k]
  ------------------
 1911|  2.22k|			case '0':
  ------------------
  |  Branch (1911:4): [True: 2.22k, False: 3.00k]
  ------------------
 1912|  2.22k|				if (src[1] < '0' || src[1] > '7') {
  ------------------
  |  Branch (1912:9): [True: 141, False: 2.08k]
  |  Branch (1912:25): [True: 564, False: 1.51k]
  ------------------
 1913|    705|					c = 0;
 1914|    705|					++src;
 1915|    705|					break;
 1916|    705|				}
 1917|       |				/* FALLTHROUGH */
 1918|  1.70k|			case '1':
  ------------------
  |  Branch (1918:4): [True: 187, False: 5.04k]
  ------------------
 1919|  2.31k|			case '2':
  ------------------
  |  Branch (1919:4): [True: 612, False: 4.61k]
  ------------------
 1920|  2.70k|			case '3':
  ------------------
  |  Branch (1920:4): [True: 386, False: 4.84k]
  ------------------
 1921|  2.70k|				if (src[1] >= '0' && src[1] <= '7' &&
  ------------------
  |  Branch (1921:9): [True: 2.40k, False: 298]
  |  Branch (1921:26): [True: 2.06k, False: 339]
  ------------------
 1922|  2.06k|				    src[2] >= '0' && src[2] <= '7') {
  ------------------
  |  Branch (1922:9): [True: 1.06k, False: 1.00k]
  |  Branch (1922:26): [True: 487, False: 576]
  ------------------
 1923|    487|					c = (src[0] - '0') << 6;
 1924|    487|					c |= (src[1] - '0') << 3;
 1925|    487|					c |= (src[2] - '0');
 1926|    487|					src += 3;
 1927|    487|				}
 1928|  2.70k|				break;
 1929|      0|			case 'a':
  ------------------
  |  Branch (1929:4): [True: 0, False: 5.22k]
  ------------------
 1930|      0|				c = '\a';
 1931|      0|				++src;
 1932|      0|				break;
 1933|    181|			case 'b':
  ------------------
  |  Branch (1933:4): [True: 181, False: 5.04k]
  ------------------
 1934|    181|				c = '\b';
 1935|    181|				++src;
 1936|    181|				break;
 1937|    137|			case 'f':
  ------------------
  |  Branch (1937:4): [True: 137, False: 5.09k]
  ------------------
 1938|    137|				c = '\f';
 1939|    137|				++src;
 1940|    137|				break;
 1941|    218|			case 'n':
  ------------------
  |  Branch (1941:4): [True: 218, False: 5.01k]
  ------------------
 1942|    218|				c = '\n';
 1943|    218|				++src;
 1944|    218|				break;
 1945|     31|			case 'r':
  ------------------
  |  Branch (1945:4): [True: 31, False: 5.19k]
  ------------------
 1946|     31|				c = '\r';
 1947|     31|				++src;
 1948|     31|				break;
 1949|     22|			case 's':
  ------------------
  |  Branch (1949:4): [True: 22, False: 5.20k]
  ------------------
 1950|     22|				c = ' ';
 1951|     22|				++src;
 1952|     22|				break;
 1953|      2|			case 't':
  ------------------
  |  Branch (1953:4): [True: 2, False: 5.22k]
  ------------------
 1954|      2|				c = '\t';
 1955|      2|				++src;
 1956|      2|				break;
 1957|      0|			case 'v':
  ------------------
  |  Branch (1957:4): [True: 0, False: 5.22k]
  ------------------
 1958|      0|				c = '\v';
 1959|      0|				++src;
 1960|      0|				break;
 1961|    190|			case '\\':
  ------------------
  |  Branch (1961:4): [True: 190, False: 5.03k]
  ------------------
 1962|    190|				c = '\\';
 1963|    190|				++src;
 1964|    190|				break;
 1965|  5.22k|			}
 1966|  5.22k|		}
 1967|   462k|		*dest++ = c;
 1968|   462k|	}
 1969|  42.3k|	*dest = '\0';
 1970|  42.3k|}
archive_read_support_format_mtree.c:add_option:
  775|  80.7k|{
  776|  80.7k|	struct mtree_option *opt;
  777|       |
  778|  80.7k|	if ((opt = malloc(sizeof(*opt))) == NULL) {
  ------------------
  |  Branch (778:6): [True: 0, False: 80.7k]
  ------------------
  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|  80.7k|	if ((opt->value = malloc(len + 1)) == NULL) {
  ------------------
  |  Branch (782:6): [True: 0, False: 80.7k]
  ------------------
  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|  80.7k|	memcpy(opt->value, value, len);
  788|  80.7k|	opt->value[len] = '\0';
  789|  80.7k|	opt->next = *global;
  790|  80.7k|	*global = opt;
  791|  80.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  80.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  792|  80.7k|}
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|   168k|	for (iter = *global; iter != NULL; last = iter, iter = iter->next) {
  ------------------
  |  Branch (800:23): [True: 139k, False: 28.7k]
  ------------------
  801|   139k|		if (strncmp(iter->value, value, len) == 0 &&
  ------------------
  |  Branch (801:7): [True: 21.7k, False: 117k]
  ------------------
  802|  21.7k|		    (iter->value[len] == '\0' ||
  ------------------
  |  Branch (802:8): [True: 11.2k, False: 10.5k]
  ------------------
  803|  10.5k|		     iter->value[len] == '='))
  ------------------
  |  Branch (803:8): [True: 2.71k, False: 7.79k]
  ------------------
  804|  13.9k|			break;
  805|   139k|	}
  806|  42.7k|	if (iter == NULL)
  ------------------
  |  Branch (806:6): [True: 28.7k, False: 13.9k]
  ------------------
  807|  28.7k|		return;
  808|  13.9k|	if (last == NULL)
  ------------------
  |  Branch (808:6): [True: 5.82k, False: 8.13k]
  ------------------
  809|  5.82k|		*global = iter->next;
  810|  8.13k|	else
  811|  8.13k|		last->next = iter->next;
  812|       |
  813|  13.9k|	free(iter->value);
  814|  13.9k|	free(iter);
  815|  13.9k|}
archive_read_support_format_mtree.c:process_global_set:
  820|  2.03k|{
  821|  2.03k|	const char *next, *eq;
  822|  2.03k|	size_t len;
  823|  2.03k|	int r;
  824|       |
  825|  2.03k|	line += 4;
  826|  11.3k|	for (;;) {
  827|  11.3k|		next = line + strspn(line, " \t\r\n");
  828|  11.3k|		if (*next == '\0')
  ------------------
  |  Branch (828:7): [True: 2.03k, False: 9.34k]
  ------------------
  829|  2.03k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  830|  9.34k|		line = next;
  831|  9.34k|		next = line + strcspn(line, " \t\r\n");
  832|  9.34k|		eq = strchr(line, '=');
  833|  9.34k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (833:7): [True: 7.28k, False: 2.06k]
  |  Branch (833:21): [True: 666, False: 1.39k]
  ------------------
  834|  7.94k|			len = next - line;
  835|  1.39k|		else
  836|  1.39k|			len = eq - line;
  837|       |
  838|  9.34k|		remove_option(global, line, len);
  839|  9.34k|		r = add_option(a, global, line, next - line);
  840|  9.34k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  9.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (840:7): [True: 0, False: 9.34k]
  ------------------
  841|      0|			return (r);
  842|  9.34k|		line = next;
  843|  9.34k|	}
  844|  2.03k|}
archive_read_support_format_mtree.c:process_global_unset:
  849|  1.35k|{
  850|  1.35k|	const char *next;
  851|  1.35k|	size_t len;
  852|       |
  853|  1.35k|	line += 6;
  854|  1.35k|	if (strchr(line, '=') != NULL) {
  ------------------
  |  Branch (854:6): [True: 6, False: 1.34k]
  ------------------
  855|      6|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  856|      6|		    "/unset shall not contain `='");
  857|      6|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  858|      6|	}
  859|       |
  860|  9.54k|	for (;;) {
  861|  9.54k|		next = line + strspn(line, " \t\r\n");
  862|  9.54k|		if (*next == '\0')
  ------------------
  |  Branch (862:7): [True: 1.34k, False: 8.19k]
  ------------------
  863|  1.34k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  864|  8.19k|		line = next;
  865|  8.19k|		len = strcspn(line, " \t\r\n");
  866|       |
  867|  8.19k|		if (len == 3 && strncmp(line, "all", 3) == 0) {
  ------------------
  |  Branch (867:7): [True: 1.49k, False: 6.69k]
  |  Branch (867:19): [True: 680, False: 816]
  ------------------
  868|    680|			free_options(*global);
  869|    680|			*global = NULL;
  870|  7.51k|		} else {
  871|  7.51k|			remove_option(global, line, len);
  872|  7.51k|		}
  873|       |
  874|  8.19k|		line += len;
  875|  8.19k|	}
  876|  1.34k|}
archive_read_support_format_mtree.c:parse_file:
 1131|  35.2k|{
 1132|  35.2k|	const char *path;
 1133|  35.2k|	la_seek_stat_t st_storage, *st;
 1134|  35.2k|	struct mtree_entry *mp;
 1135|  35.2k|	struct archive_entry *sparse_entry;
 1136|  35.2k|	int r = ARCHIVE_OK, r1, parsed_kws;
  ------------------
  |  |  233|  35.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1137|       |
 1138|  35.2k|	mentry->used = 1;
 1139|       |
 1140|       |	/* Initialize reasonable defaults. */
 1141|  35.2k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  35.2k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1142|  35.2k|	archive_entry_set_size(entry, 0);
 1143|  35.2k|	archive_string_empty(&mtree->contents_name);
  ------------------
  |  |  181|  35.2k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1144|       |
 1145|       |	/* Parse options from this line. */
 1146|  35.2k|	parsed_kws = 0;
 1147|  35.2k|	r = parse_line(a, entry, mtree, mentry, &parsed_kws);
 1148|       |
 1149|  35.2k|	if (mentry->full) {
  ------------------
  |  Branch (1149:6): [True: 1.82k, False: 33.4k]
  ------------------
 1150|  1.82k|		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|  1.82k|		mp = (struct mtree_entry *)__archive_rb_tree_find_node(
 1162|  1.82k|		    &mtree->rbtree, mentry->name);
 1163|  6.82k|		for (; mp; mp = mp->next_dup) {
  ------------------
  |  Branch (1163:10): [True: 4.99k, False: 1.82k]
  ------------------
 1164|  4.99k|			if (mp->full && !mp->used) {
  ------------------
  |  Branch (1164:8): [True: 4.99k, False: 0]
  |  Branch (1164:20): [True: 3.16k, False: 1.82k]
  ------------------
 1165|       |				/* Later lines override earlier ones. */
 1166|  3.16k|				mp->used = 1;
 1167|  3.16k|				r1 = parse_line(a, entry, mtree, mp, &parsed_kws);
 1168|  3.16k|				if (r1 < r)
  ------------------
  |  Branch (1168:9): [True: 11, False: 3.15k]
  ------------------
 1169|     11|					r = r1;
 1170|  3.16k|			}
 1171|  4.99k|		}
 1172|  33.4k|	} else {
 1173|       |		/*
 1174|       |		 * Relative entries require us to construct
 1175|       |		 * the full path and possibly update the
 1176|       |		 * current directory.
 1177|       |		 */
 1178|  33.4k|		size_t n = archive_strlen(&mtree->current_dir);
  ------------------
  |  |  178|  33.4k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1179|  33.4k|		if (n > 0)
  ------------------
  |  Branch (1179:7): [True: 1.32k, False: 32.1k]
  ------------------
 1180|  1.32k|			archive_strcat(&mtree->current_dir, "/");
 1181|  33.4k|		archive_strcat(&mtree->current_dir, mentry->name);
 1182|  33.4k|		archive_entry_copy_pathname(entry, mtree->current_dir.s);
 1183|  33.4k|		if (archive_entry_filetype(entry) != AE_IFDIR)
  ------------------
  |  |  221|  33.4k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1183:7): [True: 31.6k, False: 1.80k]
  ------------------
 1184|  31.6k|			mtree->current_dir.length = n;
 1185|  33.4k|	}
 1186|       |
 1187|  35.2k|	if (mtree->checkfs) {
  ------------------
  |  Branch (1187:6): [True: 0, False: 35.2k]
  ------------------
 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|  35.2k|	mtree->cur_size = archive_entry_size(entry);
 1366|  35.2k|	mtree->offset = 0;
 1367|       |
 1368|  35.2k|	return r;
 1369|  35.2k|}
archive_read_support_format_mtree.c:parse_line:
 1377|  38.4k|{
 1378|  38.4k|	struct mtree_option *iter;
 1379|  38.4k|	int r = ARCHIVE_OK, r1;
  ------------------
  |  |  233|  38.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1380|       |
 1381|  95.0k|	for (iter = mp->options; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1381:27): [True: 56.6k, False: 38.4k]
  ------------------
 1382|  56.6k|		r1 = parse_keyword(a, mtree, entry, iter, parsed_kws);
 1383|  56.6k|		if (r1 < r)
  ------------------
  |  Branch (1383:7): [True: 21.5k, False: 35.0k]
  ------------------
 1384|  21.5k|			r = r1;
 1385|  56.6k|	}
 1386|  38.4k|	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |  233|  76.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |   77|  16.8k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
  |  Branch (1386:6): [True: 16.8k, False: 21.5k]
  |  Branch (1386:25): [True: 13.7k, False: 3.09k]
  ------------------
 1387|  13.7k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  13.7k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1388|  13.7k|		    "Missing type keyword in mtree specification");
 1389|  13.7k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  13.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1390|  13.7k|	}
 1391|  24.6k|	return (r);
 1392|  38.4k|}
archive_read_support_format_mtree.c:parse_keyword:
 1558|  56.6k|{
 1559|  56.6k|	char *val, *key;
 1560|       |
 1561|  56.6k|	key = opt->value;
 1562|       |
 1563|  56.6k|	if (*key == '\0')
  ------------------
  |  Branch (1563:6): [True: 0, False: 56.6k]
  ------------------
 1564|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1565|       |
 1566|  56.6k|	if (strcmp(key, "nochange") == 0) {
  ------------------
  |  Branch (1566:6): [True: 167, False: 56.4k]
  ------------------
 1567|    167|		*parsed_kws |= MTREE_HAS_NOCHANGE;
  ------------------
  |  |   82|    167|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
 1568|    167|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    167|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1569|    167|	}
 1570|  56.4k|	if (strcmp(key, "optional") == 0) {
  ------------------
  |  Branch (1570:6): [True: 159, False: 56.3k]
  ------------------
 1571|    159|		*parsed_kws |= MTREE_HAS_OPTIONAL;
  ------------------
  |  |   81|    159|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
 1572|    159|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    159|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1573|    159|	}
 1574|  56.3k|	if (strcmp(key, "ignore") == 0) {
  ------------------
  |  Branch (1574:6): [True: 39, False: 56.2k]
  ------------------
 1575|       |		/*
 1576|       |		 * The mtree processing is not recursive, so
 1577|       |		 * recursion will only happen for explicitly listed
 1578|       |		 * entries.
 1579|       |		 */
 1580|     39|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1581|     39|	}
 1582|       |
 1583|  56.2k|	val = strchr(key, '=');
 1584|  56.2k|	if (val == NULL) {
  ------------------
  |  Branch (1584:6): [True: 23.3k, False: 32.9k]
  ------------------
 1585|  23.3k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  23.3k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1586|  23.3k|		    "Malformed attribute \"%s\" (%d)", key, key[0]);
 1587|  23.3k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  23.3k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1588|  23.3k|	}
 1589|       |
 1590|  32.9k|	*val = '\0';
 1591|  32.9k|	++val;
 1592|       |
 1593|  32.9k|	switch (key[0]) {
 1594|  1.02k|	case 'c':
  ------------------
  |  Branch (1594:2): [True: 1.02k, False: 31.9k]
  ------------------
 1595|  1.02k|		if (strcmp(key, "content") == 0
  ------------------
  |  Branch (1595:7): [True: 244, False: 779]
  ------------------
 1596|    779|		    || strcmp(key, "contents") == 0) {
  ------------------
  |  Branch (1596:10): [True: 321, False: 458]
  ------------------
 1597|    565|			parse_escapes(val, NULL);
 1598|    565|			archive_strcpy(&mtree->contents_name, val);
  ------------------
  |  |  165|    565|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  1.13k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 565]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1599|    565|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    565|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1600|    565|		}
 1601|    458|		if (strcmp(key, "cksum") == 0)
  ------------------
  |  Branch (1601:7): [True: 196, False: 262]
  ------------------
 1602|    196|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    196|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1603|    262|		break;
 1604|  6.13k|	case 'd':
  ------------------
  |  Branch (1604:2): [True: 6.13k, False: 26.8k]
  ------------------
 1605|  6.13k|		if (strcmp(key, "device") == 0) {
  ------------------
  |  Branch (1605:7): [True: 5.41k, False: 722]
  ------------------
 1606|       |			/* stat(2) st_rdev field, e.g. the major/minor IDs
 1607|       |			 * of a char/block special file */
 1608|  5.41k|			int r;
 1609|  5.41k|			dev_t dev;
 1610|       |
 1611|  5.41k|			*parsed_kws |= MTREE_HAS_DEVICE;
  ------------------
  |  |   69|  5.41k|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
 1612|  5.41k|			r = parse_device(&dev, &a->archive, val);
 1613|  5.41k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  5.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1613:8): [True: 1.90k, False: 3.51k]
  ------------------
 1614|  1.90k|				archive_entry_set_rdev(entry, dev);
 1615|  5.41k|			return r;
 1616|  5.41k|		}
 1617|    722|		break;
 1618|  2.52k|	case 'f':
  ------------------
  |  Branch (1618:2): [True: 2.52k, False: 30.4k]
  ------------------
 1619|  2.52k|		if (strcmp(key, "flags") == 0) {
  ------------------
  |  Branch (1619:7): [True: 1.69k, False: 830]
  ------------------
 1620|  1.69k|			*parsed_kws |= MTREE_HAS_FFLAGS;
  ------------------
  |  |   70|  1.69k|#define	MTREE_HAS_FFLAGS	0x0002
  ------------------
 1621|  1.69k|			archive_entry_copy_fflags_text(entry, val);
 1622|  1.69k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.69k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1623|  1.69k|		}
 1624|    830|		break;
 1625|    963|	case 'g':
  ------------------
  |  Branch (1625:2): [True: 963, False: 31.9k]
  ------------------
 1626|    963|		if (strcmp(key, "gid") == 0) {
  ------------------
  |  Branch (1626:7): [True: 536, False: 427]
  ------------------
 1627|    536|			*parsed_kws |= MTREE_HAS_GID;
  ------------------
  |  |   71|    536|#define	MTREE_HAS_GID		0x0004
  ------------------
 1628|    536|			archive_entry_set_gid(entry, mtree_atol(&val, 10));
 1629|    536|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    536|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1630|    536|		}
 1631|    427|		if (strcmp(key, "gname") == 0) {
  ------------------
  |  Branch (1631:7): [True: 168, False: 259]
  ------------------
 1632|    168|			*parsed_kws |= MTREE_HAS_GNAME;
  ------------------
  |  |   72|    168|#define	MTREE_HAS_GNAME		0x0008
  ------------------
 1633|    168|			archive_entry_copy_gname(entry, val);
 1634|    168|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    168|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1635|    168|		}
 1636|    259|		break;
 1637|    816|	case 'i':
  ------------------
  |  Branch (1637:2): [True: 816, False: 32.1k]
  ------------------
 1638|    816|		if (strcmp(key, "inode") == 0) {
  ------------------
  |  Branch (1638:7): [True: 664, False: 152]
  ------------------
 1639|    664|			archive_entry_set_ino(entry, mtree_atol(&val, 10));
 1640|    664|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    664|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1641|    664|		}
 1642|    152|		break;
 1643|    879|	case 'l':
  ------------------
  |  Branch (1643:2): [True: 879, False: 32.0k]
  ------------------
 1644|    879|		if (strcmp(key, "link") == 0) {
  ------------------
  |  Branch (1644:7): [True: 135, False: 744]
  ------------------
 1645|    135|			parse_escapes(val, NULL);
 1646|    135|			archive_entry_copy_symlink(entry, val);
 1647|    135|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1648|    135|		}
 1649|    744|		break;
 1650|  1.89k|	case 'm':
  ------------------
  |  Branch (1650:2): [True: 1.89k, False: 31.0k]
  ------------------
 1651|  1.89k|		if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) {
  ------------------
  |  Branch (1651:7): [True: 777, False: 1.12k]
  |  Branch (1651:34): [True: 378, False: 743]
  ------------------
 1652|  1.15k|			return parse_digest(a, entry, val,
 1653|  1.15k|			    ARCHIVE_ENTRY_DIGEST_MD5);
  ------------------
  |  |  444|  1.15k|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
 1654|  1.15k|		}
 1655|    743|		if (strcmp(key, "mode") == 0) {
  ------------------
  |  Branch (1655:7): [True: 461, False: 282]
  ------------------
 1656|    461|			if (val[0] < '0' || val[0] > '7') {
  ------------------
  |  Branch (1656:8): [True: 212, False: 249]
  |  Branch (1656:24): [True: 48, False: 201]
  ------------------
 1657|    260|				archive_set_error(&a->archive,
 1658|    260|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    260|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1659|    260|				    "Symbolic or non-octal mode \"%s\" unsupported", val);
 1660|    260|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|    260|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1661|    260|			}
 1662|    201|			*parsed_kws |= MTREE_HAS_PERM;
  ------------------
  |  |   75|    201|#define	MTREE_HAS_PERM		0x0040
  ------------------
 1663|    201|			archive_entry_set_perm(entry, (mode_t)mtree_atol(&val, 8));
 1664|    201|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    201|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1665|    461|		}
 1666|    282|		break;
 1667|    575|	case 'n':
  ------------------
  |  Branch (1667:2): [True: 575, False: 32.3k]
  ------------------
 1668|    575|		if (strcmp(key, "nlink") == 0) {
  ------------------
  |  Branch (1668:7): [True: 325, False: 250]
  ------------------
 1669|    325|			*parsed_kws |= MTREE_HAS_NLINK;
  ------------------
  |  |   74|    325|#define	MTREE_HAS_NLINK		0x0020
  ------------------
 1670|    325|			archive_entry_set_nlink(entry,
 1671|    325|				(unsigned int)mtree_atol(&val, 10));
 1672|    325|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    325|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1673|    325|		}
 1674|    250|		break;
 1675|  4.29k|	case 'r':
  ------------------
  |  Branch (1675:2): [True: 4.29k, False: 28.6k]
  ------------------
 1676|  4.29k|		if (strcmp(key, "resdevice") == 0) {
  ------------------
  |  Branch (1676:7): [True: 3.60k, False: 698]
  ------------------
 1677|       |			/* stat(2) st_dev field, e.g. the device ID where the
 1678|       |			 * inode resides */
 1679|  3.60k|			int r;
 1680|  3.60k|			dev_t dev;
 1681|       |
 1682|  3.60k|			r = parse_device(&dev, &a->archive, val);
 1683|  3.60k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  3.60k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1683:8): [True: 643, False: 2.95k]
  ------------------
 1684|    643|				archive_entry_set_dev(entry, dev);
 1685|  3.60k|			return r;
 1686|  3.60k|		}
 1687|    698|		if (strcmp(key, "rmd160") == 0 ||
  ------------------
  |  Branch (1687:7): [True: 161, False: 537]
  ------------------
 1688|    537|		    strcmp(key, "rmd160digest") == 0) {
  ------------------
  |  Branch (1688:7): [True: 289, False: 248]
  ------------------
 1689|    450|			return parse_digest(a, entry, val,
 1690|    450|			    ARCHIVE_ENTRY_DIGEST_RMD160);
  ------------------
  |  |  445|    450|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
 1691|    450|		}
 1692|    248|		break;
 1693|  3.76k|	case 's':
  ------------------
  |  Branch (1693:2): [True: 3.76k, False: 29.1k]
  ------------------
 1694|  3.76k|		if (strcmp(key, "sha1") == 0 ||
  ------------------
  |  Branch (1694:7): [True: 1.28k, False: 2.48k]
  ------------------
 1695|  2.48k|		    strcmp(key, "sha1digest") == 0) {
  ------------------
  |  Branch (1695:7): [True: 260, False: 2.22k]
  ------------------
 1696|  1.54k|			return parse_digest(a, entry, val,
 1697|  1.54k|			    ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  446|  1.54k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
 1698|  1.54k|		}
 1699|  2.22k|		if (strcmp(key, "sha256") == 0 ||
  ------------------
  |  Branch (1699:7): [True: 208, False: 2.01k]
  ------------------
 1700|  2.01k|		    strcmp(key, "sha256digest") == 0) {
  ------------------
  |  Branch (1700:7): [True: 202, False: 1.81k]
  ------------------
 1701|    410|			return parse_digest(a, entry, val,
 1702|    410|			    ARCHIVE_ENTRY_DIGEST_SHA256);
  ------------------
  |  |  447|    410|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
 1703|    410|		}
 1704|  1.81k|		if (strcmp(key, "sha384") == 0 ||
  ------------------
  |  Branch (1704:7): [True: 0, False: 1.81k]
  ------------------
 1705|  1.81k|		    strcmp(key, "sha384digest") == 0) {
  ------------------
  |  Branch (1705:7): [True: 424, False: 1.38k]
  ------------------
 1706|    424|			return parse_digest(a, entry, val,
 1707|    424|			    ARCHIVE_ENTRY_DIGEST_SHA384);
  ------------------
  |  |  448|    424|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
 1708|    424|		}
 1709|  1.38k|		if (strcmp(key, "sha512") == 0 ||
  ------------------
  |  Branch (1709:7): [True: 419, False: 967]
  ------------------
 1710|    967|		    strcmp(key, "sha512digest") == 0) {
  ------------------
  |  Branch (1710:7): [True: 98, False: 869]
  ------------------
 1711|    517|			return parse_digest(a, entry, val,
 1712|    517|			    ARCHIVE_ENTRY_DIGEST_SHA512);
  ------------------
  |  |  449|    517|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
 1713|    517|		}
 1714|    869|		if (strcmp(key, "size") == 0) {
  ------------------
  |  Branch (1714:7): [True: 214, False: 655]
  ------------------
 1715|    214|			archive_entry_set_size(entry, mtree_atol(&val, 10));
 1716|    214|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    214|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1717|    214|		}
 1718|    655|		break;
 1719|  8.36k|	case 't':
  ------------------
  |  Branch (1719:2): [True: 8.36k, False: 24.5k]
  ------------------
 1720|  8.36k|		if (strcmp(key, "tags") == 0) {
  ------------------
  |  Branch (1720:7): [True: 365, False: 7.99k]
  ------------------
 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|    365|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    365|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1727|    365|		}
 1728|  7.99k|		if (strcmp(key, "time") == 0) {
  ------------------
  |  Branch (1728:7): [True: 1.24k, False: 6.75k]
  ------------------
 1729|  1.24k|			int64_t m;
 1730|  1.24k|			long ns = 0;
 1731|       |
 1732|  1.24k|			*parsed_kws |= MTREE_HAS_MTIME;
  ------------------
  |  |   73|  1.24k|#define	MTREE_HAS_MTIME		0x0010
  ------------------
 1733|  1.24k|			m = mtree_atol(&val, 10);
 1734|       |			/* Replicate an old mtree bug:
 1735|       |			 * 123456789.1 represents 123456789
 1736|       |			 * seconds and 1 nanosecond. */
 1737|  1.24k|			if (*val == '.') {
  ------------------
  |  Branch (1737:8): [True: 985, False: 263]
  ------------------
 1738|    985|				int64_t v;
 1739|       |
 1740|    985|				++val;
 1741|    985|				v = mtree_atol(&val, 10);
 1742|    985|				if (v < 0)
  ------------------
  |  Branch (1742:9): [True: 446, False: 539]
  ------------------
 1743|    446|					ns = 0;
 1744|    539|				else if (v > 999999999)
  ------------------
  |  Branch (1744:14): [True: 355, False: 184]
  ------------------
 1745|    355|					ns = 999999999;
 1746|    184|				else
 1747|    184|					ns = (long)v;
 1748|    985|			}
 1749|  1.24k|			if (m > TIME_MAX)
  ------------------
  |  |  251|  1.24k|#define TIME_MAX (((time_t)0 < (time_t)-1) ? (time_t)~0 :		\
  |  |  ------------------
  |  |  |  Branch (251:19): [Folded, False: 1.24k]
  |  |  ------------------
  |  |  252|  1.24k|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MAX :	\
  |  |  ------------------
  |  |  |  Branch (252:6): [True: 1.24k, Folded]
  |  |  ------------------
  |  |  253|  1.24k|	    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: 1.24k]
  ------------------
 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|  1.24k|			else if (m < TIME_MIN)
  ------------------
  |  |  259|  1.24k|#define TIME_MIN (((time_t)0 < (time_t)-1) ? (time_t)0 :		\
  |  |  ------------------
  |  |  |  Branch (259:19): [Folded, False: 1.24k]
  |  |  ------------------
  |  |  260|  1.24k|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MIN :	\
  |  |  ------------------
  |  |  |  Branch (260:6): [True: 1.24k, Folded]
  |  |  ------------------
  |  |  261|  1.24k|	    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: 1.24k]
  ------------------
 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|  1.24k|			archive_entry_set_mtime(entry, (time_t)m, ns);
 1754|  1.24k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1755|  1.24k|		}
 1756|  6.75k|		if (strcmp(key, "type") == 0) {
  ------------------
  |  Branch (1756:7): [True: 5.93k, False: 820]
  ------------------
 1757|  5.93k|			switch (val[0]) {
 1758|    255|			case 'b':
  ------------------
  |  Branch (1758:4): [True: 255, False: 5.67k]
  ------------------
 1759|    255|				if (strcmp(val, "block") == 0) {
  ------------------
  |  Branch (1759:9): [True: 0, False: 255]
  ------------------
 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|    255|				break;
 1766|    496|			case 'c':
  ------------------
  |  Branch (1766:4): [True: 496, False: 5.43k]
  ------------------
 1767|    496|				if (strcmp(val, "char") == 0) {
  ------------------
  |  Branch (1767:9): [True: 219, False: 277]
  ------------------
 1768|    219|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    219|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1769|    219|					archive_entry_set_filetype(entry,
 1770|    219|						AE_IFCHR);
  ------------------
  |  |  219|    219|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1771|    219|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    219|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1772|    219|				}
 1773|    277|				break;
 1774|  2.10k|			case 'd':
  ------------------
  |  Branch (1774:4): [True: 2.10k, False: 3.82k]
  ------------------
 1775|  2.10k|				if (strcmp(val, "dir") == 0) {
  ------------------
  |  Branch (1775:9): [True: 1.87k, False: 231]
  ------------------
 1776|  1.87k|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|  1.87k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1777|  1.87k|					archive_entry_set_filetype(entry,
 1778|  1.87k|						AE_IFDIR);
  ------------------
  |  |  221|  1.87k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1779|  1.87k|					return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1780|  1.87k|				}
 1781|    231|				break;
 1782|  2.22k|			case 'f':
  ------------------
  |  Branch (1782:4): [True: 2.22k, False: 3.70k]
  ------------------
 1783|  2.22k|				if (strcmp(val, "fifo") == 0) {
  ------------------
  |  Branch (1783:9): [True: 468, False: 1.75k]
  ------------------
 1784|    468|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    468|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1785|    468|					archive_entry_set_filetype(entry,
 1786|    468|						AE_IFIFO);
  ------------------
  |  |  222|    468|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1787|    468|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    468|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1788|    468|				}
 1789|  1.75k|				if (strcmp(val, "file") == 0) {
  ------------------
  |  Branch (1789:9): [True: 1.29k, False: 468]
  ------------------
 1790|  1.29k|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|  1.29k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1791|  1.29k|					archive_entry_set_filetype(entry,
 1792|  1.29k|						AE_IFREG);
  ------------------
  |  |  216|  1.29k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1793|  1.29k|					return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1794|  1.29k|				}
 1795|    468|				break;
 1796|    468|			case 'l':
  ------------------
  |  Branch (1796:4): [True: 428, False: 5.50k]
  ------------------
 1797|    428|				if (strcmp(val, "link") == 0) {
  ------------------
  |  Branch (1797:9): [True: 213, False: 215]
  ------------------
 1798|    213|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    213|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1799|    213|					archive_entry_set_filetype(entry,
 1800|    213|						AE_IFLNK);
  ------------------
  |  |  217|    213|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1801|    213|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    213|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1802|    213|				}
 1803|    215|				break;
 1804|    423|			default:
  ------------------
  |  Branch (1804:4): [True: 423, False: 5.50k]
  ------------------
 1805|    423|				break;
 1806|  5.93k|			}
 1807|  1.86k|			archive_set_error(&a->archive,
 1808|  1.86k|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.86k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1809|  1.86k|			    "Unrecognized file type \"%s\"; "
 1810|  1.86k|			    "assuming \"file\"", val);
 1811|  1.86k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  1.86k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1812|  1.86k|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.86k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1813|  5.93k|		}
 1814|    820|		break;
 1815|  1.14k|	case 'u':
  ------------------
  |  Branch (1815:2): [True: 1.14k, False: 31.7k]
  ------------------
 1816|  1.14k|		if (strcmp(key, "uid") == 0) {
  ------------------
  |  Branch (1816:7): [True: 243, False: 902]
  ------------------
 1817|    243|			*parsed_kws |= MTREE_HAS_UID;
  ------------------
  |  |   78|    243|#define	MTREE_HAS_UID		0x0200
  ------------------
 1818|    243|			archive_entry_set_uid(entry, mtree_atol(&val, 10));
 1819|    243|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    243|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1820|    243|		}
 1821|    902|		if (strcmp(key, "uname") == 0) {
  ------------------
  |  Branch (1821:7): [True: 561, False: 341]
  ------------------
 1822|    561|			*parsed_kws |= MTREE_HAS_UNAME;
  ------------------
  |  |   79|    561|#define	MTREE_HAS_UNAME		0x0400
  ------------------
 1823|    561|			archive_entry_copy_uname(entry, val);
 1824|    561|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    561|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1825|    561|		}
 1826|    341|		break;
 1827|    551|	default:
  ------------------
  |  Branch (1827:2): [True: 551, False: 32.3k]
  ------------------
 1828|    551|		break;
 1829|  32.9k|	}
 1830|  6.11k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  6.11k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1831|  6.11k|	    "Unrecognized key %s=%s", key, val);
 1832|  6.11k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  6.11k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1833|  32.9k|}
archive_read_support_format_mtree.c:parse_device:
 1419|  9.01k|{
 1420|  9.01k|#define MAX_PACK_ARGS 3
 1421|  9.01k|	unsigned long numbers[MAX_PACK_ARGS];
 1422|  9.01k|	char *p, *dev;
 1423|  9.01k|	int argc;
 1424|  9.01k|	pack_t *pack;
 1425|  9.01k|	dev_t result;
 1426|  9.01k|	const char *error = NULL;
 1427|       |
 1428|  9.01k|	memset(pdev, 0, sizeof(*pdev));
 1429|  9.01k|	if ((dev = strchr(val, ',')) != NULL) {
  ------------------
  |  Branch (1429:6): [True: 7.88k, False: 1.12k]
  ------------------
 1430|       |		/*
 1431|       |		 * Device's major/minor are given in a specified format.
 1432|       |		 * Decode and pack it accordingly.
 1433|       |		 */
 1434|  7.88k|		*dev++ = '\0';
 1435|  7.88k|		if ((pack = pack_find(val)) == NULL) {
  ------------------
  |  Branch (1435:7): [True: 449, False: 7.44k]
  ------------------
 1436|    449|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    449|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1437|    449|			    "Unknown format `%s'", val);
 1438|    449|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    449|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1439|    449|		}
 1440|  7.44k|		argc = 0;
 1441|  23.6k|		while ((p = la_strsep(&dev, ",")) != NULL) {
  ------------------
  |  Branch (1441:10): [True: 16.9k, False: 6.71k]
  ------------------
 1442|  16.9k|			if (*p == '\0') {
  ------------------
  |  Branch (1442:8): [True: 220, False: 16.7k]
  ------------------
 1443|    220|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    220|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1444|    220|				    "Missing number");
 1445|    220|				return ARCHIVE_WARN;
  ------------------
  |  |  235|    220|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1446|    220|			}
 1447|  16.7k|			if (argc >= MAX_PACK_ARGS) {
  ------------------
  |  | 1420|  16.7k|#define MAX_PACK_ARGS 3
  ------------------
  |  Branch (1447:8): [True: 505, False: 16.2k]
  ------------------
 1448|    505|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    505|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1449|    505|				    "Too many arguments");
 1450|    505|				return ARCHIVE_WARN;
  ------------------
  |  |  235|    505|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1451|    505|			}
 1452|  16.2k|			numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
 1453|  16.2k|		}
 1454|  6.71k|		if (argc < 2) {
  ------------------
  |  Branch (1454:7): [True: 712, False: 6.00k]
  ------------------
 1455|    712|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    712|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1456|    712|			    "Not enough arguments");
 1457|    712|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    712|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1458|    712|		}
 1459|  6.00k|		result = (*pack)(argc, numbers, &error);
 1460|  6.00k|		if (error != NULL) {
  ------------------
  |  Branch (1460:7): [True: 4.58k, False: 1.42k]
  ------------------
 1461|  4.58k|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  4.58k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1462|  4.58k|			    "%s", error);
 1463|  4.58k|			return ARCHIVE_WARN;
  ------------------
  |  |  235|  4.58k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1464|  4.58k|		}
 1465|  6.00k|	} else {
 1466|       |		/* file system raw value. */
 1467|  1.12k|		result = (dev_t)mtree_atol(&val, 0);
 1468|  1.12k|	}
 1469|  2.54k|	*pdev = result;
 1470|  2.54k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.54k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1471|  9.01k|#undef MAX_PACK_ARGS
 1472|  9.01k|}
archive_read_support_format_mtree.c:la_strsep:
 1405|  23.6k|{
 1406|  23.6k|	char *p, *s;
 1407|  23.6k|	if (sp == NULL || *sp == NULL || **sp == '\0')
  ------------------
  |  Branch (1407:6): [True: 0, False: 23.6k]
  |  Branch (1407:20): [True: 0, False: 23.6k]
  |  Branch (1407:35): [True: 6.71k, False: 16.9k]
  ------------------
 1408|  6.71k|		return(NULL);
 1409|  16.9k|	s = *sp;
 1410|  16.9k|	p = s + strcspn(s, sep);
 1411|  16.9k|	if (*p != '\0')
  ------------------
  |  Branch (1411:6): [True: 11.7k, False: 5.25k]
  ------------------
 1412|  11.7k|		*p++ = '\0';
 1413|  16.9k|	*sp = p;
 1414|  16.9k|	return(s);
 1415|  23.6k|}
archive_read_support_format_mtree.c:mtree_atol:
 1993|  21.7k|{
 1994|  21.7k|	int64_t l;
 1995|  21.7k|	int digit;
 1996|       |
 1997|  21.7k|	if (base == 0) {
  ------------------
  |  Branch (1997:6): [True: 17.3k, False: 4.41k]
  ------------------
 1998|  17.3k|		if (**p != '0')
  ------------------
  |  Branch (1998:7): [True: 16.0k, False: 1.27k]
  ------------------
 1999|  16.0k|			base = 10;
 2000|  1.27k|		else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
  ------------------
  |  Branch (2000:12): [True: 693, False: 586]
  |  Branch (2000:30): [True: 322, False: 264]
  ------------------
 2001|  1.01k|			*p += 2;
 2002|  1.01k|			base = 16;
 2003|  1.01k|		} else {
 2004|    264|			base = 8;
 2005|    264|		}
 2006|  17.3k|	}
 2007|       |
 2008|  21.7k|	if (**p == '-') {
  ------------------
  |  Branch (2008:6): [True: 9.76k, False: 12.0k]
  ------------------
 2009|  9.76k|		++(*p);
 2010|       |
 2011|  9.76k|		l = 0;
 2012|  9.76k|		digit = parsedigit(**p);
 2013|  48.5k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2013:10): [True: 42.3k, False: 6.25k]
  |  Branch (2013:24): [True: 39.4k, False: 2.85k]
  ------------------
 2014|  39.4k|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2014:8): [True: 468, False: 39.0k]
  ------------------
 2015|  39.0k|			    archive_ckd_sub_i64(&l, l, digit))
  ------------------
  |  Branch (2015:8): [True: 183, False: 38.8k]
  ------------------
 2016|    651|				return INT64_MIN;
 2017|  38.8k|			digit = parsedigit(*++(*p));
 2018|  38.8k|		}
 2019|  9.11k|		return l;
 2020|  12.0k|	} else {
 2021|  12.0k|		l = 0;
 2022|  12.0k|		digit = parsedigit(**p);
 2023|  44.5k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2023:10): [True: 36.9k, False: 7.65k]
  |  Branch (2023:24): [True: 33.1k, False: 3.77k]
  ------------------
 2024|  33.1k|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2024:8): [True: 443, False: 32.6k]
  ------------------
 2025|  32.6k|			    archive_ckd_add_i64(&l, l, digit))
  ------------------
  |  Branch (2025:8): [True: 137, False: 32.5k]
  ------------------
 2026|    580|				return INT64_MAX;
 2027|  32.5k|			digit = parsedigit(*++(*p));
 2028|  32.5k|		}
 2029|  11.4k|		return l;
 2030|  12.0k|	}
 2031|  21.7k|}
archive_read_support_format_mtree.c:parsedigit:
 1975|  93.1k|{
 1976|  93.1k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1976:6): [True: 85.0k, False: 8.12k]
  |  Branch (1976:18): [True: 71.3k, False: 13.6k]
  ------------------
 1977|  71.3k|		return c - '0';
 1978|  21.7k|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1978:11): [True: 7.12k, False: 14.6k]
  |  Branch (1978:23): [True: 4.61k, False: 2.51k]
  ------------------
 1979|  4.61k|		return 10 + c - 'a';
 1980|  17.1k|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (1980:11): [True: 7.13k, False: 9.99k]
  |  Branch (1980:23): [True: 3.22k, False: 3.90k]
  ------------------
 1981|  3.22k|		return 10 + c - 'A';
 1982|  13.9k|	else
 1983|  13.9k|		return -1;
 1984|  93.1k|}
archive_read_support_format_mtree.c:parse_digest:
 1493|  4.49k|{
 1494|  4.49k|	unsigned char digest_buf[64];
 1495|  4.49k|	int high, low;
 1496|  4.49k|	size_t i, j, len;
 1497|       |
 1498|  4.49k|	switch (type) {
 1499|  1.15k|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|  1.15k|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1499:2): [True: 1.15k, False: 3.34k]
  ------------------
 1500|  1.15k|		len = sizeof(entry->digest.md5);
 1501|  1.15k|		break;
 1502|    450|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|    450|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1502:2): [True: 450, False: 4.04k]
  ------------------
 1503|    450|		len = sizeof(entry->digest.rmd160);
 1504|    450|		break;
 1505|  1.54k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|  1.54k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1505:2): [True: 1.54k, False: 2.95k]
  ------------------
 1506|  1.54k|		len = sizeof(entry->digest.sha1);
 1507|  1.54k|		break;
 1508|    410|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|    410|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1508:2): [True: 410, False: 4.08k]
  ------------------
 1509|    410|		len = sizeof(entry->digest.sha256);
 1510|    410|		break;
 1511|    424|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|    424|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1511:2): [True: 424, False: 4.07k]
  ------------------
 1512|    424|		len = sizeof(entry->digest.sha384);
 1513|    424|		break;
 1514|    517|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|    517|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1514:2): [True: 517, False: 3.98k]
  ------------------
 1515|    517|		len = sizeof(entry->digest.sha512);
 1516|    517|		break;
 1517|      0|	default:
  ------------------
  |  Branch (1517:2): [True: 0, False: 4.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|  4.49k|	}
 1522|       |
 1523|  4.49k|	if (len > sizeof(digest_buf)) {
  ------------------
  |  Branch (1523:6): [True: 0, False: 4.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|  4.49k|	len *= 2;
 1530|       |
 1531|  4.49k|	if (mtree_strnlen(digest, len+1) != len) {
  ------------------
  |  |  145|  4.49k|#define mtree_strnlen(a,b) strnlen(a,b)
  ------------------
  |  Branch (1531:6): [True: 2.74k, False: 1.75k]
  ------------------
 1532|  2.74k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  2.74k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1533|  2.74k|				  "incorrect digest length, ignoring");
 1534|  2.74k|		return ARCHIVE_WARN;
  ------------------
  |  |  235|  2.74k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1535|  2.74k|	}
 1536|       |
 1537|  26.0k|	for (i = 0, j = 0; i < len; i += 2, j++) {
  ------------------
  |  Branch (1537:21): [True: 25.3k, False: 694]
  ------------------
 1538|  25.3k|		high = parse_hex_nibble(digest[i]);
 1539|  25.3k|		low = parse_hex_nibble(digest[i+1]);
 1540|  25.3k|		if (high == -1 || low == -1) {
  ------------------
  |  Branch (1540:7): [True: 551, False: 24.8k]
  |  Branch (1540:21): [True: 507, False: 24.3k]
  ------------------
 1541|  1.05k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.05k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1542|  1.05k|					  "invalid digest data, ignoring");
 1543|  1.05k|			return ARCHIVE_WARN;
  ------------------
  |  |  235|  1.05k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1544|  1.05k|		}
 1545|       |
 1546|  24.3k|		digest_buf[j] = high << 4 | low;
 1547|  24.3k|	}
 1548|       |
 1549|    694|	return archive_entry_set_digest(entry, type, digest_buf);
 1550|  1.75k|}
archive_read_support_format_mtree.c:parse_hex_nibble:
 1476|  50.7k|{
 1477|  50.7k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1477:6): [True: 50.4k, False: 280]
  |  Branch (1477:18): [True: 28.6k, False: 21.8k]
  ------------------
 1478|  28.6k|		return c - '0';
 1479|  22.1k|	if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1479:6): [True: 21.2k, False: 867]
  |  Branch (1479:18): [True: 20.6k, False: 602]
  ------------------
 1480|  20.6k|		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.46k|	return -1;
 1488|  22.1k|}
archive_read_support_format_mtree.c:read_data:
 1838|  35.2k|{
 1839|  35.2k|	struct mtree *mtree = a->format->data;
 1840|  35.2k|	size_t bytes_to_read;
 1841|  35.2k|	ssize_t bytes_read;
 1842|       |
 1843|  35.2k|	if (mtree->fd < 0) {
  ------------------
  |  Branch (1843:6): [True: 35.2k, False: 0]
  ------------------
 1844|  35.2k|		*buff = NULL;
 1845|  35.2k|		*offset = 0;
 1846|  35.2k|		*size = 0;
 1847|  35.2k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  35.2k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1848|  35.2k|	}
 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|  35.2k|{
 1883|  35.2k|	struct mtree *mtree = a->format->data;
 1884|       |
 1885|  35.2k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1885:6): [True: 0, False: 35.2k]
  ------------------
 1886|      0|		close(mtree->fd);
 1887|      0|		mtree->fd = -1;
 1888|      0|	}
 1889|  35.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  35.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1890|  35.2k|}

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

archive_read_support_format_rar5:
 4450|  11.9k|int archive_read_support_format_rar5(struct archive *_a) {
 4451|  11.9k|	struct archive_read* ar = (struct archive_read*)_a;
 4452|  11.9k|	struct rar5 *rar5;
 4453|  11.9k|	int r;
 4454|       |
 4455|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
 4456|  11.9k|	    "archive_read_support_format_rar5");
 4457|       |
 4458|  11.9k|	rar5 = malloc(sizeof(*rar5));
 4459|  11.9k|	if(rar5 == NULL) {
  ------------------
  |  Branch (4459:5): [True: 0, False: 11.9k]
  ------------------
 4460|      0|		archive_set_error(&ar->archive, ENOMEM,
 4461|      0|		    "Can't allocate rar5 data");
 4462|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4463|      0|	}
 4464|       |
 4465|  11.9k|	if(ARCHIVE_OK != rar5_init(rar5)) {
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4465:5): [True: 0, False: 11.9k]
  ------------------
 4466|      0|		archive_set_error(&ar->archive, ENOMEM,
 4467|      0|		    "Can't allocate rar5 filter buffer");
 4468|      0|		free(rar5);
 4469|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4470|      0|	}
 4471|       |
 4472|  11.9k|	r = __archive_read_register_format(ar,
 4473|  11.9k|	    rar5,
 4474|  11.9k|	    "rar5",
 4475|  11.9k|	    rar5_bid,
 4476|  11.9k|	    rar5_options,
 4477|  11.9k|	    rar5_read_header,
 4478|  11.9k|	    rar5_read_data,
 4479|  11.9k|	    rar5_read_data_skip,
 4480|  11.9k|	    rar5_seek_data,
 4481|  11.9k|	    rar5_cleanup,
 4482|  11.9k|	    rar5_capabilities,
 4483|  11.9k|	    rar5_has_encrypted_entries);
 4484|       |
 4485|  11.9k|	if(r != ARCHIVE_OK) {
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4485:5): [True: 0, False: 11.9k]
  ------------------
 4486|      0|		rar5_deinit(rar5);
 4487|      0|		free(rar5);
 4488|      0|	}
 4489|  11.9k|	return r;
 4490|  11.9k|}
archive_read_support_format_rar5.c:rar5_init:
 4430|  11.9k|static int rar5_init(struct rar5 *rar5) {
 4431|  11.9k|	memset(rar5, 0, sizeof(struct rar5));
 4432|       |
 4433|  11.9k|	if(CDE_OK != cdeque_init(&rar5->cstate.filters, 8192))
  ------------------
  |  Branch (4433:5): [True: 0, False: 11.9k]
  ------------------
 4434|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4435|       |
 4436|       |	/*
 4437|       |	 * Until enough data has been read, we cannot tell about
 4438|       |	 * any encrypted entries yet.
 4439|       |	 */
 4440|  11.9k|	rar5->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  11.9k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4441|       |
 4442|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4443|  11.9k|}
archive_read_support_format_rar5.c:cdeque_init:
  396|  11.9k|static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) {
  397|  11.9k|	if(d == NULL || max_capacity_power_of_2 == 0)
  ------------------
  |  Branch (397:5): [True: 0, False: 11.9k]
  |  Branch (397:18): [True: 0, False: 11.9k]
  ------------------
  398|      0|		return CDE_PARAM;
  399|       |
  400|  11.9k|	d->cap_mask = max_capacity_power_of_2 - 1;
  401|  11.9k|	d->arr = NULL;
  402|       |
  403|  11.9k|	if((max_capacity_power_of_2 & d->cap_mask) != 0)
  ------------------
  |  Branch (403:5): [True: 0, False: 11.9k]
  ------------------
  404|      0|		return CDE_PARAM;
  405|       |
  406|  11.9k|	cdeque_clear(d);
  407|  11.9k|	d->arr = malloc(sizeof(void*) * max_capacity_power_of_2);
  408|       |
  409|  11.9k|	return d->arr ? CDE_OK : CDE_ALLOC;
  ------------------
  |  Branch (409:9): [True: 11.9k, False: 0]
  ------------------
  410|  11.9k|}
archive_read_support_format_rar5.c:cdeque_clear:
  387|  32.5k|static void cdeque_clear(struct cdeque* d) {
  388|  32.5k|	d->size = 0;
  389|  32.5k|	d->beg_pos = 0;
  390|  32.5k|	d->end_pos = 0;
  391|  32.5k|}
archive_read_support_format_rar5.c:rar5_bid:
 1156|  11.7k|static int rar5_bid(struct archive_read* a, int best_bid) {
 1157|  11.7k|	int my_bid;
 1158|       |
 1159|  11.7k|	if(best_bid > 30)
  ------------------
  |  Branch (1159:5): [True: 5.90k, False: 5.85k]
  ------------------
 1160|  5.90k|		return -1;
 1161|       |
 1162|  5.85k|	my_bid = bid_standard(a);
 1163|  5.85k|	if(my_bid > -1) {
  ------------------
  |  Branch (1163:5): [True: 1.47k, False: 4.37k]
  ------------------
 1164|  1.47k|		return my_bid;
 1165|  1.47k|	}
 1166|  4.37k|	my_bid = bid_sfx(a);
 1167|  4.37k|	if (my_bid > -1) {
  ------------------
  |  Branch (1167:6): [True: 4.28k, False: 90]
  ------------------
 1168|  4.28k|		return my_bid;
 1169|  4.28k|	}
 1170|       |
 1171|     90|	return -1;
 1172|  4.37k|}
archive_read_support_format_rar5.c:bid_standard:
 1103|  5.85k|static int bid_standard(struct archive_read* a) {
 1104|  5.85k|	const uint8_t* p;
 1105|  5.85k|	char signature[sizeof(rar5_signature_xor)];
 1106|       |
 1107|  5.85k|	rar5_signature(signature);
 1108|       |
 1109|  5.85k|	if(!read_ahead(a, sizeof(rar5_signature_xor), &p))
  ------------------
  |  Branch (1109:5): [True: 90, False: 5.76k]
  ------------------
 1110|     90|		return -1;
 1111|       |
 1112|  5.76k|	if(!memcmp(signature, p, sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1112:5): [True: 1.47k, False: 4.28k]
  ------------------
 1113|  1.47k|		return 30;
 1114|       |
 1115|  4.28k|	return -1;
 1116|  5.76k|}
archive_read_support_format_rar5.c:rar5_signature:
 4252|  13.5k|static void rar5_signature(char *buf) {
 4253|  13.5k|		size_t i;
 4254|       |
 4255|   122k|		for(i = 0; i < sizeof(rar5_signature_xor); i++) {
  ------------------
  |  Branch (4255:14): [True: 108k, False: 13.5k]
  ------------------
 4256|   108k|			buf[i] = rar5_signature_xor[i] ^ 0xA1;
 4257|   108k|		}
 4258|  13.5k|}
archive_read_support_format_rar5.c:read_ahead:
  894|   549k|{
  895|   549k|	if(!ptr)
  ------------------
  |  Branch (895:5): [True: 0, False: 549k]
  ------------------
  896|      0|		return 0;
  897|       |
  898|   549k|	*ptr = __archive_read_ahead(a, how_many, NULL);
  899|   549k|	if(*ptr == NULL) {
  ------------------
  |  Branch (899:5): [True: 2.54k, False: 546k]
  ------------------
  900|  2.54k|		return 0;
  901|  2.54k|	}
  902|       |
  903|   546k|	return 1;
  904|   549k|}
archive_read_support_format_rar5.c:bid_sfx:
 1119|  4.37k|{
 1120|  4.37k|	const char *p;
 1121|       |
 1122|  4.37k|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1122:6): [True: 90, False: 4.28k]
  ------------------
 1123|     90|		return -1;
 1124|       |
 1125|  4.28k|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (1125:7): [True: 305, False: 3.97k]
  |  Branch (1125:22): [True: 295, False: 10]
  |  Branch (1125:38): [True: 85, False: 3.90k]
  ------------------
 1126|       |		/* This is a PE file */
 1127|    380|		char signature[sizeof(rar5_signature_xor)];
 1128|    380|		ssize_t offset = 0x10000;
 1129|    380|		ssize_t window = 4096;
 1130|    380|		ssize_t bytes_avail;
 1131|       |
 1132|    380|		rar5_signature(signature);
 1133|       |
 1134|  2.72k|		while (offset + window <= (1024 * 512)) {
  ------------------
  |  Branch (1134:10): [True: 2.71k, False: 13]
  ------------------
 1135|  2.71k|			const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
 1136|  2.71k|			if (buff == NULL) {
  ------------------
  |  Branch (1136:8): [True: 2.49k, False: 219]
  ------------------
 1137|       |				/* Remaining bytes are less than window. */
 1138|  2.49k|				window >>= 1;
 1139|  2.49k|				if (window < 0x40)
  ------------------
  |  Branch (1139:9): [True: 354, False: 2.14k]
  ------------------
 1140|    354|					return 0;
 1141|  2.14k|				continue;
 1142|  2.49k|			}
 1143|    219|			p = buff + offset;
 1144|   850k|			while (p + 8 < buff + bytes_avail) {
  ------------------
  |  Branch (1144:11): [True: 850k, False: 206]
  ------------------
 1145|   850k|				if (memcmp(p, signature, sizeof(signature)) == 0)
  ------------------
  |  Branch (1145:9): [True: 13, False: 850k]
  ------------------
 1146|     13|					return 30;
 1147|   850k|				p += 0x10;
 1148|   850k|			}
 1149|    206|			offset = p - buff;
 1150|    206|		}
 1151|    380|	}
 1152|       |
 1153|  3.91k|	return 0;
 1154|  4.28k|}
archive_read_support_format_rar5.c:rar5_read_header:
 2541|  5.22k|{
 2542|  5.22k|	struct rar5 *rar5 = a->format->data;
 2543|  5.22k|	int ret;
 2544|       |
 2545|       |	/*
 2546|       |	 * It should be sufficient to call archive_read_next_header() for
 2547|       |	 * a reader to determine if an entry is encrypted or not.
 2548|       |	 */
 2549|  5.22k|	if (rar5->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  5.22k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (2549:6): [True: 1.39k, False: 3.83k]
  ------------------
 2550|  1.39k|		rar5->has_encrypted_entries = 0;
 2551|  1.39k|	}
 2552|       |
 2553|  5.22k|	if(rar5->header_initialized == 0) {
  ------------------
  |  Branch (2553:5): [True: 1.39k, False: 3.83k]
  ------------------
 2554|  1.39k|		init_header(a);
 2555|  1.39k|		if ((ret = try_skip_sfx(a)) < ARCHIVE_WARN)
  ------------------
  |  |  235|  1.39k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2555:7): [True: 0, False: 1.39k]
  ------------------
 2556|      0|			return ret;
 2557|  1.39k|		rar5->header_initialized = 1;
 2558|  1.39k|	}
 2559|       |
 2560|  5.22k|	if(rar5->skipped_magic == 0) {
  ------------------
  |  Branch (2560:5): [True: 1.39k, False: 3.83k]
  ------------------
 2561|  1.39k|		if(ARCHIVE_OK != consume(a, sizeof(rar5_signature_xor))) {
  ------------------
  |  |  233|  1.39k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2561:6): [True: 1, False: 1.38k]
  ------------------
 2562|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2563|      1|		}
 2564|       |
 2565|  1.38k|		rar5->skipped_magic = 1;
 2566|  1.38k|	}
 2567|       |
 2568|  9.03k|	do {
 2569|  9.03k|		ret = process_base_block(a, entry);
 2570|  9.03k|	} while(ret == ARCHIVE_RETRY ||
  ------------------
  |  |  234|  18.0k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (2570:10): [True: 2.77k, False: 6.25k]
  ------------------
 2571|  6.25k|			(rar5->main.endarc > 0 && ret == ARCHIVE_OK));
  ------------------
  |  |  233|  1.06k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2571:5): [True: 1.06k, False: 5.19k]
  |  Branch (2571:30): [True: 1.03k, False: 27]
  ------------------
 2572|       |
 2573|  5.22k|	return ret;
 2574|  5.22k|}
archive_read_support_format_rar5.c:init_header:
 1187|  1.39k|static void init_header(struct archive_read* a) {
 1188|  1.39k|	a->archive.archive_format = ARCHIVE_FORMAT_RAR_V5;
  ------------------
  |  |  387|  1.39k|#define	ARCHIVE_FORMAT_RAR_V5			0x100000
  ------------------
 1189|  1.39k|	a->archive.archive_format_name = "RAR5";
 1190|  1.39k|}
archive_read_support_format_rar5.c:try_skip_sfx:
 2484|  1.39k|{
 2485|  1.39k|	const char *p;
 2486|       |
 2487|  1.39k|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (2487:6): [True: 1, False: 1.38k]
  ------------------
 2488|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2489|       |
 2490|  1.38k|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (2490:7): [True: 8, False: 1.38k]
  |  Branch (2490:22): [True: 8, False: 0]
  |  Branch (2490:38): [True: 4, False: 1.37k]
  ------------------
 2491|     12|	{
 2492|     12|		char signature[sizeof(rar5_signature_xor)];
 2493|     12|		const void *h;
 2494|     12|		const char *q;
 2495|     12|		size_t skip, total = 0;
 2496|     12|		ssize_t bytes, window = 4096;
 2497|       |
 2498|     12|		rar5_signature(signature);
 2499|       |
 2500|     12|		while (total + window <= (1024 * 512)) {
  ------------------
  |  Branch (2500:10): [True: 12, False: 0]
  ------------------
 2501|     12|			h = __archive_read_ahead(a, window, &bytes);
 2502|     12|			if (h == NULL) {
  ------------------
  |  Branch (2502:8): [True: 0, False: 12]
  ------------------
 2503|       |				/* Remaining bytes are less than window. */
 2504|      0|				window >>= 1;
 2505|      0|				if (window < 0x40)
  ------------------
  |  Branch (2505:9): [True: 0, False: 0]
  ------------------
 2506|      0|					goto fatal;
 2507|      0|				continue;
 2508|      0|			}
 2509|     12|			if (bytes < 0x40)
  ------------------
  |  Branch (2509:8): [True: 0, False: 12]
  ------------------
 2510|      0|				goto fatal;
 2511|     12|			p = h;
 2512|     12|			q = p + bytes;
 2513|       |
 2514|       |			/*
 2515|       |			 * Scan ahead until we find something that looks
 2516|       |			 * like the RAR header.
 2517|       |			 */
 2518|  11.4k|			while (p + 8 < q) {
  ------------------
  |  Branch (2518:11): [True: 11.4k, False: 0]
  ------------------
 2519|  11.4k|				if (memcmp(p, signature, sizeof(signature)) == 0) {
  ------------------
  |  Branch (2519:9): [True: 12, False: 11.4k]
  ------------------
 2520|     12|					skip = p - (const char *)h;
 2521|     12|					__archive_read_consume(a, skip);
 2522|     12|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     12|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2523|     12|				}
 2524|  11.4k|				p += 0x10;
 2525|  11.4k|			}
 2526|      0|			skip = p - (const char *)h;
 2527|      0|			__archive_read_consume(a, skip);
 2528|      0|			total += skip;
 2529|      0|		}
 2530|     12|	}
 2531|       |
 2532|  1.37k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2533|      0|fatal:
 2534|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2535|      0|			"Couldn't find out RAR header");
 2536|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2537|  1.38k|}
archive_read_support_format_rar5.c:consume:
  906|   511k|static int consume(struct archive_read* a, int64_t how_many) {
  907|   511k|	int ret;
  908|       |
  909|   511k|	ret = how_many == __archive_read_consume(a, how_many)
  ------------------
  |  Branch (909:8): [True: 511k, False: 648]
  ------------------
  910|   511k|		? ARCHIVE_OK
  ------------------
  |  |  233|   511k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  911|   511k|		: ARCHIVE_FATAL;
  ------------------
  |  |  239|   512k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  912|       |
  913|   511k|	return ret;
  914|   511k|}
archive_read_support_format_rar5.c:process_base_block:
 2278|  30.9k|{
 2279|  30.9k|	const size_t SMALLEST_RAR5_BLOCK_SIZE = 3;
 2280|       |
 2281|  30.9k|	struct rar5 *rar5 = a->format->data;
 2282|  30.9k|	uint32_t hdr_crc, computed_crc;
 2283|  30.9k|	size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
 2284|  30.9k|	size_t header_id = 0;
 2285|  30.9k|	size_t header_flags = 0;
 2286|  30.9k|	const uint8_t* p;
 2287|  30.9k|	const uint8_t* body_start;
 2288|  30.9k|	int ret;
 2289|       |
 2290|  30.9k|	enum HEADER_TYPE {
 2291|  30.9k|		HEAD_MARK    = 0x00, HEAD_MAIN  = 0x01, HEAD_FILE   = 0x02,
 2292|  30.9k|		HEAD_SERVICE = 0x03, HEAD_CRYPT = 0x04, HEAD_ENDARC = 0x05,
 2293|  30.9k|		HEAD_UNKNOWN = 0xff,
 2294|  30.9k|	};
 2295|       |
 2296|       |	/* Skip any unprocessed data for this file. */
 2297|  30.9k|	ret = skip_unprocessed_bytes(a);
 2298|  30.9k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  30.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2298:5): [True: 2.38k, False: 28.5k]
  ------------------
 2299|  2.38k|		return ret;
 2300|       |
 2301|       |	/* Read the expected CRC32 checksum. */
 2302|  28.5k|	if(!read_u32(a, &hdr_crc)) {
  ------------------
  |  Branch (2302:5): [True: 106, False: 28.4k]
  ------------------
 2303|    106|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    106|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2304|    106|	}
 2305|       |
 2306|       |	/* Read header size. */
 2307|  28.4k|	if(!read_var_sized(a, &raw_hdr_size, &hdr_size_len)) {
  ------------------
  |  Branch (2307:5): [True: 298, False: 28.1k]
  ------------------
 2308|    298|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    298|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2309|    298|	}
 2310|       |
 2311|  28.1k|	hdr_size = raw_hdr_size + hdr_size_len;
 2312|       |
 2313|       |	/* Sanity check, maximum header size for RAR5 is 2MB. */
 2314|  28.1k|	if(hdr_size > (2 * 1024 * 1024)) {
  ------------------
  |  Branch (2314:5): [True: 38, False: 28.1k]
  ------------------
 2315|     38|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     38|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2316|     38|		    "Base block header is too large");
 2317|       |
 2318|     38|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     38|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2319|     38|	}
 2320|       |
 2321|       |	/* Additional sanity checks to weed out invalid files. */
 2322|  28.1k|	if(raw_hdr_size == 0 || hdr_size_len == 0 ||
  ------------------
  |  Branch (2322:5): [True: 99, False: 28.0k]
  |  Branch (2322:26): [True: 0, False: 28.0k]
  ------------------
 2323|  28.0k|		hdr_size < SMALLEST_RAR5_BLOCK_SIZE)
  ------------------
  |  Branch (2323:3): [True: 10, False: 28.0k]
  ------------------
 2324|    109|	{
 2325|    109|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    109|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2326|    109|		    "Too small block encountered (%zu bytes)",
 2327|    109|		    raw_hdr_size);
 2328|       |
 2329|    109|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|    109|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2330|    109|	}
 2331|       |
 2332|       |	/* Read the whole header data into memory, maximum memory use here is
 2333|       |	 * 2MB. */
 2334|  28.0k|	if(!read_ahead(a, hdr_size, &p)) {
  ------------------
  |  Branch (2334:5): [True: 298, False: 27.7k]
  ------------------
 2335|    298|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    298|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2336|    298|	}
 2337|       |
 2338|       |	/* Verify the CRC32 of the header data. */
 2339|  27.7k|	computed_crc = (uint32_t) crc32(0, p, (int) hdr_size);
 2340|  27.7k|	if(computed_crc != hdr_crc) {
  ------------------
  |  Branch (2340:5): [True: 26.7k, False: 977]
  ------------------
 2341|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2342|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2343|       |		    "Header CRC error");
 2344|       |
 2345|       |		return ARCHIVE_FATAL;
 2346|       |#endif
 2347|  26.7k|	}
 2348|       |
 2349|       |	/* Remember the first byte of the block body so we can later skip
 2350|       |	 * any bytes the sub-parser leaves unconsumed. */
 2351|  27.7k|	body_start = p + hdr_size_len;
 2352|       |
 2353|       |	/* If the checksum is OK, we proceed with parsing. */
 2354|  27.7k|	if(ARCHIVE_OK != consume(a, hdr_size_len)) {
  ------------------
  |  |  233|  27.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2354:5): [True: 0, False: 27.7k]
  ------------------
 2355|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2356|      0|	}
 2357|       |
 2358|  27.7k|	if(!read_var_sized(a, &header_id, NULL))
  ------------------
  |  Branch (2358:5): [True: 9, False: 27.7k]
  ------------------
 2359|      9|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      9|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2360|       |
 2361|  27.7k|	if(!read_var_sized(a, &header_flags, NULL))
  ------------------
  |  Branch (2361:5): [True: 8, False: 27.7k]
  ------------------
 2362|      8|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2363|       |
 2364|  27.7k|	rar5->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
 2365|  27.7k|	rar5->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
 2366|  27.7k|	rar5->generic.size = (int)hdr_size;
 2367|  27.7k|	rar5->generic.last_header_id = (int)header_id;
 2368|  27.7k|	rar5->main.endarc = 0;
 2369|       |
 2370|       |	/* Those are possible header ids in RARv5. */
 2371|  27.7k|	switch(header_id) {
 2372|  2.86k|		case HEAD_MAIN:
  ------------------
  |  Branch (2372:3): [True: 2.86k, False: 24.8k]
  ------------------
 2373|  2.86k|			ret = process_head_main(a, rar5, entry, header_flags);
 2374|       |
 2375|       |			/* Main header doesn't have any files in it, so it's
 2376|       |			 * pointless to return to the caller. Retry to next
 2377|       |			 * header, which should be HEAD_FILE/HEAD_SERVICE. */
 2378|  2.86k|			if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|  2.86k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2378:7): [True: 2.30k, False: 561]
  ------------------
 2379|  2.30k|				rar5_skip_remaining_block(a, body_start,
 2380|  2.30k|				    raw_hdr_size);
 2381|  2.30k|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|  2.30k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2382|  2.30k|			}
 2383|       |
 2384|    561|			return ret;
 2385|  1.73k|		case HEAD_SERVICE:
  ------------------
  |  Branch (2385:3): [True: 1.73k, False: 25.9k]
  ------------------
 2386|  1.73k|			ret = process_head_service(a, rar5, entry, header_flags);
 2387|  1.73k|			return ret;
 2388|  12.2k|		case HEAD_FILE:
  ------------------
  |  Branch (2388:3): [True: 12.2k, False: 15.4k]
  ------------------
 2389|  12.2k|			ret = process_head_file(a, rar5, entry, header_flags);
 2390|  12.2k|			return ret;
 2391|      2|		case HEAD_CRYPT:
  ------------------
  |  Branch (2391:3): [True: 2, False: 27.7k]
  ------------------
 2392|      2|			archive_entry_set_is_metadata_encrypted(entry, 1);
 2393|      2|			archive_entry_set_is_data_encrypted(entry, 1);
 2394|      2|			rar5->has_encrypted_entries = 1;
 2395|      2|			rar5->headers_are_encrypted = 1;
 2396|      2|			archive_set_error(&a->archive,
 2397|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2398|      2|			    "Encryption is not supported");
 2399|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2400|  7.50k|		case HEAD_ENDARC:
  ------------------
  |  Branch (2400:3): [True: 7.50k, False: 20.1k]
  ------------------
 2401|  7.50k|			rar5->main.endarc = 1;
 2402|       |
 2403|       |			/* After encountering an end of file marker, we need
 2404|       |			 * to take into consideration if this archive is
 2405|       |			 * continued in another file (i.e. is it part01.rar:
 2406|       |			 * is there a part02.rar?) */
 2407|  7.50k|			if(rar5->main.volume) {
  ------------------
  |  Branch (2407:7): [True: 7.35k, False: 155]
  ------------------
 2408|       |				/* In case there is part02.rar, position the
 2409|       |				 * read pointer in a proper place, so we can
 2410|       |				 * resume parsing. */
 2411|  7.35k|				ret = scan_for_signature(a);
 2412|  7.35k|				if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  7.35k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2412:8): [True: 0, False: 7.35k]
  ------------------
 2413|      0|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2414|  7.35k|				} else {
 2415|  7.35k|					if(rar5->vol.expected_vol_no ==
  ------------------
  |  Branch (2415:9): [True: 1, False: 7.35k]
  ------------------
 2416|  7.35k|					    UINT_MAX) {
 2417|      1|						archive_set_error(&a->archive,
 2418|      1|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2419|      1|						    "Header error");
 2420|      1|							return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2421|      1|					}
 2422|       |
 2423|  7.35k|					rar5->vol.expected_vol_no =
 2424|  7.35k|					    rar5->main.vol_no + 1;
 2425|  7.35k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  7.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2426|  7.35k|				}
 2427|  7.35k|			} else {
 2428|    155|				return ARCHIVE_EOF;
  ------------------
  |  |  232|    155|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2429|    155|			}
 2430|    163|		case HEAD_MARK:
  ------------------
  |  Branch (2430:3): [True: 163, False: 27.5k]
  ------------------
 2431|    163|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    163|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2432|  3.14k|		default:
  ------------------
  |  Branch (2432:3): [True: 3.14k, False: 24.5k]
  ------------------
 2433|  3.14k|			if((header_flags & HFL_SKIP_IF_UNKNOWN) == 0) {
  ------------------
  |  Branch (2433:7): [True: 88, False: 3.05k]
  ------------------
 2434|     88|				archive_set_error(&a->archive,
 2435|     88|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     88|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2436|     88|				    "Header type error");
 2437|     88|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|     88|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2438|  3.05k|			} else {
 2439|       |				/* If the block is marked as 'skip if unknown',
 2440|       |				 * do as the flag says: skip the block
 2441|       |				 * instead on failing on it. */
 2442|  3.05k|				rar5_skip_remaining_block(a, body_start,
 2443|  3.05k|				    raw_hdr_size);
 2444|  3.05k|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|  3.05k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2445|  3.05k|			}
 2446|  27.7k|	}
 2447|       |
 2448|      0|#if !defined WIN32
 2449|       |	// Not reached.
 2450|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2451|      0|	    "Internal unpacker error");
 2452|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2453|  27.7k|#endif
 2454|  27.7k|}
archive_read_support_format_rar5.c:skip_unprocessed_bytes:
 2168|  30.9k|static int skip_unprocessed_bytes(struct archive_read* a) {
 2169|  30.9k|	struct rar5 *rar5 = a->format->data;
 2170|  30.9k|	int ret;
 2171|       |
 2172|  30.9k|	if(rar5->file.bytes_remaining) {
  ------------------
  |  Branch (2172:5): [True: 4.24k, False: 26.7k]
  ------------------
 2173|       |		/* Use different skipping method in block merging mode than in
 2174|       |		 * normal mode. If merge mode is active, rar5_read_data_skip
 2175|       |		 * can't be used, because it could allow recursive use of
 2176|       |		 * merge_block() * function, and this function doesn't support
 2177|       |		 * recursive use. */
 2178|  4.24k|		if(rar5->merge_mode) {
  ------------------
  |  Branch (2178:6): [True: 934, False: 3.31k]
  ------------------
 2179|       |			/* Discard whole merged block. This is valid in solid
 2180|       |			 * mode as well, because the code will discard blocks
 2181|       |			 * only if those blocks are safe to discard (i.e.
 2182|       |			 * they're not FILE blocks).  */
 2183|    934|			ret = consume(a, rar5->file.bytes_remaining);
 2184|    934|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    934|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2184:7): [True: 17, False: 917]
  ------------------
 2185|     17|				return ret;
 2186|     17|			}
 2187|    917|			rar5->file.bytes_remaining = 0;
 2188|  3.31k|		} else {
 2189|       |			/* If we're not in merge mode, use safe skipping code.
 2190|       |			 * This will ensure we'll handle solid archives
 2191|       |			 * properly. */
 2192|  3.31k|			ret = rar5_read_data_skip(a);
 2193|  3.31k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  3.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2193:7): [True: 2.36k, False: 944]
  ------------------
 2194|  2.36k|				return ret;
 2195|  2.36k|			}
 2196|  3.31k|		}
 2197|  4.24k|	}
 2198|       |
 2199|  28.5k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  28.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2200|  30.9k|}
archive_read_support_format_rar5.c:read_u32:
 1085|  43.7k|static char read_u32(struct archive_read* a, uint32_t* pvalue) {
 1086|  43.7k|	const uint8_t* p;
 1087|  43.7k|	if(!read_ahead(a, 4, &p))
  ------------------
  |  Branch (1087:5): [True: 108, False: 43.6k]
  ------------------
 1088|    108|		return 0;
 1089|       |
 1090|  43.6k|	*pvalue = archive_le32dec(p);
 1091|  43.6k|	return ARCHIVE_OK == consume(a, 4);
  ------------------
  |  |  233|  43.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1092|  43.7k|}
archive_read_support_format_rar5.c:read_var_sized:
  999|   241k|{
 1000|   241k|	uint64_t v;
 1001|   241k|	uint64_t v_size = 0;
 1002|       |
 1003|   241k|	const int ret = pvalue_len ? read_var(a, &v, &v_size)
  ------------------
  |  Branch (1003:18): [True: 89.9k, False: 152k]
  ------------------
 1004|   241k|				   : read_var(a, &v, NULL);
 1005|       |
 1006|   241k|	if(ret == 1 && pvalue) {
  ------------------
  |  Branch (1006:5): [True: 240k, False: 1.21k]
  |  Branch (1006:17): [True: 240k, False: 0]
  ------------------
 1007|   240k|		*pvalue = (size_t) v;
 1008|   240k|	}
 1009|       |
 1010|   241k|	if(pvalue_len) {
  ------------------
  |  Branch (1010:5): [True: 89.9k, False: 152k]
  ------------------
 1011|       |		/* Possible data truncation should be safe. */
 1012|  89.9k|		*pvalue_len = (size_t) v_size;
 1013|  89.9k|	}
 1014|       |
 1015|   241k|	return ret;
 1016|   241k|}
archive_read_support_format_rar5.c:read_var:
  935|   373k|{
  936|   373k|	uint64_t multiplier;
  937|   373k|	uint64_t result = 0;
  938|   373k|	size_t i;
  939|   373k|	const uint8_t* p;
  940|       |
  941|       |	/* We will read maximum of 10 bytes. We don't have to handle the
  942|       |	 * situation to read the RAR5 variable-sized value stored at the end of
  943|       |	 * the file, because such situation will never happen. */
  944|   373k|	if(!read_ahead(a, 10, &p))
  ------------------
  |  Branch (944:5): [True: 427, False: 373k]
  ------------------
  945|    427|		return 0;
  946|       |
  947|   460k|	for(multiplier = 1, i = 0; i < 10; i++, multiplier *= 128) {
  ------------------
  |  Branch (947:29): [True: 460k, False: 76]
  ------------------
  948|   460k|		uint64_t val;
  949|   460k|		uint8_t b;
  950|       |
  951|   460k|		b = p[i];
  952|       |
  953|       |		/* Strip the MSB from the input byte and add the resulting
  954|       |		 * number to the `result`. */
  955|   460k|		if(archive_ckd_mul_u64(&val, b & 0x7F, multiplier) ||
  ------------------
  |  Branch (955:6): [True: 1.20k, False: 458k]
  ------------------
  956|   458k|		   archive_ckd_add_u64(&result, result, val)) {
  ------------------
  |  Branch (956:6): [True: 0, False: 458k]
  ------------------
  957|       |			/* Integer overflow occurred. */
  958|  1.20k|			return 0;
  959|  1.20k|		}
  960|       |
  961|       |		/* MSB set to 1 means we need to continue decoding process.
  962|       |		 * MSB set to 0 means we're done.
  963|       |		 *
  964|       |		 * This conditional checks for the second case. */
  965|   458k|		if((b & 0x80) == 0) {
  ------------------
  |  Branch (965:6): [True: 372k, False: 86.8k]
  ------------------
  966|   372k|			if(pvalue) {
  ------------------
  |  Branch (966:7): [True: 372k, False: 0]
  ------------------
  967|   372k|				*pvalue = result;
  968|   372k|			}
  969|       |
  970|       |			/* If the caller has passed the `pvalue_len` pointer,
  971|       |			 * store the number of consumed bytes in it and do NOT
  972|       |			 * consume those bytes, since the caller has all the
  973|       |			 * information it needs to perform */
  974|   372k|			if(pvalue_len) {
  ------------------
  |  Branch (974:7): [True: 194k, False: 177k]
  ------------------
  975|   194k|				*pvalue_len = 1 + i;
  976|   194k|			} else {
  977|       |				/* If the caller did not provide the
  978|       |				 * `pvalue_len` pointer, it will not have the
  979|       |				 * possibility to advance the file pointer,
  980|       |				 * because it will not know how many bytes it
  981|       |				 * needs to consume. This is why we handle
  982|       |				 * such situation here automatically. */
  983|   177k|				if(ARCHIVE_OK != consume(a, 1 + i)) {
  ------------------
  |  |  233|   177k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (983:8): [True: 0, False: 177k]
  ------------------
  984|      0|					return 0;
  985|      0|				}
  986|   177k|			}
  987|       |
  988|       |			/* End of decoding process, return success. */
  989|   372k|			return 1;
  990|   372k|		}
  991|   458k|	}
  992|       |
  993|       |	/* All continuation bits were set. This is an error. */
  994|     76|	return 0;
  995|   373k|}
archive_read_support_format_rar5.c:process_head_main:
 2062|  2.86k|{
 2063|  2.86k|	int ret;
 2064|  2.86k|	uint64_t extra_data_size = 0;
 2065|  2.86k|	size_t extra_field_size = 0;
 2066|  2.86k|	size_t extra_field_id = 0;
 2067|  2.86k|	size_t archive_flags = 0;
 2068|       |
 2069|  2.86k|	enum MAIN_FLAGS {
 2070|  2.86k|		VOLUME = 0x0001,         /* multi-volume archive */
 2071|  2.86k|		VOLUME_NUMBER = 0x0002,  /* volume number, first vol doesn't
 2072|       |					  * have it */
 2073|  2.86k|		SOLID = 0x0004,          /* solid archive */
 2074|  2.86k|		PROTECT = 0x0008,        /* contains Recovery info */
 2075|  2.86k|		LOCK = 0x0010,           /* readonly flag, not used */
 2076|  2.86k|	};
 2077|       |
 2078|  2.86k|	enum MAIN_EXTRA {
 2079|       |		// Just one attribute here.
 2080|  2.86k|		LOCATOR = 0x01,
 2081|  2.86k|	};
 2082|       |
 2083|  2.86k|	(void) entry;
 2084|       |
 2085|  2.86k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (2085:5): [True: 1.89k, False: 973]
  ------------------
 2086|  1.89k|		if(!read_var(a, &extra_data_size, NULL))
  ------------------
  |  Branch (2086:6): [True: 2, False: 1.89k]
  ------------------
 2087|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2088|  1.89k|	} else {
 2089|    973|		extra_data_size = 0;
 2090|    973|	}
 2091|       |
 2092|  2.86k|	if(!read_var_sized(a, &archive_flags, NULL)) {
  ------------------
  |  Branch (2092:5): [True: 1, False: 2.86k]
  ------------------
 2093|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2094|      1|	}
 2095|       |
 2096|  2.86k|	rar5->main.volume = (archive_flags & VOLUME) > 0;
 2097|  2.86k|	rar5->main.solid = (archive_flags & SOLID) > 0;
 2098|       |
 2099|  2.86k|	if(archive_flags & VOLUME_NUMBER) {
  ------------------
  |  Branch (2099:5): [True: 1.09k, False: 1.77k]
  ------------------
 2100|  1.09k|		size_t v = 0;
 2101|  1.09k|		if(!read_var_sized(a, &v, NULL)) {
  ------------------
  |  Branch (2101:6): [True: 1, False: 1.08k]
  ------------------
 2102|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2103|      1|		}
 2104|       |
 2105|  1.08k|		if (v > UINT_MAX) {
  ------------------
  |  Branch (2105:7): [True: 0, False: 1.08k]
  ------------------
 2106|      0|			archive_set_error(&a->archive,
 2107|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2108|      0|			    "Invalid volume number");
 2109|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2110|      0|		}
 2111|       |
 2112|  1.08k|		rar5->main.vol_no = (unsigned int) v;
 2113|  1.77k|	} else {
 2114|  1.77k|		rar5->main.vol_no = 0;
 2115|  1.77k|	}
 2116|       |
 2117|  2.86k|	if(rar5->vol.expected_vol_no > 0 &&
  ------------------
  |  Branch (2117:5): [True: 580, False: 2.28k]
  ------------------
 2118|    580|		rar5->main.vol_no != rar5->vol.expected_vol_no)
  ------------------
  |  Branch (2118:3): [True: 542, False: 38]
  ------------------
 2119|    542|	{
 2120|       |		/* Returning EOF instead of FATAL because of strange
 2121|       |		 * libarchive behavior. When opening multiple files via
 2122|       |		 * archive_read_open_filenames(), after reading up the whole
 2123|       |		 * last file, the __archive_read_ahead function wraps up to
 2124|       |		 * the first archive instead of returning EOF. */
 2125|    542|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    542|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2126|    542|	}
 2127|       |
 2128|  2.32k|	if(extra_data_size == 0) {
  ------------------
  |  Branch (2128:5): [True: 435, False: 1.88k]
  ------------------
 2129|       |		/* Early return. */
 2130|    435|		return ARCHIVE_OK;
  ------------------
  |  |  233|    435|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2131|    435|	}
 2132|       |
 2133|  1.88k|	if(!read_var_sized(a, &extra_field_size, NULL)) {
  ------------------
  |  Branch (2133:5): [True: 1, False: 1.88k]
  ------------------
 2134|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2135|      1|	}
 2136|       |
 2137|  1.88k|	if(!read_var_sized(a, &extra_field_id, NULL)) {
  ------------------
  |  Branch (2137:5): [True: 0, False: 1.88k]
  ------------------
 2138|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2139|      0|	}
 2140|       |
 2141|  1.88k|	if(extra_field_size == 0) {
  ------------------
  |  Branch (2141:5): [True: 1, False: 1.88k]
  ------------------
 2142|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2143|      1|		    "Invalid extra field size");
 2144|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2145|      1|	}
 2146|       |
 2147|  1.88k|	switch(extra_field_id) {
 2148|  1.87k|		case LOCATOR:
  ------------------
  |  Branch (2148:3): [True: 1.87k, False: 10]
  ------------------
 2149|  1.87k|			ret = process_main_locator_extra_block(a, rar5);
 2150|  1.87k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2150:7): [True: 3, False: 1.87k]
  ------------------
 2151|       |				/* Error while parsing main locator extra
 2152|       |				 * block. */
 2153|      3|				return ret;
 2154|      3|			}
 2155|       |
 2156|  1.87k|			break;
 2157|  1.87k|		default:
  ------------------
  |  Branch (2157:3): [True: 10, False: 1.87k]
  ------------------
 2158|     10|			archive_set_error(&a->archive,
 2159|     10|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2160|     10|			    "Unsupported extra type (0x%jx)",
 2161|     10|			    (uintmax_t)extra_field_id);
 2162|     10|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2163|  1.88k|	}
 2164|       |
 2165|  1.87k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2166|  1.88k|}
archive_read_support_format_rar5.c:process_main_locator_extra_block:
 1211|  1.87k|{
 1212|  1.87k|	uint64_t locator_flags;
 1213|       |
 1214|  1.87k|	enum LOCATOR_FLAGS {
 1215|  1.87k|		QLIST = 0x01, RECOVERY = 0x02,
 1216|  1.87k|	};
 1217|       |
 1218|  1.87k|	if(!read_var(a, &locator_flags, NULL)) {
  ------------------
  |  Branch (1218:5): [True: 2, False: 1.87k]
  ------------------
 1219|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1220|      2|	}
 1221|       |
 1222|  1.87k|	if(locator_flags & QLIST) {
  ------------------
  |  Branch (1222:5): [True: 322, False: 1.55k]
  ------------------
 1223|    322|		if(!read_var(a, &rar5->qlist_offset, NULL)) {
  ------------------
  |  Branch (1223:6): [True: 0, False: 322]
  ------------------
 1224|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1225|      0|		}
 1226|       |
 1227|       |		/* qlist is not used */
 1228|    322|	}
 1229|       |
 1230|  1.87k|	if(locator_flags & RECOVERY) {
  ------------------
  |  Branch (1230:5): [True: 187, False: 1.68k]
  ------------------
 1231|    187|		if(!read_var(a, &rar5->rr_offset, NULL)) {
  ------------------
  |  Branch (1231:6): [True: 1, False: 186]
  ------------------
 1232|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1233|      1|		}
 1234|       |
 1235|       |		/* rr is not used */
 1236|    187|	}
 1237|       |
 1238|  1.87k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1239|  1.87k|}
archive_read_support_format_rar5.c:rar5_skip_remaining_block:
 2265|  5.35k|{
 2266|  5.35k|	const uint8_t* cur;
 2267|       |
 2268|  5.35k|	if(read_ahead(a, 1, &cur)) {
  ------------------
  |  Branch (2268:5): [True: 5.35k, False: 0]
  ------------------
 2269|  5.35k|		size_t body_used = (size_t)(cur - body_start);
 2270|       |
 2271|  5.35k|		if(body_used < raw_hdr_size)
  ------------------
  |  Branch (2271:6): [True: 3.25k, False: 2.10k]
  ------------------
 2272|  3.25k|			(void)consume(a, raw_hdr_size - body_used);
 2273|  5.35k|	}
 2274|  5.35k|}
archive_read_support_format_rar5.c:process_head_service:
 2041|  1.73k|{
 2042|       |	/* Process this SERVICE block the same way as FILE blocks. */
 2043|  1.73k|	int ret = process_head_file(a, rar5, entry, block_flags);
 2044|  1.73k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.73k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2044:5): [True: 304, False: 1.43k]
  ------------------
 2045|    304|		return ret;
 2046|       |
 2047|  1.43k|	rar5->file.service = 1;
 2048|       |
 2049|       |	/* But skip the data part automatically. It's no use for the user
 2050|       |	 * anyway.  It contains only service data, not even needed to
 2051|       |	 * properly unpack the file. */
 2052|  1.43k|	ret = rar5_read_data_skip(a);
 2053|  1.43k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.43k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2053:5): [True: 7, False: 1.42k]
  ------------------
 2054|      7|		return ret;
 2055|       |
 2056|       |	/* After skipping, try parsing another block automatically. */
 2057|  1.42k|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|  1.42k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2058|  1.43k|}
archive_read_support_format_rar5.c:process_head_file:
 1713|  14.0k|{
 1714|  14.0k|	int64_t extra_data_size = 0;
 1715|  14.0k|	size_t data_size = 0;
 1716|  14.0k|	size_t file_flags = 0;
 1717|  14.0k|	size_t file_attr = 0;
 1718|  14.0k|	size_t compression_info = 0;
 1719|  14.0k|	size_t host_os = 0;
 1720|  14.0k|	size_t name_size = 0;
 1721|  14.0k|	uint64_t unpacked_size, window_size;
 1722|  14.0k|	uint32_t mtime = 0, crc = 0;
 1723|  14.0k|	int c_method = 0, c_version = 0;
 1724|  14.0k|	char name_utf8_buf[MAX_NAME_IN_BYTES];
 1725|  14.0k|	const uint8_t* p;
 1726|  14.0k|	int sanity_ret;
 1727|       |
 1728|  14.0k|	enum FILE_FLAGS {
 1729|  14.0k|		DIRECTORY = 0x0001, UTIME = 0x0002, CRC32 = 0x0004,
 1730|  14.0k|		UNKNOWN_UNPACKED_SIZE = 0x0008,
 1731|  14.0k|	};
 1732|       |
 1733|  14.0k|	enum FILE_ATTRS {
 1734|  14.0k|		ATTR_READONLY = 0x1, ATTR_HIDDEN = 0x2, ATTR_SYSTEM = 0x4,
 1735|  14.0k|		ATTR_DIRECTORY = 0x10,
 1736|  14.0k|	};
 1737|       |
 1738|  14.0k|	enum COMP_INFO_FLAGS {
 1739|  14.0k|		SOLID = 0x0040,
 1740|  14.0k|	};
 1741|       |
 1742|  14.0k|	enum HOST_OS {
 1743|  14.0k|		HOST_WINDOWS = 0,
 1744|  14.0k|		HOST_UNIX = 1,
 1745|  14.0k|	};
 1746|       |
 1747|  14.0k|	archive_entry_clear(entry);
 1748|       |
 1749|       |	/* Do not reset file context if we're switching archives. */
 1750|  14.0k|	if(!rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (1750:5): [True: 8.72k, False: 5.30k]
  ------------------
 1751|  8.72k|		reset_file_context(rar5);
 1752|  8.72k|	}
 1753|       |
 1754|  14.0k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (1754:5): [True: 8.40k, False: 5.62k]
  ------------------
 1755|  8.40k|		uint64_t edata_size = 0;
 1756|  8.40k|		if(!read_var(a, &edata_size, NULL))
  ------------------
  |  Branch (1756:6): [True: 0, False: 8.40k]
  ------------------
 1757|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1758|       |
 1759|       |		/* Intentional type cast from unsigned to signed. */
 1760|  8.40k|		extra_data_size = (int64_t) edata_size;
 1761|  8.40k|	}
 1762|       |
 1763|  14.0k|	if(block_flags & HFL_DATA) {
  ------------------
  |  Branch (1763:5): [True: 13.3k, False: 668]
  ------------------
 1764|  13.3k|		if(!read_var_sized(a, &data_size, NULL))
  ------------------
  |  Branch (1764:6): [True: 7, False: 13.3k]
  ------------------
 1765|      7|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1766|       |
 1767|  13.3k|		if(data_size > SSIZE_MAX) {
  ------------------
  |  Branch (1767:6): [True: 0, False: 13.3k]
  ------------------
 1768|      0|			archive_set_error(&a->archive,
 1769|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1770|      0|			    "File data size is too large");
 1771|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1772|      0|		}
 1773|       |
 1774|  13.3k|		rar5->file.bytes_remaining = data_size;
 1775|  13.3k|	} else {
 1776|    668|		rar5->file.bytes_remaining = 0;
 1777|    668|	}
 1778|       |
 1779|  14.0k|	if(!read_var_sized(a, &file_flags, NULL))
  ------------------
  |  Branch (1779:5): [True: 4, False: 14.0k]
  ------------------
 1780|      4|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1781|       |
 1782|  14.0k|	if(!read_var(a, &unpacked_size, NULL))
  ------------------
  |  Branch (1782:5): [True: 54, False: 13.9k]
  ------------------
 1783|     54|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     54|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1784|       |
 1785|  13.9k|	if(file_flags & UNKNOWN_UNPACKED_SIZE) {
  ------------------
  |  Branch (1785:5): [True: 4, False: 13.9k]
  ------------------
 1786|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      4|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1787|      4|		    "Files with unknown unpacked size are not supported");
 1788|      4|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1789|      4|	}
 1790|       |
 1791|  13.9k|	rar5->file.dir = (uint8_t) ((file_flags & DIRECTORY) > 0);
 1792|       |
 1793|  13.9k|	sanity_ret = file_entry_sanity_checks(a, block_flags, rar5->file.dir,
 1794|  13.9k|		unpacked_size, data_size);
 1795|       |
 1796|  13.9k|	if (sanity_ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  13.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1796:6): [True: 14, False: 13.9k]
  ------------------
 1797|     14|		return sanity_ret;
 1798|     14|	}
 1799|       |
 1800|  13.9k|	if(!read_var_sized(a, &file_attr, NULL))
  ------------------
  |  Branch (1800:5): [True: 242, False: 13.7k]
  ------------------
 1801|    242|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    242|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1802|       |
 1803|  13.7k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1803:5): [True: 5.12k, False: 8.57k]
  ------------------
 1804|  5.12k|		if(!read_u32(a, &mtime))
  ------------------
  |  Branch (1804:6): [True: 0, False: 5.12k]
  ------------------
 1805|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1806|  5.12k|	}
 1807|       |
 1808|  13.7k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1808:5): [True: 5.65k, False: 8.05k]
  ------------------
 1809|  5.65k|		if(!read_u32(a, &crc))
  ------------------
  |  Branch (1809:6): [True: 0, False: 5.65k]
  ------------------
 1810|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1811|  5.65k|	}
 1812|       |
 1813|  13.7k|	if(!read_var_sized(a, &compression_info, NULL))
  ------------------
  |  Branch (1813:5): [True: 158, False: 13.5k]
  ------------------
 1814|    158|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    158|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1815|       |
 1816|  13.5k|	c_method = (int) (compression_info >> 7) & 0x7;
 1817|  13.5k|	c_version = (int) (compression_info & 0x3f);
 1818|       |
 1819|       |	/* RAR5 seems to limit the dictionary size to 64MB. */
 1820|  13.5k|	window_size = (rar5->file.dir > 0) ?
  ------------------
  |  Branch (1820:16): [True: 775, False: 12.7k]
  ------------------
 1821|    775|		0 :
 1822|  13.5k|		g_unpack_window_size << ((compression_info >> 10) & 15);
 1823|  13.5k|	rar5->cstate.method = c_method;
 1824|  13.5k|	rar5->cstate.version = c_version + 50;
 1825|  13.5k|	rar5->file.solid = (compression_info & SOLID) > 0;
 1826|       |
 1827|       |	/* Archives which declare solid files without initializing the window
 1828|       |	 * buffer first are invalid, unless previous data was encrypted, in
 1829|       |	 * which case we may never have had the chance */
 1830|       |
 1831|  13.5k|	if(rar5->file.solid > 0 && rar5->cstate.data_encrypted == 0 &&
  ------------------
  |  Branch (1831:5): [True: 426, False: 13.1k]
  |  Branch (1831:29): [True: 147, False: 279]
  ------------------
 1832|    147|	    rar5->cstate.window_buf == NULL) {
  ------------------
  |  Branch (1832:6): [True: 3, False: 144]
  ------------------
 1833|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1834|      3|				  "Declared solid file, but no window buffer "
 1835|      3|				  "initialized yet");
 1836|      3|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1837|      3|	}
 1838|       |
 1839|       |	/* Check if window_size is a sane value. Also, if the file is not
 1840|       |	 * declared as a directory, disallow window_size == 0. */
 1841|  13.5k|	if(window_size > (64 * 1024 * 1024) ||
  ------------------
  |  Branch (1841:5): [True: 1, False: 13.5k]
  ------------------
 1842|  13.5k|	    (rar5->file.dir == 0 && window_size == 0))
  ------------------
  |  Branch (1842:7): [True: 12.7k, False: 774]
  |  Branch (1842:30): [True: 0, False: 12.7k]
  ------------------
 1843|      1|	{
 1844|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1845|      1|		    "Declared dictionary size is not supported");
 1846|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1847|      1|	}
 1848|       |
 1849|  13.5k|	if(rar5->file.solid > 0) {
  ------------------
  |  Branch (1849:5): [True: 423, False: 13.1k]
  ------------------
 1850|       |		/* Re-check if current window size is the same as previous
 1851|       |		 * window size (for solid files only). */
 1852|    423|		if(rar5->file.solid_window_size > 0 &&
  ------------------
  |  Branch (1852:6): [True: 188, False: 235]
  ------------------
 1853|    188|		    rar5->file.solid_window_size != (ssize_t) window_size)
  ------------------
  |  Branch (1853:7): [True: 2, False: 186]
  ------------------
 1854|      2|		{
 1855|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1856|      2|			    "Window size for this solid file doesn't match "
 1857|      2|			    "the window size used in previous solid file");
 1858|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1859|      2|		}
 1860|    423|	}
 1861|  13.1k|	else
 1862|  13.1k|		rar5->cstate.data_encrypted = 0; /* Reset for new buffer */
 1863|       |
 1864|  13.5k|	if(rar5->cstate.window_size < (ssize_t) window_size &&
  ------------------
  |  Branch (1864:5): [True: 1.86k, False: 11.6k]
  ------------------
 1865|  1.86k|	    rar5->cstate.window_buf)
  ------------------
  |  Branch (1865:6): [True: 395, False: 1.46k]
  ------------------
 1866|    395|	{
 1867|       |		/* The `data_ready` stack contains pointers to the `window_buf` or
 1868|       |		 * `filtered_buf` buffers.  Since we're about to reallocate the first
 1869|       |		 * buffer, some of those pointers could become invalid. Therefore, we
 1870|       |		 * need to dispose of all entries from the stack before attempting the
 1871|       |		 * realloc. */
 1872|    395|		clear_data_ready_stack(rar5);
 1873|       |
 1874|       |		/* If window_buf has been allocated before, reallocate it, so
 1875|       |		 * that its size will match new window_size. */
 1876|       |
 1877|    395|		uint8_t* new_window_buf =
 1878|    395|			realloc(rar5->cstate.window_buf, (size_t) window_size);
 1879|       |
 1880|    395|		if(!new_window_buf) {
  ------------------
  |  Branch (1880:6): [True: 0, False: 395]
  ------------------
 1881|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1882|      0|				"Not enough memory when trying to realloc the window "
 1883|      0|				"buffer");
 1884|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1885|      0|		}
 1886|       |
 1887|    395|		rar5->cstate.window_buf = new_window_buf;
 1888|    395|	}
 1889|       |
 1890|       |	/* Values up to 64M should fit into ssize_t on every
 1891|       |	 * architecture. */
 1892|  13.5k|	rar5->cstate.window_size = (ssize_t) window_size;
 1893|       |
 1894|  13.5k|	if(rar5->file.solid > 0 && rar5->file.solid_window_size == 0) {
  ------------------
  |  Branch (1894:5): [True: 421, False: 13.1k]
  |  Branch (1894:29): [True: 235, False: 186]
  ------------------
 1895|       |		/* Solid files have to have the same window_size across
 1896|       |		   whole archive. Remember the window_size parameter
 1897|       |		   for first solid file found. */
 1898|    235|		rar5->file.solid_window_size = rar5->cstate.window_size;
 1899|    235|	}
 1900|       |
 1901|  13.5k|	init_window_mask(rar5);
 1902|       |
 1903|  13.5k|	rar5->file.service = 0;
 1904|       |
 1905|  13.5k|	if(!read_var_sized(a, &host_os, NULL))
  ------------------
  |  Branch (1905:5): [True: 48, False: 13.4k]
  ------------------
 1906|     48|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     48|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1907|       |
 1908|  13.4k|	if(host_os == HOST_WINDOWS) {
  ------------------
  |  Branch (1908:5): [True: 11.4k, False: 2.04k]
  ------------------
 1909|       |		/* Host OS is Windows */
 1910|       |
 1911|  11.4k|		__LA_MODE_T mode;
  ------------------
  |  |  102|  11.4k|# define	__LA_MODE_T	mode_t
  ------------------
 1912|       |
 1913|  11.4k|		if(file_attr & ATTR_DIRECTORY) {
  ------------------
  |  Branch (1913:6): [True: 3.88k, False: 7.55k]
  ------------------
 1914|  3.88k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1914:8): [True: 3.27k, False: 614]
  ------------------
 1915|  3.27k|				mode = 0555 | AE_IFDIR;
  ------------------
  |  |  221|  3.27k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1916|  3.27k|			} else {
 1917|    614|				mode = 0755 | AE_IFDIR;
  ------------------
  |  |  221|    614|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1918|    614|			}
 1919|  7.55k|		} else {
 1920|  7.55k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1920:8): [True: 3.59k, False: 3.96k]
  ------------------
 1921|  3.59k|				mode = 0444 | AE_IFREG;
  ------------------
  |  |  216|  3.59k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1922|  3.96k|			} else {
 1923|  3.96k|				mode = 0644 | AE_IFREG;
  ------------------
  |  |  216|  3.96k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1924|  3.96k|			}
 1925|  7.55k|		}
 1926|       |
 1927|  11.4k|		archive_entry_set_mode(entry, mode);
 1928|       |
 1929|  11.4k|		if (file_attr & (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM)) {
  ------------------
  |  Branch (1929:7): [True: 7.88k, False: 3.55k]
  ------------------
 1930|  7.88k|			char buf[sizeof(",rdonly,hidden,system")];
 1931|  7.88k|			const char *fflags[3] = { "", "", "" };
 1932|  7.88k|			const char **flag = fflags;
 1933|       |
 1934|  7.88k|			if (file_attr & ATTR_READONLY)
  ------------------
  |  Branch (1934:8): [True: 6.86k, False: 1.02k]
  ------------------
 1935|  6.86k|				*flag++ = ",rdonly";
 1936|  7.88k|			if (file_attr & ATTR_HIDDEN)
  ------------------
  |  Branch (1936:8): [True: 4.31k, False: 3.57k]
  ------------------
 1937|  4.31k|				*flag++ = ",hidden";
 1938|  7.88k|			if (file_attr & ATTR_SYSTEM)
  ------------------
  |  Branch (1938:8): [True: 4.25k, False: 3.63k]
  ------------------
 1939|  4.25k|				*flag++ = ",system";
 1940|       |
 1941|  7.88k|			snprintf(buf, sizeof(buf), "%s%s%s",
 1942|  7.88k|			    fflags[0], fflags[1], fflags[2]);
 1943|  7.88k|			archive_entry_copy_fflags_text(entry, buf + 1);
 1944|  7.88k|		}
 1945|  11.4k|	} else if(host_os == HOST_UNIX) {
  ------------------
  |  Branch (1945:12): [True: 2.02k, False: 20]
  ------------------
 1946|       |		/* Host OS is Unix */
 1947|  2.02k|		archive_entry_set_mode(entry, (__LA_MODE_T) file_attr);
 1948|  2.02k|	} else {
 1949|       |		/* Unknown host OS */
 1950|     20|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     20|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1951|     20|				"Unsupported Host OS: 0x%jx",
 1952|     20|				(uintmax_t)host_os);
 1953|       |
 1954|     20|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     20|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1955|     20|	}
 1956|       |
 1957|  13.4k|	if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1957:5): [True: 366, False: 13.1k]
  ------------------
 1958|    366|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    366|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1959|       |
 1960|  13.1k|	if(name_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   92|  13.1k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1960:5): [True: 2, False: 13.1k]
  ------------------
 1961|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1962|      2|				"Filename is too long");
 1963|       |
 1964|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1965|      2|	}
 1966|       |
 1967|  13.1k|	if(name_size == 0) {
  ------------------
  |  Branch (1967:5): [True: 6, False: 13.0k]
  ------------------
 1968|      6|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1969|      6|				"No filename specified");
 1970|       |
 1971|      6|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1972|      6|	}
 1973|       |
 1974|  13.0k|	if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1974:5): [True: 33, False: 13.0k]
  ------------------
 1975|     33|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     33|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1976|       |
 1977|  13.0k|	memcpy(name_utf8_buf, p, name_size);
 1978|  13.0k|	name_utf8_buf[name_size] = 0;
 1979|  13.0k|	if(ARCHIVE_OK != consume(a, name_size)) {
  ------------------
  |  |  233|  13.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1979:5): [True: 0, False: 13.0k]
  ------------------
 1980|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1981|      0|	}
 1982|       |
 1983|  13.0k|	archive_entry_update_pathname_utf8(entry, name_utf8_buf);
 1984|       |
 1985|  13.0k|	if(extra_data_size > 0) {
  ------------------
  |  Branch (1985:5): [True: 4.23k, False: 8.82k]
  ------------------
 1986|  4.23k|		int ret = process_head_file_extra(a, entry, rar5,
 1987|  4.23k|		    extra_data_size);
 1988|       |
 1989|       |		/*
 1990|       |		 * TODO: rewrite or remove useless sanity check
 1991|       |		 *       as extra_data_size is not passed as a pointer
 1992|       |		 *
 1993|       |		if(extra_data_size < 0) {
 1994|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
 1995|       |			    "File extra data size is not zero");
 1996|       |			return ARCHIVE_FATAL;
 1997|       |		}
 1998|       |		 */
 1999|       |
 2000|  4.23k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  4.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2000:6): [True: 992, False: 3.24k]
  ------------------
 2001|    992|			return ret;
 2002|  4.23k|	}
 2003|       |
 2004|  12.0k|	if((file_flags & UNKNOWN_UNPACKED_SIZE) == 0) {
  ------------------
  |  Branch (2004:5): [True: 12.0k, False: 0]
  ------------------
 2005|  12.0k|		rar5->file.unpacked_size = (ssize_t) unpacked_size;
 2006|  12.0k|		if(rar5->file.redir_type == REDIR_TYPE_NONE)
  ------------------
  |  Branch (2006:6): [True: 11.4k, False: 571]
  ------------------
 2007|  11.4k|			archive_entry_set_size(entry, unpacked_size);
 2008|  12.0k|	}
 2009|       |
 2010|  12.0k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (2010:5): [True: 3.88k, False: 8.18k]
  ------------------
 2011|  3.88k|		archive_entry_set_mtime(entry, (time_t) mtime, 0);
 2012|  3.88k|	}
 2013|       |
 2014|  12.0k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (2014:5): [True: 4.45k, False: 7.61k]
  ------------------
 2015|  4.45k|		rar5->file.stored_crc32 = crc;
 2016|  4.45k|	}
 2017|       |
 2018|  12.0k|	if(!rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (2018:5): [True: 8.29k, False: 3.77k]
  ------------------
 2019|       |		/* Do not reinitialize unpacking state if we're switching
 2020|       |		 * archives. */
 2021|  8.29k|		rar5->cstate.block_parsing_finished = 1;
 2022|  8.29k|		rar5->cstate.all_filters_applied = 1;
 2023|  8.29k|		rar5->cstate.initialized = 0;
 2024|  8.29k|	}
 2025|       |
 2026|  12.0k|	if(rar5->generic.split_before > 0) {
  ------------------
  |  Branch (2026:5): [True: 662, False: 11.4k]
  ------------------
 2027|       |		/* If now we're standing on a header that has a 'split before'
 2028|       |		 * mark, it means we're standing on a 'continuation' file
 2029|       |		 * header. Signal the caller that if it wants to move to
 2030|       |		 * another file, it must call rar5_read_header() function
 2031|       |		 * again. */
 2032|       |
 2033|    662|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|    662|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2034|  11.4k|	} else {
 2035|  11.4k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  11.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2036|  11.4k|	}
 2037|  12.0k|}
archive_read_support_format_rar5.c:reset_file_context:
  872|  8.72k|static void reset_file_context(struct rar5 *rar5) {
  873|  8.72k|	memset(&rar5->file, 0, sizeof(rar5->file));
  874|  8.72k|	blake2sp_init(&rar5->file.b2state, 32);
  875|       |
  876|  8.72k|	if(rar5->main.solid) {
  ------------------
  |  Branch (876:5): [True: 5.08k, False: 3.63k]
  ------------------
  877|  5.08k|		rar5->cstate.solid_offset += rar5->cstate.write_ptr;
  878|  5.08k|	} else {
  879|  3.63k|		rar5->cstate.solid_offset = 0;
  880|  3.63k|	}
  881|       |
  882|  8.72k|	rar5->cstate.write_ptr = 0;
  883|  8.72k|	rar5->cstate.last_write_ptr = 0;
  884|  8.72k|	rar5->cstate.last_unstore_ptr = 0;
  885|       |
  886|  8.72k|	rar5->file.redir_type = REDIR_TYPE_NONE;
  887|  8.72k|	rar5->file.redir_flags = 0;
  888|       |
  889|  8.72k|	free_filters(rar5);
  890|  8.72k|}
archive_read_support_format_rar5.c:free_filters:
  847|  20.6k|static void free_filters(struct rar5 *rar5) {
  848|  20.6k|	struct cdeque* d = &rar5->cstate.filters;
  849|       |
  850|       |	/* Free any remaining filters. All filters should be naturally
  851|       |	 * consumed by the unpacking function, so remaining filters after
  852|       |	 * unpacking normally mean that unpacking wasn't successful.
  853|       |	 * But still of course we shouldn't leak memory in such case. */
  854|       |
  855|       |	/* cdeque_size() is a fast operation, so we can use it as a loop
  856|       |	 * expression. */
  857|  21.2k|	while(cdeque_size(d) > 0) {
  ------------------
  |  Branch (857:8): [True: 607, False: 20.6k]
  ------------------
  858|    607|		struct filter_info* f = NULL;
  859|       |
  860|       |		/* Pop_front will also decrease the collection's size. */
  861|    607|		if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
  ------------------
  |  Branch (861:7): [True: 607, False: 0]
  ------------------
  862|    607|			free(f);
  863|    607|	}
  864|       |
  865|  20.6k|	cdeque_clear(d);
  866|       |
  867|       |	/* Also clear out the variables needed for sanity checking. */
  868|  20.6k|	rar5->cstate.last_block_start = 0;
  869|  20.6k|	rar5->cstate.last_block_length = 0;
  870|  20.6k|}
archive_read_support_format_rar5.c:cdeque_size:
  413|  48.4k|static size_t cdeque_size(struct cdeque* d) {
  414|  48.4k|	return d->size;
  415|  48.4k|}
archive_read_support_format_rar5.c:cdeque_pop_front:
  459|  2.23k|static int cdeque_pop_front(struct cdeque* d, void** value) {
  460|  2.23k|	if(!d || !value)
  ------------------
  |  Branch (460:5): [True: 0, False: 2.23k]
  |  Branch (460:11): [True: 0, False: 2.23k]
  ------------------
  461|      0|		return CDE_PARAM;
  462|       |
  463|  2.23k|	if(d->size == 0)
  ------------------
  |  Branch (463:5): [True: 0, False: 2.23k]
  ------------------
  464|      0|		return CDE_OUT_OF_BOUNDS;
  465|       |
  466|  2.23k|	cdeque_pop_front_fast(d, value);
  467|  2.23k|	return CDE_OK;
  468|  2.23k|}
archive_read_support_format_rar5.c:cdeque_pop_front_fast:
  451|  2.23k|static void cdeque_pop_front_fast(struct cdeque* d, void** value) {
  452|  2.23k|	*value = (void*) d->arr[d->beg_pos];
  453|  2.23k|	d->beg_pos = (d->beg_pos + 1) & d->cap_mask;
  454|  2.23k|	d->size--;
  455|  2.23k|}
archive_read_support_format_rar5.c:cdeque_filter_p:
  471|  33.3k|static void** cdeque_filter_p(struct filter_info** f) {
  472|  33.3k|	return (void**) (size_t) f;
  473|  33.3k|}
archive_read_support_format_rar5.c:file_entry_sanity_checks:
 1687|  13.9k|{
 1688|  13.9k|	if (is_dir) {
  ------------------
  |  Branch (1688:6): [True: 785, False: 13.1k]
  ------------------
 1689|    785|		const int declares_data_size =
 1690|    785|			(int) (unpacked_size != 0 || packed_size != 0);
  ------------------
  |  Branch (1690:11): [True: 9, False: 776]
  |  Branch (1690:33): [True: 0, False: 776]
  ------------------
 1691|       |
 1692|       |		/* FILE entries for directories still declare HFL_DATA in block flags,
 1693|       |		   even though attaching data to such blocks doesn't make much sense. */
 1694|    785|		if (declares_data_size) {
  ------------------
  |  Branch (1694:7): [True: 9, False: 776]
  ------------------
 1695|      9|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1696|      9|				"directory entries cannot have any data");
 1697|      9|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1698|      9|		}
 1699|  13.1k|	} else {
 1700|  13.1k|		const int declares_hfl_data = (int) ((block_flags & HFL_DATA) != 0);
 1701|  13.1k|		if (!declares_hfl_data) {
  ------------------
  |  Branch (1701:7): [True: 5, False: 13.1k]
  ------------------
 1702|      5|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1703|      5|					"no data found in file/service block");
 1704|      5|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1705|      5|		}
 1706|  13.1k|	}
 1707|       |
 1708|  13.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  13.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1709|  13.9k|}
archive_read_support_format_rar5.c:clear_data_ready_stack:
 3823|  15.0k|static void clear_data_ready_stack(struct rar5 *rar5) {
 3824|  15.0k|	memset(&rar5->cstate.dready, 0, sizeof(rar5->cstate.dready));
 3825|  15.0k|}
archive_read_support_format_rar5.c:init_window_mask:
 1192|  14.5k|static void init_window_mask(struct rar5 *rar5) {
 1193|  14.5k|	if (rar5->cstate.window_size)
  ------------------
  |  Branch (1193:6): [True: 13.8k, False: 774]
  ------------------
 1194|  13.8k|		rar5->cstate.window_mask = rar5->cstate.window_size - 1;
 1195|    774|	else
 1196|    774|		rar5->cstate.window_mask = 0;
 1197|  14.5k|}
archive_read_support_format_rar5.c:process_head_file_extra:
 1597|  4.23k|{
 1598|  4.23k|	uint64_t extra_field_size;
 1599|  4.23k|	uint64_t extra_field_id = 0;
 1600|  4.23k|	uint64_t var_size;
 1601|       |
 1602|  49.1k|	while(extra_data_size > 0) {
  ------------------
  |  Branch (1602:8): [True: 45.8k, False: 3.26k]
  ------------------
 1603|       |		/* Make sure we won't fail if the file declares only unsupported
 1604|       |		attributes. */
 1605|  45.8k|		int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  45.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1606|       |
 1607|  45.8k|		if(!read_var(a, &extra_field_size, &var_size))
  ------------------
  |  Branch (1607:6): [True: 110, False: 45.7k]
  ------------------
 1608|    110|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    110|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1609|       |
 1610|  45.7k|		extra_data_size -= var_size;
 1611|  45.7k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  45.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1611:6): [True: 0, False: 45.7k]
  ------------------
 1612|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1613|      0|		}
 1614|       |
 1615|  45.7k|		if(!read_var(a, &extra_field_id, &var_size))
  ------------------
  |  Branch (1615:6): [True: 105, False: 45.6k]
  ------------------
 1616|    105|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    105|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1617|       |
 1618|  45.6k|		extra_field_size -= var_size;
 1619|  45.6k|		extra_data_size -= var_size;
 1620|  45.6k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  45.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1620:6): [True: 0, False: 45.6k]
  ------------------
 1621|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1622|      0|		}
 1623|       |
 1624|  45.6k|		switch(extra_field_id) {
 1625|  1.43k|			case EX_HASH:
  ------------------
  |  Branch (1625:4): [True: 1.43k, False: 44.2k]
  ------------------
 1626|  1.43k|				ret = parse_file_extra_hash(a, rar5,
 1627|  1.43k|				    &extra_data_size);
 1628|  1.43k|				break;
 1629|  3.14k|			case EX_HTIME:
  ------------------
  |  Branch (1629:4): [True: 3.14k, False: 42.5k]
  ------------------
 1630|  3.14k|				ret = parse_file_extra_htime(a, e, rar5,
 1631|  3.14k|				    &extra_data_size);
 1632|  3.14k|				break;
 1633|  5.37k|			case EX_REDIR:
  ------------------
  |  Branch (1633:4): [True: 5.37k, False: 40.2k]
  ------------------
 1634|  5.37k|				ret = parse_file_extra_redir(a, e, rar5,
 1635|  5.37k|				    &extra_data_size);
 1636|  5.37k|				break;
 1637|  1.24k|			case EX_UOWNER:
  ------------------
  |  Branch (1637:4): [True: 1.24k, False: 44.4k]
  ------------------
 1638|  1.24k|				ret = parse_file_extra_owner(a, e,
 1639|  1.24k|				    &extra_data_size);
 1640|  1.24k|				break;
 1641|  28.4k|			case EX_VERSION:
  ------------------
  |  Branch (1641:4): [True: 28.4k, False: 17.1k]
  ------------------
 1642|  28.4k|				ret = parse_file_extra_version(a, e,
 1643|  28.4k|				    &extra_data_size);
 1644|  28.4k|				break;
 1645|  3.30k|			case EX_CRYPT:
  ------------------
  |  Branch (1645:4): [True: 3.30k, False: 42.3k]
  ------------------
 1646|       |				/* Mark the entry as encrypted */
 1647|  3.30k|				archive_entry_set_is_data_encrypted(e, 1);
 1648|  3.30k|				rar5->has_encrypted_entries = 1;
 1649|  3.30k|				rar5->cstate.data_encrypted = 1;
 1650|       |				/* fallthrough */
 1651|  3.44k|			case EX_SUBDATA:
  ------------------
  |  Branch (1651:4): [True: 132, False: 45.5k]
  ------------------
 1652|       |				/* fallthrough */
 1653|  5.99k|			default:
  ------------------
  |  Branch (1653:4): [True: 2.55k, False: 43.1k]
  ------------------
 1654|       |				/* Skip unsupported entry. */
 1655|  5.99k|				extra_data_size -= extra_field_size;
 1656|  5.99k|				if (ARCHIVE_OK != consume(a, extra_field_size)) {
  ------------------
  |  |  233|  5.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1656:9): [True: 423, False: 5.57k]
  ------------------
 1657|    423|					return ARCHIVE_EOF;
  ------------------
  |  |  232|    423|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1658|    423|				}
 1659|       |
 1660|       |				/* Don't fail on unsupported attribute -- we've handled it
 1661|       |				   by skipping over it. */
 1662|  5.57k|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|  5.57k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1663|  45.6k|		}
 1664|       |
 1665|  45.2k|		if (ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  45.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1665:7): [True: 328, False: 44.9k]
  ------------------
 1666|       |			/* Forward any errors signalled by the attribute parsing
 1667|       |			   functions. */
 1668|    328|			return ret;
 1669|    328|		}
 1670|  45.2k|	}
 1671|       |
 1672|  3.26k|	if (extra_data_size != 0) {
  ------------------
  |  Branch (1672:6): [True: 26, False: 3.24k]
  ------------------
 1673|       |		/* We didn't skip everything, or we skipped too much; either way,
 1674|       |		   there's an error in this parsing function. */
 1675|       |
 1676|     26|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     26|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1677|     26|				"unsupported structure of file header extra data");
 1678|     26|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     26|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1679|     26|	}
 1680|       |
 1681|  3.24k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1682|  3.26k|}
archive_read_support_format_rar5.c:parse_file_extra_hash:
 1243|  1.43k|{
 1244|  1.43k|	size_t hash_type = 0;
 1245|  1.43k|	size_t value_len;
 1246|       |
 1247|  1.43k|	enum HASH_TYPE {
 1248|  1.43k|		BLAKE2sp = 0x00
 1249|  1.43k|	};
 1250|       |
 1251|  1.43k|	if(!read_var_sized(a, &hash_type, &value_len))
  ------------------
  |  Branch (1251:5): [True: 0, False: 1.43k]
  ------------------
 1252|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1253|       |
 1254|  1.43k|	*extra_data_size -= value_len;
 1255|  1.43k|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|  1.43k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1255:5): [True: 0, False: 1.43k]
  ------------------
 1256|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1257|      0|	}
 1258|       |
 1259|       |	/* The file uses BLAKE2sp checksum algorithm instead of plain old
 1260|       |	 * CRC32. */
 1261|  1.43k|	if(hash_type == BLAKE2sp) {
  ------------------
  |  Branch (1261:5): [True: 1.42k, False: 7]
  ------------------
 1262|  1.42k|		const uint8_t* p;
 1263|  1.42k|		const int hash_size = sizeof(rar5->file.blake2sp);
 1264|       |
 1265|  1.42k|		if(!read_ahead(a, hash_size, &p))
  ------------------
  |  Branch (1265:6): [True: 1, False: 1.42k]
  ------------------
 1266|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1267|       |
 1268|  1.42k|		rar5->file.has_blake2 = 1;
 1269|  1.42k|		memcpy(&rar5->file.blake2sp, p, hash_size);
 1270|       |
 1271|  1.42k|		if(ARCHIVE_OK != consume(a, hash_size)) {
  ------------------
  |  |  233|  1.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1271:6): [True: 0, False: 1.42k]
  ------------------
 1272|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1273|      0|		}
 1274|       |
 1275|  1.42k|		*extra_data_size -= hash_size;
 1276|  1.42k|	} else {
 1277|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1278|      7|		    "Unsupported hash type (0x%jx)", (uintmax_t)hash_type);
 1279|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1280|      7|	}
 1281|       |
 1282|  1.42k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1283|  1.43k|}
archive_read_support_format_rar5.c:parse_file_extra_htime:
 1363|  3.14k|{
 1364|  3.14k|	char unix_time, has_unix_ns, has_mtime, has_ctime, has_atime;
 1365|  3.14k|	size_t flags = 0;
 1366|  3.14k|	size_t value_len;
 1367|       |
 1368|  3.14k|	enum HTIME_FLAGS {
 1369|  3.14k|		IS_UNIX       = 0x01,
 1370|  3.14k|		HAS_MTIME     = 0x02,
 1371|  3.14k|		HAS_CTIME     = 0x04,
 1372|  3.14k|		HAS_ATIME     = 0x08,
 1373|  3.14k|		HAS_UNIX_NS   = 0x10,
 1374|  3.14k|	};
 1375|       |
 1376|  3.14k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1376:5): [True: 1, False: 3.14k]
  ------------------
 1377|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1378|       |
 1379|  3.14k|	*extra_data_size -= value_len;
 1380|  3.14k|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|  3.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1380:5): [True: 0, False: 3.14k]
  ------------------
 1381|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1382|      0|	}
 1383|       |
 1384|  3.14k|	unix_time = flags & IS_UNIX;
 1385|  3.14k|	has_unix_ns = unix_time && (flags & HAS_UNIX_NS);
  ------------------
  |  Branch (1385:16): [True: 2.35k, False: 783]
  |  Branch (1385:29): [True: 1.77k, False: 580]
  ------------------
 1386|  3.14k|	has_mtime = flags & HAS_MTIME;
 1387|  3.14k|	has_atime = flags & HAS_ATIME;
 1388|  3.14k|	has_ctime = flags & HAS_CTIME;
 1389|  3.14k|	rar5->file.e_atime_ns = rar5->file.e_ctime_ns = rar5->file.e_mtime_ns = 0;
 1390|       |
 1391|  3.14k|	if(has_mtime) {
  ------------------
  |  Branch (1391:5): [True: 2.45k, False: 682]
  ------------------
 1392|  2.45k|		parse_htime_item(a, unix_time, &rar5->file.e_mtime,
 1393|  2.45k|		    &rar5->file.e_mtime_ns, extra_data_size);
 1394|  2.45k|	}
 1395|       |
 1396|  3.14k|	if(has_ctime) {
  ------------------
  |  Branch (1396:5): [True: 391, False: 2.74k]
  ------------------
 1397|    391|		parse_htime_item(a, unix_time, &rar5->file.e_ctime,
 1398|    391|		    &rar5->file.e_ctime_ns, extra_data_size);
 1399|    391|	}
 1400|       |
 1401|  3.14k|	if(has_atime) {
  ------------------
  |  Branch (1401:5): [True: 306, False: 2.83k]
  ------------------
 1402|    306|		parse_htime_item(a, unix_time, &rar5->file.e_atime,
 1403|    306|		    &rar5->file.e_atime_ns, extra_data_size);
 1404|    306|	}
 1405|       |
 1406|  3.14k|	if(has_mtime && has_unix_ns) {
  ------------------
  |  Branch (1406:5): [True: 2.45k, False: 682]
  |  Branch (1406:18): [True: 1.68k, False: 769]
  ------------------
 1407|  1.68k|		if(!read_u32(a, &rar5->file.e_mtime_ns))
  ------------------
  |  Branch (1407:6): [True: 1, False: 1.68k]
  ------------------
 1408|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1409|       |
 1410|  1.68k|		*extra_data_size -= 4;
 1411|  1.68k|	}
 1412|       |
 1413|  3.13k|	if(has_ctime && has_unix_ns) {
  ------------------
  |  Branch (1413:5): [True: 390, False: 2.74k]
  |  Branch (1413:18): [True: 112, False: 278]
  ------------------
 1414|    112|		if(!read_u32(a, &rar5->file.e_ctime_ns))
  ------------------
  |  Branch (1414:6): [True: 0, False: 112]
  ------------------
 1415|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1416|       |
 1417|    112|		*extra_data_size -= 4;
 1418|    112|	}
 1419|       |
 1420|  3.13k|	if(has_atime && has_unix_ns) {
  ------------------
  |  Branch (1420:5): [True: 305, False: 2.83k]
  |  Branch (1420:18): [True: 107, False: 198]
  ------------------
 1421|    107|		if(!read_u32(a, &rar5->file.e_atime_ns))
  ------------------
  |  Branch (1421:6): [True: 0, False: 107]
  ------------------
 1422|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1423|       |
 1424|    107|		*extra_data_size -= 4;
 1425|    107|	}
 1426|       |
 1427|       |	/* The seconds and nanoseconds are either together, or separated in two
 1428|       |	 * fields so we parse them, then set the archive_entry's times. */
 1429|  3.13k|	if(has_mtime) {
  ------------------
  |  Branch (1429:5): [True: 2.45k, False: 682]
  ------------------
 1430|  2.45k|		archive_entry_set_mtime(e, rar5->file.e_mtime, rar5->file.e_mtime_ns);
 1431|  2.45k|	}
 1432|       |
 1433|  3.13k|	if(has_ctime) {
  ------------------
  |  Branch (1433:5): [True: 390, False: 2.74k]
  ------------------
 1434|    390|		archive_entry_set_ctime(e, rar5->file.e_ctime, rar5->file.e_ctime_ns);
 1435|    390|	}
 1436|       |
 1437|  3.13k|	if(has_atime) {
  ------------------
  |  Branch (1437:5): [True: 305, False: 2.83k]
  ------------------
 1438|    305|		archive_entry_set_atime(e, rar5->file.e_atime, rar5->file.e_atime_ns);
 1439|    305|	}
 1440|       |
 1441|  3.13k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1442|  3.13k|}
archive_read_support_format_rar5.c:parse_htime_item:
 1287|  3.15k|{
 1288|  3.15k|	if(unix_time) {
  ------------------
  |  Branch (1288:5): [True: 2.49k, False: 660]
  ------------------
 1289|  2.49k|		uint32_t time_val;
 1290|  2.49k|		if(!read_u32(a, &time_val))
  ------------------
  |  Branch (1290:6): [True: 1, False: 2.49k]
  ------------------
 1291|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1292|       |
 1293|  2.49k|		*extra_data_size -= 4;
 1294|  2.49k|		*sec = (int64_t) time_val;
 1295|  2.49k|	} else {
 1296|    660|		uint64_t windows_time;
 1297|    660|		if(!read_u64(a, &windows_time))
  ------------------
  |  Branch (1297:6): [True: 2, False: 658]
  ------------------
 1298|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1299|       |
 1300|    658|		ntfs_to_unix(windows_time, sec, nsec);
 1301|    658|		*extra_data_size -= 8;
 1302|    658|	}
 1303|       |
 1304|  3.15k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1305|  3.15k|}
archive_read_support_format_rar5.c:read_u64:
 1094|    660|static char read_u64(struct archive_read* a, uint64_t* pvalue) {
 1095|    660|	const uint8_t* p;
 1096|    660|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (1096:5): [True: 2, False: 658]
  ------------------
 1097|      2|		return 0;
 1098|       |
 1099|    658|	*pvalue = archive_le64dec(p);
 1100|    658|	return ARCHIVE_OK == consume(a, 8);
  ------------------
  |  |  233|    658|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1101|    660|}
archive_read_support_format_rar5.c:parse_file_extra_redir:
 1446|  5.37k|{
 1447|  5.37k|	uint64_t value_size = 0;
 1448|  5.37k|	size_t target_size = 0;
 1449|  5.37k|	char target_utf8_buf[MAX_NAME_IN_BYTES];
 1450|  5.37k|	const uint8_t* p;
 1451|       |
 1452|  5.37k|	if(!read_var(a, &rar5->file.redir_type, &value_size))
  ------------------
  |  Branch (1452:5): [True: 173, False: 5.19k]
  ------------------
 1453|    173|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    173|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1454|  5.19k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  5.19k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1454:5): [True: 0, False: 5.19k]
  ------------------
 1455|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1456|  5.19k|	*extra_data_size -= value_size;
 1457|       |
 1458|  5.19k|	if(!read_var(a, &rar5->file.redir_flags, &value_size))
  ------------------
  |  Branch (1458:5): [True: 0, False: 5.19k]
  ------------------
 1459|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1460|  5.19k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  5.19k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1460:5): [True: 0, False: 5.19k]
  ------------------
 1461|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1462|  5.19k|	*extra_data_size -= value_size;
 1463|       |
 1464|  5.19k|	if(!read_var_sized(a, &target_size, NULL))
  ------------------
  |  Branch (1464:5): [True: 7, False: 5.19k]
  ------------------
 1465|      7|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1466|  5.19k|	*extra_data_size -= target_size + 1;
 1467|       |
 1468|  5.19k|	if(target_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   92|  5.19k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1468:5): [True: 2, False: 5.18k]
  ------------------
 1469|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1470|      2|		    "Link target is too long");
 1471|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1472|      2|	}
 1473|       |
 1474|  5.18k|	if(target_size == 0) {
  ------------------
  |  Branch (1474:5): [True: 2, False: 5.18k]
  ------------------
 1475|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1476|      2|		    "No link target specified");
 1477|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1478|      2|	}
 1479|       |
 1480|  5.18k|	if(!read_ahead(a, target_size, &p))
  ------------------
  |  Branch (1480:5): [True: 7, False: 5.17k]
  ------------------
 1481|      7|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1482|       |
 1483|  5.17k|	memcpy(target_utf8_buf, p, target_size);
 1484|  5.17k|	target_utf8_buf[target_size] = 0;
 1485|       |
 1486|  5.17k|	if(ARCHIVE_OK != consume(a, (int64_t)target_size))
  ------------------
  |  |  233|  5.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1486:5): [True: 0, False: 5.17k]
  ------------------
 1487|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1488|       |
 1489|  5.17k|	switch(rar5->file.redir_type) {
 1490|  1.13k|		case REDIR_TYPE_UNIXSYMLINK:
  ------------------
  |  Branch (1490:3): [True: 1.13k, False: 4.04k]
  ------------------
 1491|  1.86k|		case REDIR_TYPE_WINSYMLINK:
  ------------------
  |  Branch (1491:3): [True: 731, False: 4.44k]
  ------------------
 1492|  1.86k|			archive_entry_set_filetype(e, AE_IFLNK);
  ------------------
  |  |  217|  1.86k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1493|  1.86k|			archive_entry_update_symlink_utf8(e, target_utf8_buf);
 1494|  1.86k|			if (rar5->file.redir_flags & REDIR_SYMLINK_IS_DIR) {
  ------------------
  |  |  138|  1.86k|#define REDIR_SYMLINK_IS_DIR	1
  ------------------
  |  Branch (1494:8): [True: 1.23k, False: 634]
  ------------------
 1495|  1.23k|				archive_entry_set_symlink_type(e,
 1496|  1.23k|					AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|  1.23k|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 1497|  1.23k|			} else {
 1498|    634|				archive_entry_set_symlink_type(e,
 1499|    634|				AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|    634|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 1500|    634|			}
 1501|  1.86k|			break;
 1502|       |
 1503|  1.76k|		case REDIR_TYPE_HARDLINK:
  ------------------
  |  Branch (1503:3): [True: 1.76k, False: 3.41k]
  ------------------
 1504|  1.76k|			archive_entry_set_filetype(e, AE_IFREG);
  ------------------
  |  |  216|  1.76k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1505|  1.76k|			archive_entry_update_hardlink_utf8(e, target_utf8_buf);
 1506|  1.76k|			break;
 1507|       |
 1508|  1.54k|		default:
  ------------------
  |  Branch (1508:3): [True: 1.54k, False: 3.63k]
  ------------------
 1509|       |			/* Unknown redir type, skip it. */
 1510|  1.54k|			break;
 1511|  5.17k|	}
 1512|  5.17k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  5.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1513|  5.17k|}
archive_read_support_format_rar5.c:parse_file_extra_owner:
 1517|  1.24k|{
 1518|  1.24k|	uint64_t flags = 0;
 1519|  1.24k|	uint64_t value_size = 0;
 1520|  1.24k|	uint64_t id = 0;
 1521|  1.24k|	size_t name_len = 0;
 1522|  1.24k|	size_t name_size = 0;
 1523|  1.24k|	char namebuf[OWNER_MAXNAMELEN];
 1524|  1.24k|	const uint8_t* p;
 1525|       |
 1526|  1.24k|	if(!read_var(a, &flags, &value_size))
  ------------------
  |  Branch (1526:5): [True: 2, False: 1.23k]
  ------------------
 1527|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1528|  1.23k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  1.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1528:5): [True: 0, False: 1.23k]
  ------------------
 1529|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1530|  1.23k|	*extra_data_size -= value_size;
 1531|       |
 1532|  1.23k|	if ((flags & OWNER_USER_NAME) != 0) {
  ------------------
  |  |  149|  1.23k|#define	OWNER_USER_NAME		0x01
  ------------------
  |  Branch (1532:6): [True: 517, False: 721]
  ------------------
 1533|    517|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1533:6): [True: 1, False: 516]
  ------------------
 1534|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1535|    516|		*extra_data_size -= name_size + 1;
 1536|       |
 1537|    516|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1537:6): [True: 4, False: 512]
  ------------------
 1538|      4|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1539|       |
 1540|    512|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  153|    512|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1540:7): [True: 5, False: 507]
  ------------------
 1541|      5|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  153|      5|#define	OWNER_MAXNAMELEN	256
  ------------------
 1542|    507|		} else {
 1543|    507|			name_len = name_size;
 1544|    507|		}
 1545|       |
 1546|    512|		memcpy(namebuf, p, name_len);
 1547|    512|		namebuf[name_len] = 0;
 1548|    512|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    512|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1548:6): [True: 0, False: 512]
  ------------------
 1549|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1550|       |
 1551|    512|		archive_entry_set_uname(e, namebuf);
 1552|    512|	}
 1553|  1.23k|	if ((flags & OWNER_GROUP_NAME) != 0) {
  ------------------
  |  |  150|  1.23k|#define	OWNER_GROUP_NAME	0x02
  ------------------
  |  Branch (1553:6): [True: 1.10k, False: 124]
  ------------------
 1554|  1.10k|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1554:6): [True: 1, False: 1.10k]
  ------------------
 1555|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1556|  1.10k|		*extra_data_size -= name_size + 1;
 1557|       |
 1558|  1.10k|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1558:6): [True: 10, False: 1.09k]
  ------------------
 1559|     10|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     10|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1560|       |
 1561|  1.09k|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  153|  1.09k|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1561:7): [True: 317, False: 781]
  ------------------
 1562|    317|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  153|    317|#define	OWNER_MAXNAMELEN	256
  ------------------
 1563|    781|		} else {
 1564|    781|			name_len = name_size;
 1565|    781|		}
 1566|       |
 1567|  1.09k|		memcpy(namebuf, p, name_len);
 1568|  1.09k|		namebuf[name_len] = 0;
 1569|  1.09k|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|  1.09k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1569:6): [True: 0, False: 1.09k]
  ------------------
 1570|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1571|       |
 1572|  1.09k|		archive_entry_set_gname(e, namebuf);
 1573|  1.09k|	}
 1574|  1.22k|	if ((flags & OWNER_USER_UID) != 0) {
  ------------------
  |  |  151|  1.22k|#define	OWNER_USER_UID		0x04
  ------------------
  |  Branch (1574:6): [True: 1.11k, False: 107]
  ------------------
 1575|  1.11k|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1575:6): [True: 7, False: 1.10k]
  ------------------
 1576|      7|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1577|  1.10k|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  1.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1577:6): [True: 0, False: 1.10k]
  ------------------
 1578|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1579|  1.10k|		*extra_data_size -= value_size;
 1580|       |
 1581|  1.10k|		archive_entry_set_uid(e, (la_int64_t)id);
 1582|  1.10k|	}
 1583|  1.21k|	if ((flags & OWNER_GROUP_GID) != 0) {
  ------------------
  |  |  152|  1.21k|#define	OWNER_GROUP_GID		0x08
  ------------------
  |  Branch (1583:6): [True: 548, False: 667]
  ------------------
 1584|    548|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1584:6): [True: 44, False: 504]
  ------------------
 1585|     44|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     44|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1586|    504|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    504|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1586:6): [True: 0, False: 504]
  ------------------
 1587|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1588|    504|		*extra_data_size -= value_size;
 1589|       |
 1590|    504|		archive_entry_set_gid(e, (la_int64_t)id);
 1591|    504|	}
 1592|  1.17k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1593|  1.21k|}
archive_read_support_format_rar5.c:parse_file_extra_version:
 1309|  28.4k|{
 1310|  28.4k|	size_t flags = 0;
 1311|  28.4k|	size_t version = 0;
 1312|  28.4k|	size_t value_len = 0;
 1313|  28.4k|	struct archive_string version_string;
 1314|  28.4k|	struct archive_string name_utf8_string;
 1315|  28.4k|	const char* cur_filename;
 1316|       |
 1317|       |	/* Flags are ignored. */
 1318|  28.4k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1318:5): [True: 27, False: 28.4k]
  ------------------
 1319|     27|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     27|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1320|       |
 1321|  28.4k|	*extra_data_size -= value_len;
 1322|  28.4k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  28.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1322:5): [True: 0, False: 28.4k]
  ------------------
 1323|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1324|       |
 1325|  28.4k|	if(!read_var_sized(a, &version, &value_len))
  ------------------
  |  Branch (1325:5): [True: 31, False: 28.4k]
  ------------------
 1326|     31|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     31|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1327|       |
 1328|  28.4k|	*extra_data_size -= value_len;
 1329|  28.4k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  28.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1329:5): [True: 0, False: 28.4k]
  ------------------
 1330|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1331|       |
 1332|       |	/* extra_data_size should be zero here. */
 1333|       |
 1334|  28.4k|	cur_filename = archive_entry_pathname_utf8(e);
 1335|  28.4k|	if(cur_filename == NULL) {
  ------------------
  |  Branch (1335:5): [True: 0, False: 28.4k]
  ------------------
 1336|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1337|      0|		    "Version entry without file name");
 1338|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1339|      0|	}
 1340|       |
 1341|  28.4k|	archive_string_init(&version_string);
  ------------------
  |  |   71|  28.4k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 28.4k]
  |  |  ------------------
  ------------------
 1342|  28.4k|	archive_string_init(&name_utf8_string);
  ------------------
  |  |   71|  28.4k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 28.4k]
  |  |  ------------------
  ------------------
 1343|       |
 1344|       |	/* Prepare a ;123 suffix for the filename, where '123' is the version
 1345|       |	 * value of this file. */
 1346|  28.4k|	archive_string_sprintf(&version_string, ";%zu", version);
 1347|       |
 1348|       |	/* Build the new filename. */
 1349|  28.4k|	archive_strcat(&name_utf8_string, cur_filename);
 1350|  28.4k|	archive_strcat(&name_utf8_string, version_string.s);
 1351|       |
 1352|       |	/* Apply the new filename into this file's context. */
 1353|  28.4k|	archive_entry_update_pathname_utf8(e, name_utf8_string.s);
 1354|       |
 1355|       |	/* Free buffers. */
 1356|  28.4k|	archive_string_free(&version_string);
 1357|  28.4k|	archive_string_free(&name_utf8_string);
 1358|  28.4k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  28.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1359|  28.4k|}
archive_read_support_format_rar5.c:scan_for_signature:
 3402|  7.35k|static int scan_for_signature(struct archive_read* a) {
 3403|  7.35k|	const uint8_t* p;
 3404|  7.35k|	const int chunk_size = 512;
 3405|  7.35k|	ssize_t i;
 3406|  7.35k|	char signature[sizeof(rar5_signature_xor)];
 3407|       |
 3408|       |	/* If we're here, it means we're on an 'unknown territory' data.
 3409|       |	 * There's no indication what kind of data we're reading here.
 3410|       |	 * It could be some text comment, any kind of binary data,
 3411|       |	 * digital sign, dragons, etc.
 3412|       |	 *
 3413|       |	 * We want to find a valid RARv5 magic header inside this unknown
 3414|       |	 * data. */
 3415|       |
 3416|       |	/* Is it possible in libarchive to just skip everything until the
 3417|       |	 * end of the file? If so, it would be a better approach than the
 3418|       |	 * current implementation of this function. */
 3419|       |
 3420|  7.35k|	rar5_signature(signature);
 3421|       |
 3422|  8.71k|	while(1) {
  ------------------
  |  Branch (3422:8): [True: 8.71k, Folded]
  ------------------
 3423|  8.71k|		if(!read_ahead(a, chunk_size, &p))
  ------------------
  |  Branch (3423:6): [True: 701, False: 8.01k]
  ------------------
 3424|    701|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    701|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3425|       |
 3426|  2.47M|		for(i = 0; i < chunk_size - (int)sizeof(rar5_signature_xor);
  ------------------
  |  Branch (3426:14): [True: 2.46M, False: 1.36k]
  ------------------
 3427|  2.46M|		    i++) {
 3428|  2.46M|			if(memcmp(&p[i], signature,
  ------------------
  |  Branch (3428:7): [True: 6.65k, False: 2.46M]
  ------------------
 3429|  2.46M|			    sizeof(rar5_signature_xor)) == 0) {
 3430|       |				/* Consume the number of bytes we've used to
 3431|       |				 * search for the signature, as well as the
 3432|       |				 * number of bytes used by the signature
 3433|       |				 * itself. After this we should be standing
 3434|       |				 * on a valid base block header. */
 3435|  6.65k|				(void) consume(a,
 3436|  6.65k|				    i + sizeof(rar5_signature_xor));
 3437|  6.65k|				return ARCHIVE_OK;
  ------------------
  |  |  233|  6.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3438|  6.65k|			}
 3439|  2.46M|		}
 3440|       |
 3441|  1.36k|		consume(a, chunk_size);
 3442|  1.36k|	}
 3443|       |
 3444|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3445|  7.35k|}
archive_read_support_format_rar5.c:rar5_read_data:
 4261|  73.1k|    size_t *size, int64_t *offset) {
 4262|  73.1k|	struct rar5 *rar5 = a->format->data;
 4263|  73.1k|	int ret;
 4264|       |
 4265|  73.1k|	if (size)
  ------------------
  |  Branch (4265:6): [True: 66.7k, False: 6.44k]
  ------------------
 4266|  66.7k|		*size = 0;
 4267|       |
 4268|  73.1k|	if (rar5->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  73.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (4268:6): [True: 0, False: 73.1k]
  ------------------
 4269|      0|		rar5->has_encrypted_entries = 0;
 4270|      0|	}
 4271|       |
 4272|  73.1k|	if (rar5->headers_are_encrypted || rar5->cstate.data_encrypted) {
  ------------------
  |  Branch (4272:6): [True: 0, False: 73.1k]
  |  Branch (4272:37): [True: 116, False: 73.0k]
  ------------------
 4273|    116|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    116|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4274|    116|		    "Reading encrypted data is not currently supported");
 4275|    116|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    116|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4276|    116|	}
 4277|       |
 4278|  73.0k|	if(rar5->file.dir > 0) {
  ------------------
  |  Branch (4278:5): [True: 2, False: 73.0k]
  ------------------
 4279|       |		/* Don't process any data if this file entry was declared
 4280|       |		 * as a directory. This is needed, because entries marked as
 4281|       |		 * directory doesn't have any dictionary buffer allocated, so
 4282|       |		 * it's impossible to perform any decompression. */
 4283|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4284|      2|		    "Can't decompress an entry marked as a directory");
 4285|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4286|      2|	}
 4287|       |
 4288|  73.0k|	if(!rar5->skip_mode && (rar5->cstate.last_write_ptr > rar5->file.unpacked_size)) {
  ------------------
  |  Branch (4288:5): [True: 66.6k, False: 6.44k]
  |  Branch (4288:25): [True: 1, False: 66.6k]
  ------------------
 4289|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4290|      1|		    "Unpacker has written too many bytes");
 4291|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4292|      1|	}
 4293|       |
 4294|  73.0k|	ret = use_data(rar5, buff, size, offset);
 4295|  73.0k|	if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|  73.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4295:5): [True: 30.7k, False: 42.3k]
  ------------------
 4296|  30.7k|		return ret;
 4297|  30.7k|	}
 4298|       |
 4299|  42.3k|	if(rar5->file.eof == 1) {
  ------------------
  |  Branch (4299:5): [True: 2.90k, False: 39.4k]
  ------------------
 4300|  2.90k|		return ARCHIVE_EOF;
  ------------------
  |  |  232|  2.90k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4301|  2.90k|	}
 4302|       |
 4303|  39.4k|	ret = do_unpack(a, rar5, buff, size, offset);
 4304|  39.4k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  39.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4304:5): [True: 6.32k, False: 33.1k]
  ------------------
 4305|  6.32k|		return ret;
 4306|  6.32k|	}
 4307|       |
 4308|  33.1k|	if(rar5->file.bytes_remaining == 0 &&
  ------------------
  |  Branch (4308:5): [True: 4.52k, False: 28.5k]
  ------------------
 4309|  4.52k|			rar5->cstate.last_write_ptr == rar5->file.unpacked_size)
  ------------------
  |  Branch (4309:4): [True: 1.62k, False: 2.89k]
  ------------------
 4310|  1.62k|	{
 4311|       |		/* If all bytes of current file were processed, run
 4312|       |		 * finalization.
 4313|       |		 *
 4314|       |		 * Finalization will check checksum against proper values. If
 4315|       |		 * some of the checksums will not match, we'll return an error
 4316|       |		 * value in the last `archive_read_data` call to signal an error
 4317|       |		 * to the user. */
 4318|       |
 4319|  1.62k|		rar5->file.eof = 1;
 4320|  1.62k|		return verify_global_checksums(a);
 4321|  1.62k|	}
 4322|       |
 4323|  31.4k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  31.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4324|  33.1k|}
archive_read_support_format_rar5.c:use_data:
 3804|  73.0k|{
 3805|  73.0k|	int i;
 3806|       |
 3807|   162k|	for(i = 0; i < rar5_countof(rar5->cstate.dready); i++) {
  ------------------
  |  |   64|   162k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3807:13): [True: 119k, False: 42.3k]
  ------------------
 3808|   119k|		struct data_ready *d = &rar5->cstate.dready[i];
 3809|       |
 3810|   119k|		if(d->used) {
  ------------------
  |  Branch (3810:6): [True: 30.7k, False: 89.2k]
  ------------------
 3811|  30.7k|			if(buf)    *buf = d->buf;
  ------------------
  |  Branch (3811:7): [True: 30.7k, False: 11]
  ------------------
 3812|  30.7k|			if(size)   *size = d->size;
  ------------------
  |  Branch (3812:7): [True: 30.7k, False: 11]
  ------------------
 3813|  30.7k|			if(offset) *offset = d->offset;
  ------------------
  |  Branch (3813:7): [True: 30.7k, False: 11]
  ------------------
 3814|       |
 3815|  30.7k|			d->used = 0;
 3816|  30.7k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  30.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3817|  30.7k|		}
 3818|   119k|	}
 3819|       |
 3820|  42.3k|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|  42.3k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3821|  73.0k|}
archive_read_support_format_rar5.c:do_unpack:
 4100|  39.4k|{
 4101|  39.4k|	enum COMPRESSION_METHOD {
 4102|  39.4k|		STORE = 0, FASTEST = 1, FAST = 2, NORMAL = 3, GOOD = 4,
 4103|  39.4k|		BEST = 5
 4104|  39.4k|	};
 4105|       |
 4106|  39.4k|	if(rar5->file.service > 0) {
  ------------------
  |  Branch (4106:5): [True: 201, False: 39.2k]
  ------------------
 4107|    201|		return do_unstore_file(a, rar5, buf, size, offset);
 4108|  39.2k|	} else {
 4109|  39.2k|		switch(rar5->cstate.method) {
 4110|  4.09k|			case STORE:
  ------------------
  |  Branch (4110:4): [True: 4.09k, False: 35.1k]
  ------------------
 4111|  4.09k|				return do_unstore_file(a, rar5, buf, size,
 4112|  4.09k|				    offset);
 4113|  8.70k|			case FASTEST:
  ------------------
  |  Branch (4113:4): [True: 8.70k, False: 30.5k]
  ------------------
 4114|       |				/* fallthrough */
 4115|  12.0k|			case FAST:
  ------------------
  |  Branch (4115:4): [True: 3.37k, False: 35.8k]
  ------------------
 4116|       |				/* fallthrough */
 4117|  17.3k|			case NORMAL:
  ------------------
  |  Branch (4117:4): [True: 5.22k, False: 33.9k]
  ------------------
 4118|       |				/* fallthrough */
 4119|  18.4k|			case GOOD:
  ------------------
  |  Branch (4119:4): [True: 1.16k, False: 38.0k]
  ------------------
 4120|       |				/* fallthrough */
 4121|  35.1k|			case BEST:
  ------------------
  |  Branch (4121:4): [True: 16.6k, False: 22.5k]
  ------------------
 4122|       |				/* No data is returned here. But because a sparse-file aware
 4123|       |				 * caller (like archive_read_data_into_fd) may treat zero-size
 4124|       |				 * as a sparse file block, we need to update the offset
 4125|       |				 * accordingly. At this point the decoder doesn't have any
 4126|       |				 * pending uncompressed data blocks, so the current position in
 4127|       |				 * the output file should be last_write_ptr. */
 4128|  35.1k|				if (offset) *offset = rar5->cstate.last_write_ptr;
  ------------------
  |  Branch (4128:9): [True: 28.9k, False: 6.18k]
  ------------------
 4129|  35.1k|				return uncompress_file(a);
 4130|      0|			default:
  ------------------
  |  Branch (4130:4): [True: 0, False: 39.2k]
  ------------------
 4131|      0|				archive_set_error(&a->archive,
 4132|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4133|      0|				    "Compression method not supported: 0x%x",
 4134|      0|				    (unsigned int)rar5->cstate.method);
 4135|       |
 4136|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4137|  39.2k|		}
 4138|  39.2k|	}
 4139|       |
 4140|      0|#if !defined WIN32
 4141|       |	/* Not reached. */
 4142|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4143|  39.4k|#endif
 4144|  39.4k|}
archive_read_support_format_rar5.c:do_unstore_file:
 4052|  4.29k|{
 4053|  4.29k|	size_t to_read;
 4054|  4.29k|	const uint8_t* p;
 4055|       |
 4056|  4.29k|	if(rar5->file.bytes_remaining == 0 && rar5->main.volume > 0 &&
  ------------------
  |  Branch (4056:5): [True: 2.29k, False: 2.00k]
  |  Branch (4056:40): [True: 1.87k, False: 423]
  ------------------
 4057|  1.87k|	    rar5->generic.split_after > 0)
  ------------------
  |  Branch (4057:6): [True: 1.81k, False: 53]
  ------------------
 4058|  1.81k|	{
 4059|  1.81k|		int ret;
 4060|       |
 4061|  1.81k|		rar5->cstate.switch_multivolume = 1;
 4062|  1.81k|		ret = advance_multivolume(a);
 4063|  1.81k|		rar5->cstate.switch_multivolume = 0;
 4064|       |
 4065|  1.81k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.81k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4065:6): [True: 777, False: 1.04k]
  ------------------
 4066|       |			/* Failed to advance to next multivolume archive
 4067|       |			 * file. */
 4068|    777|			return ret;
 4069|    777|		}
 4070|  1.81k|	}
 4071|       |
 4072|  3.52k|	to_read = rar5_min(rar5->file.bytes_remaining, 64 * 1024);
  ------------------
  |  |   62|  3.52k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (62:25): [True: 10, False: 3.51k]
  |  |  ------------------
  ------------------
 4073|  3.52k|	if(to_read == 0) {
  ------------------
  |  Branch (4073:5): [True: 487, False: 3.03k]
  ------------------
 4074|    487|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    487|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4075|    487|	}
 4076|       |
 4077|  3.03k|	if(!read_ahead(a, to_read, &p)) {
  ------------------
  |  Branch (4077:5): [True: 24, False: 3.00k]
  ------------------
 4078|     24|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4079|     24|		    "I/O error when unstoring file");
 4080|     24|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4081|     24|	}
 4082|       |
 4083|  3.00k|	if(ARCHIVE_OK != consume(a, to_read)) {
  ------------------
  |  |  233|  3.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4083:5): [True: 0, False: 3.00k]
  ------------------
 4084|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4085|      0|	}
 4086|       |
 4087|  3.00k|	if(buf)    *buf = p;
  ------------------
  |  Branch (4087:5): [True: 2.76k, False: 244]
  ------------------
 4088|  3.00k|	if(size)   *size = to_read;
  ------------------
  |  Branch (4088:5): [True: 2.76k, False: 244]
  ------------------
 4089|  3.00k|	if(offset) *offset = rar5->cstate.last_unstore_ptr;
  ------------------
  |  Branch (4089:5): [True: 2.76k, False: 244]
  ------------------
 4090|       |
 4091|  3.00k|	rar5->file.bytes_remaining -= to_read;
 4092|  3.00k|	rar5->cstate.last_unstore_ptr += to_read;
 4093|       |
 4094|  3.00k|	update_crc(rar5, p, to_read);
 4095|  3.00k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4096|  3.00k|}
archive_read_support_format_rar5.c:advance_multivolume:
 3449|  5.57k|static int advance_multivolume(struct archive_read* a) {
 3450|  5.57k|	struct rar5 *rar5 = a->format->data;
 3451|  5.57k|	int lret;
 3452|       |
 3453|       |	/* A small state machine that will skip unnecessary data, needed to
 3454|       |	 * switch from one multivolume to another. Such skipping is needed if
 3455|       |	 * we want to be an stream-oriented (instead of file-oriented)
 3456|       |	 * unpacker.
 3457|       |	 *
 3458|       |	 * The state machine starts with `rar5->main.endarc` == 0. It also
 3459|       |	 * assumes that current stream pointer points to some base block
 3460|       |	 * header.
 3461|       |	 *
 3462|       |	 * The `endarc` field is being set when the base block parsing
 3463|       |	 * function encounters the 'end of archive' marker.
 3464|       |	 */
 3465|       |
 3466|  14.5k|	while(1) {
  ------------------
  |  Branch (3466:8): [True: 14.5k, Folded]
  ------------------
 3467|  14.5k|		if(rar5->main.endarc == 1) {
  ------------------
  |  Branch (3467:6): [True: 4.45k, False: 10.1k]
  ------------------
 3468|  4.45k|			int looping = 1;
 3469|       |
 3470|  4.45k|			rar5->main.endarc = 0;
 3471|       |
 3472|  14.0k|			while(looping) {
  ------------------
  |  Branch (3472:10): [True: 11.7k, False: 2.31k]
  ------------------
 3473|  11.7k|				lret = skip_base_block(a);
 3474|  11.7k|				switch(lret) {
 3475|  7.33k|					case ARCHIVE_RETRY:
  ------------------
  |  |  234|  7.33k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3475:6): [True: 7.33k, False: 4.45k]
  ------------------
 3476|       |						/* Continue looping. */
 3477|  7.33k|						break;
 3478|  2.31k|					case ARCHIVE_OK:
  ------------------
  |  |  233|  2.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3478:6): [True: 2.31k, False: 9.47k]
  ------------------
 3479|       |						/* Break loop. */
 3480|  2.31k|						looping = 0;
 3481|  2.31k|						break;
 3482|  2.14k|					default:
  ------------------
  |  Branch (3482:6): [True: 2.14k, False: 9.64k]
  ------------------
 3483|       |						/* Forward any errors to the
 3484|       |						 * caller. */
 3485|  2.14k|						return lret;
 3486|  11.7k|				}
 3487|  11.7k|			}
 3488|       |
 3489|  2.31k|			break;
 3490|  10.1k|		} else {
 3491|       |			/* Skip current base block. In order to properly skip
 3492|       |			 * it, we really need to simply parse it and discard
 3493|       |			 * the results. */
 3494|       |
 3495|  10.1k|			lret = skip_base_block(a);
 3496|  10.1k|			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  239|  20.2k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  237|  10.0k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3496:7): [True: 84, False: 10.0k]
  |  Branch (3496:32): [True: 282, False: 9.77k]
  ------------------
 3497|    366|				return lret;
 3498|       |
 3499|       |			/* The `skip_base_block` function tells us if we
 3500|       |			 * should continue with skipping, or we should stop
 3501|       |			 * skipping. We're trying to skip everything up to
 3502|       |			 * a base FILE block. */
 3503|       |
 3504|  9.77k|			if(lret != ARCHIVE_RETRY) {
  ------------------
  |  |  234|  9.77k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3504:7): [True: 857, False: 8.91k]
  ------------------
 3505|       |				/* If there was an error during skipping, or we
 3506|       |				 * have just skipped a FILE base block... */
 3507|       |
 3508|    857|				if(rar5->main.endarc == 0) {
  ------------------
  |  Branch (3508:8): [True: 762, False: 95]
  ------------------
 3509|    762|					return lret;
 3510|    762|				} else {
 3511|     95|					continue;
 3512|     95|				}
 3513|    857|			}
 3514|  9.77k|		}
 3515|  14.5k|	}
 3516|       |
 3517|  2.31k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3518|  5.57k|}
archive_read_support_format_rar5.c:skip_base_block:
 2456|  21.9k|static int skip_base_block(struct archive_read* a) {
 2457|  21.9k|	struct rar5 *rar5 = a->format->data;
 2458|  21.9k|	int ret;
 2459|       |
 2460|       |	/* Create a new local archive_entry structure that will be operated on
 2461|       |	 * by header reader; operations on this archive_entry will be discarded.
 2462|       |	 */
 2463|  21.9k|	struct archive_entry* entry = archive_entry_new();
 2464|  21.9k|	if (entry == NULL)
  ------------------
  |  Branch (2464:6): [True: 0, False: 21.9k]
  ------------------
 2465|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2466|       |
 2467|  21.9k|	ret = process_base_block(a, entry);
 2468|       |
 2469|       |	/* Discard operations on this archive_entry structure. */
 2470|  21.9k|	archive_entry_free(entry);
 2471|  21.9k|	if(ret == ARCHIVE_FATAL)
  ------------------
  |  |  239|  21.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2471:5): [True: 696, False: 21.2k]
  ------------------
 2472|    696|		return ret;
 2473|       |
 2474|  21.2k|	if(rar5->generic.last_header_id == 2 && rar5->generic.split_before > 0)
  ------------------
  |  Branch (2474:5): [True: 9.17k, False: 12.0k]
  |  Branch (2474:42): [True: 2.64k, False: 6.53k]
  ------------------
 2475|  2.64k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  2.64k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2476|       |
 2477|  18.5k|	if(ret == ARCHIVE_OK)
  ------------------
  |  |  233|  18.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2477:5): [True: 11.9k, False: 6.59k]
  ------------------
 2478|  11.9k|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|  11.9k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2479|  6.59k|	else
 2480|  6.59k|		return ret;
 2481|  18.5k|}
archive_read_support_format_rar5.c:update_crc:
 2609|  33.7k|static void update_crc(struct rar5 *rar5, const uint8_t* p, size_t to_read) {
 2610|  33.7k|    int verify_crc;
 2611|       |
 2612|  33.7k|	if(rar5->skip_mode) {
  ------------------
  |  Branch (2612:5): [True: 244, False: 33.4k]
  ------------------
 2613|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 2614|       |		verify_crc = 1;
 2615|       |#else
 2616|    244|		verify_crc = 0;
 2617|    244|#endif
 2618|    244|	} else
 2619|  33.4k|		verify_crc = 1;
 2620|       |
 2621|  33.7k|	if(verify_crc) {
  ------------------
  |  Branch (2621:5): [True: 33.4k, False: 244]
  ------------------
 2622|       |		/* Don't update CRC32 if the file doesn't have the
 2623|       |		 * `stored_crc32` info filled in. */
 2624|  33.4k|		if(rar5->file.stored_crc32 > 0) {
  ------------------
  |  Branch (2624:6): [True: 4.32k, False: 29.1k]
  ------------------
 2625|  4.32k|			rar5->file.calculated_crc32 =
 2626|  4.32k|				crc32(rar5->file.calculated_crc32, p,
 2627|  4.32k|				    (unsigned int)to_read);
 2628|  4.32k|		}
 2629|       |
 2630|       |		/* Check if the file uses an optional BLAKE2sp checksum
 2631|       |		 * algorithm. */
 2632|  33.4k|		if(rar5->file.has_blake2 > 0) {
  ------------------
  |  Branch (2632:6): [True: 21.1k, False: 12.3k]
  ------------------
 2633|       |			/* Return value of the `update` function is always 0,
 2634|       |			 * so we can explicitly ignore it here. */
 2635|  21.1k|			(void) blake2sp_update(&rar5->file.b2state, p,
 2636|  21.1k|			    to_read);
 2637|  21.1k|		}
 2638|  33.4k|	}
 2639|  33.7k|}
archive_read_support_format_rar5.c:uncompress_file:
 4036|  35.1k|static int uncompress_file(struct archive_read* a) {
 4037|  35.1k|	int ret;
 4038|       |
 4039|  35.4k|	while(1) {
  ------------------
  |  Branch (4039:8): [True: 35.4k, Folded]
  ------------------
 4040|       |		/* Sometimes the uncompression function will return a
 4041|       |		 * 'retry' signal. If this will happen, we have to retry
 4042|       |		 * the function. */
 4043|  35.4k|		ret = do_uncompress_file(a);
 4044|  35.4k|		if(ret != ARCHIVE_RETRY)
  ------------------
  |  |  234|  35.4k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4044:6): [True: 35.1k, False: 300]
  ------------------
 4045|  35.1k|			return ret;
 4046|  35.4k|	}
 4047|  35.1k|}
archive_read_support_format_rar5.c:do_uncompress_file:
 3923|  35.4k|static int do_uncompress_file(struct archive_read* a) {
 3924|  35.4k|	struct rar5 *rar5 = a->format->data;
 3925|  35.4k|	int ret;
 3926|  35.4k|	int64_t max_end_pos;
 3927|       |
 3928|  35.4k|	if(!rar5->cstate.initialized) {
  ------------------
  |  Branch (3928:5): [True: 4.43k, False: 30.9k]
  ------------------
 3929|       |		/* Don't perform full context reinitialization if we're
 3930|       |		 * processing a solid archive. */
 3931|  4.43k|		if(!rar5->main.solid || !rar5->cstate.window_buf) {
  ------------------
  |  Branch (3931:6): [True: 799, False: 3.63k]
  |  Branch (3931:27): [True: 259, False: 3.37k]
  ------------------
 3932|  1.05k|			if((ret = init_unpack(rar5)) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3932:7): [True: 0, False: 1.05k]
  ------------------
 3933|      0|				return ret;
 3934|  1.05k|		}
 3935|       |
 3936|  4.43k|		rar5->cstate.initialized = 1;
 3937|  4.43k|	}
 3938|       |
 3939|       |	/* Don't allow extraction if window_size is invalid. */
 3940|  35.4k|	if(rar5->cstate.window_size == 0) {
  ------------------
  |  Branch (3940:5): [True: 0, False: 35.4k]
  ------------------
 3941|      0|		archive_set_error(&a->archive,
 3942|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3943|      0|			"Invalid window size declaration in this file");
 3944|       |
 3945|       |		/* This should never happen in valid files. */
 3946|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3947|      0|	}
 3948|       |
 3949|  35.4k|	if(rar5->cstate.all_filters_applied == 1) {
  ------------------
  |  Branch (3949:5): [True: 32.2k, False: 3.22k]
  ------------------
 3950|       |		/* We use while(1) here, but standard case allows for just 1
 3951|       |		 * iteration. The loop will iterate if process_block() didn't
 3952|       |		 * generate any data at all. This can happen if the block
 3953|       |		 * contains only filter definitions (this is common in big
 3954|       |		 * files). */
 3955|  40.3k|		while(1) {
  ------------------
  |  Branch (3955:9): [True: 40.3k, Folded]
  ------------------
 3956|  40.3k|			ret = process_block(a);
 3957|  40.3k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  40.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3957:7): [True: 4.88k, False: 35.4k]
  ------------------
 3958|  4.88k|				return ret;
 3959|       |
 3960|  35.4k|			if(rar5->cstate.last_write_ptr ==
  ------------------
  |  Branch (3960:7): [True: 8.29k, False: 27.1k]
  ------------------
 3961|  35.4k|			    rar5->cstate.write_ptr) {
 3962|       |				/* The block didn't generate any new data,
 3963|       |				 * so just process a new block if this one
 3964|       |				 * wasn't the last block in the file. */
 3965|  8.29k|				if (bf_is_last_block(&rar5->last_block_hdr)) {
  ------------------
  |  Branch (3965:9): [True: 128, False: 8.17k]
  ------------------
 3966|    128|					return ARCHIVE_EOF;
  ------------------
  |  |  232|    128|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3967|    128|				}
 3968|       |
 3969|  8.17k|				continue;
 3970|  8.29k|			}
 3971|       |
 3972|       |			/* The block has generated some new data, so break
 3973|       |			 * the loop. */
 3974|  27.1k|			break;
 3975|  35.4k|		}
 3976|  32.2k|	}
 3977|       |
 3978|       |	/* Try to run filters. If filters won't be applied, it means that
 3979|       |	 * insufficient data was generated. */
 3980|  30.4k|	ret = apply_filters(a);
 3981|  30.4k|	if(ret == ARCHIVE_RETRY) {
  ------------------
  |  |  234|  30.4k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3981:5): [True: 3.22k, False: 27.1k]
  ------------------
 3982|  3.22k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  3.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3983|  27.1k|	} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  27.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3983:12): [True: 26, False: 27.1k]
  ------------------
 3984|     26|		return ret;
 3985|     26|	}
 3986|       |
 3987|  27.1k|	if(cdeque_size(&rar5->cstate.filters) > 0) {
  ------------------
  |  Branch (3987:5): [True: 719, False: 26.4k]
  ------------------
 3988|       |		/* Check if we can write something before hitting first
 3989|       |		 * filter. */
 3990|    719|		struct filter_info* flt;
 3991|       |
 3992|       |		/* Get the block_start offset from the first filter. */
 3993|    719|		if(CDE_OK != cdeque_front(&rar5->cstate.filters,
  ------------------
  |  Branch (3993:6): [True: 0, False: 719]
  ------------------
 3994|    719|		    cdeque_filter_p(&flt)))
 3995|      0|		{
 3996|      0|			archive_set_error(&a->archive,
 3997|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3998|      0|			    "Can't read first filter");
 3999|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4000|      0|		}
 4001|       |
 4002|    719|		max_end_pos = rar5_min(flt->block_start,
  ------------------
  |  |   62|    719|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (62:25): [True: 340, False: 379]
  |  |  ------------------
  ------------------
 4003|    719|		    rar5->cstate.write_ptr);
 4004|  26.4k|	} else {
 4005|       |		/* There are no filters defined, or all filters were applied.
 4006|       |		 * This means we can just store the data without any
 4007|       |		 * postprocessing. */
 4008|  26.4k|		max_end_pos = rar5->cstate.write_ptr;
 4009|  26.4k|	}
 4010|       |
 4011|  27.1k|	if(max_end_pos == rar5->cstate.last_write_ptr) {
  ------------------
  |  Branch (4011:5): [True: 300, False: 26.8k]
  ------------------
 4012|       |		/* We can't write anything yet. The block uncompression
 4013|       |		 * function did not generate enough data, and no filter can be
 4014|       |		 * applied. At the same time we don't have any data that can be
 4015|       |		 *  stored without filter postprocessing. This means we need to
 4016|       |		 *  wait for more data to be generated, so we can apply the
 4017|       |		 * filters.
 4018|       |		 *
 4019|       |		 * Signal the caller that we need more data to be able to do
 4020|       |		 * anything.
 4021|       |		 */
 4022|    300|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|    300|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 4023|  26.8k|	} else {
 4024|       |		/* We can write the data before hitting the first filter.
 4025|       |		 * So let's do it. The push_window_data() function will
 4026|       |		 * effectively return the selected data block to the user
 4027|       |		 * application. */
 4028|  26.8k|		push_window_data(a, rar5, rar5->cstate.last_write_ptr,
 4029|  26.8k|		    max_end_pos);
 4030|  26.8k|		rar5->cstate.last_write_ptr = max_end_pos;
 4031|  26.8k|	}
 4032|       |
 4033|  26.8k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  26.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4034|  27.1k|}
archive_read_support_format_rar5.c:init_unpack:
 2576|  1.05k|static int init_unpack(struct rar5 *rar5) {
 2577|  1.05k|	rar5->file.calculated_crc32 = 0;
 2578|  1.05k|	init_window_mask(rar5);
 2579|       |
 2580|  1.05k|	free(rar5->cstate.window_buf);
 2581|  1.05k|	free(rar5->cstate.filtered_buf);
 2582|       |
 2583|  1.05k|	rar5->cstate.window_buf = NULL;
 2584|  1.05k|	rar5->cstate.filtered_buf = NULL;
 2585|       |
 2586|  1.05k|	if(rar5->cstate.window_size > 0) {
  ------------------
  |  Branch (2586:5): [True: 1.05k, False: 0]
  ------------------
 2587|  1.05k|		rar5->cstate.window_buf = calloc(1, rar5->cstate.window_size);
 2588|  1.05k|		if(rar5->cstate.window_buf == NULL)
  ------------------
  |  Branch (2588:6): [True: 0, False: 1.05k]
  ------------------
 2589|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2590|  1.05k|		rar5->cstate.filtered_buf = calloc(1,
 2591|  1.05k|		    rar5->cstate.window_size);
 2592|  1.05k|		if(rar5->cstate.filtered_buf == NULL)
  ------------------
  |  Branch (2592:6): [True: 0, False: 1.05k]
  ------------------
 2593|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2594|  1.05k|	}
 2595|       |
 2596|  1.05k|	clear_data_ready_stack(rar5);
 2597|       |
 2598|  1.05k|	rar5->cstate.write_ptr = 0;
 2599|  1.05k|	rar5->cstate.last_write_ptr = 0;
 2600|       |
 2601|  1.05k|	memset(&rar5->cstate.bd, 0, sizeof(rar5->cstate.bd));
 2602|  1.05k|	memset(&rar5->cstate.ld, 0, sizeof(rar5->cstate.ld));
 2603|  1.05k|	memset(&rar5->cstate.dd, 0, sizeof(rar5->cstate.dd));
 2604|  1.05k|	memset(&rar5->cstate.ldd, 0, sizeof(rar5->cstate.ldd));
 2605|  1.05k|	memset(&rar5->cstate.rd, 0, sizeof(rar5->cstate.rd));
 2606|  1.05k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2607|  1.05k|}
archive_read_support_format_rar5.c:process_block:
 3644|  40.3k|static int process_block(struct archive_read* a) {
 3645|  40.3k|	struct rar5 *rar5 = a->format->data;
 3646|  40.3k|	const uint8_t* p;
 3647|  40.3k|	int ret;
 3648|       |
 3649|       |	/* If we don't have any data to be processed, this most probably means
 3650|       |	 * we need to switch to the next volume. */
 3651|  40.3k|	if(rar5->main.volume && rar5->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3651:5): [True: 16.9k, False: 23.4k]
  |  Branch (3651:26): [True: 2.67k, False: 14.2k]
  ------------------
 3652|  2.67k|		ret = advance_multivolume(a);
 3653|  2.67k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3653:6): [True: 1.91k, False: 755]
  ------------------
 3654|  1.91k|			return ret;
 3655|  2.67k|	}
 3656|       |
 3657|  38.4k|	if(rar5->cstate.block_parsing_finished) {
  ------------------
  |  Branch (3657:5): [True: 29.3k, False: 9.06k]
  ------------------
 3658|  29.3k|		ssize_t block_size;
 3659|  29.3k|		ssize_t to_skip;
 3660|  29.3k|		ssize_t cur_block_size;
 3661|       |
 3662|       |		/* The header size won't be bigger than 6 bytes. */
 3663|  29.3k|		if(!read_ahead(a, 6, &p)) {
  ------------------
  |  Branch (3663:6): [True: 170, False: 29.2k]
  ------------------
 3664|       |			/* Failed to prefetch data block header. */
 3665|    170|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    170|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3666|    170|		}
 3667|       |
 3668|       |		/*
 3669|       |		 * Read block_size by parsing block header. Validate the header
 3670|       |		 * by calculating CRC byte stored inside the header. Size of
 3671|       |		 * the header is not constant (block size can be stored either
 3672|       |		 * in 1 or 2 bytes), that's why block size is left out from the
 3673|       |		 * `compressed_block_header` structure and returned by
 3674|       |		 * `parse_block_header` as the second argument. */
 3675|       |
 3676|  29.2k|		ret = parse_block_header(a, p, &block_size,
 3677|  29.2k|		    &rar5->last_block_hdr);
 3678|  29.2k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  29.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3678:6): [True: 920, False: 28.3k]
  ------------------
 3679|    920|			return ret;
 3680|    920|		}
 3681|       |
 3682|       |		/* Skip block header. Next data is huffman tables,
 3683|       |		 * if present. */
 3684|  28.3k|		to_skip = sizeof(struct compressed_block_header) +
 3685|  28.3k|			bf_byte_count(&rar5->last_block_hdr) + 1;
 3686|       |
 3687|       |		/* If the block header's to_skip value exceeds the declared
 3688|       |		 * remaining data, the archive is malformed. */
 3689|  28.3k|		if(to_skip > rar5->file.bytes_remaining) {
  ------------------
  |  Branch (3689:6): [True: 20, False: 28.2k]
  ------------------
 3690|     20|			archive_set_error(&a->archive,
 3691|     20|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     20|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3692|     20|			    "Block header size exceeds remaining file data");
 3693|     20|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     20|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3694|     20|		}
 3695|       |
 3696|  28.2k|		if(ARCHIVE_OK != consume(a, to_skip))
  ------------------
  |  |  233|  28.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3696:6): [True: 0, False: 28.2k]
  ------------------
 3697|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3698|       |
 3699|  28.2k|		rar5->file.bytes_remaining -= to_skip;
 3700|       |
 3701|       |		/* The block size gives information about the whole block size,
 3702|       |		 * but the block could be stored in split form when using
 3703|       |		 * multi-volume archives. In this case, the block size will be
 3704|       |		 * bigger than the actual data stored in this file. Remaining
 3705|       |		 * part of the data will be in another file. */
 3706|       |
 3707|  28.2k|		cur_block_size =
 3708|  28.2k|			rar5_min(rar5->file.bytes_remaining, block_size);
  ------------------
  |  |   62|  28.2k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (62:25): [True: 24.3k, False: 3.92k]
  |  |  ------------------
  ------------------
 3709|       |
 3710|  28.2k|		if(block_size > rar5->file.bytes_remaining) {
  ------------------
  |  Branch (3710:6): [True: 376, False: 27.9k]
  ------------------
 3711|       |			/* If current blocks' size is bigger than our data
 3712|       |			 * size, this means we have a multivolume archive.
 3713|       |			 * In this case, skip all base headers until the end
 3714|       |			 * of the file, proceed to next "partXXX.rar" volume,
 3715|       |			 * find its signature, skip all headers up to the first
 3716|       |			 * FILE base header, and continue from there.
 3717|       |			 *
 3718|       |			 * Note that `merge_block` will update the `rar`
 3719|       |			 * context structure quite extensively. */
 3720|       |
 3721|    376|			ret = merge_block(a, block_size, &p);
 3722|    376|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    376|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3722:7): [True: 347, False: 29]
  ------------------
 3723|    347|				return ret;
 3724|    347|			}
 3725|       |
 3726|     29|			cur_block_size = block_size;
 3727|       |
 3728|       |			/* Current stream pointer should be now directly
 3729|       |			 * *after* the block that spanned through multiple
 3730|       |			 * archive files. `p` pointer should have the data of
 3731|       |			 * the *whole* block (merged from partial blocks
 3732|       |			 * stored in multiple archives files). */
 3733|  27.9k|		} else {
 3734|  27.9k|			rar5->cstate.switch_multivolume = 0;
 3735|       |
 3736|       |			/* Read the whole block size into memory. This can take
 3737|       |			 * up to  8 megabytes of memory in theoretical cases.
 3738|       |			 * Might be worth to optimize this and use a standard
 3739|       |			 * chunk of 4kb's. */
 3740|  27.9k|			if(!read_ahead(a, 4 + cur_block_size, &p)) {
  ------------------
  |  Branch (3740:7): [True: 577, False: 27.3k]
  ------------------
 3741|       |				/* Failed to prefetch block data. */
 3742|    577|				return ARCHIVE_EOF;
  ------------------
  |  |  232|    577|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3743|    577|			}
 3744|  27.9k|		}
 3745|       |
 3746|  27.3k|		rar5->cstate.block_buf = p;
 3747|  27.3k|		rar5->cstate.cur_block_size = cur_block_size;
 3748|  27.3k|		rar5->cstate.block_parsing_finished = 0;
 3749|       |
 3750|  27.3k|		rar5->bits.in_addr = 0;
 3751|  27.3k|		rar5->bits.bit_addr = 0;
 3752|       |
 3753|  27.3k|		if(bf_is_table_present(&rar5->last_block_hdr)) {
  ------------------
  |  Branch (3753:6): [True: 1.81k, False: 25.5k]
  ------------------
 3754|       |			/* Load Huffman tables. */
 3755|  1.81k|			ret = parse_tables(a, rar5, p);
 3756|  1.81k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.81k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3756:7): [True: 607, False: 1.20k]
  ------------------
 3757|       |				/* Error during decompression of Huffman
 3758|       |				 * tables. */
 3759|    607|				return ret;
 3760|    607|			}
 3761|  1.81k|		}
 3762|  27.3k|	} else {
 3763|       |		/* Block parsing not finished, reuse previous memory buffer. */
 3764|  9.06k|		p = rar5->cstate.block_buf;
 3765|  9.06k|	}
 3766|       |
 3767|       |	/* Uncompress the block, or a part of it, depending on how many bytes
 3768|       |	 * will be generated by uncompressing the block.
 3769|       |	 *
 3770|       |	 * In case too many bytes will be generated, calling this function
 3771|       |	 * again will resume the uncompression operation. */
 3772|  35.8k|	ret = do_uncompress_block(a, p);
 3773|  35.8k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  35.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3773:5): [True: 322, False: 35.4k]
  ------------------
 3774|    322|		return ret;
 3775|    322|	}
 3776|       |
 3777|  35.4k|	if(rar5->cstate.block_parsing_finished &&
  ------------------
  |  Branch (3777:5): [True: 27.0k, False: 8.43k]
  ------------------
 3778|  27.0k|	    rar5->cstate.switch_multivolume == 0 &&
  ------------------
  |  Branch (3778:6): [True: 27.0k, False: 28]
  ------------------
 3779|  27.0k|	    rar5->cstate.cur_block_size > 0)
  ------------------
  |  Branch (3779:6): [True: 18.5k, False: 8.52k]
  ------------------
 3780|  18.5k|	{
 3781|       |		/* If we're processing a normal block, consume the whole
 3782|       |		 * block. We can do this because we've already read the whole
 3783|       |		 * block to memory. */
 3784|  18.5k|		if(ARCHIVE_OK != consume(a, rar5->cstate.cur_block_size))
  ------------------
  |  |  233|  18.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3784:6): [True: 0, False: 18.5k]
  ------------------
 3785|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3786|       |
 3787|  18.5k|		rar5->file.bytes_remaining -= rar5->cstate.cur_block_size;
 3788|  18.5k|	} else if(rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (3788:12): [True: 28, False: 16.9k]
  ------------------
 3789|       |		/* Don't consume the block if we're doing multivolume
 3790|       |		 * processing. The volume switching function will consume
 3791|       |		 * the proper count of bytes instead. */
 3792|     28|		rar5->cstate.switch_multivolume = 0;
 3793|     28|	}
 3794|       |
 3795|  35.4k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  35.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3796|  35.4k|}
archive_read_support_format_rar5.c:parse_block_header:
 2936|  29.2k|{
 2937|  29.2k|	uint8_t calculated_cksum;
 2938|  29.2k|	memcpy(hdr, p, sizeof(struct compressed_block_header));
 2939|       |
 2940|  29.2k|	if(bf_byte_count(hdr) > 2) {
  ------------------
  |  Branch (2940:5): [True: 920, False: 28.3k]
  ------------------
 2941|    920|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    920|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2942|    920|		    "Unsupported block header size (was %d, max is 2)",
 2943|    920|		    bf_byte_count(hdr));
 2944|    920|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    920|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2945|    920|	}
 2946|       |
 2947|       |	/* This should probably use bit reader interface in order to be more
 2948|       |	 * future-proof. */
 2949|  28.3k|	*block_size = 0;
 2950|  28.3k|	switch(bf_byte_count(hdr)) {
 2951|       |		/* 1-byte block size */
 2952|  27.5k|		case 0:
  ------------------
  |  Branch (2952:3): [True: 27.5k, False: 735]
  ------------------
 2953|  27.5k|			*block_size = *(const uint8_t*) &p[2];
 2954|  27.5k|			break;
 2955|       |
 2956|       |		/* 2-byte block size */
 2957|    520|		case 1:
  ------------------
  |  Branch (2957:3): [True: 520, False: 27.7k]
  ------------------
 2958|    520|			*block_size = archive_le16dec(&p[2]);
 2959|    520|			break;
 2960|       |
 2961|       |		/* 3-byte block size */
 2962|    215|		case 2:
  ------------------
  |  Branch (2962:3): [True: 215, False: 28.0k]
  ------------------
 2963|    215|			*block_size = archive_le32dec(&p[2]);
 2964|    215|			*block_size &= 0x00FFFFFF;
 2965|    215|			break;
 2966|       |
 2967|       |		/* Other block sizes are not supported. This case is not
 2968|       |		 * reached, because we have an 'if' guard before the switch
 2969|       |		 * that makes sure of it. */
 2970|      0|		default:
  ------------------
  |  Branch (2970:3): [True: 0, False: 28.3k]
  ------------------
 2971|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2972|  28.3k|	}
 2973|       |
 2974|       |	/* Verify the block header checksum. 0x5A is a magic value and is
 2975|       |	 * always * constant. */
 2976|  28.3k|	calculated_cksum = 0x5A
 2977|  28.3k|	    ^ (uint8_t) hdr->block_flags_u8
 2978|  28.3k|	    ^ (uint8_t) *block_size
 2979|  28.3k|	    ^ (uint8_t) (*block_size >> 8)
 2980|  28.3k|	    ^ (uint8_t) (*block_size >> 16);
 2981|       |
 2982|  28.3k|	if(calculated_cksum != hdr->block_cksum) {
  ------------------
  |  Branch (2982:5): [True: 26.7k, False: 1.54k]
  ------------------
 2983|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2984|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2985|       |		    "Block checksum error: got 0x%x, expected 0x%x",
 2986|       |		    hdr->block_cksum, calculated_cksum);
 2987|       |
 2988|       |		return ARCHIVE_FAILED;
 2989|       |#endif
 2990|  26.7k|	}
 2991|       |
 2992|  28.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  28.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2993|  28.3k|}
archive_read_support_format_rar5.c:bf_byte_count:
  504|  86.7k|uint8_t bf_byte_count(const struct compressed_block_header* hdr) {
  505|  86.7k|	return (hdr->block_flags_u8 >> 3) & 7;
  506|  86.7k|}
archive_read_support_format_rar5.c:merge_block:
 3526|    376|{
 3527|    376|	struct rar5 *rar5 = a->format->data;
 3528|    376|	ssize_t cur_block_size, partial_offset = 0;
 3529|    376|	const uint8_t* lp;
 3530|    376|	int ret;
 3531|       |
 3532|    376|	if(rar5->merge_mode) {
  ------------------
  |  Branch (3532:5): [True: 0, False: 376]
  ------------------
 3533|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3534|      0|		    "Recursive merge is not allowed");
 3535|       |
 3536|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3537|      0|	}
 3538|       |
 3539|       |	/* Set a flag that we're in the switching mode. */
 3540|    376|	rar5->cstate.switch_multivolume = 1;
 3541|       |
 3542|       |	/* Reallocate the memory which will hold the whole block. */
 3543|    376|	if(rar5->vol.push_buf)
  ------------------
  |  Branch (3543:5): [True: 210, False: 166]
  ------------------
 3544|    210|		free((void*) rar5->vol.push_buf);
 3545|       |
 3546|       |	/* Increasing the allocation block by 8 is due to bit reading functions,
 3547|       |	 * which are using additional 2 or 4 bytes. Allocating the block size
 3548|       |	 * by exact value would make bit reader perform reads from invalid
 3549|       |	 * memory block when reading the last byte from the buffer. */
 3550|    376|	rar5->vol.push_buf = malloc(block_size + 8);
 3551|    376|	if(!rar5->vol.push_buf) {
  ------------------
  |  Branch (3551:5): [True: 0, False: 376]
  ------------------
 3552|      0|		archive_set_error(&a->archive, ENOMEM,
 3553|      0|		    "Can't allocate memory for a merge block buffer");
 3554|      0|		rar5->cstate.switch_multivolume = 0;
 3555|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3556|      0|	}
 3557|       |
 3558|       |	/* Valgrind complains if the extension block for bit reader is not
 3559|       |	 * initialized, so initialize it. */
 3560|    376|	memset(&rar5->vol.push_buf[block_size], 0, 8);
 3561|       |
 3562|       |	/* A single block can span across multiple multivolume archive files,
 3563|       |	 * so we use a loop here. This loop will consume enough multivolume
 3564|       |	 * archive files until the whole block is read. */
 3565|       |
 3566|  1.22k|	while(1) {
  ------------------
  |  Branch (3566:8): [True: 1.22k, Folded]
  ------------------
 3567|       |		/* Get the size of current block chunk in this multivolume
 3568|       |		 * archive file and read it. */
 3569|  1.22k|		cur_block_size = rar5_min(rar5->file.bytes_remaining,
  ------------------
  |  |   62|  1.22k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (62:25): [True: 30, False: 1.19k]
  |  |  ------------------
  ------------------
 3570|  1.22k|		    block_size - partial_offset);
 3571|       |
 3572|  1.22k|		if(cur_block_size < 1) {
  ------------------
  |  Branch (3572:6): [True: 10, False: 1.21k]
  ------------------
 3573|       |			/* bytes_remaining is less than 1 at the wrong point in
 3574|       |			 * the merge loop, indicating corrupt volume
 3575|       |			 * accounting. */
 3576|     10|			archive_set_error(&a->archive,
 3577|     10|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3578|     10|			    "Encountered invalid block size during block merge");
 3579|     10|			rar5->cstate.switch_multivolume = 0;
 3580|     10|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3581|     10|		}
 3582|       |
 3583|  1.21k|		if(!read_ahead(a, cur_block_size, &lp)) {
  ------------------
  |  Branch (3583:6): [True: 94, False: 1.11k]
  ------------------
 3584|     94|			rar5->cstate.switch_multivolume = 0;
 3585|     94|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     94|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3586|     94|		}
 3587|       |
 3588|       |		/* Sanity check; there should never be a situation where this
 3589|       |		 * function reads more data than the block's size. */
 3590|  1.11k|		if(partial_offset + cur_block_size > block_size) {
  ------------------
  |  Branch (3590:6): [True: 0, False: 1.11k]
  ------------------
 3591|      0|			archive_set_error(&a->archive,
 3592|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3593|      0|			    "Consumed too much data when merging blocks");
 3594|      0|			rar5->cstate.switch_multivolume = 0;
 3595|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3596|      0|		}
 3597|       |
 3598|       |		/* Merge previous block chunk with current block chunk,
 3599|       |		 * or create first block chunk if this is our first
 3600|       |		 * iteration. */
 3601|  1.11k|		memcpy(&rar5->vol.push_buf[partial_offset], lp, cur_block_size);
 3602|       |
 3603|       |		/* Advance the stream read pointer by this block chunk size. */
 3604|  1.11k|		if(ARCHIVE_OK != consume(a, cur_block_size)) {
  ------------------
  |  |  233|  1.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3604:6): [True: 0, False: 1.11k]
  ------------------
 3605|       |			/* Data was copied but stream pointer didn't advance;
 3606|       |			 * stream position is unrecoverable. */
 3607|      0|			rar5->cstate.switch_multivolume = 0;
 3608|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3609|      0|		}
 3610|       |
 3611|       |		/* Update the pointers. `partial_offset` contains information
 3612|       |		 * about the sum of merged block chunks. */
 3613|  1.11k|		partial_offset += cur_block_size;
 3614|  1.11k|		rar5->file.bytes_remaining -= cur_block_size;
 3615|       |
 3616|       |		/* If `partial_offset` is the same as `block_size`, this means
 3617|       |		 * we've merged all block chunks and we have a valid full
 3618|       |		 * block. */
 3619|  1.11k|		if(partial_offset == block_size) {
  ------------------
  |  Branch (3619:6): [True: 29, False: 1.08k]
  ------------------
 3620|     29|			break;
 3621|     29|		}
 3622|       |
 3623|       |		/* If we don't have any bytes to read, this means we should
 3624|       |		 * switch to another multivolume archive file. */
 3625|  1.08k|		if(rar5->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3625:6): [True: 1.08k, False: 0]
  ------------------
 3626|  1.08k|			rar5->merge_mode++;
 3627|  1.08k|			ret = advance_multivolume(a);
 3628|  1.08k|			rar5->merge_mode--;
 3629|  1.08k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3629:7): [True: 243, False: 844]
  ------------------
 3630|    243|				rar5->cstate.switch_multivolume = 0;
 3631|    243|				return ret;
 3632|    243|			}
 3633|  1.08k|		}
 3634|  1.08k|	}
 3635|       |
 3636|     29|	*p = rar5->vol.push_buf;
 3637|       |
 3638|       |	/* If we're here, we can resume unpacking by processing the block
 3639|       |	 * pointed to by the `*p` memory pointer. */
 3640|       |
 3641|     29|	return ARCHIVE_OK;
  ------------------
  |  |  233|     29|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3642|    376|}
archive_read_support_format_rar5.c:bf_is_table_present:
  509|  27.3k|uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
  510|  27.3k|	return (hdr->block_flags_u8 >> 7) & 1;
  511|  27.3k|}
archive_read_support_format_rar5.c:parse_tables:
 2763|  1.81k|{
 2764|  1.81k|	int ret, value, i, w, idx = 0;
 2765|  1.81k|	uint8_t bit_length[HUFF_BC],
 2766|  1.81k|		table[HUFF_TABLE_SIZE],
 2767|  1.81k|		nibble_mask = 0xF0,
 2768|  1.81k|		nibble_shift = 4;
 2769|       |
 2770|  1.81k|	enum { ESCAPE = 15 };
 2771|       |
 2772|       |	/* The data for table generation is compressed using a simple RLE-like
 2773|       |	 * algorithm when storing zeroes, so we need to unpack it first. */
 2774|  21.8k|	for(w = 0, i = 0; w < HUFF_BC;) {
  ------------------
  |  |  249|  21.8k|#define HUFF_BC 20
  ------------------
  |  Branch (2774:20): [True: 20.0k, False: 1.79k]
  ------------------
 2775|  20.0k|		if(i >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (2775:6): [True: 24, False: 20.0k]
  ------------------
 2776|       |			/* Truncated data, can't continue. */
 2777|     24|			archive_set_error(&a->archive,
 2778|     24|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2779|     24|			    "Truncated data in huffman tables");
 2780|     24|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     24|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2781|     24|		}
 2782|       |
 2783|  20.0k|		value = (p[i] & nibble_mask) >> nibble_shift;
 2784|       |
 2785|  20.0k|		if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2785:6): [True: 9.98k, False: 10.0k]
  ------------------
 2786|  9.98k|			++i;
 2787|       |
 2788|  20.0k|		nibble_mask ^= 0xFF;
 2789|  20.0k|		nibble_shift ^= 4;
 2790|       |
 2791|       |		/* Values smaller than 15 is data, so we write it directly.
 2792|       |		 * Value 15 is a flag telling us that we need to unpack more
 2793|       |		 * bytes. */
 2794|  20.0k|		if(value == ESCAPE) {
  ------------------
  |  Branch (2794:6): [True: 1.77k, False: 18.2k]
  ------------------
 2795|  1.77k|			value = (p[i] & nibble_mask) >> nibble_shift;
 2796|  1.77k|			if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2796:7): [True: 161, False: 1.61k]
  ------------------
 2797|    161|				++i;
 2798|  1.77k|			nibble_mask ^= 0xFF;
 2799|  1.77k|			nibble_shift ^= 4;
 2800|       |
 2801|  1.77k|			if(value == 0) {
  ------------------
  |  Branch (2801:7): [True: 129, False: 1.64k]
  ------------------
 2802|       |				/* We sometimes need to write the actual value
 2803|       |				 * of 15, so this case handles that. */
 2804|    129|				bit_length[w++] = ESCAPE;
 2805|  1.64k|			} else {
 2806|  1.64k|				int k;
 2807|       |
 2808|       |				/* Fill zeroes. */
 2809|  19.1k|				for(k = 0; (k < value + 2) && (w < HUFF_BC);
  ------------------
  |  |  249|  17.5k|#define HUFF_BC 20
  ------------------
  |  Branch (2809:16): [True: 17.5k, False: 1.53k]
  |  Branch (2809:35): [True: 17.4k, False: 106]
  ------------------
 2810|  17.4k|				    k++) {
 2811|  17.4k|					bit_length[w++] = 0;
 2812|  17.4k|				}
 2813|  1.64k|			}
 2814|  18.2k|		} else {
 2815|  18.2k|			bit_length[w++] = value;
 2816|  18.2k|		}
 2817|  20.0k|	}
 2818|       |
 2819|  1.79k|	rar5->bits.in_addr = i;
 2820|  1.79k|	rar5->bits.bit_addr = nibble_shift ^ 4;
 2821|       |
 2822|  1.79k|	ret = create_decode_tables(bit_length, &rar5->cstate.bd, HUFF_BC);
  ------------------
  |  |  249|  1.79k|#define HUFF_BC 20
  ------------------
 2823|  1.79k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.79k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2823:5): [True: 87, False: 1.70k]
  ------------------
 2824|     87|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     87|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2825|     87|		    "Decoding huffman tables failed");
 2826|     87|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     87|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2827|     87|	}
 2828|       |
 2829|   132k|	for(i = 0; i < HUFF_TABLE_SIZE;) {
  ------------------
  |  |  259|   132k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  251|   132k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  253|   132k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  257|   132k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  255|   132k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2829:13): [True: 131k, False: 1.61k]
  ------------------
 2830|   131k|		uint16_t num;
 2831|       |
 2832|   131k|		ret = decode_number(a, &rar5->cstate.bd, p, &num);
 2833|   131k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|   131k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2833:6): [True: 73, False: 131k]
  ------------------
 2834|     73|			archive_set_error(&a->archive,
 2835|     73|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     73|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2836|     73|			    "Decoding huffman tables failed");
 2837|     73|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     73|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2838|     73|		}
 2839|       |
 2840|   131k|		if(num < 16) {
  ------------------
  |  Branch (2840:6): [True: 110k, False: 20.8k]
  ------------------
 2841|       |			/* 0..15: store directly */
 2842|   110k|			table[i] = (uint8_t) num;
 2843|   110k|			i++;
 2844|   110k|		} else if(num < 18) {
  ------------------
  |  Branch (2844:13): [True: 744, False: 20.1k]
  ------------------
 2845|       |			/* 16..17: repeat previous code */
 2846|    744|			uint16_t n;
 2847|       |
 2848|    744|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &n)))
  ------------------
  |  |  233|    744|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2848:7): [True: 3, False: 741]
  ------------------
 2849|      3|				return ret;
 2850|       |
 2851|    741|			if(num == 16) {
  ------------------
  |  Branch (2851:7): [True: 321, False: 420]
  ------------------
 2852|    321|				n >>= 13;
 2853|    321|				n += 3;
 2854|    321|				skip_bits(rar5, 3);
 2855|    420|			} else {
 2856|    420|				n >>= 9;
 2857|    420|				n += 11;
 2858|    420|				skip_bits(rar5, 7);
 2859|    420|			}
 2860|       |
 2861|    741|			if(i > 0) {
  ------------------
  |  Branch (2861:7): [True: 731, False: 10]
  ------------------
 2862|  29.1k|				while(n-- > 0 && i < HUFF_TABLE_SIZE) {
  ------------------
  |  |  259|  28.4k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  251|  28.4k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  253|  28.4k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  257|  28.4k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  255|  28.4k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2862:11): [True: 28.4k, False: 668]
  |  Branch (2862:22): [True: 28.3k, False: 63]
  ------------------
 2863|  28.3k|					table[i] = table[i - 1];
 2864|  28.3k|					i++;
 2865|  28.3k|				}
 2866|    731|			} else {
 2867|     10|				archive_set_error(&a->archive,
 2868|     10|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2869|     10|				    "Unexpected error when decoding "
 2870|     10|				    "huffman tables");
 2871|     10|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|     10|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2872|     10|			}
 2873|  20.1k|		} else {
 2874|       |			/* other codes: fill with zeroes `n` times */
 2875|  20.1k|			uint16_t n;
 2876|       |
 2877|  20.1k|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &n)))
  ------------------
  |  |  233|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2877:7): [True: 1, False: 20.1k]
  ------------------
 2878|      1|				return ret;
 2879|       |
 2880|  20.1k|			if(num == 18) {
  ------------------
  |  Branch (2880:7): [True: 11.6k, False: 8.42k]
  ------------------
 2881|  11.6k|				n >>= 13;
 2882|  11.6k|				n += 3;
 2883|  11.6k|				skip_bits(rar5, 3);
 2884|  11.6k|			} else {
 2885|  8.42k|				n >>= 9;
 2886|  8.42k|				n += 11;
 2887|  8.42k|				skip_bits(rar5, 7);
 2888|  8.42k|			}
 2889|       |
 2890|   588k|			while(n-- > 0 && i < HUFF_TABLE_SIZE)
  ------------------
  |  |  259|   569k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  251|   569k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  253|   569k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  257|   569k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  255|   569k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2890:10): [True: 569k, False: 18.8k]
  |  Branch (2890:21): [True: 568k, False: 1.24k]
  ------------------
 2891|   568k|				table[i++] = 0;
 2892|  20.1k|		}
 2893|   131k|	}
 2894|       |
 2895|  1.61k|	ret = create_decode_tables(&table[idx], &rar5->cstate.ld, HUFF_NC);
  ------------------
  |  |  251|  1.61k|#define HUFF_NC 306
  ------------------
 2896|  1.61k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.61k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2896:5): [True: 308, False: 1.30k]
  ------------------
 2897|    308|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    308|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2898|    308|		     "Failed to create literal table");
 2899|    308|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    308|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2900|    308|	}
 2901|       |
 2902|  1.30k|	idx += HUFF_NC;
  ------------------
  |  |  251|  1.30k|#define HUFF_NC 306
  ------------------
 2903|       |
 2904|  1.30k|	ret = create_decode_tables(&table[idx], &rar5->cstate.dd, HUFF_DC);
  ------------------
  |  |  253|  1.30k|#define HUFF_DC 64
  ------------------
 2905|  1.30k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2905:5): [True: 57, False: 1.25k]
  ------------------
 2906|     57|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     57|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2907|     57|		    "Failed to create distance table");
 2908|     57|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     57|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2909|     57|	}
 2910|       |
 2911|  1.25k|	idx += HUFF_DC;
  ------------------
  |  |  253|  1.25k|#define HUFF_DC 64
  ------------------
 2912|       |
 2913|  1.25k|	ret = create_decode_tables(&table[idx], &rar5->cstate.ldd, HUFF_LDC);
  ------------------
  |  |  255|  1.25k|#define HUFF_LDC 16
  ------------------
 2914|  1.25k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2914:5): [True: 8, False: 1.24k]
  ------------------
 2915|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2916|      8|		    "Failed to create lower bits of distances table");
 2917|      8|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      8|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2918|      8|	}
 2919|       |
 2920|  1.24k|	idx += HUFF_LDC;
  ------------------
  |  |  255|  1.24k|#define HUFF_LDC 16
  ------------------
 2921|       |
 2922|  1.24k|	ret = create_decode_tables(&table[idx], &rar5->cstate.rd, HUFF_RC);
  ------------------
  |  |  257|  1.24k|#define HUFF_RC 44
  ------------------
 2923|  1.24k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2923:5): [True: 36, False: 1.20k]
  ------------------
 2924|     36|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     36|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2925|     36|		    "Failed to create repeating distances table");
 2926|     36|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     36|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2927|     36|	}
 2928|       |
 2929|  1.20k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.20k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2930|  1.24k|}
archive_read_support_format_rar5.c:create_decode_tables:
 2643|  7.21k|{
 2644|  7.21k|	int code, upper_limit = 0, i, lc[16];
 2645|  7.21k|	uint32_t decode_pos_clone[rar5_countof(table->decode_pos)];
 2646|  7.21k|	ssize_t cur_len, quick_data_size;
 2647|       |
 2648|  7.21k|	memset(&lc, 0, sizeof(lc));
 2649|  7.21k|	memset(table->decode_num, 0, sizeof(table->decode_num));
 2650|  7.21k|	table->size = size;
 2651|  7.21k|	table->quick_bits = size == HUFF_NC ? 10 : 7;
  ------------------
  |  |  251|  7.21k|#define HUFF_NC 306
  ------------------
  |  Branch (2651:22): [True: 1.61k, False: 5.59k]
  ------------------
 2652|       |
 2653|   696k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2653:13): [True: 689k, False: 7.21k]
  ------------------
 2654|   689k|		lc[bit_length[i] & 15]++;
 2655|   689k|	}
 2656|       |
 2657|  7.21k|	lc[0] = 0;
 2658|  7.21k|	table->decode_pos[0] = 0;
 2659|  7.21k|	table->decode_len[0] = 0;
 2660|       |
 2661|   115k|	for(i = 1; i < 16; i++) {
  ------------------
  |  Branch (2661:13): [True: 108k, False: 7.21k]
  ------------------
 2662|   108k|		upper_limit += lc[i];
 2663|       |
 2664|   108k|		table->decode_len[i] = upper_limit << (16 - i);
 2665|   108k|		table->decode_pos[i] = table->decode_pos[i - 1] + lc[i - 1];
 2666|       |
 2667|   108k|		upper_limit <<= 1;
 2668|   108k|	}
 2669|       |
 2670|       |	/* Verify the code-length distribution is not over-subscribed.
 2671|       |	 * After the loop above, upper_limit == sum(lc[i] * 2^(16-i)).
 2672|       |	 * For a valid prefix-free code this must be <= 2^16 = 65536.
 2673|       |	 * An over-subscribed table (> 65536) cannot produce a valid
 2674|       |	 * decode table and must be rejected. */
 2675|  7.21k|	if(upper_limit > 65536) {
  ------------------
  |  Branch (2675:5): [True: 496, False: 6.71k]
  ------------------
 2676|    496|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    496|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2677|    496|	}
 2678|       |
 2679|  6.71k|	memcpy(decode_pos_clone, table->decode_pos, sizeof(decode_pos_clone));
 2680|       |
 2681|   594k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2681:13): [True: 587k, False: 6.71k]
  ------------------
 2682|   587k|		uint8_t clen = bit_length[i] & 15;
 2683|   587k|		if(clen > 0) {
  ------------------
  |  Branch (2683:6): [True: 100k, False: 487k]
  ------------------
 2684|   100k|			int last_pos = decode_pos_clone[clen];
 2685|   100k|			table->decode_num[last_pos] = i;
 2686|   100k|			decode_pos_clone[clen]++;
 2687|   100k|		}
 2688|   587k|	}
 2689|       |
 2690|  6.71k|	quick_data_size = (int64_t)1 << table->quick_bits;
 2691|  6.71k|	cur_len = 1;
 2692|  2.03M|	for(code = 0; code < quick_data_size; code++) {
  ------------------
  |  Branch (2692:16): [True: 2.03M, False: 6.71k]
  ------------------
 2693|  2.03M|		int bit_field = code << (16 - table->quick_bits);
 2694|  2.03M|		int dist, pos;
 2695|       |
 2696|  2.13M|		while(cur_len < rar5_countof(table->decode_len) &&
  ------------------
  |  |   64|  4.26M|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2696:9): [True: 1.14M, False: 990k]
  ------------------
 2697|  1.14M|				bit_field >= table->decode_len[cur_len]) {
  ------------------
  |  Branch (2697:5): [True: 98.5k, False: 1.04M]
  ------------------
 2698|  98.5k|			cur_len++;
 2699|  98.5k|		}
 2700|       |
 2701|  2.03M|		table->quick_len[code] = (uint8_t) cur_len;
 2702|       |
 2703|  2.03M|		dist = bit_field - table->decode_len[cur_len - 1];
 2704|  2.03M|		dist >>= (16 - cur_len);
 2705|       |
 2706|  2.03M|		pos = table->decode_pos[cur_len & 15] + dist;
 2707|  2.03M|		if(cur_len < rar5_countof(table->decode_pos) && pos < size) {
  ------------------
  |  |   64|  4.06M|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2707:6): [True: 1.04M, False: 990k]
  |  Branch (2707:51): [True: 1.04M, False: 0]
  ------------------
 2708|  1.04M|			table->quick_num[code] = table->decode_num[pos];
 2709|  1.04M|		} else {
 2710|   990k|			table->quick_num[code] = 0;
 2711|   990k|		}
 2712|  2.03M|	}
 2713|       |
 2714|  6.71k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  6.71k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2715|  7.21k|}
archive_read_support_format_rar5.c:decode_number:
 2719|  2.03M|{
 2720|  2.03M|	struct rar5 *rar5 = a->format->data;
 2721|  2.03M|	int i, bits, dist, ret;
 2722|  2.03M|	uint16_t bitfield;
 2723|  2.03M|	uint32_t pos;
 2724|       |
 2725|  2.03M|	if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &bitfield))) {
  ------------------
  |  |  233|  2.03M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2725:5): [True: 99, False: 2.03M]
  ------------------
 2726|     99|		return ret;
 2727|     99|	}
 2728|       |
 2729|  2.03M|	bitfield &= 0xfffe;
 2730|       |
 2731|  2.03M|	if(bitfield < table->decode_len[table->quick_bits]) {
  ------------------
  |  Branch (2731:5): [True: 1.69M, False: 343k]
  ------------------
 2732|  1.69M|		int code = bitfield >> (16 - table->quick_bits);
 2733|  1.69M|		skip_bits(rar5, table->quick_len[code]);
 2734|  1.69M|		*num = table->quick_num[code];
 2735|  1.69M|		return ARCHIVE_OK;
  ------------------
  |  |  233|  1.69M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2736|  1.69M|	}
 2737|       |
 2738|   343k|	bits = 15;
 2739|       |
 2740|  2.86M|	for(i = table->quick_bits + 1; i < 15; i++) {
  ------------------
  |  Branch (2740:33): [True: 2.54M, False: 322k]
  ------------------
 2741|  2.54M|		if(bitfield < table->decode_len[i]) {
  ------------------
  |  Branch (2741:6): [True: 20.4k, False: 2.52M]
  ------------------
 2742|  20.4k|			bits = i;
 2743|  20.4k|			break;
 2744|  20.4k|		}
 2745|  2.54M|	}
 2746|       |
 2747|   343k|	skip_bits(rar5, bits);
 2748|       |
 2749|   343k|	dist = bitfield - table->decode_len[bits - 1];
 2750|   343k|	dist >>= (16 - bits);
 2751|   343k|	pos = table->decode_pos[bits] + dist;
 2752|       |
 2753|   343k|	if(pos >= table->size)
  ------------------
  |  Branch (2753:5): [True: 320k, False: 23.0k]
  ------------------
 2754|   320k|		pos = 0;
 2755|       |
 2756|   343k|	*num = table->decode_num[pos];
 2757|   343k|	return ARCHIVE_OK;
  ------------------
  |  |  233|   343k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2758|  2.03M|}
archive_read_support_format_rar5.c:read_bits_16:
 1037|  2.13M|{
 1038|  2.13M|	if(rar5->bits.in_addr >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (1038:5): [True: 151, False: 2.13M]
  ------------------
 1039|    151|		archive_set_error(&a->archive,
 1040|    151|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|    151|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1041|    151|			"Premature end of stream during extraction of data (#2)");
 1042|    151|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|    151|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1043|    151|	}
 1044|       |
 1045|  2.13M|	uint32_t bits = archive_be24dec(p + (unsigned)rar5->bits.in_addr);
 1046|  2.13M|	bits >>= (8 - rar5->bits.bit_addr);
 1047|  2.13M|	*value = bits & 0xffff;
 1048|  2.13M|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.13M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1049|  2.13M|}
archive_read_support_format_rar5.c:skip_bits:
 1051|  2.15M|static void skip_bits(struct rar5 *rar5, int bits) {
 1052|  2.15M|	const int new_bits = rar5->bits.bit_addr + bits;
 1053|  2.15M|	rar5->bits.in_addr += new_bits >> 3;
 1054|  2.15M|	rar5->bits.bit_addr = new_bits & 7;
 1055|  2.15M|}
archive_read_support_format_rar5.c:do_uncompress_block:
 3172|  35.8k|static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
 3173|  35.8k|	struct rar5 *rar5 = a->format->data;
 3174|  35.8k|	uint16_t num;
 3175|  35.8k|	int ret;
 3176|       |
 3177|  35.8k|	const uint64_t cmask = rar5->cstate.window_mask;
 3178|  35.8k|	const struct compressed_block_header* hdr = &rar5->last_block_hdr;
 3179|  35.8k|	const uint8_t bit_size = 1 + bf_bit_size(hdr);
 3180|       |
 3181|  1.83M|	while(1) {
  ------------------
  |  Branch (3181:8): [True: 1.83M, Folded]
  ------------------
 3182|  1.83M|		if(rar5->cstate.write_ptr - rar5->cstate.last_write_ptr >
  ------------------
  |  Branch (3182:6): [True: 8.43k, False: 1.82M]
  ------------------
 3183|  1.83M|		    (rar5->cstate.window_size >> 1)) {
 3184|       |			/* Don't allow growing data by more than half of the
 3185|       |			 * window size at a time. In such case, break the loop;
 3186|       |			 *  next call to this function will continue processing
 3187|       |			 *  from this moment. */
 3188|  8.43k|			break;
 3189|  8.43k|		}
 3190|       |
 3191|  1.82M|		if(rar5->bits.in_addr > rar5->cstate.cur_block_size - 1 ||
  ------------------
  |  Branch (3191:6): [True: 12.1k, False: 1.81M]
  ------------------
 3192|  1.81M|		    (rar5->bits.in_addr == rar5->cstate.cur_block_size - 1 &&
  ------------------
  |  Branch (3192:8): [True: 18.2k, False: 1.79M]
  ------------------
 3193|  18.2k|		    rar5->bits.bit_addr >= bit_size))
  ------------------
  |  Branch (3193:7): [True: 14.9k, False: 3.35k]
  ------------------
 3194|  27.0k|		{
 3195|       |			/* If the program counter is here, it means the
 3196|       |			 * function has finished processing the block. */
 3197|  27.0k|			rar5->cstate.block_parsing_finished = 1;
 3198|  27.0k|			break;
 3199|  27.0k|		}
 3200|       |
 3201|       |		/* Decode the next literal. */
 3202|  1.80M|		if(ARCHIVE_OK != decode_number(a, &rar5->cstate.ld, p, &num)) {
  ------------------
  |  |  233|  1.80M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3202:6): [True: 0, False: 1.80M]
  ------------------
 3203|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3204|      0|		}
 3205|       |
 3206|       |		/* Num holds a decompression literal, or 'command code'.
 3207|       |		 *
 3208|       |		 * - Values lower than 256 are just bytes. Those codes
 3209|       |		 *   can be stored in the output buffer directly.
 3210|       |		 *
 3211|       |		 * - Code 256 defines a new filter, which is later used to
 3212|       |		 *   transform the data block accordingly to the filter type.
 3213|       |		 *   The data block needs to be fully uncompressed first.
 3214|       |		 *
 3215|       |		 * - Code bigger than 257 and smaller than 262 define
 3216|       |		 *   a repetition pattern that should be copied from
 3217|       |		 *   an already uncompressed chunk of data.
 3218|       |		 */
 3219|       |
 3220|  1.80M|		if(num < 256) {
  ------------------
  |  Branch (3220:6): [True: 1.29M, False: 506k]
  ------------------
 3221|       |			/* Directly store the byte. */
 3222|  1.29M|			int64_t write_idx;
 3223|       |
 3224|       |			/* A literal write emits one byte; copy_string() checks len. */
 3225|  1.29M|			if(rar5->cstate.write_ptr >= rar5->file.unpacked_size) {
  ------------------
  |  Branch (3225:7): [True: 42, False: 1.29M]
  ------------------
 3226|     42|				archive_set_error(&a->archive,
 3227|     42|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     42|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3228|     42|				    "Uncompressed data exceeds declared size");
 3229|     42|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|     37|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3229:12): [True: 5, False: 37]
  ------------------
 3230|     42|			}
 3231|       |
 3232|  1.29M|			write_idx = rar5->cstate.solid_offset +
 3233|  1.29M|			    rar5->cstate.write_ptr++;
 3234|       |
 3235|  1.29M|			rar5->cstate.window_buf[write_idx & cmask] =
 3236|  1.29M|			    (uint8_t) num;
 3237|  1.29M|			continue;
 3238|  1.29M|		} else if(num >= 262) {
  ------------------
  |  Branch (3238:13): [True: 24.0k, False: 482k]
  ------------------
 3239|  24.0k|			uint16_t dist_slot;
 3240|  24.0k|			int len = decode_code_length(a, rar5, p, num - 262),
 3241|  24.0k|				dbits,
 3242|  24.0k|				dist = 1;
 3243|       |
 3244|  24.0k|			if(len == -1) {
  ------------------
  |  Branch (3244:7): [True: 7, False: 24.0k]
  ------------------
 3245|      7|				archive_set_error(&a->archive,
 3246|      7|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      7|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3247|      7|				    "Failed to decode the code length");
 3248|       |
 3249|      7|				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|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3249:12): [True: 3, False: 4]
  ------------------
 3250|      7|			}
 3251|       |
 3252|  24.0k|			if(ARCHIVE_OK != decode_number(a, &rar5->cstate.dd, p,
  ------------------
  |  |  233|  24.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3252:7): [True: 11, False: 24.0k]
  ------------------
 3253|  24.0k|			    &dist_slot))
 3254|     11|			{
 3255|     11|				archive_set_error(&a->archive,
 3256|     11|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     11|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3257|     11|				    "Failed to decode the distance slot");
 3258|       |
 3259|     11|				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|     10|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3259:12): [True: 1, False: 10]
  ------------------
 3260|     11|			}
 3261|       |
 3262|  24.0k|			if(dist_slot < 4) {
  ------------------
  |  Branch (3262:7): [True: 4.20k, False: 19.8k]
  ------------------
 3263|  4.20k|				dbits = 0;
 3264|  4.20k|				dist += dist_slot;
 3265|  19.8k|			} else {
 3266|  19.8k|				dbits = dist_slot / 2 - 1;
 3267|       |
 3268|       |				/* Cast to uint32_t will make sure the shift
 3269|       |				 * left operation won't produce undefined
 3270|       |				 * result. Then, the uint32_t type will
 3271|       |				 * be implicitly casted to int. */
 3272|  19.8k|				dist += (uint32_t) (2 |
 3273|  19.8k|				    (dist_slot & 1)) << dbits;
 3274|  19.8k|			}
 3275|       |
 3276|  24.0k|			if(dbits > 0) {
  ------------------
  |  Branch (3276:7): [True: 19.8k, False: 4.20k]
  ------------------
 3277|  19.8k|				if(dbits >= 4) {
  ------------------
  |  Branch (3277:8): [True: 16.2k, False: 3.60k]
  ------------------
 3278|  16.2k|					uint32_t add = 0;
 3279|  16.2k|					uint16_t low_dist;
 3280|       |
 3281|  16.2k|					if(dbits > 4) {
  ------------------
  |  Branch (3281:9): [True: 14.8k, False: 1.41k]
  ------------------
 3282|  14.8k|						if(ARCHIVE_OK != (ret = read_bits_32(
  ------------------
  |  |  233|  14.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3282:10): [True: 7, False: 14.8k]
  ------------------
 3283|  14.8k|						    a, rar5, p, &add))) {
 3284|       |							/* Return EOF if we
 3285|       |							 * can't read more
 3286|       |							 * data. */
 3287|      7|							return ret;
 3288|      7|						}
 3289|       |
 3290|  14.8k|						skip_bits(rar5, dbits - 4);
 3291|  14.8k|						add = (add >> (
 3292|  14.8k|						    36 - dbits)) << 4;
 3293|  14.8k|						dist += add;
 3294|  14.8k|					}
 3295|       |
 3296|  16.2k|					if(ARCHIVE_OK != decode_number(a,
  ------------------
  |  |  233|  16.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3296:9): [True: 9, False: 16.2k]
  ------------------
 3297|  16.2k|					    &rar5->cstate.ldd, p, &low_dist))
 3298|      9|					{
 3299|      9|						archive_set_error(&a->archive,
 3300|      9|						    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      9|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3301|      9|						    "Failed to decode the "
 3302|      9|						    "distance slot");
 3303|       |
 3304|      9|						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|      8|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3304:14): [True: 1, False: 8]
  ------------------
 3305|      9|					}
 3306|       |
 3307|  16.2k|					if(dist >= INT_MAX - low_dist - 1) {
  ------------------
  |  Branch (3307:9): [True: 2, False: 16.2k]
  ------------------
 3308|       |						/* This only happens in
 3309|       |						 * invalid archives. */
 3310|      2|						archive_set_error(&a->archive,
 3311|      2|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3312|      2|						    "Distance pointer "
 3313|      2|						    "overflow");
 3314|      2|						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|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3314:14): [True: 1, False: 1]
  ------------------
 3315|      2|					}
 3316|       |
 3317|  16.2k|					dist += low_dist;
 3318|  16.2k|				} else {
 3319|       |					/* dbits is one of [0,1,2,3] */
 3320|  3.60k|					int add;
 3321|       |
 3322|  3.60k|					if(ARCHIVE_OK != (ret = read_consume_bits(a, rar5,
  ------------------
  |  |  233|  3.60k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3322:9): [True: 4, False: 3.60k]
  ------------------
 3323|  3.60k|					     p, dbits, &add))) {
 3324|       |						/* Return EOF if we can't read
 3325|       |						 * more data. */
 3326|      4|						return ret;
 3327|      4|					}
 3328|       |
 3329|  3.60k|					dist += add;
 3330|  3.60k|				}
 3331|  19.8k|			}
 3332|       |
 3333|  24.0k|			if(dist > 0x100) {
  ------------------
  |  Branch (3333:7): [True: 10.8k, False: 13.1k]
  ------------------
 3334|  10.8k|				len++;
 3335|       |
 3336|  10.8k|				if(dist > 0x2000) {
  ------------------
  |  Branch (3336:8): [True: 9.31k, False: 1.57k]
  ------------------
 3337|  9.31k|					len++;
 3338|       |
 3339|  9.31k|					if(dist > 0x40000) {
  ------------------
  |  Branch (3339:9): [True: 7.98k, False: 1.32k]
  ------------------
 3340|  7.98k|						len++;
 3341|  7.98k|					}
 3342|  9.31k|				}
 3343|  10.8k|			}
 3344|       |
 3345|  24.0k|			dist_cache_push(rar5, dist);
 3346|  24.0k|			rar5->cstate.last_len = len;
 3347|       |
 3348|  24.0k|			ret = copy_string(a, len, dist);
 3349|  24.0k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  24.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3349:7): [True: 45, False: 24.0k]
  ------------------
 3350|     45|				return ret;
 3351|       |
 3352|  24.0k|			continue;
 3353|   482k|		} else if(num == 256) {
  ------------------
  |  Branch (3353:13): [True: 2.40k, False: 480k]
  ------------------
 3354|       |			/* Create a filter. */
 3355|  2.40k|			ret = parse_filter(a, p);
 3356|  2.40k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.40k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3356:7): [True: 165, False: 2.23k]
  ------------------
 3357|    165|				return ret;
 3358|       |
 3359|  2.23k|			continue;
 3360|   480k|		} else if(num == 257) {
  ------------------
  |  Branch (3360:13): [True: 414k, False: 65.9k]
  ------------------
 3361|   414k|			if(rar5->cstate.last_len != 0) {
  ------------------
  |  Branch (3361:7): [True: 411k, False: 3.02k]
  ------------------
 3362|   411k|				ret = copy_string(a,
 3363|   411k|				    rar5->cstate.last_len,
 3364|   411k|				    rar5->cstate.dist_cache[0]);
 3365|   411k|				if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|   411k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3365:8): [True: 4, False: 411k]
  ------------------
 3366|      4|					return ret;
 3367|   411k|			}
 3368|       |
 3369|   414k|			continue;
 3370|   414k|		} else {
 3371|       |			/* num < 262 */
 3372|  65.9k|			const int idx = num - 258;
 3373|  65.9k|			const int dist = dist_cache_touch(rar5, idx);
 3374|       |
 3375|  65.9k|			uint16_t len_slot;
 3376|  65.9k|			int len;
 3377|       |
 3378|  65.9k|			if(ARCHIVE_OK != decode_number(a, &rar5->cstate.rd, p,
  ------------------
  |  |  233|  65.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3378:7): [True: 6, False: 65.9k]
  ------------------
 3379|  65.9k|			    &len_slot)) {
 3380|      6|				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|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3380:12): [True: 2, False: 4]
  ------------------
 3381|      6|			}
 3382|       |
 3383|  65.9k|			len = decode_code_length(a, rar5, p, len_slot);
 3384|  65.9k|			if (len == -1) {
  ------------------
  |  Branch (3384:8): [True: 9, False: 65.9k]
  ------------------
 3385|      9|				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|      7|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3385:12): [True: 2, False: 7]
  ------------------
 3386|      9|			}
 3387|       |
 3388|  65.9k|			rar5->cstate.last_len = len;
 3389|       |
 3390|  65.9k|			ret = copy_string(a, len, dist);
 3391|  65.9k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  65.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3391:7): [True: 11, False: 65.9k]
  ------------------
 3392|     11|				return ret;
 3393|       |
 3394|  65.9k|			continue;
 3395|  65.9k|		}
 3396|  1.80M|	}
 3397|       |
 3398|  35.4k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  35.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3399|  35.8k|}
archive_read_support_format_rar5.c:bf_bit_size:
  499|  35.8k|uint8_t bf_bit_size(const struct compressed_block_header* hdr) {
  500|  35.8k|	return hdr->block_flags_u8 & 7;
  501|  35.8k|}
archive_read_support_format_rar5.c:decode_code_length:
 3114|  90.0k|{
 3115|  90.0k|	int lbits, length = 2;
 3116|       |
 3117|  90.0k|	if(code < 8) {
  ------------------
  |  Branch (3117:5): [True: 28.0k, False: 62.0k]
  ------------------
 3118|  28.0k|		lbits = 0;
 3119|  28.0k|		length += code;
 3120|  62.0k|	} else {
 3121|  62.0k|		lbits = code / 4 - 1;
 3122|  62.0k|		length += (4 | (code & 3)) << lbits;
 3123|  62.0k|	}
 3124|       |
 3125|  90.0k|	if(lbits > 0) {
  ------------------
  |  Branch (3125:5): [True: 62.0k, False: 28.0k]
  ------------------
 3126|  62.0k|		int add;
 3127|       |
 3128|  62.0k|		if(ARCHIVE_OK != read_consume_bits(a, rar5, p, lbits, &add))
  ------------------
  |  |  233|  62.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3128:6): [True: 16, False: 62.0k]
  ------------------
 3129|     16|			return -1;
 3130|       |
 3131|  62.0k|		length += add;
 3132|  62.0k|	}
 3133|       |
 3134|  90.0k|	return length;
 3135|  90.0k|}
archive_read_support_format_rar5.c:read_bits_32:
 1020|  14.8k|{
 1021|  14.8k|	if(rar5->bits.in_addr >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (1021:5): [True: 7, False: 14.8k]
  ------------------
 1022|      7|		archive_set_error(&a->archive,
 1023|      7|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      7|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1024|      7|			"Premature end of stream during extraction of data (#1)");
 1025|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1026|      7|	}
 1027|       |
 1028|  14.8k|	uint32_t bits = archive_be32dec(p + rar5->bits.in_addr);
 1029|  14.8k|	bits <<= rar5->bits.bit_addr;
 1030|  14.8k|	bits |= p[rar5->bits.in_addr + 4] >> (8 - rar5->bits.bit_addr);
 1031|  14.8k|	*value = bits;
 1032|  14.8k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  14.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1033|  14.8k|}
archive_read_support_format_rar5.c:read_consume_bits:
 1060|  71.0k|{
 1061|  71.0k|	uint16_t v;
 1062|  71.0k|	int ret, num;
 1063|       |
 1064|  71.0k|	if(n == 0 || n > 16) {
  ------------------
  |  Branch (1064:5): [True: 0, False: 71.0k]
  |  Branch (1064:15): [True: 0, False: 71.0k]
  ------------------
 1065|       |		/* This is a programmer error and should never happen
 1066|       |		 * in runtime. */
 1067|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1068|      0|	}
 1069|       |
 1070|  71.0k|	ret = read_bits_16(a, rar5, p, &v);
 1071|  71.0k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  71.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1071:5): [True: 27, False: 71.0k]
  ------------------
 1072|     27|		return ret;
 1073|       |
 1074|  71.0k|	num = (int) v;
 1075|  71.0k|	num >>= 16 - n;
 1076|       |
 1077|  71.0k|	skip_bits(rar5, n);
 1078|       |
 1079|  71.0k|	if(value)
  ------------------
  |  Branch (1079:5): [True: 71.0k, False: 0]
  ------------------
 1080|  71.0k|		*value = num;
 1081|       |
 1082|  71.0k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  71.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1083|  71.0k|}
archive_read_support_format_rar5.c:dist_cache_push:
  827|  24.0k|static void dist_cache_push(struct rar5 *rar5, int value) {
  828|  24.0k|	int* q = rar5->cstate.dist_cache;
  829|       |
  830|  24.0k|	q[3] = q[2];
  831|  24.0k|	q[2] = q[1];
  832|  24.0k|	q[1] = q[0];
  833|  24.0k|	q[0] = value;
  834|  24.0k|}
archive_read_support_format_rar5.c:copy_string:
 3137|   501k|static int copy_string(struct archive_read* a, int len, int dist) {
 3138|   501k|	struct rar5 *rar5 = a->format->data;
 3139|   501k|	const ssize_t cmask = rar5->cstate.window_mask;
 3140|   501k|	const uint64_t write_ptr = rar5->cstate.write_ptr +
 3141|   501k|	    rar5->cstate.solid_offset;
 3142|   501k|	int i;
 3143|       |
 3144|   501k|	if (rar5->cstate.window_buf == NULL)
  ------------------
  |  Branch (3144:6): [True: 0, False: 501k]
  ------------------
 3145|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3146|       |
 3147|   501k|	if (rar5->cstate.write_ptr > rar5->file.unpacked_size ||
  ------------------
  |  Branch (3147:6): [True: 0, False: 501k]
  ------------------
 3148|   501k|	    len > rar5->file.unpacked_size - rar5->cstate.write_ptr) {
  ------------------
  |  Branch (3148:6): [True: 60, False: 501k]
  ------------------
 3149|     60|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     60|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3150|     60|		    "Uncompressed data exceeds declared size");
 3151|     60|		return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              		return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|     53|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3151:10): [True: 7, False: 53]
  ------------------
 3152|     60|	}
 3153|       |
 3154|       |	/* The unpacker spends most of the time in this function. It would be
 3155|       |	 * a good idea to introduce some optimizations here.
 3156|       |	 *
 3157|       |	 * Just remember that this loop treats buffers that overlap differently
 3158|       |	 * than buffers that do not overlap. This is why a simple memcpy(3)
 3159|       |	 * call will not be enough. */
 3160|       |
 3161|   636M|	for(i = 0; i < len; i++) {
  ------------------
  |  Branch (3161:13): [True: 635M, False: 501k]
  ------------------
 3162|   635M|		const ssize_t write_idx = (write_ptr + i) & cmask;
 3163|   635M|		const ssize_t read_idx = (write_ptr + i - dist) & cmask;
 3164|   635M|		rar5->cstate.window_buf[write_idx] =
 3165|   635M|		    rar5->cstate.window_buf[read_idx];
 3166|   635M|	}
 3167|       |
 3168|   501k|	rar5->cstate.write_ptr += len;
 3169|   501k|	return ARCHIVE_OK;
  ------------------
  |  |  233|   501k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3170|   501k|}
archive_read_support_format_rar5.c:parse_filter:
 3049|  2.40k|static int parse_filter(struct archive_read* ar, const uint8_t* p) {
 3050|  2.40k|	struct rar5 *rar5 = ar->format->data;
 3051|  2.40k|	uint32_t block_start, block_length;
 3052|  2.40k|	uint16_t filter_type;
 3053|  2.40k|	struct filter_info* filt = NULL;
 3054|  2.40k|	int ret;
 3055|       |
 3056|       |	/* Read the parameters from the input stream. */
 3057|  2.40k|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar5, p, &block_start)))
  ------------------
  |  |  233|  2.40k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3057:5): [True: 3, False: 2.39k]
  ------------------
 3058|      3|		return ret;
 3059|       |
 3060|  2.39k|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar5, p, &block_length)))
  ------------------
  |  |  233|  2.39k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3060:5): [True: 22, False: 2.37k]
  ------------------
 3061|     22|		return ret;
 3062|       |
 3063|  2.37k|	if(ARCHIVE_OK != (ret = read_bits_16(ar, rar5, p, &filter_type)))
  ------------------
  |  |  233|  2.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3063:5): [True: 2, False: 2.37k]
  ------------------
 3064|      2|		return ret;
 3065|       |
 3066|  2.37k|	filter_type >>= 13;
 3067|  2.37k|	skip_bits(rar5, 3);
 3068|       |
 3069|       |	/* Perform some sanity checks on this filter parameters. */
 3070|       |
 3071|  2.37k|	if(block_length < 4 ||
  ------------------
  |  Branch (3071:5): [True: 27, False: 2.34k]
  ------------------
 3072|  2.34k|	    block_length > 0x400000 ||
  ------------------
  |  Branch (3072:6): [True: 56, False: 2.29k]
  ------------------
 3073|  2.29k|	    !is_valid_filter_block_start(rar5, block_start) ||
  ------------------
  |  Branch (3073:6): [True: 43, False: 2.24k]
  ------------------
 3074|  2.24k|	    (rar5->cstate.window_size > 0 &&
  ------------------
  |  Branch (3074:7): [True: 2.24k, False: 0]
  ------------------
 3075|  2.24k|	     (ssize_t)block_length > rar5->cstate.window_size >> 1))
  ------------------
  |  Branch (3075:7): [True: 11, False: 2.23k]
  ------------------
 3076|    137|	{
 3077|    137|		archive_set_error(&ar->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    137|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3078|    137|		    "Invalid filter encountered");
 3079|    137|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    137|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3080|    137|	}
 3081|       |
 3082|       |	/* Allocate a new filter. */
 3083|  2.23k|	filt = add_new_filter(rar5);
 3084|  2.23k|	if(filt == NULL) {
  ------------------
  |  Branch (3084:5): [True: 0, False: 2.23k]
  ------------------
 3085|      0|		archive_set_error(&ar->archive, ENOMEM,
 3086|      0|		    "Can't allocate memory for a filter descriptor");
 3087|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3088|      0|	}
 3089|       |
 3090|  2.23k|	filt->type = filter_type;
 3091|  2.23k|	filt->block_start = rar5->cstate.write_ptr + block_start;
 3092|  2.23k|	filt->block_length = block_length;
 3093|       |
 3094|  2.23k|	rar5->cstate.last_block_start = filt->block_start;
 3095|  2.23k|	rar5->cstate.last_block_length = filt->block_length;
 3096|       |
 3097|       |	/* Read some more data in case this is a DELTA filter. Other filter
 3098|       |	 * types don't require any additional data over what was already
 3099|       |	 * read. */
 3100|  2.23k|	if(filter_type == FILTER_DELTA) {
  ------------------
  |  Branch (3100:5): [True: 607, False: 1.63k]
  ------------------
 3101|    607|		int channels;
 3102|       |
 3103|    607|		if(ARCHIVE_OK != (ret = read_consume_bits(ar, rar5, p, 5, &channels)))
  ------------------
  |  |  233|    607|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3103:6): [True: 1, False: 606]
  ------------------
 3104|      1|			return ret;
 3105|       |
 3106|    606|		filt->channels = channels + 1;
 3107|    606|	}
 3108|       |
 3109|  2.23k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3110|  2.23k|}
archive_read_support_format_rar5.c:parse_filter_data:
 2998|  4.80k|{
 2999|  4.80k|	int i, bytes, ret;
 3000|  4.80k|	uint32_t data = 0;
 3001|       |
 3002|  4.80k|	if(ARCHIVE_OK != (ret = read_consume_bits(a, rar5, p, 2, &bytes)))
  ------------------
  |  |  233|  4.80k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3002:5): [True: 6, False: 4.79k]
  ------------------
 3003|      6|		return ret;
 3004|       |
 3005|  4.79k|	bytes++;
 3006|       |
 3007|  10.9k|	for(i = 0; i < bytes; i++) {
  ------------------
  |  Branch (3007:13): [True: 6.15k, False: 4.77k]
  ------------------
 3008|  6.15k|		uint16_t byte;
 3009|       |
 3010|  6.15k|		if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &byte))) {
  ------------------
  |  |  233|  6.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3010:6): [True: 19, False: 6.13k]
  ------------------
 3011|     19|			return ret;
 3012|     19|		}
 3013|       |
 3014|       |		/* Cast to uint32_t will ensure the shift operation will not
 3015|       |		 * produce undefined result. */
 3016|  6.13k|		data += ((uint32_t) byte >> 8) << (i * 8);
 3017|  6.13k|		skip_bits(rar5, 8);
 3018|  6.13k|	}
 3019|       |
 3020|  4.77k|	*filter_data = data;
 3021|  4.77k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  4.77k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3022|  4.79k|}
archive_read_support_format_rar5.c:is_valid_filter_block_start:
 3027|  2.29k|{
 3028|  2.29k|	const int64_t block_start = (ssize_t) start + rar5->cstate.write_ptr;
 3029|  2.29k|	const int64_t last_bs = rar5->cstate.last_block_start;
 3030|  2.29k|	const ssize_t last_bl = rar5->cstate.last_block_length;
 3031|       |
 3032|  2.29k|	if(last_bs == 0 || last_bl == 0) {
  ------------------
  |  Branch (3032:5): [True: 302, False: 1.99k]
  |  Branch (3032:21): [True: 0, False: 1.99k]
  ------------------
 3033|       |		/* We didn't have any filters yet, so accept this offset. */
 3034|    302|		return 1;
 3035|    302|	}
 3036|       |
 3037|  1.99k|	if(block_start >= last_bs + last_bl) {
  ------------------
  |  Branch (3037:5): [True: 1.94k, False: 43]
  ------------------
 3038|       |		/* Current offset is bigger than last block's end offset, so
 3039|       |		 * accept current offset. */
 3040|  1.94k|		return 1;
 3041|  1.94k|	}
 3042|       |
 3043|       |	/* Any other case is not a normal situation and we should fail. */
 3044|     43|	return 0;
 3045|  1.99k|}
archive_read_support_format_rar5.c:add_new_filter:
  547|  2.23k|static struct filter_info* add_new_filter(struct rar5 *rar5) {
  548|  2.23k|	struct filter_info* f = calloc(1, sizeof(*f));
  549|       |
  550|  2.23k|	if(!f) {
  ------------------
  |  Branch (550:5): [True: 0, False: 2.23k]
  ------------------
  551|      0|		return NULL;
  552|      0|	}
  553|       |
  554|  2.23k|	if (CDE_OK != cdeque_push_back(&rar5->cstate.filters, cdeque_filter(f))) {
  ------------------
  |  Branch (554:6): [True: 0, False: 2.23k]
  ------------------
  555|      0|		free(f);
  556|      0|		return NULL;
  557|      0|	}
  558|       |
  559|  2.23k|	return f;
  560|  2.23k|}
archive_read_support_format_rar5.c:cdeque_push_back:
  435|  2.23k|static int cdeque_push_back(struct cdeque* d, void* item) {
  436|  2.23k|	if(d == NULL)
  ------------------
  |  Branch (436:5): [True: 0, False: 2.23k]
  ------------------
  437|      0|		return CDE_PARAM;
  438|       |
  439|  2.23k|	if(d->size == d->cap_mask + 1)
  ------------------
  |  Branch (439:5): [True: 0, False: 2.23k]
  ------------------
  440|      0|		return CDE_OUT_OF_BOUNDS;
  441|       |
  442|  2.23k|	d->arr[d->end_pos] = (size_t) item;
  443|  2.23k|	d->end_pos = (d->end_pos + 1) & d->cap_mask;
  444|  2.23k|	d->size++;
  445|       |
  446|  2.23k|	return CDE_OK;
  447|  2.23k|}
archive_read_support_format_rar5.c:cdeque_filter:
  476|  2.23k|static void* cdeque_filter(struct filter_info* f) {
  477|  2.23k|	return (void**) (size_t) f;
  478|  2.23k|}
archive_read_support_format_rar5.c:dist_cache_touch:
  836|  65.9k|static int dist_cache_touch(struct rar5 *rar5, int idx) {
  837|  65.9k|	int* q = rar5->cstate.dist_cache;
  838|  65.9k|	int i, dist = q[idx];
  839|       |
  840|   201k|	for(i = idx; i > 0; i--)
  ------------------
  |  Branch (840:15): [True: 135k, False: 65.9k]
  ------------------
  841|   135k|		q[i] = q[i - 1];
  842|       |
  843|  65.9k|	q[0] = dist;
  844|  65.9k|	return dist;
  845|  65.9k|}
archive_read_support_format_rar5.c:bf_is_last_block:
  514|  8.29k|uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
  515|  8.29k|	return (hdr->block_flags_u8 >> 6) & 1;
  516|  8.29k|}
archive_read_support_format_rar5.c:apply_filters:
  775|  30.4k|static int apply_filters(struct archive_read* a) {
  776|  30.4k|	struct rar5 *rar5 = a->format->data;
  777|  30.4k|	struct filter_info* flt;
  778|  30.4k|	int ret;
  779|       |
  780|  30.4k|	rar5->cstate.all_filters_applied = 0;
  781|       |
  782|       |	/* Get the first filter that can be applied to our data. The data
  783|       |	 * needs to be fully unpacked before the filter can be run. */
  784|  30.4k|	if(CDE_OK == cdeque_front(&rar5->cstate.filters,
  ------------------
  |  Branch (784:5): [True: 3.96k, False: 26.4k]
  ------------------
  785|  30.4k|	    cdeque_filter_p(&flt))) {
  786|       |		/* Check if our unpacked data fully covers this filter's
  787|       |		 * range. */
  788|  3.96k|		if(rar5->cstate.write_ptr > flt->block_start &&
  ------------------
  |  Branch (788:6): [True: 3.62k, False: 340]
  ------------------
  789|  3.62k|		    rar5->cstate.write_ptr >= flt->block_start +
  ------------------
  |  Branch (789:7): [True: 3.24k, False: 379]
  ------------------
  790|  3.62k|		    flt->block_length) {
  791|       |			/* Check if we have some data pending to be written
  792|       |			 * right before the filter's start offset. */
  793|  3.24k|			if(rar5->cstate.last_write_ptr == flt->block_start) {
  ------------------
  |  Branch (793:7): [True: 1.65k, False: 1.59k]
  ------------------
  794|       |				/* Run the filter specified by descriptor
  795|       |				 * `flt`. */
  796|  1.65k|				ret = run_filter(a, flt);
  797|  1.65k|				if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (797:8): [True: 26, False: 1.63k]
  ------------------
  798|       |					/* Filter failure, return error. */
  799|     26|					return ret;
  800|     26|				}
  801|       |
  802|       |				/* Filter descriptor won't be needed anymore
  803|       |				 * after it's used, * so remove it from the
  804|       |				 * filter list and free its memory. */
  805|  1.63k|				(void) cdeque_pop_front(&rar5->cstate.filters,
  806|  1.63k|				    cdeque_filter_p(&flt));
  807|       |
  808|  1.63k|				free(flt);
  809|  1.63k|			} else {
  810|       |				/* We can't run filters yet, dump the memory
  811|       |				 * right before the filter. */
  812|  1.59k|				push_window_data(a, rar5,
  813|  1.59k|				    rar5->cstate.last_write_ptr,
  814|  1.59k|				    flt->block_start);
  815|  1.59k|			}
  816|       |
  817|       |			/* Return 'filter applied or not needed' state to the
  818|       |			 * caller. */
  819|  3.22k|			return ARCHIVE_RETRY;
  ------------------
  |  |  234|  3.22k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  820|  3.24k|		}
  821|  3.96k|	}
  822|       |
  823|  27.1k|	rar5->cstate.all_filters_applied = 1;
  824|  27.1k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  27.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  825|  30.4k|}
archive_read_support_format_rar5.c:run_filter:
  665|  1.65k|static int run_filter(struct archive_read* a, struct filter_info* flt) {
  666|  1.65k|	struct rar5 *rar5 = a->format->data;
  667|  1.65k|	int ret;
  668|       |
  669|  1.65k|	clear_data_ready_stack(rar5);
  670|  1.65k|	free(rar5->cstate.filtered_buf);
  671|       |
  672|  1.65k|	rar5->cstate.filtered_buf = malloc(flt->block_length);
  673|  1.65k|	if(!rar5->cstate.filtered_buf) {
  ------------------
  |  Branch (673:5): [True: 0, False: 1.65k]
  ------------------
  674|      0|		archive_set_error(&a->archive, ENOMEM,
  675|      0|		    "Can't allocate memory for filter data");
  676|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  677|      0|	}
  678|       |
  679|  1.65k|	switch(flt->type) {
  680|    324|		case FILTER_DELTA:
  ------------------
  |  Branch (680:3): [True: 324, False: 1.33k]
  ------------------
  681|    324|			ret = run_delta_filter(rar5, flt);
  682|    324|			break;
  683|       |
  684|     99|		case FILTER_E8:
  ------------------
  |  Branch (684:3): [True: 99, False: 1.55k]
  ------------------
  685|       |			/* fallthrough */
  686|    195|		case FILTER_E8E9:
  ------------------
  |  Branch (686:3): [True: 96, False: 1.56k]
  ------------------
  687|    195|			ret = run_e8e9_filter(rar5, flt,
  688|    195|			    flt->type == FILTER_E8E9);
  689|    195|			break;
  690|       |
  691|  1.11k|		case FILTER_ARM:
  ------------------
  |  Branch (691:3): [True: 1.11k, False: 544]
  ------------------
  692|  1.11k|			ret = run_arm_filter(rar5, flt);
  693|  1.11k|			break;
  694|       |
  695|     25|		default:
  ------------------
  |  Branch (695:3): [True: 25, False: 1.63k]
  ------------------
  696|     25|			archive_set_error(&a->archive,
  697|     25|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     25|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  698|     25|			    "Unsupported filter type: 0x%x",
  699|     25|			    (unsigned int)flt->type);
  700|     25|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     25|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  701|  1.65k|	}
  702|       |
  703|  1.63k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.63k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (703:5): [True: 0, False: 1.63k]
  ------------------
  704|       |		/* Filter has failed. */
  705|      0|		return ret;
  706|      0|	}
  707|       |
  708|  1.63k|	if(ARCHIVE_OK != push_data_ready(a, rar5, rar5->cstate.filtered_buf,
  ------------------
  |  |  233|  1.63k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (708:5): [True: 1, False: 1.63k]
  ------------------
  709|  1.63k|	    flt->block_length, rar5->cstate.last_write_ptr))
  710|      1|	{
  711|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  712|      1|		    "Stack overflow when submitting unpacked data");
  713|       |
  714|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  715|      1|	}
  716|       |
  717|  1.63k|	rar5->cstate.last_write_ptr += flt->block_length;
  718|  1.63k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.63k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  719|  1.63k|}
archive_read_support_format_rar5.c:run_delta_filter:
  562|    324|static int run_delta_filter(struct rar5 *rar5, struct filter_info* flt) {
  563|    324|	int i;
  564|    324|	ssize_t dest_pos, src_pos = 0;
  565|       |
  566|  1.22k|	for(i = 0; i < flt->channels; i++) {
  ------------------
  |  Branch (566:13): [True: 897, False: 324]
  ------------------
  567|    897|		uint8_t prev_byte = 0;
  568|    897|		for(dest_pos = i;
  569|   431k|				dest_pos < flt->block_length;
  ------------------
  |  Branch (569:5): [True: 431k, False: 897]
  ------------------
  570|   431k|				dest_pos += flt->channels)
  571|   431k|		{
  572|   431k|			uint8_t byte;
  573|       |
  574|   431k|			byte = rar5->cstate.window_buf[
  575|   431k|			    (rar5->cstate.solid_offset + flt->block_start +
  576|   431k|			    src_pos) & rar5->cstate.window_mask];
  577|       |
  578|   431k|			prev_byte -= byte;
  579|   431k|			rar5->cstate.filtered_buf[dest_pos] = prev_byte;
  580|   431k|			src_pos++;
  581|   431k|		}
  582|    897|	}
  583|       |
  584|    324|	return ARCHIVE_OK;
  ------------------
  |  |  233|    324|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  585|    324|}
archive_read_support_format_rar5.c:run_e8e9_filter:
  589|    195|{
  590|    195|	const uint32_t file_size = 0x1000000;
  591|    195|	ssize_t i;
  592|       |
  593|    195|	circular_memcpy(rar5->cstate.filtered_buf,
  594|    195|	    rar5->cstate.window_buf, rar5->cstate.window_mask,
  595|    195|	    rar5->cstate.solid_offset + flt->block_start,
  596|    195|	    rar5->cstate.solid_offset + flt->block_start + flt->block_length);
  597|       |
  598|   865k|	for(i = 0; i < flt->block_length - 4;) {
  ------------------
  |  Branch (598:13): [True: 865k, False: 195]
  ------------------
  599|   865k|		uint8_t b = rar5->cstate.window_buf[
  600|   865k|		    (rar5->cstate.solid_offset + flt->block_start +
  601|   865k|		    i++) & rar5->cstate.window_mask];
  602|       |
  603|       |		/*
  604|       |		 * 0xE8 = x86's call <relative_addr_uint32> (function call)
  605|       |		 * 0xE9 = x86's jmp <relative_addr_uint32> (unconditional jump)
  606|       |		 */
  607|   865k|		if(b == 0xE8 || (extended && b == 0xE9)) {
  ------------------
  |  Branch (607:6): [True: 57, False: 865k]
  |  Branch (607:20): [True: 649k, False: 216k]
  |  Branch (607:32): [True: 82.1k, False: 567k]
  ------------------
  608|       |
  609|  82.2k|			uint32_t addr;
  610|  82.2k|			uint32_t offset = (i + flt->block_start) % file_size;
  611|       |
  612|  82.2k|			addr = read_filter_data(rar5,
  613|  82.2k|			    (uint32_t)(rar5->cstate.solid_offset +
  614|  82.2k|			    flt->block_start + i) & rar5->cstate.window_mask);
  615|       |
  616|  82.2k|			if(addr & 0x80000000) {
  ------------------
  |  Branch (616:7): [True: 35.1k, False: 47.1k]
  ------------------
  617|  35.1k|				if(((addr + offset) & 0x80000000) == 0) {
  ------------------
  |  Branch (617:8): [True: 1.36k, False: 33.7k]
  ------------------
  618|  1.36k|					write_filter_data(rar5, (uint32_t)i,
  619|  1.36k|					    addr + file_size);
  620|  1.36k|				}
  621|  47.1k|			} else {
  622|  47.1k|				if((addr - file_size) & 0x80000000) {
  ------------------
  |  Branch (622:8): [True: 45.5k, False: 1.59k]
  ------------------
  623|  45.5k|					uint32_t naddr = addr - offset;
  624|  45.5k|					write_filter_data(rar5, (uint32_t)i,
  625|  45.5k|					    naddr);
  626|  45.5k|				}
  627|  47.1k|			}
  628|       |
  629|  82.2k|			i += 4;
  630|  82.2k|		}
  631|   865k|	}
  632|       |
  633|    195|	return ARCHIVE_OK;
  ------------------
  |  |  233|    195|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  634|    195|}
archive_read_support_format_rar5.c:circular_memcpy:
  521|   113k|{
  522|   113k|	if((start & mask) > (end & mask)) {
  ------------------
  |  Branch (522:5): [True: 42, False: 113k]
  ------------------
  523|     42|		ssize_t len1 = mask + 1 - (start & mask);
  524|     42|		ssize_t len2 = end & mask;
  525|       |
  526|     42|		memcpy(dst, &window[start & mask], len1);
  527|     42|		memcpy(dst + len1, window, len2);
  528|   113k|	} else {
  529|   113k|		memcpy(dst, &window[start & mask], (size_t) (end - start));
  530|   113k|	}
  531|   113k|}
archive_read_support_format_rar5.c:read_filter_data:
  533|   112k|static uint32_t read_filter_data(struct rar5 *rar5, uint32_t offset) {
  534|   112k|	uint8_t linear_buf[4];
  535|   112k|	circular_memcpy(linear_buf, rar5->cstate.window_buf,
  536|   112k|	    rar5->cstate.window_mask, offset, offset + 4);
  537|   112k|	return archive_le32dec(linear_buf);
  538|   112k|}
archive_read_support_format_rar5.c:write_filter_data:
  542|  77.0k|{
  543|  77.0k|	archive_le32enc(&rar5->cstate.filtered_buf[offset], value);
  544|  77.0k|}
archive_read_support_format_rar5.c:run_arm_filter:
  636|  1.11k|static int run_arm_filter(struct rar5 *rar5, struct filter_info* flt) {
  637|  1.11k|	ssize_t i = 0;
  638|  1.11k|	uint32_t offset;
  639|       |
  640|  1.11k|	circular_memcpy(rar5->cstate.filtered_buf,
  641|  1.11k|	    rar5->cstate.window_buf, rar5->cstate.window_mask,
  642|  1.11k|	    rar5->cstate.solid_offset + flt->block_start,
  643|  1.11k|	    rar5->cstate.solid_offset + flt->block_start + flt->block_length);
  644|       |
  645|   140k|	for(i = 0; i < flt->block_length - 3; i += 4) {
  ------------------
  |  Branch (645:13): [True: 139k, False: 1.11k]
  ------------------
  646|   139k|		uint8_t* b = &rar5->cstate.window_buf[
  647|   139k|		    (rar5->cstate.solid_offset +
  648|   139k|		    flt->block_start + i + 3) & rar5->cstate.window_mask];
  649|       |
  650|   139k|		if(*b == 0xEB) {
  ------------------
  |  Branch (650:6): [True: 30.1k, False: 109k]
  ------------------
  651|       |			/* 0xEB = ARM's BL (branch + link) instruction. */
  652|  30.1k|			offset = read_filter_data(rar5,
  653|  30.1k|			    (rar5->cstate.solid_offset + flt->block_start + i) &
  654|  30.1k|			     (uint32_t)rar5->cstate.window_mask) & 0x00ffffff;
  655|       |
  656|  30.1k|			offset -= (uint32_t) ((i + flt->block_start) / 4);
  657|  30.1k|			offset = (offset & 0x00ffffff) | 0xeb000000;
  658|  30.1k|			write_filter_data(rar5, (uint32_t)i, offset);
  659|  30.1k|		}
  660|   139k|	}
  661|       |
  662|  1.11k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  663|  1.11k|}
archive_read_support_format_rar5.c:push_data_ready:
 3832|  34.6k|{
 3833|  34.6k|	int i;
 3834|       |
 3835|       |	/* Don't push if we're in skip mode. This is needed because solid
 3836|       |	 * streams need full processing even if we're skipping data. After
 3837|       |	 * fully processing the stream, we need to discard the generated bytes,
 3838|       |	 * because we're interested only in the side effect: building up the
 3839|       |	 * internal window circular buffer. This window buffer will be used
 3840|       |	 * later during unpacking of requested data. */
 3841|  34.6k|	if(rar5->skip_mode)
  ------------------
  |  Branch (3841:5): [True: 3.62k, False: 31.0k]
  ------------------
 3842|  3.62k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  3.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3843|       |
 3844|       |	/* Sanity check. */
 3845|  31.0k|	if(offset != rar5->file.last_offset + rar5->file.last_size) {
  ------------------
  |  Branch (3845:5): [True: 305, False: 30.7k]
  ------------------
 3846|    305|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|    305|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3847|    305|		    "Sanity check error: output stream is not continuous");
 3848|    305|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|    305|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3849|    305|	}
 3850|       |
 3851|  35.2k|	for(i = 0; i < rar5_countof(rar5->cstate.dready); i++) {
  ------------------
  |  |   64|  35.2k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3851:13): [True: 35.2k, False: 0]
  ------------------
 3852|  35.2k|		struct data_ready* d = &rar5->cstate.dready[i];
 3853|  35.2k|		if(!d->used) {
  ------------------
  |  Branch (3853:6): [True: 30.7k, False: 4.55k]
  ------------------
 3854|  30.7k|			d->used = 1;
 3855|  30.7k|			d->buf = buf;
 3856|  30.7k|			d->size = size;
 3857|  30.7k|			d->offset = offset;
 3858|       |
 3859|       |			/* These fields are used only in sanity checking. */
 3860|  30.7k|			rar5->file.last_offset = offset;
 3861|  30.7k|			rar5->file.last_size = size;
 3862|       |
 3863|       |			/* Calculate the checksum of this new block before
 3864|       |			 * submitting data to libarchive's engine. */
 3865|  30.7k|			update_crc(rar5, d->buf, d->size);
 3866|       |
 3867|  30.7k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  30.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3868|  30.7k|		}
 3869|  35.2k|	}
 3870|       |
 3871|       |	/* Program counter will reach this code if the
 3872|       |	 * `rar5->cstate.data_ready` stack will be filled up so that no new
 3873|       |	 * entries will be allowed. The code shouldn't allow such situation to
 3874|       |	 * occur. So we treat this case as an internal error. */
 3875|       |
 3876|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3877|      0|	    "Premature end of data_ready stack");
 3878|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3879|  30.7k|}
archive_read_support_format_rar5.c:cdeque_front:
  426|  31.1k|static int cdeque_front(struct cdeque* d, void** value) {
  427|  31.1k|	if(d->size > 0) {
  ------------------
  |  Branch (427:5): [True: 4.68k, False: 26.4k]
  ------------------
  428|  4.68k|		cdeque_front_fast(d, value);
  429|  4.68k|		return CDE_OK;
  430|  4.68k|	} else
  431|  26.4k|		return CDE_OUT_OF_BOUNDS;
  432|  31.1k|}
archive_read_support_format_rar5.c:cdeque_front_fast:
  420|  4.68k|static void cdeque_front_fast(struct cdeque* d, void** value) {
  421|  4.68k|	*value = (void*) d->arr[d->beg_pos];
  422|  4.68k|}
archive_read_support_format_rar5.c:push_window_data:
  771|  28.4k|{
  772|  28.4k|	push_data(a, rar5, rar5->cstate.window_buf, idx_begin, idx_end);
  773|  28.4k|}
archive_read_support_format_rar5.c:push_data:
  727|  28.4k|{
  728|  28.4k|	const ssize_t wmask = rar5->cstate.window_mask;
  729|  28.4k|	const ssize_t solid_write_ptr = (rar5->cstate.solid_offset +
  730|  28.4k|	    rar5->cstate.last_write_ptr) & wmask;
  731|       |
  732|  28.4k|	idx_begin += rar5->cstate.solid_offset;
  733|  28.4k|	idx_end += rar5->cstate.solid_offset;
  734|       |
  735|       |	/* Check if our unpacked data is wrapped inside the window circular
  736|       |	 * buffer.  If it's not wrapped, it can be copied out by using
  737|       |	 * a single memcpy, but when it's wrapped, we need to copy the first
  738|       |	 * part with one memcpy, and the second part with another memcpy. */
  739|       |
  740|  28.4k|	if((idx_begin & wmask) > (idx_end & wmask)) {
  ------------------
  |  Branch (740:5): [True: 4.56k, False: 23.8k]
  ------------------
  741|       |		/* The data is wrapped (begin offset sis bigger than end
  742|       |		 * offset). */
  743|  4.56k|		const ssize_t frag1_size = rar5->cstate.window_size -
  744|  4.56k|		    (idx_begin & wmask);
  745|  4.56k|		const ssize_t frag2_size = idx_end & wmask;
  746|       |
  747|       |		/* Copy the first part of the buffer first. */
  748|  4.56k|		push_data_ready(a, rar5, buf + solid_write_ptr, frag1_size,
  749|  4.56k|		    rar5->cstate.last_write_ptr);
  750|       |
  751|       |		/* Copy the second part of the buffer. */
  752|  4.56k|		push_data_ready(a, rar5, buf, frag2_size,
  753|  4.56k|		    rar5->cstate.last_write_ptr + frag1_size);
  754|       |
  755|  4.56k|		rar5->cstate.last_write_ptr += frag1_size + frag2_size;
  756|  23.8k|	} else {
  757|       |		/* Data is not wrapped, so we can just use one call to copy the
  758|       |		 * data. */
  759|  23.8k|		push_data_ready(a, rar5,
  760|  23.8k|		    buf + solid_write_ptr, (idx_end - idx_begin) & wmask,
  761|  23.8k|		    rar5->cstate.last_write_ptr);
  762|       |
  763|  23.8k|		rar5->cstate.last_write_ptr += idx_end - idx_begin;
  764|  23.8k|	}
  765|  28.4k|}
archive_read_support_format_rar5.c:verify_global_checksums:
 4244|  1.62k|static int verify_global_checksums(struct archive_read* a) {
 4245|  1.62k|	return verify_checksums(a);
 4246|  1.62k|}
archive_read_support_format_rar5.c:verify_checksums:
 4146|  1.62k|static int verify_checksums(struct archive_read* a) {
 4147|  1.62k|	struct rar5 *rar5 = a->format->data;
 4148|  1.62k|	int verify_crc;
 4149|       |
 4150|       |	/* Check checksums only when actually unpacking the data. There's no
 4151|       |	 * need to calculate checksum when we're skipping data in solid archives
 4152|       |	 * (skipping in solid archives is the same thing as unpacking compressed
 4153|       |	 * data and discarding the result). */
 4154|       |
 4155|  1.62k|	if(!rar5->skip_mode) {
  ------------------
  |  Branch (4155:5): [True: 1.45k, False: 172]
  ------------------
 4156|       |		/* Always check checksums if we're not in skip mode */
 4157|  1.45k|		verify_crc = 1;
 4158|  1.45k|	} else {
 4159|       |		/* We can override the logic above with a compile-time option
 4160|       |		 * NO_CRC_ON_SOLID_SKIP. This option is used during debugging,
 4161|       |		 * and it will check checksums of unpacked data even when
 4162|       |		 * we're skipping it. */
 4163|       |
 4164|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 4165|       |		/* Debug case */
 4166|       |		verify_crc = 1;
 4167|       |#else
 4168|       |		/* Normal case */
 4169|    172|		verify_crc = 0;
 4170|    172|#endif
 4171|    172|	}
 4172|       |
 4173|  1.62k|	if(verify_crc) {
  ------------------
  |  Branch (4173:5): [True: 1.45k, False: 172]
  ------------------
 4174|       |		/* During unpacking, on each unpacked block we're calling the
 4175|       |		 * update_crc() function. Since we are here, the unpacking
 4176|       |		 * process is already over and we can check if calculated
 4177|       |		 * checksum (CRC32 or BLAKE2sp) is the same as what is stored
 4178|       |		 * in the archive. */
 4179|  1.45k|		if(rar5->file.stored_crc32 > 0) {
  ------------------
  |  Branch (4179:6): [True: 1.27k, False: 182]
  ------------------
 4180|       |			/* Check CRC32 only when the file contains a CRC32
 4181|       |			 * value for this file. */
 4182|       |
 4183|  1.27k|			if(rar5->file.calculated_crc32 !=
  ------------------
  |  Branch (4183:7): [True: 1.27k, False: 1]
  ------------------
 4184|  1.27k|			    rar5->file.stored_crc32) {
 4185|       |				/* Checksums do not match; the unpacked file
 4186|       |				 * is corrupted. */
 4187|       |
 4188|  1.27k|				DEBUG_CODE {
  ------------------
  |  |   70|  1.27k|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (70:23): [Folded, False: 1.27k]
  |  |  ------------------
  ------------------
 4189|      0|					printf("Checksum error: CRC32 "
 4190|      0|					    "(was: %08" PRIx32 ", expected: %08" PRIx32 ")\n",
 4191|      0|					    rar5->file.calculated_crc32,
 4192|      0|					    rar5->file.stored_crc32);
 4193|      0|				}
 4194|       |
 4195|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4196|       |				archive_set_error(&a->archive,
 4197|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4198|       |				    "Checksum error: CRC32");
 4199|       |				return ARCHIVE_FAILED;
 4200|       |#endif
 4201|  1.27k|			} else {
 4202|      1|				DEBUG_CODE {
  ------------------
  |  |   70|      1|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (70:23): [Folded, False: 1]
  |  |  ------------------
  ------------------
 4203|      0|					printf("Checksum OK: CRC32 "
 4204|      0|					    "(%08" PRIx32 "/%08" PRIx32 ")\n",
 4205|      0|					    rar5->file.stored_crc32,
 4206|      0|					    rar5->file.calculated_crc32);
 4207|      0|				}
 4208|      1|			}
 4209|  1.27k|		}
 4210|       |
 4211|  1.45k|		if(rar5->file.has_blake2 > 0) {
  ------------------
  |  Branch (4211:6): [True: 1.27k, False: 184]
  ------------------
 4212|       |			/* BLAKE2sp is an optional checksum algorithm that is
 4213|       |			 * added to RARv5 archives when using the `-htb` switch
 4214|       |			 *  during creation of archive.
 4215|       |			 *
 4216|       |			 * We now finalize the hash calculation by calling the
 4217|       |			 * `final` function. This will generate the final hash
 4218|       |			 * value we can use to compare it with the BLAKE2sp
 4219|       |			 * checksum that is stored in the archive.
 4220|       |			 *
 4221|       |			 * The return value of this `final` function is not
 4222|       |			 * very helpful, as it guards only against improper use.
 4223|       | 			 * This is why we're explicitly ignoring it. */
 4224|       |
 4225|  1.27k|			uint8_t b2_buf[32];
 4226|  1.27k|			(void) blake2sp_final(&rar5->file.b2state, b2_buf, 32);
 4227|       |
 4228|  1.27k|			if(memcmp(&rar5->file.blake2sp, b2_buf, 32) != 0) {
  ------------------
  |  Branch (4228:7): [True: 1.27k, False: 0]
  ------------------
 4229|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4230|       |				archive_set_error(&a->archive,
 4231|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4232|       |				    "Checksum error: BLAKE2");
 4233|       |
 4234|       |				return ARCHIVE_FAILED;
 4235|       |#endif
 4236|  1.27k|			}
 4237|  1.27k|		}
 4238|  1.45k|	}
 4239|       |
 4240|       |	/* Finalization for this file has been successfully completed. */
 4241|  1.62k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4242|  1.62k|}
archive_read_support_format_rar5.c:rar5_read_data_skip:
 4326|  8.79k|static int rar5_read_data_skip(struct archive_read *a) {
 4327|  8.79k|	struct rar5 *rar5 = a->format->data;
 4328|       |
 4329|  8.79k|	if(rar5->main.solid && (rar5->cstate.data_encrypted == 0)) {
  ------------------
  |  Branch (4329:5): [True: 5.06k, False: 3.73k]
  |  Branch (4329:25): [True: 4.68k, False: 380]
  ------------------
 4330|       |		/* In solid archives, instead of skipping the data, we need to
 4331|       |		 * extract it, and dispose the result. The side effect of this
 4332|       |		 * operation will be setting up the initial window buffer state
 4333|       |		 * needed to be able to extract the selected file. Note that
 4334|       |		 * this is only possible when data within this solid block is
 4335|       |		 * not encrypted, in which case we'll skip and fail if the user
 4336|       |		 * tries to read data. */
 4337|       |
 4338|  4.68k|		int ret;
 4339|       |
 4340|       |		/* Make sure to process all blocks in the compressed stream. */
 4341|  8.55k|		while(rar5->file.bytes_remaining > 0) {
  ------------------
  |  Branch (4341:9): [True: 6.44k, False: 2.11k]
  ------------------
 4342|       |			/* Setting the "skip mode" will allow us to skip
 4343|       |			 * checksum checks during data skipping. Checking the
 4344|       |			 * checksum of skipped data isn't really necessary and
 4345|       |			 * it's only slowing things down.
 4346|       |			 *
 4347|       |			 * This is incremented instead of setting to 1 because
 4348|       |			 * this data skipping function can be called
 4349|       |			 * recursively. */
 4350|  6.44k|			rar5->skip_mode++;
 4351|       |
 4352|       |			/* We're disposing 1 block of data, so we use triple
 4353|       |			 * NULLs in arguments. */
 4354|  6.44k|			ret = rar5_read_data(a, NULL, NULL, NULL);
 4355|       |
 4356|       |			/* Turn off "skip mode". */
 4357|  6.44k|			rar5->skip_mode--;
 4358|       |
 4359|  6.44k|			if(ret < 0 || ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|  4.80k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4359:7): [True: 1.64k, False: 4.80k]
  |  Branch (4359:18): [True: 932, False: 3.86k]
  ------------------
 4360|       |				/* Propagate any potential error conditions
 4361|       |				 * to the caller. */
 4362|  2.57k|				return ret;
 4363|  2.57k|			}
 4364|  6.44k|		}
 4365|  4.68k|	} else {
 4366|       |		/* In standard archives, we can just jump over the compressed
 4367|       |		 * stream. Each file in non-solid archives starts from an empty
 4368|       |		 * window buffer. */
 4369|       |
 4370|  4.11k|		if(ARCHIVE_OK != consume(a, rar5->file.bytes_remaining)) {
  ------------------
  |  |  233|  4.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4370:6): [True: 206, False: 3.90k]
  ------------------
 4371|    206|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|    206|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4372|    206|		}
 4373|       |
 4374|  3.90k|		rar5->file.bytes_remaining = 0;
 4375|  3.90k|	}
 4376|       |
 4377|  6.01k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  6.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4378|  8.79k|}
archive_read_support_format_rar5.c:rar5_cleanup:
 4394|  11.9k|static int rar5_cleanup(struct archive_read *a) {
 4395|  11.9k|	struct rar5 *rar5 = a->format->data;
 4396|       |
 4397|  11.9k|	free(rar5->cstate.window_buf);
 4398|  11.9k|	free(rar5->cstate.filtered_buf);
 4399|  11.9k|	clear_data_ready_stack(rar5);
 4400|       |
 4401|  11.9k|	free(rar5->vol.push_buf);
 4402|       |
 4403|  11.9k|	free_filters(rar5);
 4404|  11.9k|	rar5_deinit(rar5);
 4405|       |
 4406|  11.9k|	free(rar5);
 4407|  11.9k|	a->format->data = NULL;
 4408|       |
 4409|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4410|  11.9k|}
archive_read_support_format_rar5.c:rar5_capabilities:
 4412|  2.78k|static int rar5_capabilities(struct archive_read * a) {
 4413|  2.78k|	(void) a;
 4414|  2.78k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  398|  2.78k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 4415|  2.78k|			| ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  2.78k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 4416|  2.78k|}
archive_read_support_format_rar5.c:rar5_has_encrypted_entries:
 4418|  1.39k|static int rar5_has_encrypted_entries(struct archive_read *_a) {
 4419|  1.39k|	if (_a && _a->format) {
  ------------------
  |  Branch (4419:6): [True: 1.39k, False: 0]
  |  Branch (4419:12): [True: 1.39k, False: 0]
  ------------------
 4420|  1.39k|		struct rar5 *rar5 = _a->format->data;
 4421|  1.39k|		if (rar5) {
  ------------------
  |  Branch (4421:7): [True: 1.39k, False: 0]
  ------------------
 4422|  1.39k|			return rar5->has_encrypted_entries;
 4423|  1.39k|		}
 4424|  1.39k|	}
 4425|       |
 4426|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4427|  1.39k|}
archive_read_support_format_rar5.c:rar5_deinit:
 4446|  11.9k|static void rar5_deinit(struct rar5 *rar5) {
 4447|  11.9k|	cdeque_free(&rar5->cstate.filters);
 4448|  11.9k|}
archive_read_support_format_rar5.c:cdeque_free:
  483|  11.9k|static void cdeque_free(struct cdeque* d) {
  484|  11.9k|	if(!d)
  ------------------
  |  Branch (484:5): [True: 0, False: 11.9k]
  ------------------
  485|      0|		return;
  486|       |
  487|  11.9k|	if(!d->arr)
  ------------------
  |  Branch (487:5): [True: 0, False: 11.9k]
  ------------------
  488|      0|		return;
  489|       |
  490|  11.9k|	free(d->arr);
  491|       |
  492|       |	d->arr = NULL;
  493|  11.9k|	d->beg_pos = -1;
  494|  11.9k|	d->end_pos = -1;
  495|  11.9k|	d->cap_mask = 0;
  496|  11.9k|}

archive_read_support_format_raw:
   57|  11.9k|{
   58|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
   59|  11.9k|	struct raw *raw;
   60|  11.9k|	int r;
   61|       |
   62|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
   63|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_raw");
   64|       |
   65|  11.9k|	raw = calloc(1, sizeof(*raw));
   66|  11.9k|	if (raw == NULL) {
  ------------------
  |  Branch (66:6): [True: 0, False: 11.9k]
  ------------------
   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|  11.9k|	r = __archive_read_register_format(a,
   72|  11.9k|	    raw,
   73|  11.9k|	    "raw",
   74|  11.9k|	    archive_read_format_raw_bid,
   75|  11.9k|	    NULL,
   76|  11.9k|	    archive_read_format_raw_read_header,
   77|  11.9k|	    archive_read_format_raw_read_data,
   78|  11.9k|	    archive_read_format_raw_read_data_skip,
   79|  11.9k|	    NULL,
   80|  11.9k|	    archive_read_format_raw_cleanup,
   81|  11.9k|	    NULL,
   82|  11.9k|	    NULL);
   83|       |
   84|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (84:6): [True: 0, False: 11.9k]
  ------------------
   85|      0|		free(raw);
   86|  11.9k|	return (r);
   87|  11.9k|}
archive_read_support_format_raw.c:archive_read_format_raw_bid:
   98|  11.7k|{
   99|  11.7k|	if (best_bid < 1 && __archive_read_ahead(a, 1, NULL) != NULL)
  ------------------
  |  Branch (99:6): [True: 465, False: 11.2k]
  |  Branch (99:22): [True: 375, False: 90]
  ------------------
  100|    375|		return (1);
  101|  11.3k|	return (-1);
  102|  11.7k|}
archive_read_support_format_raw.c:archive_read_format_raw_read_header:
  110|    717|{
  111|    717|	struct raw *raw = a->format->data;
  112|       |
  113|    717|	if (raw->end_of_file)
  ------------------
  |  Branch (113:6): [True: 342, False: 375]
  ------------------
  114|    342|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    342|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  115|       |
  116|    375|	a->archive.archive_format = ARCHIVE_FORMAT_RAW;
  ------------------
  |  |  380|    375|#define	ARCHIVE_FORMAT_RAW			0x90000
  ------------------
  117|    375|	a->archive.archive_format_name = "raw";
  118|    375|	archive_entry_set_pathname(entry, "data");
  119|    375|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|    375|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  120|    375|	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|    375|	return __archive_read_header(a, entry);
  125|    717|}
archive_read_support_format_raw.c:archive_read_format_raw_read_data:
  130|  28.1k|{
  131|  28.1k|	struct raw *raw = a->format->data;
  132|  28.1k|	ssize_t avail;
  133|       |
  134|       |	/* Consume the bytes we read last time. */
  135|  28.1k|	if (raw->unconsumed) {
  ------------------
  |  Branch (135:6): [True: 27.3k, False: 708]
  ------------------
  136|  27.3k|		__archive_read_consume(a, raw->unconsumed);
  137|  27.3k|		raw->unconsumed = 0;
  138|  27.3k|	}
  139|       |
  140|  28.1k|	if (raw->end_of_file)
  ------------------
  |  Branch (140:6): [True: 333, False: 27.7k]
  ------------------
  141|    333|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    333|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  142|       |
  143|       |	/* Get whatever bytes are immediately available. */
  144|  27.7k|	*buff = __archive_read_ahead(a, 1, &avail);
  145|  27.7k|	if (avail > 0) {
  ------------------
  |  Branch (145:6): [True: 27.3k, False: 375]
  ------------------
  146|       |		/* Return the bytes we just read */
  147|  27.3k|		*offset = raw->offset;
  148|  27.3k|		if (archive_ckd_add_i64(&raw->offset, raw->offset, avail)) {
  ------------------
  |  Branch (148:7): [True: 0, False: 27.3k]
  ------------------
  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|  27.3k|		*size = avail;
  156|  27.3k|		raw->unconsumed = avail;
  157|  27.3k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  27.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  158|  27.3k|	} else if (0 == avail) {
  ------------------
  |  Branch (158:13): [True: 342, False: 33]
  ------------------
  159|       |		/* Record and return end-of-file. */
  160|    342|		raw->end_of_file = 1;
  161|    342|		*size = 0;
  162|    342|		*offset = raw->offset;
  163|    342|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    342|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  164|    342|	} else {
  165|       |		/* Record and return an error. */
  166|     33|		*size = 0;
  167|     33|		*offset = raw->offset;
  168|     33|		return ((int)avail);
  169|     33|	}
  170|  27.7k|}
archive_read_support_format_raw.c:archive_read_format_raw_read_data_skip:
  174|    342|{
  175|    342|	struct raw *raw = a->format->data;
  176|       |
  177|       |	/* Consume the bytes we read last time. */
  178|    342|	if (raw->unconsumed) {
  ------------------
  |  Branch (178:6): [True: 0, False: 342]
  ------------------
  179|      0|		__archive_read_consume(a, raw->unconsumed);
  180|      0|		raw->unconsumed = 0;
  181|      0|	}
  182|    342|	raw->end_of_file = 1;
  183|    342|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    342|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  184|    342|}
archive_read_support_format_raw.c:archive_read_format_raw_cleanup:
  188|  11.9k|{
  189|  11.9k|	struct raw *raw = a->format->data;
  190|       |
  191|  11.9k|	free(raw);
  192|  11.9k|	a->format->data = NULL;
  193|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  194|  11.9k|}

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

archive_read_support_format_warc:
  144|  11.9k|{
  145|  11.9k|	struct archive_read *a = (struct archive_read *)_a;
  146|  11.9k|	struct warc *warc;
  147|  11.9k|	int r;
  148|       |
  149|  11.9k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  11.9k|	do { \
  |  |  178|  11.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  11.9k|			(allowed_states), (function_name)); \
  |  |  180|  11.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  11.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |  181|  11.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  11.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 11.9k]
  |  |  ------------------
  ------------------
  150|  11.9k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
  151|       |
  152|  11.9k|	if ((warc = calloc(1, sizeof(*warc))) == NULL) {
  ------------------
  |  Branch (152:6): [True: 0, False: 11.9k]
  ------------------
  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|  11.9k|	r = __archive_read_register_format(a,
  158|  11.9k|	    warc,
  159|  11.9k|	    "warc",
  160|  11.9k|	    archive_read_format_warc_bid,
  161|  11.9k|	    NULL,
  162|  11.9k|	    archive_read_format_warc_read_header,
  163|  11.9k|	    archive_read_format_warc_read_data,
  164|  11.9k|	    archive_read_format_warc_skip,
  165|  11.9k|	    NULL,
  166|  11.9k|	    archive_read_format_warc_cleanup,
  167|  11.9k|	    NULL,
  168|  11.9k|	    NULL);
  169|       |
  170|  11.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (170:6): [True: 0, False: 11.9k]
  ------------------
  171|      0|		free(warc);
  172|  11.9k|	return (r);
  173|  11.9k|}
archive_read_support_format_warc.c:archive_read_format_warc_cleanup:
  177|  11.9k|{
  178|  11.9k|	struct warc *warc = a->format->data;
  179|       |
  180|  11.9k|	if (warc->pool.len > 0U) {
  ------------------
  |  Branch (180:6): [True: 297, False: 11.6k]
  ------------------
  181|    297|		free(warc->pool.str);
  182|    297|	}
  183|  11.9k|	archive_string_free(&warc->sver);
  184|  11.9k|	free(warc);
  185|  11.9k|	a->format->data = NULL;
  186|  11.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  187|  11.9k|}
archive_read_support_format_warc.c:archive_read_format_warc_bid:
  191|  11.7k|{
  192|  11.7k|	const char *hdr;
  193|  11.7k|	ssize_t nrd;
  194|  11.7k|	unsigned int ver;
  195|       |
  196|  11.7k|	(void)best_bid; /* UNUSED */
  197|       |
  198|       |	/* Check the first line, which should already be a record header. */
  199|  11.7k|	if ((hdr = __archive_read_ahead(a, 12, &nrd)) == NULL) {
  ------------------
  |  Branch (199:6): [True: 100, False: 11.6k]
  ------------------
  200|       |		/* Not enough data to identify this format. */
  201|    100|		return -1;
  202|    100|	}
  203|       |
  204|       |	/* Parse the record version number. */
  205|  11.6k|	ver = warc_read_version(hdr, nrd);
  206|  11.6k|	if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (206:6): [True: 11.0k, False: 604]
  |  Branch (206:21): [True: 0, False: 604]
  ------------------
  207|       |		/* Only WARC 0.12 through WARC 1.0 are supported. */
  208|  11.0k|		return -1;
  209|  11.0k|	}
  210|       |
  211|       |	/* WARC magic and version checks passed. */
  212|    604|	return (64);
  213|  11.6k|}
archive_read_support_format_warc.c:warc_read_version:
  640|  26.7k|{
  641|  26.7k|	static const char magic[] = "WARC/";
  642|  26.7k|	const char *c;
  643|  26.7k|	unsigned int ver = 0U;
  644|  26.7k|	unsigned int end = 0U;
  645|       |
  646|  26.7k|	if (bsz < 12 || memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
  ------------------
  |  Branch (646:6): [True: 4, False: 26.7k]
  |  Branch (646:18): [True: 11.0k, False: 15.6k]
  ------------------
  647|       |		/* Buffer too small or invalid magic. */
  648|  11.0k|		return ver;
  649|  11.0k|	}
  650|       |	/* Parse the version number. */
  651|  15.6k|	buf += sizeof(magic) - 1U;
  652|       |
  653|  15.6k|	if (warc_isdigit(buf[0]) && buf[1] == '.' && warc_isdigit(buf[2])) {
  ------------------
  |  Branch (653:6): [True: 15.6k, False: 3]
  |  Branch (653:30): [True: 15.6k, False: 7]
  |  Branch (653:47): [True: 15.6k, False: 0]
  ------------------
  654|       |		/* Support at most two digits in the minor version. */
  655|  15.6k|		if (warc_isdigit(buf[3]))
  ------------------
  |  Branch (655:7): [True: 374, False: 15.3k]
  ------------------
  656|    374|			end = 1U;
  657|       |		/* Set up the major version. */
  658|  15.6k|		ver = (buf[0U] - '0') * 10000U;
  659|       |		/* Set up the minor version. */
  660|  15.6k|		if (end == 1U) {
  ------------------
  |  Branch (660:7): [True: 374, False: 15.3k]
  ------------------
  661|    374|			ver += (buf[2U] - '0') * 1000U;
  662|    374|			ver += (buf[3U] - '0') * 100U;
  663|    374|		} else
  664|  15.3k|			ver += (buf[2U] - '0') * 100U;
  665|       |		/*
  666|       |		 * WARC versions before 0.12 use a space-separated header.
  667|       |		 * WARC 0.12 and later terminate the version with CRLF.
  668|       |		 */
  669|  15.6k|		c = buf + 3U + end;
  670|  15.6k|		if (ver >= 1200U) {
  ------------------
  |  Branch (670:7): [True: 15.6k, False: 1]
  ------------------
  671|  15.6k|			if (memcmp(c, "\r\n", 2U) != 0)
  ------------------
  |  Branch (671:8): [True: 7, False: 15.6k]
  ------------------
  672|      7|				ver = 0U;
  673|  15.6k|		} else {
  674|       |			/* Version is below WARC 0.12. */
  675|      1|			if (*c != ' ' && *c != '\t')
  ------------------
  |  Branch (675:8): [True: 1, False: 0]
  |  Branch (675:21): [True: 1, False: 0]
  ------------------
  676|      1|				ver = 0U;
  677|      1|		}
  678|  15.6k|	}
  679|  15.6k|	return ver;
  680|  26.7k|}
archive_read_support_format_warc.c:warc_isdigit:
  634|  47.0k|{
  635|  47.0k|	return c >= '0' && c <= '9';
  ------------------
  |  Branch (635:9): [True: 31.7k, False: 15.3k]
  |  Branch (635:21): [True: 31.7k, False: 6]
  ------------------
  636|  47.0k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_header:
  218|  7.78k|{
  219|  7.78k|#define HDR_PROBE_LEN		(12U)
  220|  7.78k|	struct warc *warc = a->format->data;
  221|  7.78k|	unsigned int ver;
  222|  7.78k|	const char *buf;
  223|  7.78k|	ssize_t nrd;
  224|  7.78k|	const char *eoh;
  225|  7.78k|	char *tmp;
  226|       |	/* Reuse the header buffer while parsing the file name. */
  227|  7.78k|	warc_string_t fnam;
  228|       |	/* WARC record type */
  229|  7.78k|	warc_type_t ftyp;
  230|       |	/* Content length, or a negative error indicator */
  231|  7.78k|	int64_t cntlen;
  232|       |	/* WARC-Date is exposed as the entry ctime. */
  233|  7.78k|	time_t rtime;
  234|       |	/* A Last-Modified record header is exposed as the entry mtime. */
  235|  7.78k|	time_t mtime;
  236|       |
  237|  15.4k|start_over:
  238|       |	/* Use read_ahead(); it already tracks unconsumed bytes, so this
  239|       |	 * reader does not need a separate shift buffer. */
  240|  15.4k|	buf = __archive_read_ahead(a, HDR_PROBE_LEN, &nrd);
  ------------------
  |  |  219|  15.4k|#define HDR_PROBE_LEN		(12U)
  ------------------
  241|       |
  242|  15.4k|	if (nrd < 0) {
  ------------------
  |  Branch (242:6): [True: 0, False: 15.4k]
  ------------------
  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|  15.4k|	} else if (buf == NULL) {
  ------------------
  |  Branch (248:13): [True: 45, False: 15.3k]
  ------------------
  249|       |		/* there should be room for at least WARC/bla\r\n
  250|       |		 * must be EOF therefore */
  251|     45|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     45|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  252|     45|	}
  253|       |	/* Locate the end of the record header. */
  254|  15.3k|	eoh = warc_find_eoh(buf, nrd);
  255|  15.3k|	if (eoh == NULL) {
  ------------------
  |  Branch (255:6): [True: 283, False: 15.1k]
  ------------------
  256|       |		/* The header terminator was not found in the probed data. */
  257|    283|		archive_set_error(
  258|    283|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    283|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  259|    283|			"Bad record header");
  260|    283|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    283|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  261|    283|	}
  262|  15.1k|	ver = warc_read_version(buf, eoh - buf);
  263|       |	/* Only WARC 0.12 through WARC 1.0 are supported. */
  264|  15.1k|	if (ver == 0U) {
  ------------------
  |  Branch (264:6): [True: 37, False: 15.0k]
  ------------------
  265|     37|		archive_set_error(
  266|     37|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     37|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  267|     37|			"Invalid record version");
  268|     37|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     37|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  269|  15.0k|	} else if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (269:13): [True: 0, False: 15.0k]
  |  Branch (269:28): [True: 3, False: 15.0k]
  ------------------
  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|  15.0k|	cntlen = warc_read_length(buf, eoh - buf);
  277|  15.0k|	if (cntlen < 0) {
  ------------------
  |  Branch (277:6): [True: 36, False: 15.0k]
  ------------------
  278|       |		/* This reader requires Content-Length before processing a record. */
  279|     36|		archive_set_error(
  280|     36|			&a->archive, EINVAL,
  281|     36|			"Bad content length");
  282|     36|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  283|     36|	}
  284|  15.0k|	rtime = warc_read_date(buf, eoh - buf);
  285|  15.0k|	if (rtime == (time_t)-1) {
  ------------------
  |  Branch (285:6): [True: 110, False: 14.9k]
  ------------------
  286|       |		/* This reader requires WARC-Date before processing a record. */
  287|    110|		archive_set_error(
  288|    110|			&a->archive, EINVAL,
  289|    110|			"Bad record time");
  290|    110|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    110|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  291|    110|	}
  292|       |
  293|       |	/* Report this archive as WARC. */
  294|  14.9k|	a->archive.archive_format = ARCHIVE_FORMAT_WARC;
  ------------------
  |  |  386|  14.9k|#define	ARCHIVE_FORMAT_WARC			0xF0000
  ------------------
  295|  14.9k|	if (ver != warc->pver) {
  ------------------
  |  Branch (295:6): [True: 1.25k, False: 13.6k]
  ------------------
  296|       |		/* Format this entry's WARC version. */
  297|  1.25k|		archive_string_sprintf(&warc->sver,
  298|  1.25k|			"WARC/%u.%u", ver / 10000, (ver % 10000) / 100);
  299|       |		/* Remember the version for later entries. */
  300|  1.25k|		warc->pver = ver;
  301|  1.25k|	}
  302|       |	/* Parse the record type. */
  303|  14.9k|	ftyp = warc_read_type(buf, eoh - buf);
  304|       |	/* Save content state for subsequent read calls. */
  305|  14.9k|	warc->cntlen = cntlen;
  306|  14.9k|	warc->cntoff = 0;
  307|  14.9k|	mtime = 0;/* Avoid compiler warnings on some platforms. */
  308|       |
  309|  14.9k|	switch (ftyp) {
  310|    739|	case WT_RSRC:
  ------------------
  |  Branch (310:2): [True: 739, False: 14.1k]
  ------------------
  311|  10.1k|	case WT_RSP:
  ------------------
  |  Branch (311:2): [True: 9.38k, False: 5.52k]
  ------------------
  312|       |		/* Read the filename only for record types that are expected to
  313|       |		 * have a target URI. */
  314|  10.1k|		fnam = warc_read_uri(buf, eoh - buf);
  315|       |		/* Avoid creating directory endpoints as files. */
  316|  10.1k|		if (fnam.len == 0 || fnam.str[fnam.len - 1] == '/') {
  ------------------
  |  Branch (316:7): [True: 2.82k, False: 7.30k]
  |  Branch (316:24): [True: 82, False: 7.22k]
  ------------------
  317|       |			/* Skip this record. */
  318|  2.90k|			fnam.len = 0U;
  319|  2.90k|			fnam.str = NULL;
  320|  2.90k|			break;
  321|  2.90k|		}
  322|       |		/* Copy the name into the reusable string pool to avoid a malloc/free
  323|       |		 * roundtrip for each entry. */
  324|  7.22k|		if (fnam.len + 1U > warc->pool.len) {
  ------------------
  |  Branch (324:7): [True: 313, False: 6.90k]
  ------------------
  325|    313|			warc->pool.len = ((fnam.len + 64U) / 64U) * 64U;
  326|    313|			tmp = realloc(warc->pool.str, warc->pool.len);
  327|    313|			if (tmp == NULL) {
  ------------------
  |  Branch (327:8): [True: 0, False: 313]
  ------------------
  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|    313|			warc->pool.str = tmp;
  334|    313|		}
  335|  7.22k|		memcpy(warc->pool.str, fnam.str, fnam.len);
  336|  7.22k|		warc->pool.str[fnam.len] = '\0';
  337|       |		/* Hide the pool implementation behind the parsed string. */
  338|  7.22k|		fnam.str = warc->pool.str;
  339|       |
  340|       |		/* Use a Last-Modified record header when present; otherwise fall back
  341|       |		 * to WARC-Date. */
  342|  7.22k|		if ((mtime = warc_read_last_modified(buf, eoh - buf)) == (time_t)-1) {
  ------------------
  |  Branch (342:7): [True: 7.12k, False: 92]
  ------------------
  343|  7.12k|			mtime = rtime;
  344|  7.12k|		}
  345|  7.22k|		break;
  346|  4.79k|	case WT_NONE:
  ------------------
  |  Branch (346:2): [True: 4.79k, False: 10.1k]
  ------------------
  347|  4.79k|	case WT_INFO:
  ------------------
  |  Branch (347:2): [True: 0, False: 14.9k]
  ------------------
  348|  4.79k|	case WT_META:
  ------------------
  |  Branch (348:2): [True: 0, False: 14.9k]
  ------------------
  349|  4.79k|	case WT_REQ:
  ------------------
  |  Branch (349:2): [True: 0, False: 14.9k]
  ------------------
  350|  4.79k|	case WT_RVIS:
  ------------------
  |  Branch (350:2): [True: 0, False: 14.9k]
  ------------------
  351|  4.79k|	case WT_CONV:
  ------------------
  |  Branch (351:2): [True: 0, False: 14.9k]
  ------------------
  352|  4.79k|	case WT_CONT:
  ------------------
  |  Branch (352:2): [True: 0, False: 14.9k]
  ------------------
  353|  4.79k|	case LAST_WT:
  ------------------
  |  Branch (353:2): [True: 0, False: 14.9k]
  ------------------
  354|  4.79k|	default:
  ------------------
  |  Branch (354:2): [True: 0, False: 14.9k]
  ------------------
  355|  4.79k|		fnam.len = 0U;
  356|  4.79k|		fnam.str = NULL;
  357|  4.79k|		break;
  358|  14.9k|	}
  359|       |
  360|       |	/* Consume the record header. */
  361|  14.9k|	__archive_read_consume(a, eoh - buf);
  362|       |
  363|  14.9k|	switch (ftyp) {
  364|    739|	case WT_RSRC:
  ------------------
  |  Branch (364:2): [True: 739, False: 14.1k]
  ------------------
  365|  10.1k|	case WT_RSP:
  ------------------
  |  Branch (365:2): [True: 9.38k, False: 5.52k]
  ------------------
  366|  10.1k|		if (fnam.len > 0U) {
  ------------------
  |  Branch (366:7): [True: 7.22k, False: 2.90k]
  ------------------
  367|       |			/* Populate the entry object. */
  368|  7.22k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  7.22k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  369|  7.22k|			archive_entry_copy_pathname(entry, fnam.str);
  370|  7.22k|			archive_entry_set_size(entry, cntlen);
  371|  7.22k|			archive_entry_set_perm(entry, 0644);
  372|       |			/* WARC-Date becomes ctime; mtime comes from Last-Modified or WARC-Date. */
  373|  7.22k|			archive_entry_set_ctime(entry, rtime, 0L);
  374|  7.22k|			archive_entry_set_mtime(entry, mtime, 0L);
  375|  7.22k|			break;
  376|  7.22k|		}
  377|       |		/* FALLTHROUGH */
  378|  7.69k|	case WT_NONE:
  ------------------
  |  Branch (378:2): [True: 4.79k, False: 10.1k]
  ------------------
  379|  7.69k|	case WT_INFO:
  ------------------
  |  Branch (379:2): [True: 0, False: 14.9k]
  ------------------
  380|  7.69k|	case WT_META:
  ------------------
  |  Branch (380:2): [True: 0, False: 14.9k]
  ------------------
  381|  7.69k|	case WT_REQ:
  ------------------
  |  Branch (381:2): [True: 0, False: 14.9k]
  ------------------
  382|  7.69k|	case WT_RVIS:
  ------------------
  |  Branch (382:2): [True: 0, False: 14.9k]
  ------------------
  383|  7.69k|	case WT_CONV:
  ------------------
  |  Branch (383:2): [True: 0, False: 14.9k]
  ------------------
  384|  7.69k|	case WT_CONT:
  ------------------
  |  Branch (384:2): [True: 0, False: 14.9k]
  ------------------
  385|  7.69k|	case LAST_WT:
  ------------------
  |  Branch (385:2): [True: 0, False: 14.9k]
  ------------------
  386|  7.69k|	default:
  ------------------
  |  Branch (386:2): [True: 0, False: 14.9k]
  ------------------
  387|       |		/* Skip this record body and look for the next one. */
  388|  7.69k|		if (archive_read_format_warc_skip(a) < 0)
  ------------------
  |  Branch (388:7): [True: 48, False: 7.64k]
  ------------------
  389|     48|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     48|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  390|  7.64k|		goto start_over;
  391|  14.9k|	}
  392|  7.22k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  393|  14.9k|}
archive_read_support_format_warc.c:warc_find_eoh:
  865|  15.3k|{
  866|  15.3k|	static const char _marker[] = "\r\n\r\n";
  867|  15.3k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  868|       |
  869|  15.3k|	if (hit != NULL) {
  ------------------
  |  Branch (869:6): [True: 15.1k, False: 283]
  ------------------
  870|  15.1k|		hit += sizeof(_marker) - 1U;
  871|  15.1k|	}
  872|  15.3k|	return hit;
  873|  15.3k|}
archive_read_support_format_warc.c:xmemmem:
  468|   144k|{
  469|   144k|	const char *const eoh = hay + haysize;
  470|   144k|	const char *const eon = needle + needlesize;
  471|   144k|	const char *hp;
  472|   144k|	const char *np;
  473|   144k|	const char *cand;
  474|   144k|	unsigned int hsum;
  475|   144k|	unsigned int nsum;
  476|   144k|	unsigned int eqp;
  477|       |
  478|       |	/* Handle trivial cases first.  A zero-sized needle is defined to be
  479|       |	 * found anywhere in the haystack; otherwise find the first candidate
  480|       |	 * that begins with *NEEDLE. */
  481|   144k|	if (needlesize == 0UL) {
  ------------------
  |  Branch (481:6): [True: 0, False: 144k]
  ------------------
  482|      0|		return deconst(hay);
  483|   144k|	} else if ((hay = memchr(hay, *needle, haysize)) == NULL) {
  ------------------
  |  Branch (483:13): [True: 125, False: 144k]
  ------------------
  484|       |		/* No candidate match remains. */
  485|    125|		return NULL;
  486|    125|	}
  487|       |
  488|       |	/* The first characters of haystack and needle already match, and both
  489|       |	 * strings are at least one character long.  Compute the rolling XOR
  490|       |	 * values for the needle and the first NEEDLESIZE characters of haystack. */
  491|   144k|	for (hp = hay + 1U, np = needle + 1U, hsum = *hay, nsum = *hay, eqp = 1U;
  492|  1.11M|	     hp < eoh && np < eon;
  ------------------
  |  Branch (492:7): [True: 1.11M, False: 243]
  |  Branch (492:19): [True: 973k, False: 144k]
  ------------------
  493|   973k|	     hsum ^= *hp, nsum ^= *np, eqp &= *hp == *np, hp++, np++);
  494|       |
  495|       |	/* HP now references the (NEEDLESIZE + 1)-th character. */
  496|   144k|	if (np < eon) {
  ------------------
  |  Branch (496:6): [True: 226, False: 144k]
  ------------------
  497|       |		/* The haystack is smaller than the needle. */
  498|    226|		return NULL;
  499|   144k|	} else if (eqp) {
  ------------------
  |  Branch (499:13): [True: 72.8k, False: 71.5k]
  ------------------
  500|       |		/* Found a match. */
  501|  72.8k|		return deconst(hay);
  502|  72.8k|	}
  503|       |
  504|       |	/* Loop through the rest of the haystack and update the rolling XOR
  505|       |	 * iteratively. */
  506|  22.2M|	for (cand = hay; hp < eoh; hp++) {
  ------------------
  |  Branch (506:19): [True: 22.2M, False: 5.70k]
  ------------------
  507|  22.2M|		hsum ^= *cand++;
  508|  22.2M|		hsum ^= *hp;
  509|       |
  510|       |		/* When the rolling XOR values match, it is enough to check
  511|       |		 * NEEDLESIZE - 1 characters for equality.  CAND is always before
  512|       |		 * HP by design, so no range check is needed. */
  513|  22.2M|		if (hsum == nsum && memcmp(cand, needle, needlesize - 1U) == 0) {
  ------------------
  |  Branch (513:7): [True: 1.74M, False: 20.5M]
  |  Branch (513:23): [True: 65.8k, False: 1.67M]
  ------------------
  514|  65.8k|			return deconst(cand);
  515|  65.8k|		}
  516|  22.2M|	}
  517|  5.70k|	return NULL;
  518|  71.5k|}
archive_read_support_format_warc.c:deconst:
  461|   158k|{
  462|   158k|	return (void *)(uintptr_t)c;
  463|   158k|}
archive_read_support_format_warc.c:warc_read_length:
  770|  15.0k|{
  771|  15.0k|	static const char _key[] = "\r\nContent-Length:";
  772|  15.0k|	const char *val, *eol, *p;
  773|  15.0k|	int64_t len;
  774|       |
  775|  15.0k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (775:6): [True: 21, False: 15.0k]
  ------------------
  776|       |		/* Header field is absent. */
  777|     21|		return -1;
  778|     21|	}
  779|  15.0k|	val += sizeof(_key) - 1U;
  780|       |
  781|  15.0k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (781:6): [True: 0, False: 15.0k]
  ------------------
  782|       |		/* Malformed field with no end of line. */
  783|      0|		return -1;
  784|      0|	}
  785|       |
  786|       |	/* Skip leading whitespace. */
  787|  17.7k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (787:9): [True: 17.7k, False: 0]
  |  Branch (787:23): [True: 2.37k, False: 15.3k]
  |  Branch (787:38): [True: 330, False: 15.0k]
  ------------------
  788|  2.70k|		val++;
  789|       |
  790|       |	/* Require at least one digit. */
  791|  15.0k|	if (val >= eol || *val < '0' || *val > '9')
  ------------------
  |  Branch (791:6): [True: 0, False: 15.0k]
  |  Branch (791:20): [True: 4, False: 15.0k]
  |  Branch (791:34): [True: 3, False: 15.0k]
  ------------------
  792|      7|		return -1;
  793|       |
  794|  15.0k|	len = 0;
  795|  43.2k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (795:16): [True: 28.2k, False: 15.0k]
  ------------------
  796|  28.2k|		int64_t digit;
  797|       |
  798|  28.2k|		if (*p < '0' || *p > '9')
  ------------------
  |  Branch (798:7): [True: 4, False: 28.2k]
  |  Branch (798:19): [True: 2, False: 28.2k]
  ------------------
  799|      6|			return -1;
  800|  28.2k|		digit = *p - '0';
  801|  28.2k|		if (archive_ckd_mul_i64(&len, len, 10) ||
  ------------------
  |  Branch (801:7): [True: 1, False: 28.2k]
  ------------------
  802|  28.2k|		    archive_ckd_add_i64(&len, len, digit))
  ------------------
  |  Branch (802:7): [True: 1, False: 28.2k]
  ------------------
  803|      2|			return -1;
  804|  28.2k|	}
  805|       |
  806|  15.0k|	return len;
  807|  15.0k|}
archive_read_support_format_warc.c:warc_find_eol:
  877|  57.3k|{
  878|  57.3k|	static const char _marker[] = "\r\n";
  879|  57.3k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  880|       |
  881|  57.3k|	return hit;
  882|  57.3k|}
archive_read_support_format_warc.c:warc_read_date:
  811|  15.0k|{
  812|  15.0k|	static const char _key[] = "\r\nWARC-Date:";
  813|  15.0k|	const char *val, *eol;
  814|  15.0k|	char *on = NULL;
  815|  15.0k|	time_t res;
  816|       |
  817|  15.0k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (817:6): [True: 28, False: 14.9k]
  ------------------
  818|       |		/* Header field is absent. */
  819|     28|		return (time_t)-1;
  820|     28|	}
  821|  14.9k|	val += sizeof(_key) - 1U;
  822|  14.9k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (822:6): [True: 0, False: 14.9k]
  ------------------
  823|       |		/* Header field has no end of line. */
  824|      0|		return -1;
  825|      0|	}
  826|       |
  827|       |	/* xstrpisotime() skips leading whitespace. */
  828|  14.9k|	res = xstrpisotime(val, &on);
  829|  14.9k|	if (on != eol) {
  ------------------
  |  Branch (829:6): [True: 79, False: 14.9k]
  ------------------
  830|       |		/* The field must end here. */
  831|     79|		return -1;
  832|     79|	}
  833|  14.9k|	return res;
  834|  14.9k|}
archive_read_support_format_warc.c:xstrpisotime:
  580|  20.1k|{
  581|       |/* Like strptime(), but only for ISO 8601 Zulu strings. */
  582|  20.1k|	struct tm tm;
  583|  20.1k|	time_t res = (time_t)-1;
  584|       |
  585|       |	/* Clear the tm structure. */
  586|  20.1k|	memset(&tm, 0, sizeof(tm));
  587|       |
  588|       |	/* This is a non-standard routine, so skip leading whitespace for
  589|       |	 * caller convenience. */
  590|  40.8k|	while (*s == ' ' || *s == '\t')
  ------------------
  |  Branch (590:9): [True: 332, False: 40.5k]
  |  Branch (590:22): [True: 20.4k, False: 20.1k]
  ------------------
  591|  20.7k|		++s;
  592|       |
  593|       |	/* Read the year. */
  594|  20.1k|	if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (594:6): [True: 539, False: 19.6k]
  |  Branch (594:58): [True: 95, False: 19.5k]
  ------------------
  595|    634|		goto out;
  596|    634|	}
  597|       |	/* Read the month. */
  598|  19.5k|	if ((tm.tm_mon = strtoi_lim(s, &s, 1, 12)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (598:6): [True: 456, False: 19.0k]
  |  Branch (598:52): [True: 93, False: 18.9k]
  ------------------
  599|    549|		goto out;
  600|    549|	}
  601|       |	/* Read the day of the month. */
  602|  18.9k|	if ((tm.tm_mday = strtoi_lim(s, &s, 1, 31)) < 0 || *s++ != 'T') {
  ------------------
  |  Branch (602:6): [True: 920, False: 18.0k]
  |  Branch (602:53): [True: 556, False: 17.4k]
  ------------------
  603|  1.47k|		goto out;
  604|  1.47k|	}
  605|       |	/* Read the hour. */
  606|  17.4k|	if ((tm.tm_hour = strtoi_lim(s, &s, 0, 23)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (606:6): [True: 825, False: 16.6k]
  |  Branch (606:53): [True: 430, False: 16.2k]
  ------------------
  607|  1.25k|		goto out;
  608|  1.25k|	}
  609|       |	/* Read the minute. */
  610|  16.2k|	if ((tm.tm_min = strtoi_lim(s, &s, 0, 59)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (610:6): [True: 649, False: 15.5k]
  |  Branch (610:52): [True: 188, False: 15.3k]
  ------------------
  611|    837|		goto out;
  612|    837|	}
  613|       |	/* Read the second. */
  614|  15.3k|	if ((tm.tm_sec = strtoi_lim(s, &s, 0, 60)) < 0 || *s++ != 'Z') {
  ------------------
  |  Branch (614:6): [True: 140, False: 15.2k]
  |  Branch (614:52): [True: 241, False: 15.0k]
  ------------------
  615|    381|		goto out;
  616|    381|	}
  617|       |
  618|       |	/* Adjust tm fields to satisfy POSIX constraints. */
  619|  15.0k|	tm.tm_year -= 1900;
  620|  15.0k|	tm.tm_mon--;
  621|       |
  622|       |	/* Convert the tm structure to a Unix timestamp in UTC. */
  623|  15.0k|	res = time_from_tm(&tm);
  624|       |
  625|  20.1k|out:
  626|  20.1k|	if (endptr != NULL) {
  ------------------
  |  Branch (626:6): [True: 20.1k, False: 0]
  ------------------
  627|  20.1k|		*endptr = deconst(s);
  628|  20.1k|	}
  629|  20.1k|	return res;
  630|  15.0k|}
archive_read_support_format_warc.c:strtoi_lim:
  522|   107k|{
  523|   107k|	int res = 0;
  524|   107k|	const char *sp;
  525|       |	/* Track the number of digits with rulim. */
  526|   107k|	int rulim;
  527|       |
  528|   107k|	for (sp = str, rulim = ulim > 10 ? ulim : 10;
  ------------------
  |  Branch (528:25): [True: 107k, False: 0]
  ------------------
  529|   288k|	     res * 10 <= ulim && rulim && *sp >= '0' && *sp <= '9';
  ------------------
  |  Branch (529:7): [True: 218k, False: 69.4k]
  |  Branch (529:27): [True: 217k, False: 1.04k]
  |  Branch (529:36): [True: 215k, False: 2.06k]
  |  Branch (529:50): [True: 180k, False: 35.1k]
  ------------------
  530|   180k|	     sp++, rulim /= 10) {
  531|   180k|		res *= 10;
  532|   180k|		res += *sp - '0';
  533|   180k|	}
  534|   107k|	if (sp == str) {
  ------------------
  |  Branch (534:6): [True: 2.58k, False: 105k]
  ------------------
  535|  2.58k|		res = -1;
  536|   105k|	} else if (res < llim || res > ulim) {
  ------------------
  |  Branch (536:13): [True: 477, False: 104k]
  |  Branch (536:27): [True: 467, False: 104k]
  ------------------
  537|    944|		res = -2;
  538|    944|	}
  539|   107k|	*ep = (const char*)sp;
  540|   107k|	return res;
  541|   107k|}
archive_read_support_format_warc.c:time_from_tm:
  545|  15.0k|{
  546|       |#if HAVE__MKGMTIME
  547|       |        return _mkgmtime(t);
  548|       |#elif HAVE_TIMEGM
  549|       |        /* Use platform timegm() if available. */
  550|  15.0k|        return (timegm(t));
  551|       |#else
  552|       |        int64_t days, result;
  553|       |
  554|       |        /* Otherwise, calculate directly using POSIX assumptions. */
  555|       |        /* First, fix up tm_yday based on the year, month, and day. */
  556|       |        if (mktime(t) == (time_t)-1)
  557|       |                return ((time_t)-1);
  558|       |        /* Then compute timegm() from first principles. */
  559|       |        days = (int64_t)t->tm_yday
  560|       |            + ((int64_t)t->tm_year - 70) * 365
  561|       |            + ((int64_t)t->tm_year - 69) / 4
  562|       |            - ((int64_t)t->tm_year - 1) / 100
  563|       |            + ((int64_t)t->tm_year + 299) / 400;
  564|       |        if (archive_ckd_mul_i64(&result, days, 86400) ||
  565|       |            archive_ckd_add_i64(&result, result,
  566|       |                (int64_t)t->tm_hour * 3600 + t->tm_min * 60
  567|       |                + t->tm_sec))
  568|       |                return ((time_t)-1);
  569|       |        if (result < 0) {
  570|       |                if (TIME_MIN == 0 || result < (int64_t)TIME_MIN)
  571|       |                        return ((time_t)-1);
  572|       |        } else if ((uint64_t)result > (uint64_t)TIME_MAX)
  573|       |                return ((time_t)-1);
  574|       |        return ((time_t)result);
  575|       |#endif
  576|  15.0k|}
archive_read_support_format_warc.c:warc_read_type:
  684|  14.9k|{
  685|  14.9k|	static const char _key[] = "\r\nWARC-Type:";
  686|  14.9k|	const char *val, *eol;
  687|       |
  688|  14.9k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (688:6): [True: 2.38k, False: 12.5k]
  ------------------
  689|       |		/* Header field is absent. */
  690|  2.38k|		return WT_NONE;
  691|  2.38k|	}
  692|  12.5k|	val += sizeof(_key) - 1U;
  693|  12.5k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (693:6): [True: 0, False: 12.5k]
  ------------------
  694|       |		/* Header field has no end of line. */
  695|      0|		return WT_NONE;
  696|      0|	}
  697|       |
  698|       |	/* Skip leading whitespace. */
  699|  25.8k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (699:9): [True: 25.6k, False: 240]
  |  Branch (699:23): [True: 12.4k, False: 13.1k]
  |  Branch (699:38): [True: 887, False: 12.2k]
  ------------------
  700|  13.3k|		++val;
  701|       |
  702|  12.5k|	if (val + 8U == eol) {
  ------------------
  |  Branch (702:6): [True: 10.9k, False: 1.56k]
  ------------------
  703|  10.9k|		if (memcmp(val, "resource", 8U) == 0)
  ------------------
  |  Branch (703:7): [True: 739, False: 10.2k]
  ------------------
  704|    739|			return WT_RSRC;
  705|  10.2k|		else if (memcmp(val, "response", 8U) == 0)
  ------------------
  |  Branch (705:12): [True: 9.38k, False: 848]
  ------------------
  706|  9.38k|			return WT_RSP;
  707|  10.9k|	}
  708|  2.41k|	return WT_NONE;
  709|  12.5k|}
archive_read_support_format_warc.c:warc_read_uri:
  713|  10.1k|{
  714|  10.1k|	static const char _key[] = "\r\nWARC-Target-URI:";
  715|  10.1k|	const char *val, *uri, *eol, *p;
  716|  10.1k|	warc_string_t res = {0U, NULL};
  717|       |
  718|  10.1k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (718:6): [True: 473, False: 9.65k]
  ------------------
  719|       |		/* Header field is absent. */
  720|    473|		return res;
  721|    473|	}
  722|       |	/* Skip leading whitespace. */
  723|  9.65k|	val += sizeof(_key) - 1U;
  724|  9.65k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (724:6): [True: 0, False: 9.65k]
  ------------------
  725|       |		/* Header field has no end of line. */
  726|      0|		return res;
  727|      0|	}
  728|       |
  729|  10.2k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (729:9): [True: 10.1k, False: 73]
  |  Branch (729:23): [True: 401, False: 9.75k]
  |  Branch (729:38): [True: 170, False: 9.58k]
  ------------------
  730|    571|		++val;
  731|       |
  732|       |	/* Locate the :// separator. */
  733|  9.65k|	if ((uri = xmemmem(val, eol - val, "://", 3U)) == NULL) {
  ------------------
  |  Branch (733:6): [True: 797, False: 8.85k]
  ------------------
  734|       |		/* Ignore values without a :// separator. */
  735|    797|		return res;
  736|    797|	}
  737|       |
  738|       |	/* Spaces inside a URI are not allowed; CRLF should follow. */
  739|   260k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (739:16): [True: 252k, False: 8.43k]
  ------------------
  740|   252k|		if (isspace((unsigned char)*p))
  ------------------
  |  Branch (740:7): [True: 422, False: 251k]
  ------------------
  741|    422|			return res;
  742|   252k|	}
  743|       |
  744|       |	/* Require enough room for the shortest supported scheme. */
  745|  8.43k|	if (uri < (val + 3U))
  ------------------
  |  Branch (745:6): [True: 541, False: 7.89k]
  ------------------
  746|    541|		return res;
  747|       |
  748|       |	/* Move uri past the :// separator. */
  749|  7.89k|	uri += 3U;
  750|       |
  751|       |	/* Inspect the scheme prefix. */
  752|  7.89k|	if (memcmp(val, "file", 4U) == 0) {
  ------------------
  |  Branch (752:6): [True: 5.52k, False: 2.36k]
  ------------------
  753|       |		/* Keep file:// paths as-is. */
  754|       |
  755|  5.52k|	} else if (memcmp(val, "http", 4U) == 0 ||
  ------------------
  |  Branch (755:13): [True: 1.66k, False: 699]
  ------------------
  756|  2.20k|		   memcmp(val, "ftp", 3U) == 0) {
  ------------------
  |  Branch (756:6): [True: 537, False: 162]
  ------------------
  757|       |		/* Skip the domain and the first slash. */
  758|  12.4k|		while (uri < eol && *uri++ != '/');
  ------------------
  |  Branch (758:10): [True: 12.0k, False: 428]
  |  Branch (758:23): [True: 10.2k, False: 1.77k]
  ------------------
  759|  2.20k|	} else {
  760|       |		/* Unsupported URI scheme. */
  761|    162|		return res;
  762|    162|	}
  763|  7.73k|	res.str = uri;
  764|  7.73k|	res.len = eol - uri;
  765|  7.73k|	return res;
  766|  7.89k|}
archive_read_support_format_warc.c:warc_read_last_modified:
  838|  7.22k|{
  839|  7.22k|	static const char _key[] = "\r\nLast-Modified:";
  840|  7.22k|	const char *val, *eol;
  841|  7.22k|	char *on = NULL;
  842|  7.22k|	time_t res;
  843|       |
  844|  7.22k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (844:6): [True: 2.07k, False: 5.14k]
  ------------------
  845|       |		/* Header field is absent. */
  846|  2.07k|		return (time_t)-1;
  847|  2.07k|	}
  848|  5.14k|	val += sizeof(_key) - 1U;
  849|  5.14k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (849:6): [True: 0, False: 5.14k]
  ------------------
  850|       |		/* Header field has no end of line. */
  851|      0|		return -1;
  852|      0|	}
  853|       |
  854|       |	/* xstrpisotime() skips leading whitespace. */
  855|  5.14k|	res = xstrpisotime(val, &on);
  856|  5.14k|	if (on != eol) {
  ------------------
  |  Branch (856:6): [True: 4.95k, False: 190]
  ------------------
  857|       |		/* The field must end here. */
  858|  4.95k|		return -1;
  859|  4.95k|	}
  860|    190|	return res;
  861|  5.14k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_data:
  398|  21.6k|{
  399|  21.6k|	struct warc *warc = a->format->data;
  400|  21.6k|	const char *rab;
  401|  21.6k|	ssize_t nrd;
  402|       |
  403|  21.6k|	if (warc->unconsumed) {
  ------------------
  |  Branch (403:6): [True: 7.21k, False: 14.4k]
  ------------------
  404|  7.21k|		__archive_read_consume(a, warc->unconsumed);
  405|  7.21k|		warc->unconsumed = 0;
  406|  7.21k|	}
  407|       |
  408|  21.6k|	if (warc->cntoff >= warc->cntlen) {
  ------------------
  |  Branch (408:6): [True: 14.3k, False: 7.25k]
  ------------------
  409|       |		/* No data is available to return for this entry. */
  410|  14.3k|		*buf = NULL;
  411|  14.3k|		*bsz = 0U;
  412|  14.3k|		*off = warc->cntoff;
  413|  14.3k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  14.3k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  414|  14.3k|	}
  415|       |
  416|  7.25k|	rab = __archive_read_ahead(a, 1U, &nrd);
  417|  7.25k|	if (nrd < 0) {
  ------------------
  |  Branch (417:6): [True: 0, False: 7.25k]
  ------------------
  418|      0|		*bsz = 0U;
  419|       |		/* Propagate the read error. */
  420|      0|		return (int)nrd;
  421|  7.25k|	} else if (nrd == 0) {
  ------------------
  |  Branch (421:13): [True: 40, False: 7.21k]
  ------------------
  422|     40|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     40|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  423|     40|		    "Truncated WARC file data");
  424|     40|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     40|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  425|  7.21k|	} else if ((int64_t)nrd > warc->cntlen - warc->cntoff) {
  ------------------
  |  Branch (425:13): [True: 7.18k, False: 33]
  ------------------
  426|       |		/* Clamp reads to Content-Length. */
  427|  7.18k|		nrd = warc->cntlen - warc->cntoff;
  428|  7.18k|	}
  429|  7.21k|	*off = warc->cntoff;
  430|  7.21k|	*bsz = nrd;
  431|  7.21k|	*buf = rab;
  432|       |
  433|  7.21k|	warc->cntoff += nrd;
  434|  7.21k|	warc->unconsumed = nrd;
  435|  7.21k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  436|  7.25k|}
archive_read_support_format_warc.c:archive_read_format_warc_skip:
  440|  14.8k|{
  441|  14.8k|	struct warc *warc = a->format->data;
  442|       |
  443|  14.8k|	if (warc->cntoff > warc->cntlen)
  ------------------
  |  Branch (443:6): [True: 0, False: 14.8k]
  ------------------
  444|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  445|  14.8k|	if (warc->unconsumed) {
  ------------------
  |  Branch (445:6): [True: 0, False: 14.8k]
  ------------------
  446|      0|		__archive_read_consume(a, warc->unconsumed);
  447|      0|		warc->unconsumed = 0;
  448|      0|	}
  449|  14.8k|	if (__archive_read_consume(a, warc->cntlen - warc->cntoff) < 0 ||
  ------------------
  |  Branch (449:6): [True: 34, False: 14.8k]
  ------------------
  450|  14.8k|	    __archive_read_consume(a, 4U/*\r\n\r\n separator*/) < 0)
  ------------------
  |  Branch (450:6): [True: 16, False: 14.8k]
  ------------------
  451|     50|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     50|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  452|  14.8k|	warc->cntlen = 0;
  453|  14.8k|	warc->cntoff = 0;
  454|  14.8k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  14.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  455|  14.8k|}

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

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

archive_array_append:
  250|    347|{
  251|    347|	return archive_string_append(as, p, s);
  252|    347|}
archive_string_concat:
  256|    703|{
  257|    703|	if (archive_string_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (257:6): [True: 0, False: 703]
  ------------------
  258|      0|		__archive_errx(1, "Out of memory");
  259|    703|}
archive_wstring_concat:
  264|  11.0k|{
  265|  11.0k|	if (archive_wstring_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (265:6): [True: 0, False: 11.0k]
  ------------------
  266|      0|		__archive_errx(1, "Out of memory");
  267|  11.0k|}
archive_string_free:
  271|  15.2M|{
  272|  15.2M|	as->length = 0;
  273|  15.2M|	as->buffer_length = 0;
  274|  15.2M|	free(as->s);
  275|       |	as->s = NULL;
  276|  15.2M|}
archive_wstring_free:
  280|  4.80M|{
  281|  4.80M|	as->length = 0;
  282|  4.80M|	as->buffer_length = 0;
  283|  4.80M|	free(as->s);
  284|       |	as->s = NULL;
  285|  4.80M|}
archive_wstring_ensure:
  289|   291k|{
  290|   291k|	return (struct archive_wstring *)
  291|   291k|		archive_string_ensure((struct archive_string *)as,
  292|   291k|					s * sizeof(wchar_t));
  293|   291k|}
archive_string_ensure:
  298|  30.1M|{
  299|  30.1M|	char *p;
  300|  30.1M|	size_t new_length;
  301|       |
  302|       |	/* If buffer is already big enough, don't reallocate. */
  303|  30.1M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (303:6): [True: 29.1M, False: 1.02M]
  |  Branch (303:15): [True: 29.0M, False: 67.2k]
  ------------------
  304|  29.0M|		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.09M|	if (as->buffer_length < 32)
  ------------------
  |  Branch (313:6): [True: 1.02M, False: 67.2k]
  ------------------
  314|       |		/* Start with a minimum 32-character buffer. */
  315|  1.02M|		new_length = 32;
  316|  67.2k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (316:11): [True: 66.8k, False: 336]
  ------------------
  317|       |		/* Buffers under 8k are doubled for speed. */
  318|  66.8k|		new_length = as->buffer_length + as->buffer_length;
  319|    336|	else {
  320|       |		/* Buffers 8k and over grow by at least 25% each time. */
  321|    336|		new_length = as->buffer_length + as->buffer_length / 4;
  322|       |		/* Be safe: If size wraps, fail. */
  323|    336|		if (new_length < as->buffer_length) {
  ------------------
  |  Branch (323:7): [True: 0, False: 336]
  ------------------
  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|    336|	}
  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.09M|	if (new_length < s)
  ------------------
  |  Branch (335:6): [True: 490k, False: 602k]
  ------------------
  336|   490k|		new_length = s;
  337|       |	/* Now we can reallocate the buffer. */
  338|  1.09M|	p = realloc(as->s, new_length);
  339|  1.09M|	if (p == NULL) {
  ------------------
  |  Branch (339:6): [True: 0, False: 1.09M]
  ------------------
  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.09M|	as->s = p;
  347|  1.09M|	as->buffer_length = new_length;
  348|  1.09M|	return (as);
  349|  1.09M|}
archive_strncat:
  360|   404k|{
  361|   404k|	size_t s;
  362|   404k|	const char *p, *pp;
  363|       |
  364|   404k|	p = (const char *)_p;
  365|       |
  366|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  367|   404k|	s = 0;
  368|   404k|	pp = p;
  369|   139M|	while (s < n && *pp) {
  ------------------
  |  Branch (369:9): [True: 139M, False: 188k]
  |  Branch (369:18): [True: 138M, False: 216k]
  ------------------
  370|   138M|		pp++;
  371|   138M|		s++;
  372|   138M|	}
  373|   404k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (373:6): [True: 0, False: 404k]
  ------------------
  374|      0|		__archive_errx(1, "Out of memory");
  375|   404k|	return (as);
  376|   404k|}
archive_wstrncat:
  380|  8.12k|{
  381|  8.12k|	size_t s;
  382|  8.12k|	const wchar_t *pp;
  383|       |
  384|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  385|  8.12k|	s = 0;
  386|  8.12k|	pp = p;
  387|  69.8k|	while (s < n && *pp) {
  ------------------
  |  Branch (387:9): [True: 61.9k, False: 7.89k]
  |  Branch (387:18): [True: 61.7k, False: 227]
  ------------------
  388|  61.7k|		pp++;
  389|  61.7k|		s++;
  390|  61.7k|	}
  391|  8.12k|	if ((as = archive_wstring_append(as, p, s)) == NULL)
  ------------------
  |  Branch (391:6): [True: 0, False: 8.12k]
  ------------------
  392|      0|		__archive_errx(1, "Out of memory");
  393|  8.12k|	return (as);
  394|  8.12k|}
archive_strcat:
  398|   192k|{
  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|   192k|	return archive_strncat(as, p, 0x1000000);
  406|   192k|}
archive_wstrcat:
  410|    227|{
  411|       |	/* Ditto. */
  412|    227|	return archive_wstrncat(as, p, 0x1000000);
  413|    227|}
archive_strappend_char:
  417|  27.9M|{
  418|  27.9M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (418:6): [True: 0, False: 27.9M]
  ------------------
  419|      0|		__archive_errx(1, "Out of memory");
  420|  27.9M|	return (as);
  421|  27.9M|}
archive_wstrappend_wchar:
  425|    227|{
  426|    227|	if ((as = archive_wstring_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (426:6): [True: 0, False: 227]
  ------------------
  427|      0|		__archive_errx(1, "Out of memory");
  428|    227|	return (as);
  429|    227|}
archive_wstring_append_from_mbs:
  623|   260k|{
  624|   260k|	size_t r;
  625|   260k|	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|   260k|	size_t mbs_length = len;
  632|   260k|	const char *mbs = p;
  633|   260k|	wchar_t *wcs;
  634|   260k|#if HAVE_MBRTOWC
  635|   260k|	mbstate_t shift_state;
  636|       |
  637|   260k|	memset(&shift_state, 0, sizeof(shift_state));
  638|   260k|#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|   260k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (643:6): [True: 0, False: 260k]
  ------------------
  644|      0|		return (-1);
  645|   260k|	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|  11.6M|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (651:9): [True: 11.4M, False: 225k]
  |  Branch (651:17): [True: 11.4M, 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|  11.4M|#if HAVE_MBRTOWC
  669|  11.4M|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  670|       |#else
  671|       |		r = mbtowc(wcs, mbs, mbs_length);
  672|       |#endif
  673|  11.4M|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (673:7): [True: 34.4k, False: 11.4M]
  |  Branch (673:26): [True: 0, False: 11.4M]
  ------------------
  674|  34.4k|			ret_val = -1;
  675|  34.4k|			break;
  676|  34.4k|		}
  677|  11.4M|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (677:7): [True: 0, False: 11.4M]
  |  Branch (677:17): [True: 0, False: 11.4M]
  ------------------
  678|      0|			break;
  679|  11.4M|		wcs++;
  680|       |		// wcs_length--;
  681|  11.4M|		mbs += r;
  682|  11.4M|		mbs_length -= r;
  683|  11.4M|	}
  684|   260k|	dest->length = wcs - dest->s;
  685|   260k|	dest->s[dest->length] = L'\0';
  686|   260k|	return (ret_val);
  687|   260k|}
archive_string_append_from_wcs:
  821|  6.32k|{
  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.32k|	int n, ret_val = 0;
  829|  6.32k|	char *p;
  830|  6.32k|	char *end;
  831|  6.32k|#if HAVE_WCRTOMB
  832|  6.32k|	mbstate_t shift_state;
  833|       |
  834|  6.32k|	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.32k|	if (archive_string_ensure(as, as->length + len + 1) == NULL)
  ------------------
  |  Branch (844:6): [True: 0, False: 6.32k]
  ------------------
  845|      0|		return (-1);
  846|       |
  847|  6.32k|	p = as->s + as->length;
  848|  6.32k|	end = as->s + as->buffer_length - MB_CUR_MAX -1;
  849|  45.2k|	while (*w != L'\0' && len > 0) {
  ------------------
  |  Branch (849:9): [True: 38.9k, False: 6.32k]
  |  Branch (849:24): [True: 38.9k, False: 0]
  ------------------
  850|  38.9k|		if (p >= end) {
  ------------------
  |  Branch (850:7): [True: 423, False: 38.5k]
  ------------------
  851|    423|			as->length = p - as->s;
  852|    423|			as->s[as->length] = '\0';
  853|       |			/* Re-allocate buffer for MBS. */
  854|    423|			if (archive_string_ensure(as,
  ------------------
  |  Branch (854:8): [True: 0, False: 423]
  ------------------
  855|    423|			    as->length + max(len * 2,
  ------------------
  |  |   78|    423|#define max(a, b)       ((a)>(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (78:26): [True: 423, False: 0]
  |  |  ------------------
  ------------------
  856|    423|			    (size_t)MB_CUR_MAX) + 1) == NULL)
  857|      0|				return (-1);
  858|    423|			p = as->s + as->length;
  859|    423|			end = as->s + as->buffer_length - MB_CUR_MAX -1;
  860|    423|		}
  861|  38.9k|#if HAVE_WCRTOMB
  862|  38.9k|		n = wcrtomb(p, *w++, &shift_state);
  863|       |#else
  864|       |		n = wctomb(p, *w++);
  865|       |#endif
  866|  38.9k|		if (n == -1) {
  ------------------
  |  Branch (866:7): [True: 0, False: 38.9k]
  ------------------
  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|  38.9k|			p += n;
  877|  38.9k|		len--;
  878|  38.9k|	}
  879|  6.32k|	as->length = p - as->s;
  880|  6.32k|	as->s[as->length] = '\0';
  881|  6.32k|	return (ret_val);
  882|  6.32k|}
archive_string_conversion_to_charset:
 1782|   234k|{
 1783|   234k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   89|   234k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1784|       |
 1785|   234k|	if (best_effort)
  ------------------
  |  Branch (1785:6): [True: 234k, False: 0]
  ------------------
 1786|   234k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|   234k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1787|   234k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1788|   234k|}
archive_string_conversion_from_charset:
 1793|  51.5k|{
 1794|  51.5k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   91|  51.5k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1795|       |
 1796|  51.5k|	if (best_effort)
  ------------------
  |  Branch (1796:6): [True: 51.5k, False: 0]
  ------------------
 1797|  51.5k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  51.5k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1798|  51.5k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1799|  51.5k|}
archive_string_default_conversion_for_read:
 1855|  5.84k|{
 1856|  5.84k|	(void)a; /* UNUSED */
 1857|       |	return (NULL);
 1858|  5.84k|}
archive_string_conversion_free:
 1873|  11.9k|{
 1874|  11.9k|	struct archive_string_conv *sc; 
 1875|  11.9k|	struct archive_string_conv *sc_next; 
 1876|       |
 1877|  15.0k|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1877:22): [True: 3.12k, False: 11.9k]
  ------------------
 1878|  3.12k|		sc_next = sc->next;
 1879|  3.12k|		free_sconv_object(sc);
 1880|  3.12k|	}
 1881|  11.9k|	a->sconv = NULL;
 1882|  11.9k|	free(a->current_code);
 1883|       |	a->current_code = NULL;
 1884|  11.9k|}
archive_string_conversion_charset_name:
 1891|  3.56k|{
 1892|  3.56k|	if (sc == NULL) {
  ------------------
  |  Branch (1892:6): [True: 0, False: 3.56k]
  ------------------
 1893|      0|		return "current locale";
 1894|      0|	}
 1895|  3.56k|	if (sc->flag & SCONV_TO_CHARSET)
  ------------------
  |  |   89|  3.56k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1895:6): [True: 0, False: 3.56k]
  ------------------
 1896|      0|		return (sc->to_charset);
 1897|  3.56k|	else
 1898|  3.56k|		return (sc->from_charset);
 1899|  3.56k|}
archive_strncpy_l:
 2014|   506k|{
 2015|   506k|	as->length = 0;
 2016|   506k|	return (archive_strncat_l(as, _p, n, sc));
 2017|   506k|}
archive_strncat_l:
 2022|   506k|{
 2023|   506k|	const void *s;
 2024|   506k|	size_t length = 0;
 2025|   506k|	int i, r = 0, r2;
 2026|       |
 2027|   506k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2027:6): [True: 506k, False: 0]
  |  Branch (2027:20): [True: 419k, False: 87.3k]
  ------------------
 2028|   419k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|   235k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   235k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   235k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2028:7): [True: 235k, False: 184k]
  |  Branch (2028:21): [True: 4.60k, False: 230k]
  ------------------
 2029|  4.60k|			length = utf16nbytes(_p, n);
 2030|   414k|		else
 2031|   414k|			length = mbsnbytes(_p, n);
 2032|   419k|	}
 2033|       |
 2034|       |	/* We must allocate memory even if there is no data for conversion
 2035|       |	 * or copy. This simulates archive_string_append behavior. */
 2036|   506k|	if (length == 0) {
  ------------------
  |  Branch (2036:6): [True: 111k, False: 395k]
  ------------------
 2037|   111k|		size_t tn = 1;
 2038|   111k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  68.0k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  68.0k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  68.0k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2038:7): [True: 68.0k, False: 43.0k]
  |  Branch (2038:21): [True: 0, False: 68.0k]
  ------------------
 2039|      0|			tn = 2;
 2040|   111k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2040:7): [True: 0, False: 111k]
  ------------------
 2041|      0|			return (-1);
 2042|   111k|		as->s[as->length] = 0;
 2043|   111k|		if (tn == 2)
  ------------------
  |  Branch (2043:7): [True: 0, False: 111k]
  ------------------
 2044|      0|			as->s[as->length+1] = 0;
 2045|   111k|		return (0);
 2046|   111k|	}
 2047|       |
 2048|       |	/*
 2049|       |	 * If sc is NULL, we just make a copy.
 2050|       |	 */
 2051|   395k|	if (sc == NULL) {
  ------------------
  |  Branch (2051:6): [True: 162k, False: 233k]
  ------------------
 2052|   162k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2052:7): [True: 0, False: 162k]
  ------------------
 2053|      0|			return (-1);/* No memory */
 2054|   162k|		return (0);
 2055|   162k|	}
 2056|       |
 2057|   233k|	s = _p;
 2058|   233k|	i = 0;
 2059|   233k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2059:6): [True: 49.9k, False: 183k]
  ------------------
 2060|  49.9k|		sc->utftmp.length = 0;
 2061|  49.9k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2062|  49.9k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2062:7): [True: 36.2k, False: 13.6k]
  |  Branch (2062:18): [True: 3, False: 36.2k]
  ------------------
 2063|      3|			return (r2);
 2064|  49.9k|		if (r > r2)
  ------------------
  |  Branch (2064:7): [True: 36.2k, False: 13.6k]
  ------------------
 2065|  36.2k|			r = r2;
 2066|  49.9k|		s = sc->utftmp.s;
 2067|  49.9k|		length = sc->utftmp.length;
 2068|  49.9k|		++i;
 2069|  49.9k|	}
 2070|   233k|	r2 = sc->converter[i](as, s, length, sc);
 2071|   233k|	if (r > r2)
  ------------------
  |  Branch (2071:6): [True: 24.3k, False: 208k]
  ------------------
 2072|  24.3k|		r = r2;
 2073|   233k|	return (r);
 2074|   233k|}
archive_string_dirname:
 2078|  1.60k|{
 2079|       |	/* strip trailing separators */
 2080|  1.63k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2080:9): [True: 1.60k, False: 32]
  |  Branch (2080:27): [True: 30, False: 1.57k]
  ------------------
 2081|     30|		as->length--;
 2082|       |	/* strip final component */
 2083|  6.40k|	while (as->length > 0 && as->s[as->length - 1] != '/')
  ------------------
  |  Branch (2083:9): [True: 5.62k, False: 784]
  |  Branch (2083:27): [True: 4.80k, False: 821]
  ------------------
 2084|  4.80k|		as->length--;
 2085|       |	/* empty path -> cwd */
 2086|  1.60k|	if (as->length == 0)
  ------------------
  |  Branch (2086:6): [True: 784, False: 821]
  ------------------
 2087|    784|		return (archive_strcat(as, "."));
 2088|       |	/* strip separator(s) */
 2089|  1.64k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2089:9): [True: 1.33k, False: 306]
  |  Branch (2089:27): [True: 821, False: 515]
  ------------------
 2090|    821|		as->length--;
 2091|       |	/* terminate */
 2092|    821|	as->s[as->length] = '\0';
 2093|    821|	return (as);
 2094|  1.60k|}
archive_mstring_clean:
 3928|  4.76M|{
 3929|  4.76M|	archive_wstring_free(&(aes->aes_wcs));
 3930|  4.76M|	archive_string_free(&(aes->aes_mbs));
 3931|  4.76M|	archive_string_free(&(aes->aes_utf8));
 3932|  4.76M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3933|  4.76M|	aes->aes_set = 0;
 3934|  4.76M|}
archive_mstring_get_utf8:
 3948|   275k|{
 3949|   275k|	struct archive_string_conv *sc;
 3950|   275k|	int r;
 3951|       |
 3952|       |	/* If we already have a UTF8 form, return that immediately. */
 3953|   275k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   275k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3953:6): [True: 33.4k, False: 241k]
  ------------------
 3954|  33.4k|		*p = aes->aes_utf8.s;
 3955|  33.4k|		return (0);
 3956|  33.4k|	}
 3957|       |
 3958|   241k|	*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|   241k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   241k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3984:6): [True: 7.34k, False: 234k]
  ------------------
 3985|  7.34k|		const char *pm; /* unused */
 3986|  7.34k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3987|  7.34k|	}
 3988|   241k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   241k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3988:6): [True: 234k, False: 7.34k]
  ------------------
 3989|   234k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3990|   234k|		if (sc == NULL)
  ------------------
  |  Branch (3990:7): [True: 0, False: 234k]
  ------------------
 3991|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3992|   234k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 3993|   234k|		    aes->aes_mbs.length, sc);
 3994|   234k|		if (a == NULL)
  ------------------
  |  Branch (3994:7): [True: 234k, False: 0]
  ------------------
 3995|   234k|			free_sconv_object(sc);
 3996|   234k|		if (r == 0) {
  ------------------
  |  Branch (3996:7): [True: 214k, False: 20.3k]
  ------------------
 3997|   214k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|   214k|#define	AES_SET_UTF8 2
  ------------------
 3998|   214k|			*p = aes->aes_utf8.s;
 3999|   214k|			return (0);/* success. */
 4000|   214k|		} else
 4001|  20.3k|			return (-1);/* failure. */
 4002|   234k|	}
 4003|  7.34k|	return (0);/* success. */
 4004|   241k|}
archive_mstring_get_mbs:
 4009|   831k|{
 4010|   831k|	struct archive_string_conv *sc;
 4011|   831k|	int r, ret = 0;
 4012|       |
 4013|       |	/* If we already have an MBS form, return that immediately. */
 4014|   831k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   831k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4014:6): [True: 496k, False: 334k]
  ------------------
 4015|   496k|		*p = aes->aes_mbs.s;
 4016|   496k|		return (ret);
 4017|   496k|	}
 4018|       |
 4019|   334k|	*p = NULL;
 4020|       |	/* If there's a WCS form, try converting with the native locale. */
 4021|   334k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   334k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4021:6): [True: 6.32k, False: 328k]
  ------------------
 4022|  6.32k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  6.32k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4023|  6.32k|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 4024|  6.32k|		    aes->aes_wcs.s, aes->aes_wcs.length);
 4025|  6.32k|		*p = aes->aes_mbs.s;
 4026|  6.32k|		if (r == 0) {
  ------------------
  |  Branch (4026:7): [True: 6.32k, False: 0]
  ------------------
 4027|  6.32k|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|  6.32k|#define	AES_SET_MBS 1
  ------------------
 4028|  6.32k|			return (ret);
 4029|  6.32k|		} else
 4030|      0|			ret = -1;
 4031|  6.32k|	}
 4032|       |
 4033|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 4034|   328k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   328k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4034:6): [True: 1.45k, False: 326k]
  ------------------
 4035|  1.45k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  1.45k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4036|  1.45k|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4037|  1.45k|		if (sc == NULL)
  ------------------
  |  Branch (4037:7): [True: 0, False: 1.45k]
  ------------------
 4038|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4039|  1.45k|		r = archive_strncpy_l(&(aes->aes_mbs),
 4040|  1.45k|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4041|  1.45k|		if (a == NULL)
  ------------------
  |  Branch (4041:7): [True: 1.45k, False: 0]
  ------------------
 4042|  1.45k|			free_sconv_object(sc);
 4043|  1.45k|		*p = aes->aes_mbs.s;
 4044|  1.45k|		if (r == 0) {
  ------------------
  |  Branch (4044:7): [True: 0, False: 1.45k]
  ------------------
 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.45k|			ret = -1;/* failure. */
 4049|  1.45k|	}
 4050|   328k|	return (ret);
 4051|   328k|}
archive_mstring_get_wcs:
 4056|   457k|{
 4057|   457k|	int r, ret = 0;
 4058|       |
 4059|   457k|	(void)a;/* UNUSED */
 4060|       |	/* Return WCS form if we already have it. */
 4061|   457k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   457k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4061:6): [True: 56.2k, False: 401k]
  ------------------
 4062|  56.2k|		*wp = aes->aes_wcs.s;
 4063|  56.2k|		return (ret);
 4064|  56.2k|	}
 4065|       |
 4066|   401k|	*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|   401k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   401k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4094:6): [True: 152k, False: 248k]
  ------------------
 4095|   152k|		const char *p; /* unused */
 4096|   152k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4097|   152k|	}
 4098|       |	/* Try converting MBS to WCS using native locale. */
 4099|   401k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   401k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4099:6): [True: 248k, False: 152k]
  ------------------
 4100|   248k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   248k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4101|   248k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4102|   248k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4103|   248k|		if (r == 0) {
  ------------------
  |  Branch (4103:7): [True: 214k, False: 34.4k]
  ------------------
 4104|   214k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|   214k|#define	AES_SET_WCS 4
  ------------------
 4105|   214k|			*wp = aes->aes_wcs.s;
 4106|   214k|		} else
 4107|  34.4k|			ret = -1;/* failure. */
 4108|   248k|	}
 4109|   401k|	return (ret);
 4110|   457k|}
archive_mstring_copy_mbs:
 4180|  60.1k|{
 4181|  60.1k|	if (mbs == NULL) {
  ------------------
  |  Branch (4181:6): [True: 5.49k, False: 54.6k]
  ------------------
 4182|  5.49k|		aes->aes_set = 0;
 4183|  5.49k|		return (0);
 4184|  5.49k|	}
 4185|  54.6k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4186|  60.1k|}
archive_mstring_copy_mbs_len:
 4191|  65.2k|{
 4192|  65.2k|	if (mbs == NULL) {
  ------------------
  |  Branch (4192:6): [True: 0, False: 65.2k]
  ------------------
 4193|      0|		aes->aes_set = 0;
 4194|      0|		return (0);
 4195|      0|	}
 4196|  65.2k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  65.2k|#define	AES_SET_MBS 1
  ------------------
 4197|  65.2k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  65.2k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4198|  65.2k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  65.2k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4199|  65.2k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  65.2k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4200|  65.2k|	return (0);
 4201|  65.2k|}
archive_mstring_copy_wcs:
 4205|  6.81k|{
 4206|  6.81k|	return archive_mstring_copy_wcs_len(aes, wcs,
 4207|  6.81k|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4207:5): [True: 0, False: 6.81k]
  ------------------
 4208|  6.81k|}
archive_mstring_copy_wcs_len:
 4227|  6.81k|{
 4228|  6.81k|	if (wcs == NULL) {
  ------------------
  |  Branch (4228:6): [True: 0, False: 6.81k]
  ------------------
 4229|      0|		aes->aes_set = 0;
 4230|      0|		return (0);
 4231|      0|	}
 4232|  6.81k|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  222|  6.81k|#define	AES_SET_WCS 4
  ------------------
 4233|  6.81k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  6.81k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4234|  6.81k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  6.81k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4235|  6.81k|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|  6.81k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4236|  6.81k|	return (0);
 4237|  6.81k|}
archive_mstring_copy_mbs_len_l:
 4242|   234k|{
 4243|   234k|	int r;
 4244|       |
 4245|   234k|	if (mbs == NULL) {
  ------------------
  |  Branch (4245:6): [True: 8.49k, False: 225k]
  ------------------
 4246|  8.49k|		aes->aes_set = 0;
 4247|  8.49k|		return (0);
 4248|  8.49k|	}
 4249|   225k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|   225k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4250|   225k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   225k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4251|   225k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|   225k|#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|   225k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4314|   225k|	if (r == 0)
  ------------------
  |  Branch (4314:6): [True: 220k, False: 5.12k]
  ------------------
 4315|   220k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|   220k|#define	AES_SET_MBS 1
  ------------------
 4316|  5.12k|	else
 4317|  5.12k|		aes->aes_set = 0;
 4318|   225k|#endif
 4319|   225k|	return (r);
 4320|   234k|}
archive_mstring_update_utf8:
 4335|  45.1k|{
 4336|  45.1k|	struct archive_string_conv *sc;
 4337|  45.1k|	int r;
 4338|       |
 4339|  45.1k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4339:6): [True: 0, False: 45.1k]
  ------------------
 4340|      0|		aes->aes_set = 0;
 4341|      0|		return (0); /* Succeeded in clearing everything. */
 4342|      0|	}
 4343|       |
 4344|       |	/* Save the UTF8 string. */
 4345|  45.1k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  45.1k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  90.2k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 45.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4346|       |
 4347|       |	/* Empty the mbs and wcs strings. */
 4348|  45.1k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  45.1k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4349|  45.1k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  45.1k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4350|       |
 4351|  45.1k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  45.1k|#define	AES_SET_UTF8 2
  ------------------
 4352|       |
 4353|  45.1k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4354|  45.1k|	if (sc == NULL)
  ------------------
  |  Branch (4354:6): [True: 0, False: 45.1k]
  ------------------
 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|  45.1k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  45.1k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 45.1k]
  |  |  ------------------
  ------------------
 4378|       |
 4379|  45.1k|	if (a == NULL)
  ------------------
  |  Branch (4379:6): [True: 45.1k, False: 0]
  ------------------
 4380|  45.1k|		free_sconv_object(sc);
 4381|  45.1k|	if (r != 0)
  ------------------
  |  Branch (4381:6): [True: 33.6k, False: 11.4k]
  ------------------
 4382|  33.6k|		return (-1);
 4383|  11.4k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  221|  11.4k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  220|  11.4k|#define	AES_SET_MBS 1
  ------------------
 4384|       |
 4385|       |	/* Try converting MBS to WCS, return false on failure. */
 4386|  11.4k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4386:6): [True: 0, False: 11.4k]
  ------------------
 4387|  11.4k|	    aes->aes_mbs.length))
 4388|      0|		return (-1);
 4389|  11.4k|#endif
 4390|       |
 4391|       |	/* All conversions succeeded. */
 4392|  11.4k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  221|  11.4k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  222|  11.4k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  220|  11.4k|#define	AES_SET_MBS 1
  ------------------
 4393|       |
 4394|  11.4k|	return (0);
 4395|  11.4k|}
archive_string.c:archive_string_append:
  226|  28.4M|{
  227|  28.4M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (227:6): [True: 0, False: 28.4M]
  ------------------
  228|      0|		return (NULL);
  229|  28.4M|	if (s)
  ------------------
  |  Branch (229:6): [True: 28.4M, False: 21.2k]
  ------------------
  230|  28.4M|		memmove(as->s + as->length, p, s);
  231|  28.4M|	as->length += s;
  232|  28.4M|	as->s[as->length] = 0;
  233|  28.4M|	return (as);
  234|  28.4M|}
archive_string.c:archive_wstring_append:
  238|  19.3k|{
  239|  19.3k|	if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (239:6): [True: 0, False: 19.3k]
  ------------------
  240|      0|		return (NULL);
  241|  19.3k|	if (s)
  ------------------
  |  Branch (241:6): [True: 12.8k, False: 6.57k]
  ------------------
  242|  12.8k|		wmemmove(as->s + as->length, p, s);
  243|  19.3k|	as->length += s;
  244|  19.3k|	as->s[as->length] = 0;
  245|  19.3k|	return (as);
  246|  19.3k|}
archive_string.c:get_sconv_object:
 1700|   286k|{
 1701|   286k|	struct archive_string_conv *sc;
 1702|   286k|	unsigned current_codepage;
 1703|       |
 1704|       |	/* Check if we have made the sconv object. */
 1705|   286k|	sc = find_sconv_object(a, fc, tc);
 1706|   286k|	if (sc != NULL)
  ------------------
  |  Branch (1706:6): [True: 1.87k, False: 284k]
  ------------------
 1707|  1.87k|		return (sc);
 1708|       |
 1709|   284k|	if (a == NULL)
  ------------------
  |  Branch (1709:6): [True: 281k, False: 3.12k]
  ------------------
 1710|   281k|		current_codepage = get_current_codepage();
 1711|  3.12k|	else
 1712|  3.12k|		current_codepage = a->current_codepage;
 1713|       |
 1714|   284k|	sc = create_sconv_object(canonical_charset_name(fc),
 1715|   284k|	    canonical_charset_name(tc), current_codepage, flag);
 1716|   284k|	if (sc == NULL) {
  ------------------
  |  Branch (1716:6): [True: 0, False: 284k]
  ------------------
 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|   284k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1728:6): [True: 0, False: 284k]
  ------------------
 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|   284k|	if (a != NULL)
  ------------------
  |  Branch (1748:6): [True: 3.12k, False: 281k]
  ------------------
 1749|  3.12k|		add_sconv_object(a, sc);
 1750|   284k|	return (sc);
 1751|   284k|}
archive_string.c:find_sconv_object:
  912|   286k|{
  913|   286k|	struct archive_string_conv *sc; 
  914|       |
  915|   286k|	if (a == NULL)
  ------------------
  |  Branch (915:6): [True: 281k, False: 5.00k]
  ------------------
  916|   281k|		return (NULL);
  917|       |
  918|  14.2k|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (918:22): [True: 11.0k, False: 3.12k]
  ------------------
  919|  11.0k|		if (strcmp(sc->from_charset, fc) == 0 &&
  ------------------
  |  Branch (919:7): [True: 1.87k, False: 9.21k]
  ------------------
  920|  1.87k|		    strcmp(sc->to_charset, tc) == 0)
  ------------------
  |  Branch (920:7): [True: 1.87k, False: 0]
  ------------------
  921|  1.87k|			break;
  922|  11.0k|	}
  923|  5.00k|	return (sc);
  924|   286k|}
archive_string.c:get_current_codepage:
 1678|   283k|{
 1679|   283k|	return (-1);/* Unknown */
 1680|   283k|}
archive_string.c:create_sconv_object:
 1173|   284k|{
 1174|   284k|	struct archive_string_conv *sc; 
 1175|       |
 1176|   284k|	sc = calloc(1, sizeof(*sc));
 1177|   284k|	if (sc == NULL)
  ------------------
  |  Branch (1177:6): [True: 0, False: 284k]
  ------------------
 1178|      0|		return (NULL);
 1179|   284k|	sc->next = NULL;
 1180|   284k|	sc->from_charset = strdup(fc);
 1181|   284k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1181:6): [True: 0, False: 284k]
  ------------------
 1182|      0|		free(sc);
 1183|      0|		return (NULL);
 1184|      0|	}
 1185|   284k|	sc->to_charset = strdup(tc);
 1186|   284k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1186:6): [True: 0, False: 284k]
  ------------------
 1187|      0|		free(sc->from_charset);
 1188|      0|		free(sc);
 1189|      0|		return (NULL);
 1190|      0|	}
 1191|   284k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|   284k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 284k]
  |  |  ------------------
  ------------------
 1192|       |
 1193|   284k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|   284k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1193:6): [True: 234k, False: 49.7k]
  ------------------
 1194|       |		/*
 1195|       |		 * Convert characters from the current locale charset to
 1196|       |		 * a specified charset.
 1197|       |		 */
 1198|   234k|		sc->from_cp = current_codepage;
 1199|   234k|		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|   234k|	} else if (flag & SCONV_FROM_CHARSET) {
  ------------------
  |  |   91|  49.7k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1204:13): [True: 49.7k, False: 0]
  ------------------
 1205|       |		/*
 1206|       |		 * Convert characters from a specified charset to
 1207|       |		 * the current locale charset.
 1208|       |		 */
 1209|  49.7k|		sc->to_cp = current_codepage;
 1210|  49.7k|		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|  49.7k|	}
 1216|       |
 1217|       |	/*
 1218|       |	 * Check if "from charset" and "to charset" are the same.
 1219|       |	 */
 1220|   284k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1220:6): [True: 0, False: 284k]
  ------------------
 1221|   284k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1221:7): [True: 0, False: 284k]
  |  Branch (1221:38): [True: 0, False: 0]
  ------------------
 1222|      0|		sc->same = 1;
 1223|   284k|	else
 1224|   284k|		sc->same = 0;
 1225|       |
 1226|       |	/*
 1227|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1228|       |	 */
 1229|   284k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1229:6): [True: 234k, False: 49.7k]
  ------------------
 1230|   234k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|   234k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1231|  49.7k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1231:11): [True: 0, False: 49.7k]
  ------------------
 1232|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1233|  49.7k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1233:11): [True: 0, False: 49.7k]
  ------------------
 1234|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  109|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1235|   284k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1235:6): [True: 48.8k, False: 235k]
  ------------------
 1236|  48.8k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  48.8k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1237|   235k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1237:11): [True: 456, False: 234k]
  ------------------
 1238|    456|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  108|    456|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1239|   234k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1239:11): [True: 167, False: 234k]
  ------------------
 1240|    167|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  110|    167|#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|   284k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   284k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1267:6): [True: 49.7k, False: 234k]
  ------------------
 1268|  49.7k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  112|  49.7k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  49.7k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  49.7k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  106|  49.7k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1268:6): [True: 49.5k, False: 197]
  ------------------
 1269|       |#if defined(__APPLE__)
 1270|       |		if (flag & SCONV_TO_UTF8)
 1271|       |			flag |= SCONV_NORMALIZATION_D;
 1272|       |		else
 1273|       |#endif
 1274|  49.5k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   98|  49.5k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1275|  49.5k|	}
 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|   284k|#if defined(HAVE_ICONV)
 1301|   284k|	sc->cd_w = (iconv_t)-1;
 1302|       |	/*
 1303|       |	 * Create an iconv object.
 1304|       |	 */
 1305|   284k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|   284k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|   284k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   284k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   284k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1305:7): [True: 234k, False: 49.7k]
  ------------------
 1306|   234k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  106|   234k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  112|   234k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   234k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   234k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1306:6): [True: 0, False: 234k]
  ------------------
 1307|   284k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|   284k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1307:6): [True: 0, False: 284k]
  ------------------
 1308|       |		/* This case we won't use iconv. */
 1309|      0|		sc->cd = (iconv_t)-1;
 1310|   284k|	} else {
 1311|   284k|		sc->cd = iconv_open(tc, fc);
 1312|   284k|		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
  ------------------
  |  |   93|    197|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1312:7): [True: 197, False: 283k]
  |  Branch (1312:32): [True: 0, False: 197]
  ------------------
 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|   284k|	}
 1350|   284k|#endif	/* HAVE_ICONV */
 1351|       |
 1352|   284k|	sc->flag = flag;
 1353|       |
 1354|       |	/*
 1355|       |	 * Set up converters.
 1356|       |	 */
 1357|   284k|	setup_converter(sc);
 1358|       |
 1359|   284k|	return (sc);
 1360|   284k|}
archive_string.c:make_codepage_from_charset:
 1683|   284k|{
 1684|   284k|	(void)charset; /* UNUSED */
 1685|   284k|	return (-1);/* Unknown */
 1686|   284k|}
archive_string.c:canonical_charset_name:
 1133|   568k|{
 1134|   568k|	char cs[16];
 1135|   568k|	char *p;
 1136|   568k|	const char *s;
 1137|       |
 1138|   568k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1138:6): [True: 0, False: 568k]
  |  Branch (1138:25): [True: 0, False: 568k]
  ------------------
 1139|   568k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1139:9): [True: 0, False: 568k]
  ------------------
 1140|      0|		return (charset);
 1141|       |
 1142|       |	/* Copy name to uppercase. */
 1143|   568k|	p = cs;
 1144|   568k|	s = charset;
 1145|  5.97M|	while (*s) {
  ------------------
  |  Branch (1145:9): [True: 5.40M, False: 568k]
  ------------------
 1146|  5.40M|		char c = *s++;
 1147|  5.40M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1147:7): [True: 0, False: 5.40M]
  |  Branch (1147:19): [True: 0, False: 0]
  ------------------
 1148|      0|			c -= 'a' - 'A';
 1149|  5.40M|		*p++ = c;
 1150|  5.40M|	}
 1151|   568k|	*p++ = '\0';
 1152|       |
 1153|   568k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1153:6): [True: 283k, False: 284k]
  ------------------
 1154|   284k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1154:6): [True: 0, False: 284k]
  ------------------
 1155|   283k|		return ("UTF-8");
 1156|   284k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1156:6): [True: 456, False: 284k]
  ------------------
 1157|   284k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1157:6): [True: 0, False: 284k]
  ------------------
 1158|    456|		return ("UTF-16BE");
 1159|   284k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1159:6): [True: 167, False: 284k]
  ------------------
 1160|   284k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1160:6): [True: 0, False: 284k]
  ------------------
 1161|    167|		return ("UTF-16LE");
 1162|   284k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1162:6): [True: 0, False: 284k]
  ------------------
 1163|      0|		return ("CP932");
 1164|   284k|	return (charset);
 1165|   284k|}
archive_string.c:add_sconv_object:
  931|  3.12k|{
  932|  3.12k|	struct archive_string_conv **psc; 
  933|       |
  934|       |	/* Add a new sconv to sconv list. */
  935|  3.12k|	psc = &(a->sconv);
  936|  4.94k|	while (*psc != NULL)
  ------------------
  |  Branch (936:9): [True: 1.82k, False: 3.12k]
  ------------------
  937|  1.82k|		psc = &((*psc)->next);
  938|  3.12k|	*psc = sc;
  939|  3.12k|}
archive_string.c:get_current_charset:
 1755|   286k|{
 1756|   286k|	const char *cur_charset;
 1757|       |
 1758|   286k|	if (a == NULL)
  ------------------
  |  Branch (1758:6): [True: 281k, False: 5.00k]
  ------------------
 1759|   281k|		cur_charset = default_iconv_charset("");
 1760|  5.00k|	else {
 1761|  5.00k|		cur_charset = default_iconv_charset(a->current_code);
 1762|  5.00k|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1762:7): [True: 2.90k, False: 2.09k]
  ------------------
 1763|  2.90k|			a->current_code = strdup(cur_charset);
 1764|  2.90k|			a->current_codepage = get_current_codepage();
 1765|  2.90k|			a->current_oemcp = get_current_oemcp();
 1766|  2.90k|		}
 1767|  5.00k|	}
 1768|   286k|	return (cur_charset);
 1769|   286k|}
archive_string.c:default_iconv_charset:
  445|   286k|default_iconv_charset(const char *charset) {
  446|   286k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (446:6): [True: 283k, False: 2.90k]
  |  Branch (446:25): [True: 2.09k, False: 281k]
  ------------------
  447|  2.09k|		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|   283k|	return nl_langinfo(CODESET);
  453|       |#elif defined(__BIONIC__)
  454|       |	return "UTF-8";
  455|       |#else
  456|       |	return "";
  457|       |#endif
  458|   286k|}
archive_string.c:get_current_oemcp:
 1689|  2.90k|{
 1690|  2.90k|	return (-1);/* Unknown */
 1691|  2.90k|}
archive_string.c:free_sconv_object:
 1367|   284k|{
 1368|   284k|	free(sc->from_charset);
 1369|   284k|	free(sc->to_charset);
 1370|   284k|	archive_string_free(&sc->utftmp);
 1371|   284k|#if HAVE_ICONV
 1372|   284k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1372:6): [True: 283k, False: 197]
  ------------------
 1373|   283k|		iconv_close(sc->cd);
 1374|   284k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1374:6): [True: 0, False: 284k]
  ------------------
 1375|      0|		iconv_close(sc->cd_w);
 1376|   284k|#endif
 1377|   284k|	free(sc);
 1378|   284k|}
archive_string.c:setup_converter:
  953|   284k|{
  954|       |
  955|       |	/* Reset. */
  956|   284k|	sc->nconverter = 0;
  957|       |
  958|       |	/*
  959|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  960|       |	 * made by libarchive2.x.
  961|       |	 */
  962|   284k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|   284k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (962:6): [True: 0, False: 284k]
  ------------------
  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|   284k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|   284k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   284k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   284k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (970:6): [True: 0, False: 284k]
  ------------------
  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|   284k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|   284k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   284k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   284k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1013:6): [True: 623, False: 283k]
  ------------------
 1014|       |		/*
 1015|       |		 * At least we should normalize a UTF-16BE string.
 1016|       |		 */
 1017|    623|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|    623|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1017:7): [True: 0, False: 623]
  ------------------
 1018|      0|			add_converter(sc,archive_string_normalize_D);
 1019|    623|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|    623|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1019:12): [True: 623, False: 0]
  ------------------
 1020|    623|			add_converter(sc, archive_string_normalize_C);
 1021|       |
 1022|    623|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|    623|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1022:7): [True: 0, False: 623]
  ------------------
 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|    623|#if defined(HAVE_ICONV)
 1045|    623|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1045:7): [True: 623, False: 0]
  ------------------
 1046|    623|			add_converter(sc, iconv_strncat_in_locale);
 1047|    623|			return;
 1048|    623|		}
 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|    623|	}
 1062|       |
 1063|   283k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|   283k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1063:6): [True: 48.8k, False: 234k]
  ------------------
 1064|       |		/*
 1065|       |		 * At least we should normalize a UTF-8 string.
 1066|       |		 */
 1067|  48.8k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|  48.8k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1067:7): [True: 0, False: 48.8k]
  ------------------
 1068|      0|			add_converter(sc,archive_string_normalize_D);
 1069|  48.8k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|  48.8k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1069:12): [True: 48.8k, False: 0]
  ------------------
 1070|  48.8k|			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|  48.8k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  48.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1078:7): [True: 0, False: 48.8k]
  ------------------
 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|  48.8k|	}
 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|   283k|#if HAVE_ICONV
 1101|   283k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1101:6): [True: 283k, False: 197]
  ------------------
 1102|   283k|		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|   283k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   283k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1108:7): [True: 48.8k, False: 234k]
  ------------------
 1109|  48.8k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  105|  48.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1109:7): [True: 0, False: 48.8k]
  ------------------
 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|   283k|		return;
 1114|   283k|	}
 1115|    197|#endif
 1116|       |
 1117|       |	/*
 1118|       |	 * Try conversion in the best effort or no conversion.
 1119|       |	 */
 1120|    197|	if ((sc->flag & SCONV_BEST_EFFORT) || sc->same)
  ------------------
  |  |   93|    197|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1120:6): [True: 197, False: 0]
  |  Branch (1120:40): [True: 0, False: 0]
  ------------------
 1121|    197|		add_converter(sc, best_effort_strncat_in_locale);
 1122|      0|	else
 1123|       |		/* Make sure we have no converter. */
 1124|      0|		sc->nconverter = 0;
 1125|    197|}
archive_string.c:add_converter:
  945|   333k|{
  946|   333k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (946:6): [True: 0, False: 333k]
  |  Branch (946:20): [True: 0, False: 333k]
  ------------------
  947|      0|		__archive_errx(1, "Programming error");
  948|   333k|	sc->converter[sc->nconverter++] = converter;
  949|   333k|}
archive_string.c:_utf8_to_unicode:
 2374|  67.6M|{
 2375|  67.6M|	static const char utf8_count[256] = {
 2376|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2377|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2378|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2379|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2380|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2381|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2382|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2383|  67.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2384|  67.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2385|  67.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2386|  67.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2387|  67.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2388|  67.6M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2389|  67.6M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2390|  67.6M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2391|  67.6M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2392|  67.6M|	};
 2393|  67.6M|	int ch, i;
 2394|  67.6M|	int cnt;
 2395|  67.6M|	uint32_t wc;
 2396|       |
 2397|       |	/* Sanity check. */
 2398|  67.6M|	if (n == 0)
  ------------------
  |  Branch (2398:6): [True: 47.8k, False: 67.6M]
  ------------------
 2399|  47.8k|		return (0);
 2400|       |	/*
 2401|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2402|       |	 */
 2403|  67.6M|	ch = (unsigned char)*s;
 2404|  67.6M|	if (ch == 0)
  ------------------
  |  Branch (2404:6): [True: 0, False: 67.6M]
  ------------------
 2405|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2406|  67.6M|	cnt = utf8_count[ch];
 2407|       |
 2408|       |	/* Invalid sequence or there are not plenty bytes. */
 2409|  67.6M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2409:6): [True: 2.84k, False: 67.6M]
  ------------------
 2410|  2.84k|		cnt = (int)n;
 2411|  3.32k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2411:15): [True: 1.06k, False: 2.26k]
  ------------------
 2412|  1.06k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2412:8): [True: 585, False: 478]
  ------------------
 2413|    585|				cnt = i;
 2414|    585|				break;
 2415|    585|			}
 2416|  1.06k|		}
 2417|  2.84k|		goto invalid_sequence;
 2418|  2.84k|	}
 2419|       |
 2420|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2421|  67.6M|	switch (cnt) {
 2422|  67.1M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2422:2): [True: 67.1M, False: 524k]
  ------------------
 2423|  67.1M|		*pwc = ch & 0x7f;
 2424|  67.1M|		return (cnt);
 2425|   130k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2425:2): [True: 130k, False: 67.5M]
  ------------------
 2426|   130k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2426:7): [True: 44.4k, False: 85.7k]
  ------------------
 2427|  44.4k|			cnt = 1;
 2428|  44.4k|			goto invalid_sequence;
 2429|  44.4k|		}
 2430|  85.7k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2431|  85.7k|		return (cnt);
 2432|   147k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2432:2): [True: 147k, False: 67.4M]
  ------------------
 2433|   147k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2433:7): [True: 45.9k, False: 101k]
  ------------------
 2434|  45.9k|			cnt = 1;
 2435|  45.9k|			goto invalid_sequence;
 2436|  45.9k|		}
 2437|   101k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2437:7): [True: 40.0k, False: 61.2k]
  ------------------
 2438|  40.0k|			cnt = 2;
 2439|  40.0k|			goto invalid_sequence;
 2440|  40.0k|		}
 2441|  61.2k|		wc = ((ch & 0x0f) << 12)
 2442|  61.2k|		    | ((s[1] & 0x3f) << 6)
 2443|  61.2k|		    | (s[2] & 0x3f);
 2444|  61.2k|		if (wc < 0x800)
  ------------------
  |  Branch (2444:7): [True: 438, False: 60.7k]
  ------------------
 2445|    438|			goto invalid_sequence;/* Overlong sequence. */
 2446|  60.7k|		break;
 2447|  60.7k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2447:2): [True: 7.59k, False: 67.6M]
  ------------------
 2448|  7.59k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2448:7): [True: 826, False: 6.77k]
  ------------------
 2449|    826|			cnt = 1;
 2450|    826|			goto invalid_sequence;
 2451|    826|		}
 2452|  6.77k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2452:7): [True: 1.22k, False: 5.55k]
  ------------------
 2453|  1.22k|			cnt = 2;
 2454|  1.22k|			goto invalid_sequence;
 2455|  1.22k|		}
 2456|  5.55k|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2456:7): [True: 583, False: 4.96k]
  ------------------
 2457|    583|			cnt = 3;
 2458|    583|			goto invalid_sequence;
 2459|    583|		}
 2460|  4.96k|		wc = ((ch & 0x07) << 18)
 2461|  4.96k|		    | ((s[1] & 0x3f) << 12)
 2462|  4.96k|		    | ((s[2] & 0x3f) << 6)
 2463|  4.96k|		    | (s[3] & 0x3f);
 2464|  4.96k|		if (wc < 0x10000)
  ------------------
  |  Branch (2464:7): [True: 398, False: 4.57k]
  ------------------
 2465|    398|			goto invalid_sequence;/* Overlong sequence. */
 2466|  4.57k|		break;
 2467|   239k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2467:2): [True: 239k, False: 67.3M]
  ------------------
 2468|   239k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2468:7): [True: 3.83k, False: 235k]
  |  Branch (2468:21): [True: 314, False: 235k]
  ------------------
 2469|  4.14k|			cnt = 2;
 2470|   235k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2470:12): [True: 101k, False: 133k]
  |  Branch (2470:26): [True: 2.92k, False: 98.9k]
  ------------------
 2471|  2.92k|			cnt = 4;
 2472|   232k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2472:12): [True: 98.9k, False: 133k]
  |  Branch (2472:26): [True: 4.39k, False: 94.5k]
  ------------------
 2473|  4.39k|			cnt = 5;
 2474|   227k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2474:12): [True: 555, False: 227k]
  |  Branch (2474:26): [True: 3.58k, False: 223k]
  ------------------
 2475|  4.13k|			cnt = 6;
 2476|   223k|		else
 2477|   223k|			cnt = 1;
 2478|   239k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2478:7): [True: 975, False: 238k]
  ------------------
 2479|    975|			cnt = (int)n;
 2480|   250k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2480:15): [True: 25.2k, False: 225k]
  ------------------
 2481|  25.2k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2481:8): [True: 13.6k, False: 11.6k]
  ------------------
 2482|  13.6k|				cnt = i;
 2483|  13.6k|				break;
 2484|  13.6k|			}
 2485|  25.2k|		}
 2486|   239k|		goto invalid_sequence;
 2487|  67.6M|	}
 2488|       |
 2489|       |	/* The code point larger than 0x10FFFF is not legal
 2490|       |	 * Unicode values. */
 2491|  65.3k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|  65.3k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2491:6): [True: 577, False: 64.7k]
  ------------------
 2492|    577|		goto invalid_sequence;
 2493|       |	/* Correctly gets a Unicode, returns used bytes. */
 2494|  64.7k|	*pwc = wc;
 2495|  64.7k|	return (cnt);
 2496|   376k|invalid_sequence:
 2497|   376k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|   376k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2498|   376k|	return (cnt * -1);
 2499|  65.3k|}
archive_string.c:unicode_to_utf16be:
 2679|  11.9k|{
 2680|  11.9k|	char *utf16 = p;
 2681|       |
 2682|  11.9k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2682:6): [True: 40, False: 11.9k]
  ------------------
 2683|       |		/* We have a code point that won't fit into a
 2684|       |		 * wchar_t; convert it to a surrogate pair. */
 2685|     40|		if (remaining < 4)
  ------------------
  |  Branch (2685:7): [True: 0, False: 40]
  ------------------
 2686|      0|			return (0);
 2687|     40|		uc -= 0x10000;
 2688|     40|		archive_be16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2689|     40|		archive_be16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2690|     40|		return (4);
 2691|  11.9k|	} else {
 2692|  11.9k|		if (remaining < 2)
  ------------------
  |  Branch (2692:7): [True: 0, False: 11.9k]
  ------------------
 2693|      0|			return (0);
 2694|  11.9k|		archive_be16enc(utf16, (uint16_t)uc);
 2695|  11.9k|		return (2);
 2696|  11.9k|	}
 2697|  11.9k|}
archive_string.c:unicode_to_utf16le:
 2701|  4.35k|{
 2702|  4.35k|	char *utf16 = p;
 2703|       |
 2704|  4.35k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2704:6): [True: 80, False: 4.27k]
  ------------------
 2705|       |		/* We have a code point that won't fit into a
 2706|       |		 * wchar_t; convert it to a surrogate pair. */
 2707|     80|		if (remaining < 4)
  ------------------
  |  Branch (2707:7): [True: 0, False: 80]
  ------------------
 2708|      0|			return (0);
 2709|     80|		uc -= 0x10000;
 2710|     80|		archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2711|     80|		archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2712|     80|		return (4);
 2713|  4.27k|	} else {
 2714|  4.27k|		if (remaining < 2)
  ------------------
  |  Branch (2714:7): [True: 0, False: 4.27k]
  ------------------
 2715|      0|			return (0);
 2716|  4.27k|		archive_le16enc(utf16, (uint16_t)uc);
 2717|  4.27k|		return (2);
 2718|  4.27k|	}
 2719|  4.35k|}
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: 78.4k, False: 450k]
  ------------------
 2581|  78.4k|		if (remaining == 0)
  ------------------
  |  Branch (2581:7): [True: 593, False: 77.8k]
  ------------------
 2582|    593|			return (0);
 2583|  77.8k|		*p++ = (char)uc;
 2584|   450k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2584:13): [True: 67.6k, False: 382k]
  ------------------
 2585|  67.6k|		if (remaining < 2)
  ------------------
  |  Branch (2585:7): [True: 71, False: 67.5k]
  ------------------
 2586|     71|			return (0);
 2587|  67.5k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2588|  67.5k|		*p++ = 0x80 | (uc & 0x3f);
 2589|   382k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2589:13): [True: 378k, False: 4.08k]
  ------------------
 2590|   378k|		if (remaining < 3)
  ------------------
  |  Branch (2590:7): [True: 2.22k, False: 376k]
  ------------------
 2591|  2.22k|			return (0);
 2592|   376k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2593|   376k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2594|   376k|		*p++ = 0x80 | (uc & 0x3f);
 2595|   376k|	} else {
 2596|  4.08k|		if (remaining < 4)
  ------------------
  |  Branch (2596:7): [True: 99, False: 3.98k]
  ------------------
 2597|     99|			return (0);
 2598|  3.98k|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2599|  3.98k|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2600|  3.98k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2601|  3.98k|		*p++ = 0x80 | (uc & 0x3f);
 2602|  3.98k|	}
 2603|   525k|	return (p - _p);
 2604|   528k|}
archive_string.c:utf16be_to_unicode:
 2608|  36.0k|{
 2609|  36.0k|	return (utf16_to_unicode(pwc, s, n, 1));
 2610|  36.0k|}
archive_string.c:utf16_to_unicode:
 2620|  63.6k|{
 2621|  63.6k|	const char *utf16 = s;
 2622|  63.6k|	unsigned uc;
 2623|       |
 2624|  63.6k|	if (n == 0)
  ------------------
  |  Branch (2624:6): [True: 2.77k, False: 60.9k]
  ------------------
 2625|  2.77k|		return (0);
 2626|  60.9k|	if (n == 1) {
  ------------------
  |  Branch (2626:6): [True: 0, False: 60.9k]
  ------------------
 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|  60.9k|	if (be)
  ------------------
  |  Branch (2632:6): [True: 34.0k, False: 26.8k]
  ------------------
 2633|  34.0k|		uc = archive_be16dec(utf16);
 2634|  26.8k|	else
 2635|  26.8k|		uc = archive_le16dec(utf16);
 2636|  60.9k|	utf16 += 2;
 2637|       |		
 2638|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2639|  60.9k|	if (IS_HIGH_SURROGATE_LA(uc)) {
  ------------------
  |  |  130|  60.9k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 18.9k, False: 41.9k]
  |  |  |  Branch (130:53): [True: 11.6k, False: 7.28k]
  |  |  ------------------
  ------------------
 2640|  11.6k|		unsigned uc2;
 2641|       |
 2642|  11.6k|		if (n >= 4) {
  ------------------
  |  Branch (2642:7): [True: 11.6k, False: 5]
  ------------------
 2643|  11.6k|			if (be)
  ------------------
  |  Branch (2643:8): [True: 8.13k, False: 3.48k]
  ------------------
 2644|  8.13k|				uc2 = archive_be16dec(utf16);
 2645|  3.48k|			else
 2646|  3.48k|				uc2 = archive_le16dec(utf16);
 2647|  11.6k|		} else
 2648|      5|			uc2 = 0;
 2649|  11.6k|		if (IS_LOW_SURROGATE_LA(uc2)) {
  ------------------
  |  |  131|  11.6k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 207, False: 11.4k]
  |  |  |  Branch (131:53): [True: 120, False: 87]
  |  |  ------------------
  ------------------
 2650|    120|			uc = combine_surrogate_pair(uc, uc2);
 2651|    120|			utf16 += 2;
 2652|  11.5k|		} else {
 2653|       |	 		/* Undescribed code point should be U+FFFD
 2654|       |		 	* (replacement character). */
 2655|  11.5k|			*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  11.5k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2656|  11.5k|			return (-2);
 2657|  11.5k|		}
 2658|  11.6k|	}
 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|  49.3k|	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  132|  98.7k|#define IS_SURROGATE_PAIR_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 7.40k, False: 41.9k]
  |  |  |  Branch (132:53): [True: 3.26k, False: 4.13k]
  |  |  ------------------
  ------------------
              	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  133|  46.1k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2667:34): [True: 0, False: 46.1k]
  ------------------
 2668|       |	 	/* Undescribed code point should be U+FFFD
 2669|       |	 	* (replacement character). */
 2670|  3.26k|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  3.26k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2671|  3.26k|		return (((int)(utf16 - s)) * -1);
 2672|  3.26k|	}
 2673|  46.1k|	*pwc = uc;
 2674|  46.1k|	return ((int)(utf16 - s));
 2675|  49.3k|}
archive_string.c:combine_surrogate_pair:
 2515|  6.62k|{
 2516|  6.62k|	uc -= 0xD800;
 2517|  6.62k|	uc *= 0x400;
 2518|  6.62k|	uc += uc2 - 0xDC00;
 2519|  6.62k|	uc += 0x10000;
 2520|  6.62k|	return (uc);
 2521|  6.62k|}
archive_string.c:utf16le_to_unicode:
 2614|  27.6k|{
 2615|  27.6k|	return (utf16_to_unicode(pwc, s, n, 0));
 2616|  27.6k|}
archive_string.c:cesu8_to_unicode:
 2534|  67.6M|{
 2535|  67.6M|	uint32_t wc = 0;
 2536|  67.6M|	int cnt;
 2537|       |
 2538|  67.6M|	cnt = _utf8_to_unicode(&wc, s, n);
 2539|  67.6M|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  130|  53.6k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 29.8k, False: 23.8k]
  |  |  |  Branch (130:53): [True: 26.7k, False: 3.08k]
  |  |  ------------------
  ------------------
  |  Branch (2539:6): [True: 53.6k, False: 67.6M]
  ------------------
 2540|  26.7k|		uint32_t wc2 = 0;
 2541|  26.7k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2541:7): [True: 71, False: 26.7k]
  ------------------
 2542|       |			/* Invalid byte sequence. */
 2543|     71|			goto invalid_sequence;
 2544|     71|		}
 2545|  26.7k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2546|  26.7k|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  131|  7.10k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 6.85k, False: 250]
  |  |  |  Branch (131:53): [True: 6.50k, False: 348]
  |  |  ------------------
  ------------------
  |  Branch (2546:7): [True: 19.5k, False: 7.10k]
  ------------------
 2547|       |			/* Invalid byte sequence. */
 2548|  20.1k|			goto invalid_sequence;
 2549|  20.1k|		}
 2550|  6.50k|		wc = combine_surrogate_pair(wc, wc2);
 2551|  6.50k|		cnt = 6;
 2552|  67.6M|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|  26.9k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 3.08k, False: 23.8k]
  |  |  |  Branch (131:53): [True: 1.85k, False: 1.22k]
  |  |  ------------------
  ------------------
  |  Branch (2552:13): [True: 26.9k, False: 67.6M]
  ------------------
 2553|       |		/* Invalid byte sequence. */
 2554|  1.85k|		goto invalid_sequence;
 2555|  1.85k|	}
 2556|  67.6M|	*pwc = wc;
 2557|  67.6M|	return (cnt);
 2558|  22.1k|invalid_sequence:
 2559|  22.1k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  22.1k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2560|  22.1k|	if (cnt > 0)
  ------------------
  |  Branch (2560:6): [True: 2.69k, False: 19.4k]
  ------------------
 2561|  2.69k|		cnt *= -1;
 2562|  22.1k|	return (cnt);
 2563|  67.6M|}
archive_string.c:iconv_strncat_in_locale:
 2104|   233k|{
 2105|   233k|	ICONV_CONST char *itp;
 2106|   233k|	size_t remaining;
 2107|   233k|	iconv_t cd;
 2108|   233k|	char *outp;
 2109|   233k|	size_t avail, bs;
 2110|   233k|	int return_value = 0; /* success */
 2111|   233k|	size_t to_size, from_size;
 2112|       |
 2113|   233k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|   233k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   233k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   233k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2113:6): [True: 0, False: 233k]
  ------------------
 2114|      0|		to_size = 2;
 2115|   233k|	else
 2116|   233k|		to_size = 1;
 2117|   233k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|   233k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   233k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   233k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2117:6): [True: 2.77k, False: 230k]
  ------------------
 2118|  2.77k|		from_size = 2;
 2119|   230k|	else
 2120|   230k|		from_size = 1;
 2121|       |
 2122|   233k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2122:6): [True: 0, False: 233k]
  ------------------
 2123|      0|		return (-1);
 2124|       |
 2125|   233k|	cd = sc->cd;
 2126|   233k|	itp = (char *)(uintptr_t)_p;
 2127|   233k|	remaining = length;
 2128|   233k|	outp = as->s + as->length;
 2129|   233k|	avail = as->buffer_length - as->length - to_size;
 2130|  1.66M|	while (remaining >= from_size) {
  ------------------
  |  Branch (2130:9): [True: 1.65M, False: 10.3k]
  ------------------
 2131|  1.65M|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2132|       |
 2133|  1.65M|		if (result != (size_t)-1)
  ------------------
  |  Branch (2133:7): [True: 222k, False: 1.42M]
  ------------------
 2134|   222k|			break; /* Conversion completed. */
 2135|       |
 2136|  1.42M|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2136:7): [True: 1.42M, False: 215]
  |  Branch (2136:26): [True: 0, False: 215]
  ------------------
 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.42M|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|  1.42M|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|  1.42M|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  1.42M|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  1.42M|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2142:8): [True: 196k, False: 1.23M]
  ------------------
 2143|   196k|				size_t rbytes;
 2144|   196k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|   196k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2144:9): [True: 196k, False: 0]
  ------------------
 2145|   196k|					rbytes = sizeof(utf8_replacement_char);
 2146|      0|				else
 2147|      0|					rbytes = 2;
 2148|       |
 2149|   196k|				if (avail < rbytes) {
  ------------------
  |  Branch (2149:9): [True: 511, False: 195k]
  ------------------
 2150|    511|					as->length = outp - as->s;
 2151|    511|					bs = as->buffer_length +
 2152|    511|					    (remaining * to_size) + rbytes;
 2153|    511|					if (NULL ==
  ------------------
  |  Branch (2153:10): [True: 0, False: 511]
  ------------------
 2154|    511|					    archive_string_ensure(as, bs))
 2155|      0|						return (-1);
 2156|    511|					outp = as->s + as->length;
 2157|    511|					avail = as->buffer_length
 2158|    511|					    - as->length - to_size;
 2159|    511|				}
 2160|   196k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|   196k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2160:9): [True: 196k, False: 0]
  ------------------
 2161|   196k|					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|   196k|				outp += rbytes;
 2167|   196k|				avail -= rbytes;
 2168|  1.23M|			} else {
 2169|       |				/* Skip the illegal input bytes. */
 2170|  1.23M|				*outp++ = '?';
 2171|  1.23M|				avail--;
 2172|  1.23M|			}
 2173|  1.42M|			itp += from_size;
 2174|  1.42M|			remaining -= from_size;
 2175|  1.42M|			return_value = -1; /* failure */
 2176|  1.42M|		} else {
 2177|       |			/* E2BIG no output buffer,
 2178|       |			 * Increase an output buffer.  */
 2179|    215|			as->length = outp - as->s;
 2180|    215|			bs = as->buffer_length + remaining * 2;
 2181|    215|			if (NULL == archive_string_ensure(as, bs))
  ------------------
  |  Branch (2181:8): [True: 0, False: 215]
  ------------------
 2182|      0|				return (-1);
 2183|    215|			outp = as->s + as->length;
 2184|    215|			avail = as->buffer_length - as->length - to_size;
 2185|    215|		}
 2186|  1.42M|	}
 2187|   233k|	as->length = outp - as->s;
 2188|   233k|	as->s[as->length] = 0;
 2189|   233k|	if (to_size == 2)
  ------------------
  |  Branch (2189:6): [True: 0, False: 233k]
  ------------------
 2190|      0|		as->s[as->length+1] = 0;
 2191|   233k|	return (return_value);
 2192|   233k|}
archive_string.c:archive_string_normalize_C:
 3006|  49.9k|{
 3007|  49.9k|	const char *s = (const char *)_p;
 3008|  49.9k|	char *p, *endp;
 3009|  49.9k|	uint32_t uc, uc2;
 3010|  49.9k|	size_t w;
 3011|  49.9k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3012|  49.9k|	int (*parse)(uint32_t *, const char *, size_t);
 3013|  49.9k|	size_t (*unparse)(char *, size_t, uint32_t);
 3014|       |
 3015|  49.9k|	always_replace = 1;
 3016|  49.9k|	ts = 1;/* text size. */
 3017|  49.9k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  49.9k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3017:6): [True: 0, False: 49.9k]
  ------------------
 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.9k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  109|  49.9k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (3022:13): [True: 0, False: 49.9k]
  ------------------
 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.9k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  49.9k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (3027:13): [True: 0, False: 49.9k]
  ------------------
 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.9k|	} else {
 3032|       |		/*
 3033|       |		 * This case is going to be converted to another
 3034|       |		 * character-set through iconv.
 3035|       |		 */
 3036|  49.9k|		always_replace = 0;
 3037|  49.9k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  49.9k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3037:7): [True: 1.93k, False: 47.9k]
  ------------------
 3038|  1.93k|			unparse = unicode_to_utf16be;
 3039|  1.93k|			ts = 2;
 3040|  47.9k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  47.9k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3040:14): [True: 837, False: 47.1k]
  ------------------
 3041|    837|			unparse = unicode_to_utf16le;
 3042|    837|			ts = 2;
 3043|  47.1k|		} else {
 3044|  47.1k|			unparse = unicode_to_utf8;
 3045|  47.1k|		}
 3046|  49.9k|	}
 3047|       |
 3048|  49.9k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  49.9k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3048:6): [True: 1.93k, False: 47.9k]
  ------------------
 3049|  1.93k|		parse = utf16be_to_unicode;
 3050|  1.93k|		tm = 1;
 3051|  1.93k|		spair = 4;/* surrogate pair size in UTF-16. */
 3052|  47.9k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  47.9k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3052:13): [True: 837, False: 47.1k]
  ------------------
 3053|    837|		parse = utf16le_to_unicode;
 3054|    837|		tm = 1;
 3055|    837|		spair = 4;/* surrogate pair size in UTF-16. */
 3056|  47.1k|	} else {
 3057|  47.1k|		parse = cesu8_to_unicode;
 3058|  47.1k|		tm = ts;
 3059|  47.1k|		spair = 6;/* surrogate pair size in UTF-8. */
 3060|  47.1k|	}
 3061|       |
 3062|  49.9k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (3062:6): [True: 0, False: 49.9k]
  ------------------
 3063|      0|		return (-1);
 3064|       |
 3065|  49.9k|	p = as->s + as->length;
 3066|  49.9k|	endp = as->s + as->buffer_length - ts;
 3067|   470k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3067:9): [True: 464k, False: 5.99k]
  ------------------
 3068|   464k|		const char *ucptr, *uc2ptr;
 3069|       |
 3070|   464k|		if (n < 0) {
  ------------------
  |  Branch (3070:7): [True: 291k, False: 173k]
  ------------------
 3071|       |			/* Use a replaced unicode character. */
 3072|   291k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2936|   291k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|   292k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 1.60k, False: 291k]
  |  |  ------------------
  |  | 2938|  1.60k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|  1.60k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|  1.60k|	as->length = p - as->s;			\
  |  |  |  | 2929|  1.60k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 1.60k]
  |  |  |  |  ------------------
  |  |  |  | 2930|  1.60k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|  1.60k|		return (-1);			\
  |  |  |  | 2932|  1.60k|	p = as->s + as->length;			\
  |  |  |  | 2933|  1.60k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|  1.60k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 1.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|  1.60k|	}					\
  |  | 2940|   291k|	p += w;					\
  |  | 2941|   291k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 291k]
  |  |  ------------------
  ------------------
 3073|   291k|			s += n*-1;
 3074|   291k|			len -= n*-1;
 3075|   291k|			ret = -1;
 3076|   291k|			continue;
 3077|   291k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3077:14): [True: 3.25k, False: 169k]
  |  Branch (3077:28): [True: 0, False: 169k]
  ------------------
 3078|       |			/* uc is converted from a surrogate pair.
 3079|       |			 * this should be treated as a changed code. */
 3080|  3.25k|			ucptr = NULL;
 3081|   169k|		else
 3082|   169k|			ucptr = s;
 3083|   173k|		s += n;
 3084|   173k|		len -= n;
 3085|       |
 3086|       |		/* Read second code point. */
 3087|  67.0M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3087:10): [True: 66.9M, False: 142k]
  ------------------
 3088|  66.9M|			uint32_t ucx[FDC_MAX];
 3089|  66.9M|			int ccx[FDC_MAX];
 3090|  66.9M|			int cl, cx, i, nx, ucx_size;
 3091|  66.9M|			int LIndex,SIndex;
 3092|  66.9M|			uint32_t nfc;
 3093|       |
 3094|  66.9M|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3094:8): [True: 209, False: 66.9M]
  |  Branch (3094:23): [True: 0, False: 66.9M]
  ------------------
 3095|       |				/* uc2 is converted from a surrogate pair.
 3096|       |			 	 * this should be treated as a changed code. */
 3097|    209|				uc2ptr = NULL;
 3098|  66.9M|			else
 3099|  66.9M|				uc2ptr = s;
 3100|  66.9M|			s += n2;
 3101|  66.9M|			len -= n2;
 3102|       |
 3103|       |			/*
 3104|       |			 * If current second code point is out of decomposable
 3105|       |			 * code points, finding compositions is unneeded.
 3106|       |			 */
 3107|  66.9M|			if (!IS_DECOMPOSABLE_BLOCK(uc2)) {
  ------------------
  |  |  986|  66.9M|	(((uc)>>8) <= 0x1D2 && u_decomposable_blocks[(uc)>>8])
  |  |  ------------------
  |  |  |  Branch (986:3): [True: 66.9M, False: 1.46k]
  |  |  |  Branch (986:25): [True: 54.5k, False: 66.8M]
  |  |  ------------------
  ------------------
 3108|  66.8M|				WRITE_UC();
  ------------------
  |  | 2949|  66.8M|#define WRITE_UC()	do {			\
  |  | 2950|  66.8M|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 66.8M, False: 3.76k]
  |  |  ------------------
  |  | 2951|  66.8M|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 24.8k, False: 66.8M]
  |  |  ------------------
  |  | 2952|  66.8M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|  24.8k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|  24.8k|	as->length = p - as->s;			\
  |  |  |  | 2929|  24.8k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 24.8k]
  |  |  |  |  ------------------
  |  |  |  | 2930|  24.8k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|  24.8k|		return (-1);			\
  |  |  |  | 2932|  24.8k|	p = as->s + as->length;			\
  |  |  |  | 2933|  24.8k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|  24.8k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  66.8M|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 66.8M, False: 0]
  |  |  ------------------
  |  | 2954|  1.28k|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 1.28k, False: 66.8M]
  |  |  ------------------
  |  | 2955|  1.28k|			*p++ = *ucptr++;	\
  |  | 2956|  1.28k|			/* FALL THROUGH */	\
  |  | 2957|  21.6k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 20.3k, False: 66.8M]
  |  |  ------------------
  |  | 2958|  21.6k|			*p++ = *ucptr++;	\
  |  | 2959|  21.6k|			/* FALL THROUGH */	\
  |  | 2960|  56.1k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 34.4k, False: 66.8M]
  |  |  ------------------
  |  | 2961|  56.1k|			*p++ = *ucptr++;	\
  |  | 2962|  56.1k|			/* FALL THROUGH */	\
  |  | 2963|  66.8M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 66.8M, False: 56.1k]
  |  |  ------------------
  |  | 2964|  66.8M|			*p++ = *ucptr;		\
  |  | 2965|  66.8M|			break;			\
  |  | 2966|  66.8M|		}				\
  |  | 2967|  66.8M|		ucptr = NULL;			\
  |  | 2968|  66.8M|	} else {				\
  |  | 2969|  3.76k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|  3.76k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|  3.82k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 57, False: 3.76k]
  |  |  |  |  ------------------
  |  |  |  | 2938|     57|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     57|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     57|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     57|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 57]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     57|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     57|		return (-1);			\
  |  |  |  |  |  | 2932|     57|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     57|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     57|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 57]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     57|	}					\
  |  |  |  | 2940|  3.76k|	p += w;					\
  |  |  |  | 2941|  3.76k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 3.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|  3.76k|	}					\
  |  | 2971|  66.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 66.8M]
  |  |  ------------------
  ------------------
 3109|  66.8M|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|  66.8M|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|  66.8M|	uc = uc2;				\
  |  | 2923|  66.8M|	ucptr = uc2ptr;				\
  |  | 2924|  66.8M|	n = n2;					\
  |  | 2925|  66.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 66.8M]
  |  |  ------------------
  ------------------
 3110|  66.8M|				continue;
 3111|  66.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|  54.5k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2875|  54.5k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3120:8): [True: 16.7k, False: 37.8k]
  ------------------
 3121|  16.7k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2878|  16.7k|#define HC_LCOUNT	19
  ------------------
  |  Branch (3121:8): [True: 1.59k, False: 15.1k]
  ------------------
 3122|       |				/*
 3123|       |				 * Hangul Composition.
 3124|       |				 * 1. Two current code points are L and V.
 3125|       |				 */
 3126|  1.59k|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2876|  1.59k|#define HC_VBASE	0x1161
  ------------------
 3127|  1.59k|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2879|  1.05k|#define HC_VCOUNT	21
  ------------------
  |  Branch (3127:9): [True: 1.05k, False: 536]
  |  Branch (3127:24): [True: 534, False: 525]
  ------------------
 3128|       |					/* Make syllable of form LV. */
 3129|    534|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2913|    534|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|    534|	uc = new_uc;				\
  |  | 2915|    534|	ucptr = NULL;				\
  |  | 2916|    534|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 534]
  |  |  ------------------
  ------------------
 3130|    534|					    (LIndex * HC_VCOUNT + VIndex) *
 3131|    534|					     HC_TCOUNT);
 3132|  1.06k|				} else {
 3133|  1.06k|					WRITE_UC();
  ------------------
  |  | 2949|  1.06k|#define WRITE_UC()	do {			\
  |  | 2950|  1.06k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 1.06k, False: 0]
  |  |  ------------------
  |  | 2951|  1.06k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 36, False: 1.02k]
  |  |  ------------------
  |  | 2952|  1.06k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|     36|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|     36|	as->length = p - as->s;			\
  |  |  |  | 2929|     36|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 36]
  |  |  |  |  ------------------
  |  |  |  | 2930|     36|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|     36|		return (-1);			\
  |  |  |  | 2932|     36|	p = as->s + as->length;			\
  |  |  |  | 2933|     36|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|     36|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  1.06k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 1.06k, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 1.06k]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|    435|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 435, False: 626]
  |  |  ------------------
  |  | 2958|    435|			*p++ = *ucptr++;	\
  |  | 2959|    435|			/* FALL THROUGH */	\
  |  | 2960|  1.06k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 626, False: 435]
  |  |  ------------------
  |  | 2961|  1.06k|			*p++ = *ucptr++;	\
  |  | 2962|  1.06k|			/* FALL THROUGH */	\
  |  | 2963|  1.06k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 0, False: 1.06k]
  |  |  ------------------
  |  | 2964|  1.06k|			*p++ = *ucptr;		\
  |  | 2965|  1.06k|			break;			\
  |  | 2966|  1.06k|		}				\
  |  | 2967|  1.06k|		ucptr = NULL;			\
  |  | 2968|  1.06k|	} 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|  1.06k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 1.06k]
  |  |  ------------------
  ------------------
 3134|  1.06k|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|  1.06k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|  1.06k|	uc = uc2;				\
  |  | 2923|  1.06k|	ucptr = uc2ptr;				\
  |  | 2924|  1.06k|	n = n2;					\
  |  | 2925|  1.06k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 1.06k]
  |  |  ------------------
  ------------------
 3135|  1.06k|				}
 3136|  1.59k|				continue;
 3137|  52.9k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2874|  52.9k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3137:15): [True: 4.42k, False: 48.5k]
  ------------------
 3138|  4.42k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2882|  57.4k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2878|  4.42k|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2881|  4.42k|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2879|  4.42k|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2880|  4.42k|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2880|  2.66k|#define HC_TCOUNT	28
  ------------------
  |  Branch (3138:8): [True: 2.66k, False: 1.75k]
  |  Branch (3138:30): [True: 573, False: 2.09k]
  ------------------
 3139|       |				/*
 3140|       |				 * Hangul Composition.
 3141|       |				 * 2. Two current code points are LV and T.
 3142|       |				 */
 3143|    573|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2877|    573|#define HC_TBASE	0x11A7
  ------------------
 3144|    573|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2880|    365|#define HC_TCOUNT	28
  ------------------
  |  Branch (3144:9): [True: 365, False: 208]
  |  Branch (3144:23): [True: 14, False: 351]
  ------------------
 3145|       |					/* Make syllable of form LVT. */
 3146|     14|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2913|     14|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|     14|	uc = new_uc;				\
  |  | 2915|     14|	ucptr = NULL;				\
  |  | 2916|     14|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 14]
  |  |  ------------------
  ------------------
 3147|    559|				} else {
 3148|    559|					WRITE_UC();
  ------------------
  |  | 2949|    559|#define WRITE_UC()	do {			\
  |  | 2950|    559|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 300, False: 259]
  |  |  ------------------
  |  | 2951|    300|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 5, False: 295]
  |  |  ------------------
  |  | 2952|    300|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|      5|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|      5|	as->length = p - as->s;			\
  |  |  |  | 2929|      5|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  |  | 2930|      5|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|      5|		return (-1);			\
  |  |  |  | 2932|      5|	p = as->s + as->length;			\
  |  |  |  | 2933|      5|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|      5|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|    300|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 300, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 300]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|    187|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 187, False: 113]
  |  |  ------------------
  |  | 2958|    187|			*p++ = *ucptr++;	\
  |  | 2959|    187|			/* FALL THROUGH */	\
  |  | 2960|    300|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 113, False: 187]
  |  |  ------------------
  |  | 2961|    300|			*p++ = *ucptr++;	\
  |  | 2962|    300|			/* FALL THROUGH */	\
  |  | 2963|    300|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 0, False: 300]
  |  |  ------------------
  |  | 2964|    300|			*p++ = *ucptr;		\
  |  | 2965|    300|			break;			\
  |  | 2966|    300|		}				\
  |  | 2967|    300|		ucptr = NULL;			\
  |  | 2968|    300|	} else {				\
  |  | 2969|    259|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    259|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    276|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 17, False: 259]
  |  |  |  |  ------------------
  |  |  |  | 2938|     17|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     17|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     17|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     17|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     17|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     17|		return (-1);			\
  |  |  |  |  |  | 2932|     17|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     17|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     17|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     17|	}					\
  |  |  |  | 2940|    259|	p += w;					\
  |  |  |  | 2941|    259|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 259]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    259|	}					\
  |  | 2971|    559|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 559]
  |  |  ------------------
  ------------------
 3149|    559|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|    559|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|    559|	uc = uc2;				\
  |  | 2923|    559|	ucptr = uc2ptr;				\
  |  | 2924|    559|	n = n2;					\
  |  | 2925|    559|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 559]
  |  |  ------------------
  ------------------
 3150|    559|				}
 3151|    573|				continue;
 3152|  52.4k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3152:15): [True: 1.42k, False: 50.9k]
  ------------------
 3153|       |				/* A composition to current code points
 3154|       |				 * is found. */
 3155|  1.42k|				UPDATE_UC(nfc);
  ------------------
  |  | 2913|  1.42k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|  1.42k|	uc = new_uc;				\
  |  | 2915|  1.42k|	ucptr = NULL;				\
  |  | 2916|  1.42k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 1.42k]
  |  |  ------------------
  ------------------
 3156|  1.42k|				continue;
 3157|  50.9k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1007|  50.9k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 503, False: 50.4k]
  |  |  ------------------
  |  | 1008|  50.9k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3157:15): [True: 19.9k, False: 31.0k]
  ------------------
 3158|       |				/* Clearly 'uc2' the second code point is not
 3159|       |				 * a decomposable code. */
 3160|  19.9k|				WRITE_UC();
  ------------------
  |  | 2949|  19.9k|#define WRITE_UC()	do {			\
  |  | 2950|  19.9k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 19.6k, False: 329]
  |  |  ------------------
  |  | 2951|  19.6k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 34, False: 19.6k]
  |  |  ------------------
  |  | 2952|  19.6k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|     34|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|     34|	as->length = p - as->s;			\
  |  |  |  | 2929|     34|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 34]
  |  |  |  |  ------------------
  |  |  |  | 2930|     34|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|     34|		return (-1);			\
  |  |  |  | 2932|     34|	p = as->s + as->length;			\
  |  |  |  | 2933|     34|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|     34|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  19.6k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 19.6k, False: 0]
  |  |  ------------------
  |  | 2954|    217|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 217, False: 19.4k]
  |  |  ------------------
  |  | 2955|    217|			*p++ = *ucptr++;	\
  |  | 2956|    217|			/* FALL THROUGH */	\
  |  | 2957|    564|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 347, False: 19.3k]
  |  |  ------------------
  |  | 2958|    564|			*p++ = *ucptr++;	\
  |  | 2959|    564|			/* FALL THROUGH */	\
  |  | 2960|  14.5k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 13.9k, False: 5.69k]
  |  |  ------------------
  |  | 2961|  14.5k|			*p++ = *ucptr++;	\
  |  | 2962|  14.5k|			/* FALL THROUGH */	\
  |  | 2963|  19.6k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 5.13k, False: 14.5k]
  |  |  ------------------
  |  | 2964|  19.6k|			*p++ = *ucptr;		\
  |  | 2965|  19.6k|			break;			\
  |  | 2966|  19.6k|		}				\
  |  | 2967|  19.6k|		ucptr = NULL;			\
  |  | 2968|  19.6k|	} else {				\
  |  | 2969|    329|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    329|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    335|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 6, False: 329]
  |  |  |  |  ------------------
  |  |  |  | 2938|      6|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|      6|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|      6|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|      6|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|      6|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|      6|		return (-1);			\
  |  |  |  |  |  | 2932|      6|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|      6|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|      6|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|      6|	}					\
  |  |  |  | 2940|    329|	p += w;					\
  |  |  |  | 2941|    329|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 329]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    329|	}					\
  |  | 2971|  19.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 3161|  19.9k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|  19.9k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|  19.9k|	uc = uc2;				\
  |  | 2923|  19.9k|	ucptr = uc2ptr;				\
  |  | 2924|  19.9k|	n = n2;					\
  |  | 2925|  19.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 3162|  19.9k|				continue;
 3163|  19.9k|			}
 3164|       |
 3165|       |			/*
 3166|       |			 * Collect following decomposable code points.
 3167|       |			 */
 3168|  31.0k|			cx = 0;
 3169|  31.0k|			ucx[0] = uc2;
 3170|  31.0k|			ccx[0] = cl;
 3171|  31.0k|			COLLECT_CPS(1);
  ------------------
  |  | 2976|  31.0k|#define COLLECT_CPS(start)	do {		\
  |  | 2977|  31.0k|	int _i;					\
  |  | 2978|  61.9k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2907|  61.9k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2978:19): [True: 61.7k, False: 281]
  |  |  ------------------
  |  | 2979|  61.7k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2980|  61.7k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2980:7): [True: 3.42k, False: 58.2k]
  |  |  ------------------
  |  | 2981|  61.7k|			break;			\
  |  | 2982|  61.7k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  58.2k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 929, False: 57.3k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  58.2k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2983|  58.2k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2983:7): [True: 31.3k, False: 26.9k]
  |  |  |  Branch (2983:19): [True: 27.6k, False: 3.61k]
  |  |  |  Branch (2983:32): [True: 27.3k, False: 386]
  |  |  ------------------
  |  | 2984|  58.2k|			break;			\
  |  | 2985|  58.2k|		s += nx;			\
  |  | 2986|  30.9k|		len -= nx;			\
  |  | 2987|  30.9k|		cl = cx;			\
  |  | 2988|  30.9k|		ccx[_i] = cx;			\
  |  | 2989|  30.9k|	}					\
  |  | 2990|  31.0k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2907|  31.0k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2990:6): [True: 281, False: 30.7k]
  |  |  ------------------
  |  | 2991|    281|		ret = -1;			\
  |  | 2992|    281|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2907|    281|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2993|    281|	} else					\
  |  | 2994|  31.0k|		ucx_size = _i;			\
  |  | 2995|  31.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2995:10): [Folded, False: 31.0k]
  |  |  ------------------
  ------------------
 3172|       |
 3173|       |			/*
 3174|       |			 * Find a composed code in the collected code points.
 3175|       |			 */
 3176|  31.0k|			i = 1;
 3177|  94.0k|			while (i < ucx_size) {
  ------------------
  |  Branch (3177:11): [True: 63.0k, False: 31.0k]
  ------------------
 3178|  63.0k|				int j;
 3179|       |
 3180|  63.0k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3180:9): [True: 37.7k, False: 25.3k]
  ------------------
 3181|  37.7k|					i++;
 3182|  37.7k|					continue;
 3183|  37.7k|				}
 3184|       |
 3185|       |				/*
 3186|       |				 * nfc is composed of uc and ucx[i].
 3187|       |				 */
 3188|  25.3k|				UPDATE_UC(nfc);
  ------------------
  |  | 2913|  25.3k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|  25.3k|	uc = new_uc;				\
  |  | 2915|  25.3k|	ucptr = NULL;				\
  |  | 2916|  25.3k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 25.3k]
  |  |  ------------------
  ------------------
 3189|       |
 3190|       |				/*
 3191|       |				 * Remove ucx[i] by shifting
 3192|       |				 * following code points.
 3193|       |				 */
 3194|  26.9k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3194:17): [True: 1.57k, False: 25.3k]
  ------------------
 3195|  1.57k|					ucx[j] = ucx[j+1];
 3196|  1.57k|					ccx[j] = ccx[j+1];
 3197|  1.57k|				}
 3198|  25.3k|				ucx_size --;
 3199|       |
 3200|       |				/*
 3201|       |				 * Collect following code points blocked
 3202|       |				 * by ucx[i] the removed code point.
 3203|       |				 */
 3204|  25.3k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3204:9): [True: 25.3k, False: 0]
  |  Branch (3204:25): [True: 25.0k, False: 328]
  ------------------
 3205|  25.0k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3205:9): [True: 23.6k, False: 1.33k]
  |  Branch (3205:19): [True: 4.12k, False: 19.5k]
  ------------------
 3206|  4.12k|					cl =  ccx[ucx_size-1];
 3207|  4.12k|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 2976|  4.12k|#define COLLECT_CPS(start)	do {		\
  |  | 2977|  4.12k|	int _i;					\
  |  | 2978|  9.80k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2907|  9.80k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2978:19): [True: 9.54k, False: 258]
  |  |  ------------------
  |  | 2979|  9.54k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2980|  9.54k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2980:7): [True: 606, False: 8.94k]
  |  |  ------------------
  |  | 2981|  9.54k|			break;			\
  |  | 2982|  9.54k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  8.94k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 3.01k, False: 5.92k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  8.94k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2983|  8.94k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2983:7): [True: 4.81k, False: 4.12k]
  |  |  |  Branch (2983:19): [True: 3.26k, False: 1.54k]
  |  |  |  Branch (2983:32): [True: 3.26k, False: 0]
  |  |  ------------------
  |  | 2984|  8.94k|			break;			\
  |  | 2985|  8.94k|		s += nx;			\
  |  | 2986|  5.67k|		len -= nx;			\
  |  | 2987|  5.67k|		cl = cx;			\
  |  | 2988|  5.67k|		ccx[_i] = cx;			\
  |  | 2989|  5.67k|	}					\
  |  | 2990|  4.12k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2907|  4.12k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2990:6): [True: 258, False: 3.87k]
  |  |  ------------------
  |  | 2991|    258|		ret = -1;			\
  |  | 2992|    258|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2907|    258|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2993|    258|	} else					\
  |  | 2994|  4.12k|		ucx_size = _i;			\
  |  | 2995|  4.12k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2995:10): [Folded, False: 4.12k]
  |  |  ------------------
  ------------------
 3208|  4.12k|				}
 3209|       |				/*
 3210|       |				 * Restart finding a composed code with
 3211|       |				 * the updated uc from the top of the
 3212|       |				 * collected code points.
 3213|       |				 */
 3214|  25.3k|				i = 0;
 3215|  25.3k|			}
 3216|       |
 3217|       |			/*
 3218|       |			 * Apparently the current code points are not
 3219|       |			 * decomposed characters or already composed.
 3220|       |			 */
 3221|  31.0k|			WRITE_UC();
  ------------------
  |  | 2949|  31.0k|#define WRITE_UC()	do {			\
  |  | 2950|  31.0k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 5.37k, False: 25.6k]
  |  |  ------------------
  |  | 2951|  5.37k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 71, False: 5.30k]
  |  |  ------------------
  |  | 2952|  5.37k|			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.37k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 5.37k, False: 0]
  |  |  ------------------
  |  | 2954|    185|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 185, False: 5.18k]
  |  |  ------------------
  |  | 2955|    185|			*p++ = *ucptr++;	\
  |  | 2956|    185|			/* FALL THROUGH */	\
  |  | 2957|    896|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 711, False: 4.66k]
  |  |  ------------------
  |  | 2958|    896|			*p++ = *ucptr++;	\
  |  | 2959|    896|			/* FALL THROUGH */	\
  |  | 2960|  2.22k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 1.33k, False: 4.04k]
  |  |  ------------------
  |  | 2961|  2.22k|			*p++ = *ucptr++;	\
  |  | 2962|  2.22k|			/* FALL THROUGH */	\
  |  | 2963|  5.37k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 3.14k, False: 2.22k]
  |  |  ------------------
  |  | 2964|  5.37k|			*p++ = *ucptr;		\
  |  | 2965|  5.37k|			break;			\
  |  | 2966|  5.37k|		}				\
  |  | 2967|  5.37k|		ucptr = NULL;			\
  |  | 2968|  25.6k|	} else {				\
  |  | 2969|  25.6k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|  25.6k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|  25.6k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 10, False: 25.6k]
  |  |  |  |  ------------------
  |  |  |  | 2938|     10|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     10|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     10|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     10|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     10|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     10|		return (-1);			\
  |  |  |  |  |  | 2932|     10|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     10|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     10|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     10|	}					\
  |  |  |  | 2940|  25.6k|	p += w;					\
  |  |  |  | 2941|  25.6k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 25.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|  25.6k|	}					\
  |  | 2971|  31.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 31.0k]
  |  |  ------------------
  ------------------
 3222|  73.3k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3222:16): [True: 42.3k, False: 31.0k]
  ------------------
 3223|  42.3k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2936|  73.3k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|  42.3k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 37, False: 42.3k]
  |  |  ------------------
  |  | 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|  42.3k|	p += w;					\
  |  | 2941|  42.3k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 42.3k]
  |  |  ------------------
  ------------------
 3224|       |
 3225|       |			/*
 3226|       |			 * Flush out remaining canonical combining characters.
 3227|       |			 */
 3228|  31.0k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3228:8): [True: 26.9k, False: 4.03k]
  |  Branch (3228:18): [True: 2.12k, False: 24.8k]
  |  Branch (3228:30): [True: 2.12k, False: 0]
  ------------------
 3229|  81.9k|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3229:12): [True: 80.2k, False: 1.64k]
  ------------------
 3230|  81.9k|				    > 0) {
 3231|  80.2k|					cx = CCC(ucx[0]);
  ------------------
  |  | 1007|  80.2k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 660, False: 79.6k]
  |  |  ------------------
  |  | 1008|  80.2k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
 3232|  80.2k|					if (cl > cx)
  ------------------
  |  Branch (3232:10): [True: 477, False: 79.8k]
  ------------------
 3233|    477|						break;
 3234|  79.8k|					s += nx;
 3235|  79.8k|					len -= nx;
 3236|  79.8k|					cl = cx;
 3237|  79.8k|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2936|  79.8k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|  80.4k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 622, False: 79.8k]
  |  |  ------------------
  |  | 2938|    622|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|    622|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    622|	as->length = p - as->s;			\
  |  |  |  | 2929|    622|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 622]
  |  |  |  |  ------------------
  |  |  |  | 2930|    622|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    622|		return (-1);			\
  |  |  |  | 2932|    622|	p = as->s + as->length;			\
  |  |  |  | 2933|    622|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    622|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 622]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|    622|	}					\
  |  | 2940|  79.8k|	p += w;					\
  |  | 2941|  79.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 79.8k]
  |  |  ------------------
  ------------------
 3238|  79.8k|				}
 3239|  2.12k|			}
 3240|  31.0k|			break;
 3241|  31.0k|		}
 3242|   173k|		if (n2 < 0) {
  ------------------
  |  Branch (3242:7): [True: 98.0k, False: 74.9k]
  ------------------
 3243|  98.0k|			WRITE_UC();
  ------------------
  |  | 2949|  98.0k|#define WRITE_UC()	do {			\
  |  | 2950|  98.0k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 97.3k, False: 709]
  |  |  ------------------
  |  | 2951|  97.3k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 152, False: 97.2k]
  |  |  ------------------
  |  | 2952|  97.3k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|    152|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    152|	as->length = p - as->s;			\
  |  |  |  | 2929|    152|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 152]
  |  |  |  |  ------------------
  |  |  |  | 2930|    152|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    152|		return (-1);			\
  |  |  |  | 2932|    152|	p = as->s + as->length;			\
  |  |  |  | 2933|    152|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    152|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 152]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  97.3k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 97.3k, False: 0]
  |  |  ------------------
  |  | 2954|    658|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 658, False: 96.7k]
  |  |  ------------------
  |  | 2955|    658|			*p++ = *ucptr++;	\
  |  | 2956|    658|			/* FALL THROUGH */	\
  |  | 2957|  2.47k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 1.82k, False: 95.5k]
  |  |  ------------------
  |  | 2958|  2.47k|			*p++ = *ucptr++;	\
  |  | 2959|  2.47k|			/* FALL THROUGH */	\
  |  | 2960|  5.06k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 2.58k, False: 94.8k]
  |  |  ------------------
  |  | 2961|  5.06k|			*p++ = *ucptr++;	\
  |  | 2962|  5.06k|			/* FALL THROUGH */	\
  |  | 2963|  97.3k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 92.3k, False: 5.06k]
  |  |  ------------------
  |  | 2964|  97.3k|			*p++ = *ucptr;		\
  |  | 2965|  97.3k|			break;			\
  |  | 2966|  97.3k|		}				\
  |  | 2967|  97.3k|		ucptr = NULL;			\
  |  | 2968|  97.3k|	} else {				\
  |  | 2969|    709|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    709|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    724|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 15, False: 709]
  |  |  |  |  ------------------
  |  |  |  | 2938|     15|		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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     15|	}					\
  |  |  |  | 2940|    709|	p += w;					\
  |  |  |  | 2941|    709|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 709]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    709|	}					\
  |  | 2971|  98.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 98.0k]
  |  |  ------------------
  ------------------
 3244|       |			/* Use a replaced unicode character. */
 3245|  98.0k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2936|  98.0k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|  98.6k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 583, False: 98.0k]
  |  |  ------------------
  |  | 2938|    583|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|    583|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    583|	as->length = p - as->s;			\
  |  |  |  | 2929|    583|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 583]
  |  |  |  |  ------------------
  |  |  |  | 2930|    583|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    583|		return (-1);			\
  |  |  |  | 2932|    583|	p = as->s + as->length;			\
  |  |  |  | 2933|    583|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    583|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 583]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|    583|	}					\
  |  | 2940|  98.0k|	p += w;					\
  |  | 2941|  98.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 98.0k]
  |  |  ------------------
  ------------------
 3246|  98.0k|			s += n2*-1;
 3247|  98.0k|			len -= n2*-1;
 3248|  98.0k|			ret = -1;
 3249|  98.0k|			continue;
 3250|  98.0k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3250:14): [True: 43.9k, False: 31.0k]
  ------------------
 3251|  43.9k|			WRITE_UC();
  ------------------
  |  | 2949|  43.9k|#define WRITE_UC()	do {			\
  |  | 2950|  43.9k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 43.8k, False: 72]
  |  |  ------------------
  |  | 2951|  43.8k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 243, False: 43.6k]
  |  |  ------------------
  |  | 2952|  43.8k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|    243|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    243|	as->length = p - as->s;			\
  |  |  |  | 2929|    243|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 243]
  |  |  |  |  ------------------
  |  |  |  | 2930|    243|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    243|		return (-1);			\
  |  |  |  | 2932|    243|	p = as->s + as->length;			\
  |  |  |  | 2933|    243|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    243|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 243]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  43.8k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 43.8k, False: 0]
  |  |  ------------------
  |  | 2954|    208|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 208, False: 43.6k]
  |  |  ------------------
  |  | 2955|    208|			*p++ = *ucptr++;	\
  |  | 2956|    208|			/* FALL THROUGH */	\
  |  | 2957|    376|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 168, False: 43.6k]
  |  |  ------------------
  |  | 2958|    376|			*p++ = *ucptr++;	\
  |  | 2959|    376|			/* FALL THROUGH */	\
  |  | 2960|  3.14k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 2.76k, False: 41.0k]
  |  |  ------------------
  |  | 2961|  3.14k|			*p++ = *ucptr++;	\
  |  | 2962|  3.14k|			/* FALL THROUGH */	\
  |  | 2963|  43.8k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 40.7k, False: 3.14k]
  |  |  ------------------
  |  | 2964|  43.8k|			*p++ = *ucptr;		\
  |  | 2965|  43.8k|			break;			\
  |  | 2966|  43.8k|		}				\
  |  | 2967|  43.8k|		ucptr = NULL;			\
  |  | 2968|  43.8k|	} else {				\
  |  | 2969|     72|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|     72|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    107|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 35, False: 72]
  |  |  |  |  ------------------
  |  |  |  | 2938|     35|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     35|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     35|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     35|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     35|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     35|		return (-1);			\
  |  |  |  |  |  | 2932|     35|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     35|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     35|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     35|	}					\
  |  |  |  | 2940|     72|	p += w;					\
  |  |  |  | 2941|     72|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|     72|	}					\
  |  | 2971|  43.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 43.9k]
  |  |  ------------------
  ------------------
 3252|  43.9k|			break;
 3253|  43.9k|		}
 3254|   173k|	}
 3255|  49.9k|	as->length = p - as->s;
 3256|  49.9k|	as->s[as->length] = '\0';
 3257|  49.9k|	if (ts == 2)
  ------------------
  |  Branch (3257:6): [True: 2.77k, False: 47.1k]
  ------------------
 3258|  2.77k|		as->s[as->length+1] = '\0';
 3259|  49.9k|	return (ret);
 3260|  49.9k|}
archive_string.c:get_nfc:
 2886|   115k|{
 2887|   115k|	int t, b;
 2888|       |
 2889|   115k|	t = 0;
 2890|   115k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2891|  1.15M|	while (b >= t) {
  ------------------
  |  Branch (2891:9): [True: 1.06M, False: 88.6k]
  ------------------
 2892|  1.06M|		int m = (t + b) / 2;
 2893|  1.06M|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2893:7): [True: 556k, False: 511k]
  ------------------
 2894|   556k|			t = m + 1;
 2895|   511k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2895:12): [True: 418k, False: 92.7k]
  ------------------
 2896|   418k|			b = m - 1;
 2897|  92.7k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2897:12): [True: 38.1k, False: 54.5k]
  ------------------
 2898|  38.1k|			t = m + 1;
 2899|  54.5k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2899:12): [True: 27.8k, False: 26.7k]
  ------------------
 2900|  27.8k|			b = m - 1;
 2901|  26.7k|		else
 2902|  26.7k|			return (u_composition_table[m].nfc);
 2903|  1.06M|	}
 2904|  88.6k|	return (0);
 2905|   115k|}
archive_string.c:best_effort_strncat_in_locale:
 2310|     12|{
 2311|     12|	size_t remaining;
 2312|     12|	const uint8_t *itp;
 2313|     12|	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|     12|	if (sc->same) {
  ------------------
  |  Branch (2319:6): [True: 0, False: 12]
  ------------------
 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|     12|	remaining = length;
 2333|     12|	itp = (const uint8_t *)_p;
 2334|    650|	while (remaining > 0 && *itp) {
  ------------------
  |  Branch (2334:9): [True: 638, False: 12]
  |  Branch (2334:26): [True: 638, False: 0]
  ------------------
 2335|    638|		if (*itp > 127) {
  ------------------
  |  Branch (2335:7): [True: 316, False: 322]
  ------------------
 2336|       |			// Non-ASCII: Substitute with suitable replacement
 2337|    316|			if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|    316|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2337:8): [True: 0, False: 316]
  ------------------
 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|    316|			} else {
 2342|    316|				archive_strappend_char(as, '?');
 2343|    316|			}
 2344|    316|			return_value = -1;
 2345|    322|		} else {
 2346|    322|			archive_strappend_char(as, *itp);
 2347|    322|		}
 2348|    638|		++itp;
 2349|    638|		--remaining;
 2350|    638|	}
 2351|     12|	return (return_value);
 2352|     12|}
archive_string.c:utf16nbytes:
 1992|  4.60k|{
 1993|  4.60k|	size_t s;
 1994|  4.60k|	const char *p, *pp;
 1995|       |
 1996|  4.60k|	if (_p == NULL)
  ------------------
  |  Branch (1996:6): [True: 0, False: 4.60k]
  ------------------
 1997|      0|		return (0);
 1998|  4.60k|	p = (const char *)_p;
 1999|       |
 2000|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 2001|  4.60k|	s = 0;
 2002|  4.60k|	pp = p;
 2003|  4.60k|	n >>= 1;
 2004|  65.2k|	while (s < n && (pp[0] || pp[1])) {
  ------------------
  |  Branch (2004:9): [True: 62.8k, False: 2.43k]
  |  Branch (2004:19): [True: 49.7k, False: 13.0k]
  |  Branch (2004:28): [True: 10.8k, False: 2.16k]
  ------------------
 2005|  60.6k|		pp += 2;
 2006|  60.6k|		s++;
 2007|  60.6k|	}
 2008|  4.60k|	return (s<<1);
 2009|  4.60k|}
archive_string.c:mbsnbytes:
 1972|   414k|{
 1973|   414k|	size_t s;
 1974|   414k|	const char *p, *pp;
 1975|       |
 1976|   414k|	if (_p == NULL)
  ------------------
  |  Branch (1976:6): [True: 0, False: 414k]
  ------------------
 1977|      0|		return (0);
 1978|   414k|	p = (const char *)_p;
 1979|       |
 1980|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1981|   414k|	s = 0;
 1982|   414k|	pp = p;
 1983|  91.5M|	while (s < n && *pp) {
  ------------------
  |  Branch (1983:9): [True: 91.1M, False: 372k]
  |  Branch (1983:18): [True: 91.1M, False: 42.3k]
  ------------------
 1984|  91.1M|		pp++;
 1985|  91.1M|		s++;
 1986|  91.1M|	}
 1987|   414k|	return (s);
 1988|   414k|}

archive_string_sprintf:
   77|  70.2k|{
   78|  70.2k|	va_list ap;
   79|       |
   80|  70.2k|	va_start(ap, fmt);
   81|  70.2k|	archive_string_vsprintf(as, fmt, ap);
   82|       |	va_end(ap);
   83|  70.2k|}
archive_string_vsprintf:
   92|   743k|{
   93|   743k|	char long_flag;
   94|   743k|	intmax_t s; /* Signed integer temp. */
   95|   743k|	uintmax_t u; /* Unsigned integer temp. */
   96|   743k|	const char *p, *p2;
   97|   743k|	const wchar_t *pw;
   98|       |
   99|   743k|	if (archive_string_ensure(as, 64) == NULL)
  ------------------
  |  Branch (99:6): [True: 0, False: 743k]
  ------------------
  100|      0|		__archive_errx(1, "Out of memory");
  101|       |
  102|   743k|	if (fmt == NULL) {
  ------------------
  |  Branch (102:6): [True: 0, False: 743k]
  ------------------
  103|      0|		as->s[0] = 0;
  104|      0|		return;
  105|      0|	}
  106|       |
  107|  28.5M|	for (p = fmt; *p != '\0'; p++) {
  ------------------
  |  Branch (107:16): [True: 27.8M, False: 743k]
  ------------------
  108|  27.8M|		const char *saved_p = p;
  109|       |
  110|  27.8M|		if (*p != '%') {
  ------------------
  |  Branch (110:7): [True: 27.5M, False: 288k]
  ------------------
  111|  27.5M|			archive_strappend_char(as, *p);
  112|  27.5M|			continue;
  113|  27.5M|		}
  114|       |
  115|   288k|		p++;
  116|       |
  117|   288k|		long_flag = '\0';
  118|   288k|		switch(*p) {
  ------------------
  |  Branch (118:10): [True: 71.5k, False: 216k]
  ------------------
  119|    330|		case 'l':
  ------------------
  |  Branch (119:3): [True: 330, False: 288k]
  ------------------
  120|    330|			if (p[1] == 'l') {
  ------------------
  |  Branch (120:8): [True: 166, False: 164]
  ------------------
  121|    166|				long_flag = 'L';
  122|    166|				p += 2;
  123|    166|				break;
  124|    166|			}
  125|    164|			__LA_FALLTHROUGH;
  126|  42.8k|		case 'j':
  ------------------
  |  Branch (126:3): [True: 42.6k, False: 245k]
  ------------------
  127|  71.3k|		case 'z':
  ------------------
  |  Branch (127:3): [True: 28.5k, False: 259k]
  ------------------
  128|  71.3k|			long_flag = *p;
  129|  71.3k|			p++;
  130|  71.3k|			break;
  131|   288k|		}
  132|       |
  133|   288k|		switch (*p) {
  134|      0|		case '%':
  ------------------
  |  Branch (134:3): [True: 0, False: 288k]
  ------------------
  135|      0|			archive_strappend_char(as, '%');
  136|      0|			break;
  137|  1.09k|		case 'c':
  ------------------
  |  Branch (137:3): [True: 1.09k, False: 287k]
  ------------------
  138|  1.09k|			s = va_arg(ap, int);
  139|  1.09k|			archive_strappend_char(as, (char)s);
  140|  1.09k|			break;
  141|   147k|		case 'd':
  ------------------
  |  Branch (141:3): [True: 147k, False: 140k]
  ------------------
  142|   147k|			switch(long_flag) {
  143|  37.0k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (143:4): [True: 37.0k, False: 110k]
  ------------------
  144|      0|			case 'l': s = va_arg(ap, long); break;
  ------------------
  |  Branch (144:4): [True: 0, False: 147k]
  ------------------
  145|     97|			case 'L': s = va_arg(ap, long long); break;
  ------------------
  |  Branch (145:4): [True: 97, False: 147k]
  ------------------
  146|      0|			case 'z': s = va_arg(ap, ssize_t); break;
  ------------------
  |  Branch (146:4): [True: 0, False: 147k]
  ------------------
  147|   110k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (147:4): [True: 110k, False: 37.1k]
  ------------------
  148|   147k|			}
  149|   147k|			append_int(as, s, 10);
  150|   147k|			break;
  151|  99.3k|		case 's':
  ------------------
  |  Branch (151:3): [True: 99.3k, False: 189k]
  ------------------
  152|  99.3k|			switch(long_flag) {
  153|      0|			case 'l':
  ------------------
  |  Branch (153:4): [True: 0, False: 99.3k]
  ------------------
  154|      0|			case 'L':
  ------------------
  |  Branch (154:4): [True: 0, False: 99.3k]
  ------------------
  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|  99.3k|			default:
  ------------------
  |  Branch (162:4): [True: 99.3k, False: 0]
  ------------------
  163|  99.3k|				p2 = va_arg(ap, char *);
  164|  99.3k|				if (p2 == NULL)
  ------------------
  |  Branch (164:9): [True: 2, False: 99.3k]
  ------------------
  165|      2|					p2 = "(null)";
  166|  99.3k|				archive_strcat(as, p2);
  167|  99.3k|				break;
  168|  99.3k|			}
  169|  99.3k|			break;
  170|  99.3k|		case 'S':
  ------------------
  |  Branch (170:3): [True: 0, False: 288k]
  ------------------
  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|  40.3k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (178:3): [True: 0, False: 288k]
  |  Branch (178:13): [True: 40.1k, False: 248k]
  |  Branch (178:23): [True: 236, False: 288k]
  |  Branch (178:33): [True: 34, False: 288k]
  ------------------
  179|       |			/* Common handling for unsigned integer formats. */
  180|  40.3k|			switch(long_flag) {
  181|  5.64k|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (181:4): [True: 5.64k, False: 34.7k]
  ------------------
  182|    164|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (182:4): [True: 164, False: 40.2k]
  ------------------
  183|     69|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (183:4): [True: 69, False: 40.3k]
  ------------------
  184|  28.5k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (184:4): [True: 28.5k, False: 11.8k]
  ------------------
  185|  5.97k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (185:4): [True: 5.97k, False: 34.4k]
  ------------------
  186|  40.3k|			}
  187|       |			/* Format it in the correct base. */
  188|  40.3k|			switch (*p) {
  189|      0|			case 'o': append_uint(as, u, 8); break;
  ------------------
  |  Branch (189:4): [True: 0, False: 40.3k]
  ------------------
  190|  40.1k|			case 'u': append_uint(as, u, 10); break;
  ------------------
  |  Branch (190:4): [True: 40.1k, False: 270]
  ------------------
  191|    270|			default: append_uint(as, u, 16); break;
  ------------------
  |  Branch (191:4): [True: 270, False: 40.1k]
  ------------------
  192|  40.3k|			}
  193|  40.3k|			break;
  194|  40.3k|		default:
  ------------------
  |  Branch (194:3): [True: 28, False: 288k]
  ------------------
  195|       |			/* Rewind and print the initial '%' literally. */
  196|     28|			p = saved_p;
  197|     28|			archive_strappend_char(as, *p);
  198|   288k|		}
  199|   288k|	}
  200|   743k|}
archive_string_sprintf.c:append_int:
   63|   147k|{
   64|   147k|	uintmax_t ud;
   65|       |
   66|   147k|	if (d < 0) {
  ------------------
  |  Branch (66:6): [True: 10.3k, False: 137k]
  ------------------
   67|  10.3k|		archive_strappend_char(as, '-');
   68|  10.3k|		ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
  ------------------
  |  Branch (68:8): [True: 37, False: 10.2k]
  ------------------
   69|  10.3k|	} else
   70|   137k|		ud = d;
   71|   147k|	append_uint(as, ud, base);
   72|   147k|}
archive_string_sprintf.c:append_uint:
   54|   370k|{
   55|   370k|	static const char digits[] = "0123456789abcdef";
   56|   370k|	if (d >= base)
  ------------------
  |  Branch (56:6): [True: 182k, False: 187k]
  ------------------
   57|   182k|		append_uint(as, d/base, base);
   58|   370k|	archive_strappend_char(as, digits[d % base]);
   59|   370k|}

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

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

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

__archive_create_child:
   76|      2|{
   77|      2|	pid_t child = -1;
   78|      2|	int stdin_pipe[2], stdout_pipe[2], tmp;
   79|       |
   80|      2|#if !defined(POSIX_SPAWN_CLOEXEC_DEFAULT) && \
   81|      2|    (HAVE_FORK || HAVE_VFORK) && \
   82|      2|    (HAVE_CLOSEFROM || HAVE_CLOSE_RANGE || defined(_SC_OPEN_MAX))
   83|      2|#undef HAVE_POSIX_SPAWNP
   84|      2|#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|      2|	struct archive_cmdline *cmdline;
   92|       |
   93|      2|	cmdline = __archive_cmdline_allocate();
   94|      2|	if (cmdline == NULL)
  ------------------
  |  Branch (94:6): [True: 0, False: 2]
  ------------------
   95|      0|		goto state_allocated;
   96|      2|	if (__archive_cmdline_parse(cmdline, cmd) != ARCHIVE_OK)
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (96:6): [True: 0, False: 2]
  ------------------
   97|      0|		goto state_allocated;
   98|       |
   99|      2|	if (pipe(stdin_pipe) == -1)
  ------------------
  |  Branch (99:6): [True: 0, False: 2]
  ------------------
  100|      0|		goto state_allocated;
  101|      2|	if (stdin_pipe[0] == 1 /* stdout */) {
  ------------------
  |  Branch (101:6): [True: 0, False: 2]
  ------------------
  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|      2|	if (pipe(stdout_pipe) == -1)
  ------------------
  |  Branch (107:6): [True: 0, False: 2]
  ------------------
  108|      0|		goto stdin_opened;
  109|      2|	if (stdout_pipe[1] == 0 /* stdin */) {
  ------------------
  |  Branch (109:6): [True: 0, False: 2]
  ------------------
  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|      2|#if HAVE_VFORK
  167|      2|	child = vfork();
  168|       |#else
  169|       |	child = fork();
  170|       |#endif
  171|      2|	if (child == -1)
  ------------------
  |  Branch (171:6): [True: 0, False: 2]
  ------------------
  172|      0|		goto stdout_opened;
  173|      2|	if (child == 0) {
  ------------------
  |  Branch (173:6): [True: 2, False: 0]
  ------------------
  174|      2|		close(stdin_pipe[1]);
  175|      2|		close(stdout_pipe[0]);
  176|      2|		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
  ------------------
  |  Branch (176:7): [True: 0, False: 2]
  ------------------
  177|      0|			_exit(254);
  178|      2|		if (stdin_pipe[0] != 0 /* stdin */)
  ------------------
  |  Branch (178:7): [True: 2, False: 0]
  ------------------
  179|      2|			close(stdin_pipe[0]);
  180|      2|		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
  ------------------
  |  Branch (180:7): [True: 0, False: 2]
  ------------------
  181|      0|			_exit(254);
  182|      2|		if (stdout_pipe[1] != 1 /* stdout */)
  ------------------
  |  Branch (182:7): [True: 2, False: 0]
  ------------------
  183|      2|			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|  2.04k|		for (int i = sysconf(_SC_OPEN_MAX); i > 3;)
  ------------------
  |  Branch (190:39): [True: 2.04k, False: 2]
  ------------------
  191|  2.04k|			close(--i);
  192|      2|#endif
  193|       |
  194|      2|		execvp(cmdline->path, cmdline->argv);
  195|      2|		_exit(254);
  196|      2|	}
  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.83k|{
  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.83k|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|  1.83k|#   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.83k|    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.83k, False: 0]
  ------------------
  315|  1.83k|        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.83k|#endif
  319|  1.83k|}
xxhash.c:XXH32_endian_align:
  235|  1.83k|{
  236|  1.83k|    const BYTE* p = (const BYTE*)input;
  237|  1.83k|    const BYTE* bEnd = p + len;
  238|  1.83k|    U32 h32;
  239|  1.83k|#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.83k|    if (len>=16)
  ------------------
  |  Branch (245:9): [True: 4, False: 1.83k]
  ------------------
  246|      4|    {
  247|      4|        const BYTE* const limit = bEnd - 16;
  248|      4|        U32 v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  189|      4|#define PRIME32_1   2654435761U
  ------------------
                      U32 v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  190|      4|#define PRIME32_2   2246822519U
  ------------------
  249|      4|        U32 v2 = seed + PRIME32_2;
  ------------------
  |  |  190|      4|#define PRIME32_2   2246822519U
  ------------------
  250|      4|        U32 v3 = seed + 0;
  251|      4|        U32 v4 = seed - PRIME32_1;
  ------------------
  |  |  189|      4|#define PRIME32_1   2654435761U
  ------------------
  252|       |
  253|      4|        do
  254|    268|        {
  255|    268|            v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    268|#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|    268|#define PRIME32_2   2246822519U
  ------------------
                          v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    268|#  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|    268|#define PRIME32_1   2654435761U
  ------------------
  256|    268|            v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    268|#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|    268|#define PRIME32_2   2246822519U
  ------------------
                          v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    268|#  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|    268|#define PRIME32_1   2654435761U
  ------------------
  257|    268|            v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    268|#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|    268|#define PRIME32_2   2246822519U
  ------------------
                          v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    268|#  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|    268|#define PRIME32_1   2654435761U
  ------------------
  258|    268|            v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    268|#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|    268|#define PRIME32_2   2246822519U
  ------------------
                          v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    268|#  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|    268|#define PRIME32_1   2654435761U
  ------------------
  259|    268|        } while (p<=limit);
  ------------------
  |  Branch (259:18): [True: 264, False: 4]
  ------------------
  260|       |
  261|      4|        h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
  ------------------
  |  |  170|      4|#  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|      4|#  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|      4|#  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|      4|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
  262|      4|    }
  263|  1.83k|    else
  264|  1.83k|    {
  265|  1.83k|        h32  = seed + PRIME32_5;
  ------------------
  |  |  193|  1.83k|#define PRIME32_5    374761393U
  ------------------
  266|  1.83k|    }
  267|       |
  268|  1.83k|    h32 += (U32) len;
  269|       |
  270|  3.24k|    while (p<=bEnd-4)
  ------------------
  |  Branch (270:12): [True: 1.41k, False: 1.83k]
  ------------------
  271|  1.41k|    {
  272|  1.41k|        h32 += XXH_get32bits(p) * PRIME32_3;
  ------------------
  |  |  239|  1.41k|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  ------------------
                      h32 += XXH_get32bits(p) * PRIME32_3;
  ------------------
  |  |  191|  1.41k|#define PRIME32_3   3266489917U
  ------------------
  273|  1.41k|        h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;
  ------------------
  |  |  170|  1.41k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;
  ------------------
  |  |  192|  1.41k|#define PRIME32_4    668265263U
  ------------------
  274|  1.41k|        p+=4;
  275|  1.41k|    }
  276|       |
  277|  4.81k|    while (p<bEnd)
  ------------------
  |  Branch (277:12): [True: 2.97k, False: 1.83k]
  ------------------
  278|  2.97k|    {
  279|  2.97k|        h32 += (*p) * PRIME32_5;
  ------------------
  |  |  193|  2.97k|#define PRIME32_5    374761393U
  ------------------
  280|  2.97k|        h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
  ------------------
  |  |  170|  2.97k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
  ------------------
  |  |  189|  2.97k|#define PRIME32_1   2654435761U
  ------------------
  281|  2.97k|        p++;
  282|  2.97k|    }
  283|       |
  284|  1.83k|    h32 ^= h32 >> 15;
  285|  1.83k|    h32 *= PRIME32_2;
  ------------------
  |  |  190|  1.83k|#define PRIME32_2   2246822519U
  ------------------
  286|  1.83k|    h32 ^= h32 >> 13;
  287|  1.83k|    h32 *= PRIME32_3;
  ------------------
  |  |  191|  1.83k|#define PRIME32_3   3266489917U
  ------------------
  288|  1.83k|    h32 ^= h32 >> 16;
  289|       |
  290|  1.83k|    return h32;
  291|  1.83k|}
xxhash.c:XXH_readLE32_align:
  219|   284k|{
  220|   284k|    if (align==XXH_unaligned)
  ------------------
  |  Branch (220:9): [True: 284k, False: 0]
  ------------------
  221|   284k|        return endian==XXH_littleEndian ? A32(ptr) : XXH_swap32(A32(ptr));
  ------------------
  |  Branch (221:16): [True: 284k, False: 0]
  ------------------
  222|      0|    else
  223|      0|        return endian==XXH_littleEndian ? *ptr : XXH_swap32(*ptr);
  ------------------
  |  Branch (223:16): [True: 0, False: 0]
  ------------------
  224|   284k|}
xxhash.c:A32:
  162|   284k|{
  163|   284k|    return (((const U32_S *)(x))->v);
  164|   284k|}
xxhash.c:XXH32_init:
  362|    741|{
  363|    741|    void* state = XXH_malloc (sizeof(struct XXH_state32_t));
  ------------------
  |  |   91|    741|#define XXH_malloc malloc
  ------------------
  364|    741|    if (state == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 741]
  ------------------
  365|      0|        return NULL;
  366|    741|    XXH32_resetState(state, seed);
  367|    741|    return state;
  368|    741|}
xxhash.c:XXH32_resetState:
  348|    741|{
  349|    741|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  350|    741|    state->seed = seed;
  351|    741|    state->v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  189|    741|#define PRIME32_1   2654435761U
  ------------------
                  state->v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  190|    741|#define PRIME32_2   2246822519U
  ------------------
  352|    741|    state->v2 = seed + PRIME32_2;
  ------------------
  |  |  190|    741|#define PRIME32_2   2246822519U
  ------------------
  353|    741|    state->v3 = seed + 0;
  354|    741|    state->v4 = seed - PRIME32_1;
  ------------------
  |  |  189|    741|#define PRIME32_1   2654435761U
  ------------------
  355|    741|    state->total_len = 0;
  356|    741|    state->memsize = 0;
  357|    741|    return XXH_OK;
  358|    741|}
xxhash.c:XXH32_update:
  437|  5.85k|{
  438|  5.85k|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|  5.85k|#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
  ------------------
  439|       |
  440|  5.85k|    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.85k, False: 0]
  ------------------
  441|  5.85k|        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.85k|}
xxhash.c:XXH32_update_endian:
  372|  5.85k|{
  373|  5.85k|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  374|  5.85k|    const BYTE* p = (const BYTE*)input;
  375|  5.85k|    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.85k|    state->total_len += len;
  382|       |
  383|  5.85k|    if (state->memsize + len < 16)   /* fill in tmp buffer */
  ------------------
  |  Branch (383:9): [True: 3.90k, False: 1.95k]
  ------------------
  384|  3.90k|    {
  385|  3.90k|        XXH_memcpy(state->memory + state->memsize, input, len);
  ------------------
  |  |   93|  3.90k|#define XXH_memcpy memcpy
  ------------------
  386|  3.90k|        state->memsize +=  len;
  387|  3.90k|        return XXH_OK;
  388|  3.90k|    }
  389|       |
  390|  1.95k|    if (state->memsize)   /* some data left from previous update */
  ------------------
  |  Branch (390:9): [True: 1.60k, False: 348]
  ------------------
  391|  1.60k|    {
  392|  1.60k|        XXH_memcpy(state->memory + state->memsize, input, 16-state->memsize);
  ------------------
  |  |   93|  1.60k|#define XXH_memcpy memcpy
  ------------------
  393|  1.60k|        {
  394|  1.60k|            const U32* p32 = (const U32*)state->memory;
  395|  1.60k|            state->v1 += XXH_readLE32(p32, endian) * PRIME32_2; state->v1 = XXH_rotl32(state->v1, 13); state->v1 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.60k|#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.60k|#  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.60k|#define PRIME32_1   2654435761U
  ------------------
  396|  1.60k|            state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; state->v2 = XXH_rotl32(state->v2, 13); state->v2 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.60k|#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.60k|#  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.60k|#define PRIME32_1   2654435761U
  ------------------
  397|  1.60k|            state->v3 += XXH_readLE32(p32, endian) * PRIME32_2; state->v3 = XXH_rotl32(state->v3, 13); state->v3 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.60k|#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.60k|#  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.60k|#define PRIME32_1   2654435761U
  ------------------
  398|  1.60k|            state->v4 += XXH_readLE32(p32, endian) * PRIME32_2; state->v4 = XXH_rotl32(state->v4, 13); state->v4 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.60k|#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.60k|#  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.60k|#define PRIME32_1   2654435761U
  ------------------
  399|  1.60k|        }
  400|  1.60k|        p += 16-state->memsize;
  401|  1.60k|        state->memsize = 0;
  402|  1.60k|    }
  403|       |
  404|  1.95k|    if (p <= bEnd-16)
  ------------------
  |  Branch (404:9): [True: 799, False: 1.15k]
  ------------------
  405|    799|    {
  406|    799|        const BYTE* const limit = bEnd - 16;
  407|    799|        U32 v1 = state->v1;
  408|    799|        U32 v2 = state->v2;
  409|    799|        U32 v3 = state->v3;
  410|    799|        U32 v4 = state->v4;
  411|       |
  412|    799|        do
  413|  68.8k|        {
  414|  68.8k|            v1 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  68.8k|#define PRIME32_2   2246822519U
  ------------------
                          v1 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  68.8k|#  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|  68.8k|#define PRIME32_1   2654435761U
  ------------------
  415|  68.8k|            v2 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  68.8k|#define PRIME32_2   2246822519U
  ------------------
                          v2 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  68.8k|#  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|  68.8k|#define PRIME32_1   2654435761U
  ------------------
  416|  68.8k|            v3 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  68.8k|#define PRIME32_2   2246822519U
  ------------------
                          v3 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  68.8k|#  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|  68.8k|#define PRIME32_1   2654435761U
  ------------------
  417|  68.8k|            v4 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  68.8k|#define PRIME32_2   2246822519U
  ------------------
                          v4 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  68.8k|#  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|  68.8k|#define PRIME32_1   2654435761U
  ------------------
  418|  68.8k|        } while (p<=limit);
  ------------------
  |  Branch (418:18): [True: 68.0k, False: 799]
  ------------------
  419|       |
  420|    799|        state->v1 = v1;
  421|    799|        state->v2 = v2;
  422|    799|        state->v3 = v3;
  423|    799|        state->v4 = v4;
  424|    799|    }
  425|       |
  426|  1.95k|    if (p < bEnd)
  ------------------
  |  Branch (426:9): [True: 1.56k, False: 386]
  ------------------
  427|  1.56k|    {
  428|  1.56k|        XXH_memcpy(state->memory, p, bEnd-p);
  ------------------
  |  |   93|  1.56k|#define XXH_memcpy memcpy
  ------------------
  429|  1.56k|        state->memsize = (int)(bEnd-p);
  430|  1.56k|    }
  431|       |
  432|  1.95k|    return XXH_OK;
  433|  5.85k|}
xxhash.c:XXH_readLE32:
  227|   282k|FORCE_INLINE U32 XXH_readLE32(const U32* ptr, XXH_endianess endian) { return XXH_readLE32_align(ptr, endian, XXH_unaligned); }
xxhash.c:XXH32_digest:
  503|    468|{
  504|    468|    U32 h32 = XXH32_intermediateDigest(state_in);
  505|       |
  506|    468|    XXH_free(state_in);
  ------------------
  |  |   92|    468|#define XXH_free free
  ------------------
  507|       |
  508|    468|    return h32;
  509|    468|}
xxhash.c:XXH32_intermediateDigest:
  492|    468|{
  493|    468|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|    468|#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
  ------------------
  494|       |
  495|    468|    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: 468, False: 0]
  ------------------
  496|    468|        return XXH32_intermediateDigest_endian(state_in, XXH_littleEndian);
  497|      0|    else
  498|      0|        return XXH32_intermediateDigest_endian(state_in, XXH_bigEndian);
  499|    468|}
xxhash.c:XXH32_intermediateDigest_endian:
  450|    468|{
  451|    468|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  452|    468|    const BYTE * p = (const BYTE*)state->memory;
  453|    468|    BYTE* bEnd = (BYTE*)state->memory + state->memsize;
  454|    468|    U32 h32;
  455|       |
  456|    468|    if (state->total_len >= 16)
  ------------------
  |  Branch (456:9): [True: 31, False: 437]
  ------------------
  457|     31|    {
  458|     31|        h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
  ------------------
  |  |  170|     31|#  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|     31|#  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|     31|#  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|     31|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
  459|     31|    }
  460|    437|    else
  461|    437|    {
  462|    437|        h32  = state->seed + PRIME32_5;
  ------------------
  |  |  193|    437|#define PRIME32_5    374761393U
  ------------------
  463|    437|    }
  464|       |
  465|    468|    h32 += (U32) state->total_len;
  466|       |
  467|    885|    while (p<=bEnd-4)
  ------------------
  |  Branch (467:12): [True: 417, False: 468]
  ------------------
  468|    417|    {
  469|    417|        h32 += XXH_readLE32((const U32*)p, endian) * PRIME32_3;
  ------------------
  |  |  191|    417|#define PRIME32_3   3266489917U
  ------------------
  470|    417|        h32  = XXH_rotl32(h32, 17) * PRIME32_4;
  ------------------
  |  |  170|    417|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32  = XXH_rotl32(h32, 17) * PRIME32_4;
  ------------------
  |  |  192|    417|#define PRIME32_4    668265263U
  ------------------
  471|    417|        p+=4;
  472|    417|    }
  473|       |
  474|  1.79k|    while (p<bEnd)
  ------------------
  |  Branch (474:12): [True: 1.32k, False: 468]
  ------------------
  475|  1.32k|    {
  476|  1.32k|        h32 += (*p) * PRIME32_5;
  ------------------
  |  |  193|  1.32k|#define PRIME32_5    374761393U
  ------------------
  477|  1.32k|        h32 = XXH_rotl32(h32, 11) * PRIME32_1;
  ------------------
  |  |  170|  1.32k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(h32, 11) * PRIME32_1;
  ------------------
  |  |  189|  1.32k|#define PRIME32_1   2654435761U
  ------------------
  478|  1.32k|        p++;
  479|  1.32k|    }
  480|       |
  481|    468|    h32 ^= h32 >> 15;
  482|    468|    h32 *= PRIME32_2;
  ------------------
  |  |  190|    468|#define PRIME32_2   2246822519U
  ------------------
  483|    468|    h32 ^= h32 >> 13;
  484|    468|    h32 *= PRIME32_3;
  ------------------
  |  |  191|    468|#define PRIME32_3   3266489917U
  ------------------
  485|    468|    h32 ^= h32 >> 16;
  486|       |
  487|    468|    return h32;
  488|    468|}

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

