archive_acl_clear:
  129|   257k|{
  130|   257k|	struct archive_acl_entry *ap;
  131|       |
  132|   258k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 773, False: 257k]
  ------------------
  133|    773|		ap = acl->acl_head->next;
  134|    773|		archive_mstring_clean(&acl->acl_head->name);
  135|    773|		free(acl->acl_head);
  136|    773|		acl->acl_head = ap;
  137|    773|	}
  138|   257k|	free(acl->acl_text_w);
  139|   257k|	acl->acl_text_w = NULL;
  140|   257k|	free(acl->acl_text);
  141|   257k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   257k|	acl->acl_types = 0;
  144|   257k|	acl->acl_state = 0; /* Not counting. */
  145|   257k|}
archive_acl_count:
  380|    219|{
  381|    219|	int count;
  382|    219|	struct archive_acl_entry *ap;
  383|       |
  384|    219|	count = 0;
  385|    219|	ap = acl->acl_head;
  386|    992|	while (ap != NULL) {
  ------------------
  |  Branch (386:9): [True: 773, False: 219]
  ------------------
  387|    773|		if ((ap->type & want_type) != 0)
  ------------------
  |  Branch (387:7): [True: 773, False: 0]
  ------------------
  388|    773|			count++;
  389|    773|		ap = ap->next;
  390|    773|	}
  391|       |
  392|    219|	if (count > 0 && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0))
  ------------------
  |  |  534|     65|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (392:6): [True: 65, False: 154]
  |  Branch (392:19): [True: 38, False: 27]
  ------------------
  393|     38|		count += 3;
  394|    219|	return (count);
  395|    219|}
archive_acl_reset:
  413|    219|{
  414|    219|	int count, cutoff;
  415|       |
  416|    219|	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|    219|	if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
  ------------------
  |  |  534|    219|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (423:6): [True: 40, False: 179]
  ------------------
  424|     40|		cutoff = 3;
  425|    179|	else
  426|    179|		cutoff = 0;
  427|       |
  428|    219|	if (count > cutoff)
  ------------------
  |  Branch (428:6): [True: 65, False: 154]
  ------------------
  429|     65|		acl->acl_state = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|     65|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  430|    154|	else
  431|    154|		acl->acl_state = 0;
  432|    219|	acl->acl_p = acl->acl_head;
  433|    219|	return (count);
  434|    219|}
archive_acl_from_text_l:
 1506|    219|{
 1507|    219|	return archive_acl_from_text_nl(acl, text, strlen(text), want_type, sc);
 1508|    219|}
archive_acl_from_text_nl:
 1513|    219|{
 1514|    219|	struct {
 1515|    219|		const char *start;
 1516|    219|		const char *end;
 1517|    219|	} field[6], name;
 1518|       |
 1519|    219|	const char *s, *st, *text_end;
 1520|    219|	int numfields, fields, n, r, sol, ret;
 1521|    219|	int type, types, tag, permset, id;
 1522|    219|	size_t len;
 1523|    219|	char sep;
 1524|       |
 1525|    219|	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: 219]
  ------------------
 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|    105|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|    105|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (1529:2): [True: 105, False: 114]
  ------------------
 1530|    105|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|    105|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (1530:2): [True: 0, False: 219]
  ------------------
 1531|    105|		numfields = 5;
 1532|    105|		break;
 1533|    114|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  542|    114|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    114|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    114|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    114|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    114|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    114|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    114|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    114|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1533:2): [True: 114, False: 105]
  ------------------
 1534|    114|		numfields = 6;
 1535|    114|		break;
 1536|      0|	default:
  ------------------
  |  Branch (1536:2): [True: 0, False: 219]
  ------------------
 1537|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|    219|	}
 1539|       |
 1540|    219|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    219|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1541|    219|	types = 0;
 1542|    219|	text_end = (text == NULL) ? text : text + length;
  ------------------
  |  Branch (1542:13): [True: 0, False: 219]
  ------------------
 1543|       |
 1544|  21.0k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1544:9): [True: 21.0k, False: 0]
  |  Branch (1544:25): [True: 20.8k, False: 219]
  |  Branch (1544:39): [True: 20.8k, False: 0]
  ------------------
 1545|       |		/*
 1546|       |		 * Parse the fields out of the next entry,
 1547|       |		 * advance 'text' to start of next entry.
 1548|       |		 */
 1549|  20.8k|		fields = 0;
 1550|  37.7k|		do {
 1551|  37.7k|			const char *start, *end;
 1552|  37.7k|			next_field(&text, &length, &start, &end, &sep);
 1553|  37.7k|			if (fields < numfields) {
  ------------------
  |  Branch (1553:8): [True: 36.3k, False: 1.38k]
  ------------------
 1554|  36.3k|				field[fields].start = start;
 1555|  36.3k|				field[fields].end = end;
 1556|  36.3k|			}
 1557|  37.7k|			++fields;
 1558|  37.7k|		} while (sep == ':');
  ------------------
  |  Branch (1558:12): [True: 16.8k, False: 20.8k]
  ------------------
 1559|       |
 1560|       |		/* Set remaining fields to blank. */
 1561|  93.7k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1561:20): [True: 72.8k, False: 20.8k]
  ------------------
 1562|  72.8k|			field[n].start = field[n].end = NULL;
 1563|       |
 1564|  20.8k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1564:7): [True: 0, False: 20.8k]
  |  Branch (1564:33): [True: 0, False: 20.8k]
  ------------------
 1565|       |			/* This should never happen */
 1566|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1567|      0|		}
 1568|       |
 1569|  20.8k|		if (field[0].start == text_end) {
  ------------------
  |  Branch (1569:7): [True: 4, False: 20.8k]
  ------------------
 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|      4|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|      4|			continue;
 1579|      4|		}
 1580|       |
 1581|  20.8k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1581:7): [True: 182, False: 20.6k]
  ------------------
 1582|       |			/* Comment, skip entry */
 1583|    182|			continue;
 1584|    182|		}
 1585|       |
 1586|  20.6k|		n = 0;
 1587|  20.6k|		sol = 0;
 1588|  20.6k|		id = -1;
 1589|  20.6k|		permset = 0;
 1590|  20.6k|		name.start = name.end = NULL;
 1591|       |
 1592|  20.6k|		if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  20.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  20.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  20.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  20.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  20.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  20.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  20.6k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  20.6k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1592:7): [True: 15.8k, False: 4.78k]
  ------------------
 1593|       |			/* POSIX.1e ACLs */
 1594|       |			/*
 1595|       |			 * Default keyword "default:user::rwx"
 1596|       |			 * if found, we have one more field
 1597|       |			 *
 1598|       |			 * We also support old Solaris extension:
 1599|       |			 * "defaultuser::rwx" is the default ACL corresponding
 1600|       |			 * to "user::rwx", etc. valid only for first field
 1601|       |			 */
 1602|  15.8k|			s = field[0].start;
 1603|  15.8k|			len = field[0].end - field[0].start;
 1604|  15.8k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1604:8): [True: 2.53k, False: 13.3k]
  |  Branch (1604:22): [True: 1.93k, False: 595]
  |  Branch (1604:35): [True: 122, False: 473]
  ------------------
 1605|  1.99k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1605:11): [True: 58, False: 64]
  ------------------
 1606|  1.99k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  535|  1.99k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1607|  1.99k|				if (len > 7)
  ------------------
  |  Branch (1607:9): [True: 58, False: 1.93k]
  ------------------
 1608|     58|					field[0].start += 7;
 1609|  1.93k|				else
 1610|  1.93k|					n = 1;
 1611|  1.99k|			} else
 1612|  13.8k|				type = want_type;
 1613|       |
 1614|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1615|  15.8k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1615:8): [True: 98, False: 15.7k]
  ------------------
 1616|  15.8k|			    &id) < 0) {
 1617|     98|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     98|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|     98|				continue;
 1619|     98|			}
 1620|       |			/* Field n+3 is optional. */
 1621|  15.7k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1621:8): [True: 15.6k, False: 148]
  |  Branch (1621:20): [True: 1.39k, False: 14.2k]
  ------------------
 1622|  1.39k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1622:8): [True: 35, False: 1.36k]
  ------------------
 1623|  1.39k|			    &id) < 0) {
 1624|     35|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     35|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1625|     35|				continue;
 1626|     35|			}
 1627|       |
 1628|  15.7k|			tag = 0;
 1629|  15.7k|			s = field[n].start;
 1630|  15.7k|			len = field[n].end - field[n].start;
 1631|       |
 1632|  15.7k|			if (len == 0) {
  ------------------
  |  Branch (1632:8): [True: 2.83k, False: 12.9k]
  ------------------
 1633|  2.83k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  2.83k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1634|  2.83k|				continue;
 1635|  2.83k|			}
 1636|       |
 1637|  12.9k|			st = s + 1; 
 1638|       |
 1639|  12.9k|			switch (*s) {
 1640|    806|			case 'u':
  ------------------
  |  Branch (1640:4): [True: 806, False: 12.1k]
  ------------------
 1641|    806|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1641:9): [True: 594, False: 212]
  |  Branch (1641:22): [True: 30, False: 182]
  ------------------
 1642|     30|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1642:12): [True: 15, False: 15]
  ------------------
 1643|    609|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    609|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1644|    806|				break;
 1645|  1.92k|			case 'g':
  ------------------
  |  Branch (1645:4): [True: 1.92k, False: 10.9k]
  ------------------
 1646|  1.92k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1646:9): [True: 1.26k, False: 659]
  |  Branch (1646:22): [True: 282, False: 377]
  ------------------
 1647|    282|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1647:12): [True: 186, False: 96]
  ------------------
 1648|  1.45k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|  1.45k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1649|  1.92k|				break;
 1650|  1.17k|			case 'o':
  ------------------
  |  Branch (1650:4): [True: 1.17k, False: 11.7k]
  ------------------
 1651|  1.17k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1651:9): [True: 474, False: 699]
  |  Branch (1651:22): [True: 371, False: 328]
  ------------------
 1652|    371|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1652:12): [True: 326, False: 45]
  ------------------
 1653|    800|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  553|    800|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1654|  1.17k|				break;
 1655|    520|			case 'm':
  ------------------
  |  Branch (1655:4): [True: 520, False: 12.4k]
  ------------------
 1656|    520|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1656:9): [True: 177, False: 343]
  |  Branch (1656:22): [True: 188, False: 155]
  ------------------
 1657|    188|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1657:12): [True: 8, False: 180]
  ------------------
 1658|    185|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  552|    185|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1659|    520|				break;
 1660|  8.49k|			default:
  ------------------
  |  Branch (1660:4): [True: 8.49k, False: 4.42k]
  ------------------
 1661|  8.49k|					break;
 1662|  12.9k|			}
 1663|       |
 1664|  12.9k|			switch (tag) {
 1665|    800|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    800|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1665:4): [True: 800, False: 12.1k]
  ------------------
 1666|    985|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|    985|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1666:4): [True: 185, False: 12.7k]
  ------------------
 1667|    985|				if (fields == (n + 2)
  ------------------
  |  Branch (1667:9): [True: 507, False: 478]
  ------------------
 1668|    507|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1668:12): [True: 500, False: 7]
  ------------------
 1669|    500|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1669:12): [True: 180, False: 320]
  ------------------
 1670|    500|				    field[n + 1].end, &permset)) {
 1671|       |					/* This is Solaris-style "other:rwx" */
 1672|    180|					sol = 1;
 1673|    805|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1673:16): [True: 36, False: 769]
  ------------------
 1674|     36|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1674:9): [True: 27, False: 9]
  ------------------
 1675|       |					/* Invalid mask or other field */
 1676|     27|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     27|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1677|     27|					continue;
 1678|     27|				}
 1679|    958|				break;
 1680|    958|			case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    609|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1680:4): [True: 609, False: 12.3k]
  ------------------
 1681|  2.06k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  2.06k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1681:4): [True: 1.45k, False: 11.4k]
  ------------------
 1682|  2.06k|				if (id != -1 ||
  ------------------
  |  Branch (1682:9): [True: 500, False: 1.56k]
  ------------------
 1683|  1.72k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1683:9): [True: 1.22k, False: 344]
  ------------------
 1684|  1.72k|					name = field[n + 1];
 1685|  1.72k|					if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
  ------------------
  |  |  549|  1.72k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1685:10): [True: 584, False: 1.13k]
  ------------------
 1686|    584|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    584|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1687|  1.13k|					else
 1688|  1.13k|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|  1.13k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1689|  1.72k|				}
 1690|  2.06k|				break;
 1691|  9.87k|			default:
  ------------------
  |  Branch (1691:4): [True: 9.87k, False: 3.04k]
  ------------------
 1692|       |				/* Invalid tag, skip entry */
 1693|  9.87k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  9.87k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1694|  9.87k|				continue;
 1695|  12.9k|			}
 1696|       |
 1697|       |			/*
 1698|       |			 * Without "default:" we expect mode in field 3
 1699|       |			 * Exception: Solaris other and mask fields
 1700|       |			 */
 1701|  3.02k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1701:8): [True: 2.84k, False: 177]
  |  Branch (1701:24): [True: 1.64k, False: 1.19k]
  ------------------
 1702|  2.84k|			    field[n + 2 - sol].end, &permset)) {
 1703|       |				/* Invalid mode, skip entry */
 1704|  1.64k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.64k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1705|  1.64k|				continue;
 1706|  1.64k|			}
 1707|  4.78k|		} else {
 1708|       |			/* NFS4 ACLs */
 1709|  4.78k|			s = field[0].start;
 1710|  4.78k|			len = field[0].end - field[0].start;
 1711|  4.78k|			tag = 0;
 1712|       |
 1713|  4.78k|			switch (len) {
 1714|    235|			case 4:
  ------------------
  |  Branch (1714:4): [True: 235, False: 4.54k]
  ------------------
 1715|    235|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1715:9): [True: 0, False: 235]
  ------------------
 1716|      0|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|      0|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1717|    235|				break;
 1718|    780|			case 5:
  ------------------
  |  Branch (1718:4): [True: 780, False: 4.00k]
  ------------------
 1719|    780|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1719:9): [True: 300, False: 480]
  ------------------
 1720|    300|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    300|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1721|    780|				break;
 1722|    994|			case 6:
  ------------------
  |  Branch (1722:4): [True: 994, False: 3.79k]
  ------------------
 1723|    994|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1723:9): [True: 235, False: 759]
  ------------------
 1724|    235|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    235|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1725|    759|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1725:14): [True: 314, False: 445]
  ------------------
 1726|    314|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|    314|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1727|    994|				break;
 1728|    344|			case 9:
  ------------------
  |  Branch (1728:4): [True: 344, False: 4.44k]
  ------------------
 1729|    344|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1729:9): [True: 34, False: 310]
  ------------------
 1730|     34|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  554|     34|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1731|    344|				break;
 1732|  2.43k|			default:
  ------------------
  |  Branch (1732:4): [True: 2.43k, False: 2.35k]
  ------------------
 1733|  2.43k|				break;
 1734|  4.78k|			}
 1735|       |
 1736|  4.78k|			if (tag == 0) {
  ------------------
  |  Branch (1736:8): [True: 3.90k, False: 883]
  ------------------
 1737|       |				/* Invalid tag, skip entry */
 1738|  3.90k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  3.90k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1739|  3.90k|				continue;
 1740|  3.90k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  548|  1.76k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1740:15): [True: 0, False: 883]
  ------------------
 1741|    883|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  550|    883|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1741:8): [True: 300, False: 583]
  ------------------
 1742|    300|				n = 1;
 1743|    300|				name = field[1];
 1744|    300|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1744:9): [True: 0, False: 300]
  ------------------
 1745|      0|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1746|      0|					continue;
 1747|      0|				}
 1748|    300|			} else
 1749|    583|				n = 0;
 1750|       |
 1751|    883|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1751:8): [True: 59, False: 824]
  ------------------
 1752|    883|			    field[1 + n].end, &permset)) {
 1753|       |				/* Invalid NFSv4 perms, skip entry */
 1754|     59|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     59|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1755|     59|				continue;
 1756|     59|			}
 1757|    824|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1757:8): [True: 277, False: 547]
  ------------------
 1758|    824|			    field[2 + n].end, &permset)) {
 1759|       |				/* Invalid NFSv4 flags, skip entry */
 1760|    277|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    277|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1761|    277|				continue;
 1762|    277|			}
 1763|    547|			s = field[3 + n].start;
 1764|    547|			len = field[3 + n].end - field[3 + n].start;
 1765|    547|			type = 0;
 1766|    547|			if (len == 4) {
  ------------------
  |  Branch (1766:8): [True: 338, False: 209]
  ------------------
 1767|    338|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1767:9): [True: 99, False: 239]
  ------------------
 1768|     99|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  537|     99|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1769|    338|			} else if (len == 5) {
  ------------------
  |  Branch (1769:15): [True: 142, False: 67]
  ------------------
 1770|    142|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1770:9): [True: 50, False: 92]
  ------------------
 1771|     50|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  536|     50|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1772|     92|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1772:14): [True: 32, False: 60]
  ------------------
 1773|     32|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  538|     32|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1774|     60|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1774:14): [True: 42, False: 18]
  ------------------
 1775|     42|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  539|     42|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1776|    142|			}
 1777|    547|			if (type == 0) {
  ------------------
  |  Branch (1777:8): [True: 324, False: 223]
  ------------------
 1778|       |				/* Invalid entry type, skip entry */
 1779|    324|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    324|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1780|    324|				continue;
 1781|    324|			}
 1782|    223|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1782:8): [True: 1, False: 222]
  ------------------
 1783|    223|			    &id) < 0) {
 1784|      1|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1785|      1|				continue;
 1786|      1|			}
 1787|    223|		}
 1788|       |
 1789|       |		/* Add entry to the internal list. */
 1790|  1.59k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1791|  1.59k|		    tag, id, name.start, name.end - name.start, sc);
 1792|  1.59k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  1.59k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1792:7): [True: 0, False: 1.59k]
  ------------------
 1793|      0|			return (r);
 1794|  1.59k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 832, False: 764]
  ------------------
 1795|    832|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    832|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1796|  1.59k|		types |= type;
 1797|  1.59k|	}
 1798|       |
 1799|       |	/* Reset ACL */
 1800|    219|	archive_acl_reset(acl, types);
 1801|       |
 1802|    219|	return (ret);
 1803|    219|}
archive_acl.c:acl_special:
  240|  1.59k|{
  241|  1.59k|	if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
  ------------------
  |  |  534|  3.19k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (241:6): [True: 1.25k, False: 337]
  ------------------
  242|  1.25k|	    && ((permset & ~007) == 0)) {
  ------------------
  |  Branch (242:9): [True: 1.25k, False: 0]
  ------------------
  243|  1.25k|		switch (tag) {
  ------------------
  |  Branch (243:11): [True: 252, False: 1.00k]
  ------------------
  244|     20|		case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|     20|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (244:3): [True: 20, False: 1.23k]
  ------------------
  245|     20|			acl->mode &= ~0700;
  246|     20|			acl->mode |= (permset & 7) << 6;
  247|     20|			return (0);
  248|      4|		case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|      4|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (248:3): [True: 4, False: 1.25k]
  ------------------
  249|      4|			acl->mode &= ~0070;
  250|      4|			acl->mode |= (permset & 7) << 3;
  251|      4|			return (0);
  252|    228|		case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    228|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (252:3): [True: 228, False: 1.03k]
  ------------------
  253|    228|			acl->mode &= ~0007;
  254|    228|			acl->mode |= permset & 7;
  255|    228|			return (0);
  256|  1.25k|		}
  257|  1.25k|	}
  258|  1.34k|	return (1);
  259|  1.59k|}
archive_acl.c:acl_new_entry:
  268|  1.34k|{
  269|  1.34k|	struct archive_acl_entry *ap, *aq;
  270|       |
  271|       |	/* Reject an invalid type */
  272|  1.34k|	switch (type) {
  273|  1.00k|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|  1.00k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (273:2): [True: 1.00k, False: 337]
  ------------------
  274|  1.12k|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|  1.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (274:2): [True: 115, False: 1.22k]
  ------------------
  275|  1.17k|	case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
  ------------------
  |  |  536|  1.17k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
  |  Branch (275:2): [True: 49, False: 1.29k]
  ------------------
  276|  1.27k|	case ARCHIVE_ENTRY_ACL_TYPE_DENY:
  ------------------
  |  |  537|  1.27k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
  |  Branch (276:2): [True: 99, False: 1.24k]
  ------------------
  277|  1.30k|	case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
  ------------------
  |  |  538|  1.30k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
  |  Branch (277:2): [True: 32, False: 1.31k]
  ------------------
  278|  1.34k|	case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
  ------------------
  |  |  539|  1.34k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
  |  Branch (278:2): [True: 42, False: 1.30k]
  ------------------
  279|  1.34k|		break;
  280|      0|	default:
  ------------------
  |  Branch (280:2): [True: 0, False: 1.34k]
  ------------------
  281|      0|		return (NULL);
  282|  1.34k|	}
  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.34k|	if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  1.34k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  1.34k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  1.34k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  1.34k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  1.34k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  1.34k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  1.34k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  1.34k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (287:6): [True: 222, False: 1.12k]
  ------------------
  288|    222|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|    222|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    222|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    222|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    222|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    222|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    222|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    222|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    222|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (288:7): [True: 0, False: 222]
  ------------------
  289|      0|			return (NULL);
  290|      0|		}
  291|    222|		if (permset &
  ------------------
  |  Branch (291:7): [True: 0, False: 222]
  ------------------
  292|    222|		    ~(ARCHIVE_ENTRY_ACL_PERMS_NFS4
  ------------------
  |  |  495|    222|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|    222|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  496|    222|	    | ARCHIVE_ENTRY_ACL_READ_DATA		\
  |  |  ------------------
  |  |  |  |  472|    222|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  |  |  ------------------
  |  |  497|    222|	    | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 		\
  |  |  ------------------
  |  |  |  |  473|    222|#define	ARCHIVE_ENTRY_ACL_LIST_DIRECTORY      0x00000008
  |  |  ------------------
  |  |  498|    222|	    | ARCHIVE_ENTRY_ACL_WRITE_DATA		\
  |  |  ------------------
  |  |  |  |  474|    222|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  |  |  ------------------
  |  |  499|    222|	    | ARCHIVE_ENTRY_ACL_ADD_FILE		\
  |  |  ------------------
  |  |  |  |  475|    222|#define	ARCHIVE_ENTRY_ACL_ADD_FILE            0x00000010
  |  |  ------------------
  |  |  500|    222|	    | ARCHIVE_ENTRY_ACL_APPEND_DATA		\
  |  |  ------------------
  |  |  |  |  476|    222|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  |  |  ------------------
  |  |  501|    222|	    | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY	\
  |  |  ------------------
  |  |  |  |  477|    222|#define	ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY    0x00000020
  |  |  ------------------
  |  |  502|    222|	    | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  478|    222|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  |  |  ------------------
  |  |  503|    222|	    | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  479|    222|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  |  |  ------------------
  |  |  504|    222|	    | ARCHIVE_ENTRY_ACL_DELETE_CHILD		\
  |  |  ------------------
  |  |  |  |  480|    222|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  |  |  ------------------
  |  |  505|    222|	    | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES		\
  |  |  ------------------
  |  |  |  |  481|    222|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  |  |  ------------------
  |  |  506|    222|	    | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES	\
  |  |  ------------------
  |  |  |  |  482|    222|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  |  |  ------------------
  |  |  507|    222|	    | ARCHIVE_ENTRY_ACL_DELETE			\
  |  |  ------------------
  |  |  |  |  483|    222|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  |  |  ------------------
  |  |  508|    222|	    | ARCHIVE_ENTRY_ACL_READ_ACL		\
  |  |  ------------------
  |  |  |  |  484|    222|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  |  |  ------------------
  |  |  509|    222|	    | ARCHIVE_ENTRY_ACL_WRITE_ACL		\
  |  |  ------------------
  |  |  |  |  485|    222|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  |  |  ------------------
  |  |  510|    222|	    | ARCHIVE_ENTRY_ACL_WRITE_OWNER		\
  |  |  ------------------
  |  |  |  |  486|    222|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  |  |  ------------------
  |  |  511|    222|	    | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
  |  |  ------------------
  |  |  |  |  487|    222|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  |  |  ------------------
  ------------------
  293|    222|			| ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) {
  ------------------
  |  |  525|    222|	(ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT			\
  |  |  ------------------
  |  |  |  |  517|    222|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  |  |  ------------------
  |  |  526|    222|	    | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT		\
  |  |  ------------------
  |  |  |  |  518|    222|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  |  |  ------------------
  |  |  527|    222|	    | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT	\
  |  |  ------------------
  |  |  |  |  519|    222|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  |  |  ------------------
  |  |  528|    222|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY		\
  |  |  ------------------
  |  |  |  |  520|    222|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  |  |  ------------------
  |  |  529|    222|	    | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS		\
  |  |  ------------------
  |  |  |  |  521|    222|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  |  |  ------------------
  |  |  530|    222|	    | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS		\
  |  |  ------------------
  |  |  |  |  522|    222|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  |  |  ------------------
  |  |  531|    222|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
  |  |  ------------------
  |  |  |  |  516|    222|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  |  |  ------------------
  ------------------
  294|      0|			return (NULL);
  295|      0|		}
  296|  1.12k|	} else	if (type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.12k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (296:13): [True: 1.12k, False: 0]
  ------------------
  297|  1.12k|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.12k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (297:7): [True: 0, False: 1.12k]
  ------------------
  298|      0|			return (NULL);
  299|      0|		}
  300|  1.12k|		if (permset & ~ARCHIVE_ENTRY_ACL_PERMS_POSIX1E) {
  ------------------
  |  |  490|  1.12k|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|  1.12k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  491|  1.12k|	    | ARCHIVE_ENTRY_ACL_WRITE			\
  |  |  ------------------
  |  |  |  |  470|  1.12k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  |  |  ------------------
  |  |  492|  1.12k|	    | ARCHIVE_ENTRY_ACL_READ)
  |  |  ------------------
  |  |  |  |  471|  1.12k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  |  |  ------------------
  ------------------
  |  Branch (300:7): [True: 0, False: 1.12k]
  ------------------
  301|      0|			return (NULL);
  302|      0|		}
  303|  1.12k|	} else {
  304|      0|		return (NULL);
  305|      0|	}
  306|       |
  307|       |	/* Verify the tag is valid and compatible with NFS4 or POSIX.1e. */
  308|  1.34k|	switch (tag) {
  309|    225|	case ARCHIVE_ENTRY_ACL_USER:
  ------------------
  |  |  548|    225|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (309:2): [True: 225, False: 1.11k]
  ------------------
  310|    299|	case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    299|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (310:2): [True: 74, False: 1.27k]
  ------------------
  311|  1.16k|	case ARCHIVE_ENTRY_ACL_GROUP:
  ------------------
  |  |  550|  1.16k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (311:2): [True: 863, False: 481]
  ------------------
  312|  1.21k|	case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  1.21k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (312:2): [True: 49, False: 1.29k]
  ------------------
  313|       |		/* Tags valid in both NFS4 and POSIX.1e */
  314|  1.21k|		break;
  315|     69|	case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|     69|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (315:2): [True: 69, False: 1.27k]
  ------------------
  316|    128|	case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    128|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (316:2): [True: 59, False: 1.28k]
  ------------------
  317|       |		/* Tags valid only in POSIX.1e. */
  318|    128|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|    128|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|    128|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|    128|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|    128|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (318:7): [True: 0, False: 128]
  ------------------
  319|      0|			return (NULL);
  320|      0|		}
  321|    128|		break;
  322|    128|	case ARCHIVE_ENTRY_ACL_EVERYONE:
  ------------------
  |  |  554|      5|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
  |  Branch (322:2): [True: 5, False: 1.33k]
  ------------------
  323|       |		/* Tags valid only in NFS4. */
  324|      5|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|      5|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|      5|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|      5|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (324:7): [True: 0, False: 5]
  ------------------
  325|      0|			return (NULL);
  326|      0|		}
  327|      5|		break;
  328|      5|	default:
  ------------------
  |  Branch (328:2): [True: 0, False: 1.34k]
  ------------------
  329|       |		/* No other values are valid. */
  330|      0|		return (NULL);
  331|  1.34k|	}
  332|       |
  333|  1.34k|	free(acl->acl_text_w);
  334|  1.34k|	acl->acl_text_w = NULL;
  335|  1.34k|	free(acl->acl_text);
  336|  1.34k|	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.34k|	ap = acl->acl_head;
  345|  1.34k|	aq = NULL;
  346|  12.0k|	while (ap != NULL) {
  ------------------
  |  Branch (346:9): [True: 11.2k, False: 773]
  ------------------
  347|  11.2k|		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
  ------------------
  |  |  542|  11.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  11.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  11.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  11.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  11.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  11.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  11.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  11.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (347:7): [True: 9.35k, False: 1.92k]
  ------------------
  348|  9.35k|		    ap->type == type && ap->tag == tag && ap->id == id) {
  ------------------
  |  Branch (348:7): [True: 8.34k, False: 1.01k]
  |  Branch (348:27): [True: 7.10k, False: 1.23k]
  |  Branch (348:45): [True: 6.30k, False: 793]
  ------------------
  349|  6.30k|			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
  ------------------
  |  |  548|  11.6k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (349:8): [True: 468, False: 5.84k]
  |  Branch (349:21): [True: 3.93k, False: 1.90k]
  ------------------
  350|  3.93k|			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
  ------------------
  |  |  550|  3.93k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (350:8): [True: 103, False: 3.83k]
  ------------------
  351|    571|				ap->permset = permset;
  352|    571|				return (ap);
  353|    571|			}
  354|  6.30k|		}
  355|  10.7k|		aq = ap;
  356|  10.7k|		ap = ap->next;
  357|  10.7k|	}
  358|       |
  359|       |	/* Add a new entry to the end of the list. */
  360|    773|	ap = calloc(1, sizeof(*ap));
  361|    773|	if (ap == NULL)
  ------------------
  |  Branch (361:6): [True: 0, False: 773]
  ------------------
  362|      0|		return (NULL);
  363|    773|	if (aq == NULL)
  ------------------
  |  Branch (363:6): [True: 65, False: 708]
  ------------------
  364|     65|		acl->acl_head = ap;
  365|    708|	else
  366|    708|		aq->next = ap;
  367|    773|	ap->type = type;
  368|    773|	ap->tag = tag;
  369|    773|	ap->id = id;
  370|    773|	ap->permset = permset;
  371|    773|	acl->acl_types |= type;
  372|    773|	return (ap);
  373|    773|}
archive_acl.c:archive_acl_add_entry_len_l:
  209|  1.59k|{
  210|  1.59k|	struct archive_acl_entry *ap;
  211|  1.59k|	int r;
  212|       |
  213|  1.59k|	if (acl_special(acl, type, permset, tag) == 0)
  ------------------
  |  Branch (213:6): [True: 252, False: 1.34k]
  ------------------
  214|    252|		return ARCHIVE_OK;
  ------------------
  |  |  233|    252|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  215|  1.34k|	ap = acl_new_entry(acl, type, permset, tag, id);
  216|  1.34k|	if (ap == NULL) {
  ------------------
  |  Branch (216:6): [True: 0, False: 1.34k]
  ------------------
  217|       |		/* XXX Error XXX */
  218|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  219|      0|	}
  220|  1.34k|	if (name != NULL  &&  *name != '\0' && len > 0) {
  ------------------
  |  Branch (220:6): [True: 1.08k, False: 256]
  |  Branch (220:24): [True: 1.08k, False: 0]
  |  Branch (220:41): [True: 995, False: 93]
  ------------------
  221|    995|		r = archive_mstring_copy_mbs_len_l(&ap->name, name, len, sc);
  222|    995|	} else {
  223|    349|		r = 0;
  224|    349|		archive_mstring_clean(&ap->name);
  225|    349|	}
  226|  1.34k|	if (r == 0)
  ------------------
  |  Branch (226:6): [True: 512, False: 832]
  ------------------
  227|    512|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    512|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  228|    832|	else if (errno == ENOMEM)
  ------------------
  |  Branch (228:11): [True: 0, False: 832]
  ------------------
  229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|    832|	else
  231|    832|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    832|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  232|  1.34k|}
archive_acl.c:isint:
 1812|  17.8k|{
 1813|  17.8k|	int n = 0;
 1814|  17.8k|	if (start >= end)
  ------------------
  |  Branch (1814:6): [True: 12.3k, False: 5.42k]
  ------------------
 1815|  12.3k|		return (0);
 1816|  8.60k|	while (start < end) {
  ------------------
  |  Branch (1816:9): [True: 7.86k, False: 745]
  ------------------
 1817|  7.86k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1817:7): [True: 3.42k, False: 4.43k]
  |  Branch (1817:23): [True: 1.11k, False: 3.31k]
  ------------------
 1818|  4.54k|			return (0);
 1819|  3.31k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1819:7): [True: 91, False: 3.22k]
  ------------------
 1820|  3.22k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1820:8): [True: 43, False: 3.18k]
  |  Branch (1820:29): [True: 43, False: 0]
  ------------------
 1821|    134|			return (-1);
 1822|  3.18k|		} else {
 1823|  3.18k|			n *= 10;
 1824|  3.18k|			n += *start - '0';
 1825|  3.18k|		}
 1826|  3.18k|		start++;
 1827|  3.18k|	}
 1828|    745|	*result = n;
 1829|    745|	return (1);
 1830|  5.42k|}
archive_acl.c:ismode:
 1839|  3.34k|{
 1840|  3.34k|	const char *p;
 1841|       |
 1842|  3.34k|	if (start >= end)
  ------------------
  |  Branch (1842:6): [True: 1.27k, False: 2.07k]
  ------------------
 1843|  1.27k|		return (0);
 1844|  2.07k|	p = start;
 1845|  2.07k|	*permset = 0;
 1846|  6.65k|	while (p < end) {
  ------------------
  |  Branch (1846:9): [True: 5.28k, False: 1.37k]
  ------------------
 1847|  5.28k|		switch (*p++) {
 1848|  1.00k|		case 'r': case 'R':
  ------------------
  |  Branch (1848:3): [True: 868, False: 4.41k]
  |  Branch (1848:13): [True: 135, False: 5.14k]
  ------------------
 1849|  1.00k|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  471|  1.00k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1850|  1.00k|			break;
 1851|      0|		case 'w': case 'W':
  ------------------
  |  Branch (1851:3): [True: 0, False: 5.28k]
  |  Branch (1851:13): [True: 0, False: 5.28k]
  ------------------
 1852|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  470|      0|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1853|      0|			break;
 1854|      0|		case 'x': case 'X':
  ------------------
  |  Branch (1854:3): [True: 0, False: 5.28k]
  |  Branch (1854:13): [True: 0, False: 5.28k]
  ------------------
 1855|      0|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|      0|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1856|      0|			break;
 1857|  3.58k|		case '-':
  ------------------
  |  Branch (1857:3): [True: 3.58k, False: 1.70k]
  ------------------
 1858|  3.58k|			break;
 1859|    697|		default:
  ------------------
  |  Branch (1859:3): [True: 697, False: 4.58k]
  ------------------
 1860|    697|			return (0);
 1861|  5.28k|		}
 1862|  5.28k|	}
 1863|  1.37k|	return (1);
 1864|  2.07k|}
archive_acl.c:is_nfs4_perms:
 1873|    883|{
 1874|    883|	const char *p = start;
 1875|       |
 1876|  1.39k|	while (p < end) {
  ------------------
  |  Branch (1876:9): [True: 572, False: 824]
  ------------------
 1877|    572|		switch (*p++) {
 1878|      0|		case 'r':
  ------------------
  |  Branch (1878:3): [True: 0, False: 572]
  ------------------
 1879|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  472|      0|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1880|      0|			break;
 1881|      0|		case 'w':
  ------------------
  |  Branch (1881:3): [True: 0, False: 572]
  ------------------
 1882|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  474|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1883|      0|			break;
 1884|     18|		case 'x':
  ------------------
  |  Branch (1884:3): [True: 18, False: 554]
  ------------------
 1885|     18|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|     18|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1886|     18|			break;
 1887|      0|		case 'p':
  ------------------
  |  Branch (1887:3): [True: 0, False: 572]
  ------------------
 1888|      0|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  476|      0|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1889|      0|			break;
 1890|      0|		case 'D':
  ------------------
  |  Branch (1890:3): [True: 0, False: 572]
  ------------------
 1891|      0|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  480|      0|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1892|      0|			break;
 1893|      5|		case 'd':
  ------------------
  |  Branch (1893:3): [True: 5, False: 567]
  ------------------
 1894|      5|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  483|      5|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1895|      5|			break;
 1896|     41|		case 'a':
  ------------------
  |  Branch (1896:3): [True: 41, False: 531]
  ------------------
 1897|     41|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  481|     41|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1898|     41|			break;
 1899|      8|		case 'A':
  ------------------
  |  Branch (1899:3): [True: 8, False: 564]
  ------------------
 1900|      8|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  482|      8|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1901|      8|			break;
 1902|      0|		case 'R':
  ------------------
  |  Branch (1902:3): [True: 0, False: 572]
  ------------------
 1903|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  478|      0|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1904|      0|			break;
 1905|      0|		case 'W':
  ------------------
  |  Branch (1905:3): [True: 0, False: 572]
  ------------------
 1906|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  479|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1907|      0|			break;
 1908|      7|		case 'c':
  ------------------
  |  Branch (1908:3): [True: 7, False: 565]
  ------------------
 1909|      7|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  484|      7|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1910|      7|			break;
 1911|    408|		case 'C':
  ------------------
  |  Branch (1911:3): [True: 408, False: 164]
  ------------------
 1912|    408|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  485|    408|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1913|    408|			break;
 1914|      1|		case 'o':
  ------------------
  |  Branch (1914:3): [True: 1, False: 571]
  ------------------
 1915|      1|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  486|      1|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1916|      1|			break;
 1917|      0|		case 's':
  ------------------
  |  Branch (1917:3): [True: 0, False: 572]
  ------------------
 1918|      0|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  487|      0|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1919|      0|			break;
 1920|     25|		case '-':
  ------------------
  |  Branch (1920:3): [True: 25, False: 547]
  ------------------
 1921|     25|			break;
 1922|     59|		default:
  ------------------
  |  Branch (1922:3): [True: 59, False: 513]
  ------------------
 1923|     59|			return(0);
 1924|    572|		}
 1925|    572|	}
 1926|    824|	return (1);
 1927|    883|}
archive_acl.c:is_nfs4_flags:
 1936|    824|{
 1937|    824|	const char *p = start;
 1938|       |
 1939|  1.47k|	while (p < end) {
  ------------------
  |  Branch (1939:9): [True: 925, False: 547]
  ------------------
 1940|    925|		switch(*p++) {
 1941|     26|		case 'f':
  ------------------
  |  Branch (1941:3): [True: 26, False: 899]
  ------------------
 1942|     26|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  517|     26|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1943|     26|			break;
 1944|      4|		case 'd':
  ------------------
  |  Branch (1944:3): [True: 4, False: 921]
  ------------------
 1945|      4|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  518|      4|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1946|      4|			break;
 1947|    182|		case 'i':
  ------------------
  |  Branch (1947:3): [True: 182, False: 743]
  ------------------
 1948|    182|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  520|    182|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1949|    182|			break;
 1950|      7|		case 'n':
  ------------------
  |  Branch (1950:3): [True: 7, False: 918]
  ------------------
 1951|      7|			*permset |=
 1952|      7|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  519|      7|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1953|      7|			break;
 1954|     28|		case 'S':
  ------------------
  |  Branch (1954:3): [True: 28, False: 897]
  ------------------
 1955|     28|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  521|     28|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1956|     28|			break;
 1957|    369|		case 'F':
  ------------------
  |  Branch (1957:3): [True: 369, False: 556]
  ------------------
 1958|    369|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  522|    369|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1959|    369|			break;
 1960|     22|		case 'I':
  ------------------
  |  Branch (1960:3): [True: 22, False: 903]
  ------------------
 1961|     22|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  516|     22|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1962|     22|			break;
 1963|     10|		case '-':
  ------------------
  |  Branch (1963:3): [True: 10, False: 915]
  ------------------
 1964|     10|			break;
 1965|    277|		default:
  ------------------
  |  Branch (1965:3): [True: 277, False: 648]
  ------------------
 1966|    277|			return (0);
 1967|    925|		}
 1968|    925|	}
 1969|    547|	return (1);
 1970|    824|}
archive_acl.c:next_field:
 1983|  37.7k|{
 1984|       |	/* Skip leading whitespace to find start of field. */
 1985|  76.0k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1985:9): [True: 75.9k, False: 16]
  |  Branch (1985:20): [True: 297, False: 75.7k]
  |  Branch (1985:34): [True: 489, False: 75.2k]
  |  Branch (1985:49): [True: 37.4k, False: 37.7k]
  ------------------
 1986|  38.2k|		(*p)++;
 1987|  38.2k|		(*l)--;
 1988|  38.2k|	}
 1989|  37.7k|	*start = *p;
 1990|       |
 1991|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1992|   172k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1992:9): [True: 171k, False: 197]
  |  Branch (1992:19): [True: 169k, False: 1.92k]
  |  Branch (1992:33): [True: 169k, False: 499]
  |  Branch (1992:48): [True: 151k, False: 18.2k]
  |  Branch (1992:63): [True: 150k, False: 480]
  |  Branch (1992:77): [True: 134k, False: 15.9k]
  |  Branch (1992:91): [True: 134k, False: 414]
  ------------------
 1993|   134k|		(*p)++;
 1994|   134k|		(*l)--;
 1995|   134k|	}
 1996|  37.7k|	*end = *p;
 1997|       |
 1998|       |	/* Scan for the separator. */
 1999|  62.9k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1999:9): [True: 62.7k, False: 210]
  |  Branch (1999:19): [True: 61.8k, False: 943]
  |  Branch (1999:33): [True: 44.9k, False: 16.8k]
  |  Branch (1999:47): [True: 25.6k, False: 19.2k]
  |  Branch (1999:62): [True: 25.2k, False: 414]
  ------------------
 2000|  25.2k|		(*p)++;
 2001|  25.2k|		(*l)--;
 2002|  25.2k|	}
 2003|  37.7k|	if (*l > 0)
  ------------------
  |  Branch (2003:6): [True: 37.5k, False: 210]
  ------------------
 2004|  37.5k|		*sep = **p;
 2005|    210|	else
 2006|    210|		*sep = '\0';
 2007|       |
 2008|       |	/* Handle in-field comments */
 2009|  37.7k|	if (*sep == '#') {
  ------------------
  |  Branch (2009:6): [True: 414, False: 37.3k]
  ------------------
 2010|  6.93k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (2010:10): [True: 6.92k, False: 4]
  |  Branch (2010:20): [True: 6.86k, False: 61]
  |  Branch (2010:34): [True: 6.51k, False: 349]
  ------------------
 2011|  6.51k|			(*p)++;
 2012|  6.51k|			(*l)--;
 2013|  6.51k|		}
 2014|    414|		if (*l > 0)
  ------------------
  |  Branch (2014:7): [True: 410, False: 4]
  ------------------
 2015|    410|			*sep = **p;
 2016|      4|		else
 2017|      4|			*sep = '\0';
 2018|    414|	}
 2019|       |
 2020|       |	/* Skip separator. */
 2021|  37.7k|	if (*l > 0) {
  ------------------
  |  Branch (2021:6): [True: 37.5k, False: 214]
  ------------------
 2022|  37.5k|		(*p)++;
 2023|  37.5k|		(*l)--;
 2024|  37.5k|	}
 2025|  37.7k|}

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

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

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

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

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

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

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

archive_read_support_filter_gzip.c:archive_le32dec:
  144|    234|{
  145|    234|	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|    234|	unsigned int p3 = p[3];
  151|    234|	unsigned int p2 = p[2];
  152|    234|	unsigned int p1 = p[1];
  153|    234|	unsigned int p0 = p[0];
  154|       |
  155|    234|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|    234|}
archive_read_support_filter_gzip.c:archive_le16dec:
  115|      2|{
  116|      2|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|      2|	unsigned int p1 = p[1];
  122|      2|	unsigned int p0 = p[0];
  123|       |
  124|      2|	return ((p1 << 8) | p0);
  125|      2|}
archive_read_support_filter_lz4.c:archive_le32dec:
  144|  9.24k|{
  145|  9.24k|	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|  9.24k|	unsigned int p3 = p[3];
  151|  9.24k|	unsigned int p2 = p[2];
  152|  9.24k|	unsigned int p1 = p[1];
  153|  9.24k|	unsigned int p0 = p[0];
  154|       |
  155|  9.24k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  9.24k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   91|    226|{
   92|    226|	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|    226|	unsigned int p3 = p[3];
   98|    226|	unsigned int p2 = p[2];
   99|    226|	unsigned int p1 = p[1];
  100|    226|	unsigned int p0 = p[0];
  101|       |
  102|    226|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    226|}
archive_read_support_filter_xz.c:archive_le32enc:
  216|      3|{
  217|      3|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|      3|	p[0] = u & 0xff;
  220|      3|	p[1] = (u >> 8) & 0xff;
  221|      3|	p[2] = (u >> 16) & 0xff;
  222|      3|	p[3] = (u >> 24) & 0xff;
  223|      3|}
archive_read_support_filter_xz.c:archive_le32dec:
  144|  11.9k|{
  145|  11.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|  11.9k|	unsigned int p3 = p[3];
  151|  11.9k|	unsigned int p2 = p[2];
  152|  11.9k|	unsigned int p1 = p[1];
  153|  11.9k|	unsigned int p0 = p[0];
  154|       |
  155|  11.9k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  11.9k|}
archive_read_support_filter_xz.c:archive_le64dec:
  160|  3.97k|{
  161|  3.97k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  3.97k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  3.97k|}
archive_read_support_filter_zstd.c:archive_le32dec:
  144|  4.33k|{
  145|  4.33k|	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|  4.33k|	unsigned int p3 = p[3];
  151|  4.33k|	unsigned int p2 = p[2];
  152|  4.33k|	unsigned int p1 = p[1];
  153|  4.33k|	unsigned int p0 = p[0];
  154|       |
  155|  4.33k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  4.33k|}
archive_read_support_format_cab.c:archive_le32dec:
  144|   105k|{
  145|   105k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|   105k|	unsigned int p3 = p[3];
  151|   105k|	unsigned int p2 = p[2];
  152|   105k|	unsigned int p1 = p[1];
  153|   105k|	unsigned int p0 = p[0];
  154|       |
  155|   105k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   105k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  2.75k|{
  116|  2.75k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  2.75k|	unsigned int p1 = p[1];
  122|  2.75k|	unsigned int p0 = p[0];
  123|       |
  124|  2.75k|	return ((p1 << 8) | p0);
  125|  2.75k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|    908|{
  198|    908|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|    908|	p[0] = u & 0xff;
  201|    908|	p[1] = (u >> 8) & 0xff;
  202|    908|}
archive_read_support_format_cab.c:archive_le32enc:
  216|    258|{
  217|    258|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    258|	p[0] = u & 0xff;
  220|    258|	p[1] = (u >> 8) & 0xff;
  221|    258|	p[2] = (u >> 16) & 0xff;
  222|    258|	p[3] = (u >> 24) & 0xff;
  223|    258|}
archive_read_support_format_cpio.c:archive_be16dec:
   61|  5.60k|{
   62|  5.60k|	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|  5.60k|	unsigned int p1 = p[1];
   68|  5.60k|	unsigned int p0 = p[0];
   69|       |
   70|  5.60k|	return ((p0 << 8) | p1);
   71|  5.60k|}
archive_read_support_format_cpio.c:archive_le16dec:
  115|  6.59k|{
  116|  6.59k|	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|  6.59k|	unsigned int p1 = p[1];
  122|  6.59k|	unsigned int p0 = p[0];
  123|       |
  124|  6.59k|	return ((p1 << 8) | p0);
  125|  6.59k|}
archive_read_support_format_iso9660.c:archive_le32dec:
  144|  2.92k|{
  145|  2.92k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  2.92k|	unsigned int p3 = p[3];
  151|  2.92k|	unsigned int p2 = p[2];
  152|  2.92k|	unsigned int p1 = p[1];
  153|  2.92k|	unsigned int p0 = p[0];
  154|       |
  155|  2.92k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  2.92k|}
archive_read_support_format_iso9660.c:archive_le16dec:
  115|    400|{
  116|    400|	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|    400|	unsigned int p1 = p[1];
  122|    400|	unsigned int p0 = p[0];
  123|       |
  124|    400|	return ((p1 << 8) | p0);
  125|    400|}
archive_read_support_format_iso9660.c:archive_be32dec:
   91|    354|{
   92|    354|	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|    354|	unsigned int p3 = p[3];
   98|    354|	unsigned int p2 = p[2];
   99|    354|	unsigned int p1 = p[1];
  100|    354|	unsigned int p0 = p[0];
  101|       |
  102|    354|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    354|}
archive_read_support_format_lha.c:archive_le32dec:
  144|  14.6k|{
  145|  14.6k|	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.6k|	unsigned int p3 = p[3];
  151|  14.6k|	unsigned int p2 = p[2];
  152|  14.6k|	unsigned int p1 = p[1];
  153|  14.6k|	unsigned int p0 = p[0];
  154|       |
  155|  14.6k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  14.6k|}
archive_read_support_format_lha.c:archive_le16dec:
  115|  36.0k|{
  116|  36.0k|	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|  36.0k|	unsigned int p1 = p[1];
  122|  36.0k|	unsigned int p0 = p[0];
  123|       |
  124|  36.0k|	return ((p1 << 8) | p0);
  125|  36.0k|}
archive_read_support_format_lha.c:archive_be16dec:
   61|      6|{
   62|      6|	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|      6|	unsigned int p1 = p[1];
   68|      6|	unsigned int p0 = p[0];
   69|       |
   70|      6|	return ((p0 << 8) | p1);
   71|      6|}
archive_read_support_format_lha.c:archive_le64dec:
  160|    487|{
  161|    487|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    487|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    487|}
archive_read_support_format_rar.c:archive_le16dec:
  115|  27.4k|{
  116|  27.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|  27.4k|	unsigned int p1 = p[1];
  122|  27.4k|	unsigned int p0 = p[0];
  123|       |
  124|  27.4k|	return ((p1 << 8) | p0);
  125|  27.4k|}
archive_read_support_format_rar.c:archive_le64dec:
  160|    502|{
  161|    502|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    502|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    502|}
archive_read_support_format_rar.c:archive_le32dec:
  144|  31.1k|{
  145|  31.1k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  31.1k|	unsigned int p3 = p[3];
  151|  31.1k|	unsigned int p2 = p[2];
  152|  31.1k|	unsigned int p1 = p[1];
  153|  31.1k|	unsigned int p0 = p[0];
  154|       |
  155|  31.1k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  31.1k|}
archive_read_support_format_rar.c:archive_le32enc:
  216|   104k|{
  217|   104k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|   104k|	p[0] = u & 0xff;
  220|   104k|	p[1] = (u >> 8) & 0xff;
  221|   104k|	p[2] = (u >> 16) & 0xff;
  222|   104k|	p[3] = (u >> 24) & 0xff;
  223|   104k|}
archive_read_support_format_rar5.c:archive_le32dec:
  144|  51.7k|{
  145|  51.7k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  51.7k|	unsigned int p3 = p[3];
  151|  51.7k|	unsigned int p2 = p[2];
  152|  51.7k|	unsigned int p1 = p[1];
  153|  51.7k|	unsigned int p0 = p[0];
  154|       |
  155|  51.7k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  51.7k|}
archive_read_support_format_rar5.c:archive_le64dec:
  160|    449|{
  161|    449|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    449|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    449|}
archive_read_support_format_rar5.c:archive_le16dec:
  115|    455|{
  116|    455|	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|    455|	unsigned int p1 = p[1];
  122|    455|	unsigned int p0 = p[0];
  123|       |
  124|    455|	return ((p1 << 8) | p0);
  125|    455|}
archive_read_support_format_rar5.c:archive_be24dec:
   75|  1.01M|{
   76|  1.01M|	unsigned char const *p = (unsigned char const *)pp;
   77|       |
   78|       |	/* Store into unsigned temporaries before left shifting, to avoid
   79|       |	promotion to signed int and then left shifting into the sign bit,
   80|       |	which is undefined behaviour. */
   81|  1.01M|	unsigned int p2 = p[2];
   82|  1.01M|	unsigned int p1 = p[1];
   83|  1.01M|	unsigned int p0 = p[0];
   84|       |
   85|  1.01M|	return ((p0 << 16) | (p1 << 8) | p2);
   86|  1.01M|}
archive_read_support_format_rar5.c:archive_be32dec:
   91|  22.7k|{
   92|  22.7k|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|  22.7k|	unsigned int p3 = p[3];
   98|  22.7k|	unsigned int p2 = p[2];
   99|  22.7k|	unsigned int p1 = p[1];
  100|  22.7k|	unsigned int p0 = p[0];
  101|       |
  102|  22.7k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  22.7k|}
archive_read_support_format_rar5.c:archive_le32enc:
  216|     54|{
  217|     54|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|     54|	p[0] = u & 0xff;
  220|     54|	p[1] = (u >> 8) & 0xff;
  221|     54|	p[2] = (u >> 16) & 0xff;
  222|     54|	p[3] = (u >> 24) & 0xff;
  223|     54|}
archive_read_support_format_xar.c:archive_be32dec:
   91|  6.24k|{
   92|  6.24k|	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|  6.24k|	unsigned int p3 = p[3];
   98|  6.24k|	unsigned int p2 = p[2];
   99|  6.24k|	unsigned int p1 = p[1];
  100|  6.24k|	unsigned int p0 = p[0];
  101|       |
  102|  6.24k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  6.24k|}
archive_read_support_format_xar.c:archive_be16dec:
   61|  1.14k|{
   62|  1.14k|	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|  1.14k|	unsigned int p1 = p[1];
   68|  1.14k|	unsigned int p0 = p[0];
   69|       |
   70|  1.14k|	return ((p0 << 8) | p1);
   71|  1.14k|}
archive_read_support_format_xar.c:archive_be64dec:
  107|    766|{
  108|    766|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|    766|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|    766|}
archive_read_support_format_zip.c:archive_le16dec:
  115|   232k|{
  116|   232k|	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|   232k|	unsigned int p1 = p[1];
  122|   232k|	unsigned int p0 = p[0];
  123|       |
  124|   232k|	return ((p1 << 8) | p0);
  125|   232k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   356k|{
  145|   356k|	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|   356k|	unsigned int p3 = p[3];
  151|   356k|	unsigned int p2 = p[2];
  152|   356k|	unsigned int p1 = p[1];
  153|   356k|	unsigned int p0 = p[0];
  154|       |
  155|   356k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   356k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  34.7k|{
  161|  34.7k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  34.7k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  34.7k|}
archive_string.c:archive_be16enc:
  168|  10.6k|{
  169|  10.6k|	unsigned char *p = (unsigned char *)pp;
  170|       |
  171|  10.6k|	p[0] = (u >> 8) & 0xff;
  172|  10.6k|	p[1] = u & 0xff;
  173|  10.6k|}
archive_string.c:archive_le16enc:
  197|  3.84k|{
  198|  3.84k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  3.84k|	p[0] = u & 0xff;
  201|  3.84k|	p[1] = (u >> 8) & 0xff;
  202|  3.84k|}
archive_string.c:archive_be16dec:
   61|  41.2k|{
   62|  41.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|  41.2k|	unsigned int p1 = p[1];
   68|  41.2k|	unsigned int p0 = p[0];
   69|       |
   70|  41.2k|	return ((p0 << 8) | p1);
   71|  41.2k|}
archive_string.c:archive_le16dec:
  115|  33.4k|{
  116|  33.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|  33.4k|	unsigned int p1 = p[1];
  122|  33.4k|	unsigned int p0 = p[0];
  123|       |
  124|  33.4k|	return ((p1 << 8) | p0);
  125|  33.4k|}
archive_read_support_format_7zip.c:archive_le32dec:
  144|  35.5k|{
  145|  35.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|  35.5k|	unsigned int p3 = p[3];
  151|  35.5k|	unsigned int p2 = p[2];
  152|  35.5k|	unsigned int p1 = p[1];
  153|  35.5k|	unsigned int p0 = p[0];
  154|       |
  155|  35.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  35.5k|}
archive_read_support_format_7zip.c:archive_le16dec:
  115|    174|{
  116|    174|	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|    174|	unsigned int p1 = p[1];
  122|    174|	unsigned int p0 = p[0];
  123|       |
  124|    174|	return ((p1 << 8) | p0);
  125|    174|}
archive_read_support_format_7zip.c:archive_be16dec:
   61|     12|{
   62|     12|	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|     12|	unsigned int p1 = p[1];
   68|     12|	unsigned int p0 = p[0];
   69|       |
   70|     12|	return ((p0 << 8) | p1);
   71|     12|}
archive_read_support_format_7zip.c:archive_be32dec:
   91|    276|{
   92|    276|	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|    276|	unsigned int p3 = p[3];
   98|    276|	unsigned int p2 = p[2];
   99|    276|	unsigned int p1 = p[1];
  100|    276|	unsigned int p0 = p[0];
  101|       |
  102|    276|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    276|}
archive_read_support_format_7zip.c:archive_be64dec:
  107|      3|{
  108|      3|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|      3|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|      3|}
archive_read_support_format_7zip.c:archive_le64dec:
  160|    687|{
  161|    687|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    687|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    687|}

archive_entry_clear:
  155|   257k|{
  156|   257k|	if (entry == NULL)
  ------------------
  |  Branch (156:6): [True: 0, False: 257k]
  ------------------
  157|      0|		return (NULL);
  158|   257k|	archive_mstring_clean(&entry->ae_fflags_text);
  159|   257k|	archive_mstring_clean(&entry->ae_gname);
  160|   257k|	archive_mstring_clean(&entry->ae_linkname);
  161|   257k|	archive_mstring_clean(&entry->ae_pathname);
  162|   257k|	archive_mstring_clean(&entry->ae_sourcepath);
  163|   257k|	archive_mstring_clean(&entry->ae_uname);
  164|   257k|	archive_entry_copy_mac_metadata(entry, NULL, 0);
  165|   257k|	archive_acl_clear(&entry->acl);
  166|   257k|	archive_entry_xattr_clear(entry);
  167|   257k|	archive_entry_sparse_clear(entry);
  168|   257k|	free(entry->stat);
  169|   257k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|   257k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  170|   257k|	memset(entry, 0, sizeof(*entry));
  171|   257k|	return entry;
  172|   257k|}
archive_entry_free:
  250|  26.5k|{
  251|  26.5k|	archive_entry_clear(entry);
  252|  26.5k|	free(entry);
  253|  26.5k|}
archive_entry_new:
  257|  22.8k|{
  258|       |	return archive_entry_new2(NULL);
  259|  22.8k|}
archive_entry_new2:
  263|  26.5k|{
  264|  26.5k|	struct archive_entry *entry;
  265|       |
  266|  26.5k|	entry = calloc(1, sizeof(*entry));
  267|  26.5k|	if (entry == NULL)
  ------------------
  |  Branch (267:6): [True: 0, False: 26.5k]
  ------------------
  268|      0|		return (NULL);
  269|  26.5k|	entry->archive = a;
  270|  26.5k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|  26.5k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  271|  26.5k|	return (entry);
  272|  26.5k|}
archive_entry_atime:
  280|  92.5k|{
  281|  92.5k|	return (entry->ae_stat.aest_atime);
  282|  92.5k|}
archive_entry_atime_is_set:
  292|  1.46k|{
  293|  1.46k|	return (entry->ae_set & AE_SET_ATIME);
  ------------------
  |  |  141|  1.46k|#define	AE_SET_ATIME	4
  ------------------
  294|  1.46k|}
archive_entry_birthtime:
  298|  92.5k|{
  299|  92.5k|	return (entry->ae_stat.aest_birthtime);
  300|  92.5k|}
archive_entry_ctime:
  316|  92.5k|{
  317|  92.5k|	return (entry->ae_stat.aest_ctime);
  318|  92.5k|}
archive_entry_ctime_is_set:
  322|  1.46k|{
  323|  1.46k|	return (entry->ae_set & AE_SET_CTIME);
  ------------------
  |  |  142|  1.46k|#define	AE_SET_CTIME	8
  ------------------
  324|  1.46k|}
archive_entry_dev:
  334|  98.6k|{
  335|  98.6k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (335:6): [True: 11.7k, False: 86.9k]
  ------------------
  336|  11.7k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  11.7k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  337|  86.9k|		    entry->ae_stat.aest_devminor);
  338|  86.9k|	else
  339|  86.9k|		return (entry->ae_stat.aest_dev);
  340|  98.6k|}
archive_entry_filetype:
  368|   126k|{
  369|   126k|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|   126k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  370|   126k|}
archive_entry_gid:
  427|  92.5k|{
  428|  92.5k|	return (entry->ae_stat.aest_gid);
  429|  92.5k|}
archive_entry_gid_is_set:
  433|  19.1k|{
  434|  19.1k|	return (entry->ae_set & AE_SET_GID);
  ------------------
  |  |  151|  19.1k|#define	AE_SET_GID	4096
  ------------------
  435|  19.1k|}
archive_entry_gname:
  439|  6.98k|{
  440|  6.98k|	const char *p;
  441|  6.98k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_gname, &p) == 0)
  ------------------
  |  Branch (441:6): [True: 6.98k, False: 0]
  ------------------
  442|  6.98k|		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|  5.38k|{
  481|  5.38k|	if ((entry->ae_set & AE_SET_SYMLINK) != 0) {
  ------------------
  |  |  140|  5.38k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (481:6): [True: 0, False: 5.38k]
  ------------------
  482|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  483|      0|	}
  484|  5.38k|	entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  5.38k|#define	AE_SET_HARDLINK	1
  ------------------
  485|  5.38k|}
archive_entry_hardlink:
  489|  5.38k|{
  490|  5.38k|	const char *p;
  491|  5.38k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  5.38k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (491:6): [True: 0, False: 5.38k]
  ------------------
  492|      0|		return (NULL);
  493|  5.38k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (493:6): [True: 5.38k, False: 0]
  ------------------
  494|  5.38k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  495|  5.38k|		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|  5.38k|{
  518|  5.38k|	const wchar_t *p;
  519|  5.38k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  5.38k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (519:6): [True: 0, False: 5.38k]
  ------------------
  520|      0|		return (NULL);
  521|  5.38k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (521:6): [True: 5.38k, False: 0]
  ------------------
  522|  5.38k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  523|  5.38k|		return (p);
  524|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (524:6): [True: 0, False: 0]
  ------------------
  525|      0|		__archive_errx(1, "No memory");
  526|      0|	return (NULL);
  527|      0|}
archive_entry_ino64:
  561|  6.10k|{
  562|  6.10k|	return (entry->ae_stat.aest_ino);
  563|  6.10k|}
archive_entry_mode:
  567|  92.5k|{
  568|  92.5k|	return (entry->acl.mode);
  569|  92.5k|}
archive_entry_mtime:
  573|  92.5k|{
  574|  92.5k|	return (entry->ae_stat.aest_mtime);
  575|  92.5k|}
archive_entry_mtime_is_set:
  585|  19.1k|{
  586|  19.1k|	return (entry->ae_set & AE_SET_MTIME);
  ------------------
  |  |  143|  19.1k|#define	AE_SET_MTIME	16
  ------------------
  587|  19.1k|}
archive_entry_nlink:
  591|  10.7k|{
  592|  10.7k|	return (entry->ae_stat.aest_nlink);
  593|  10.7k|}
archive_entry_pathname:
  604|   158k|{
  605|   158k|	const char *p;
  606|   158k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (606:6): [True: 158k, False: 605]
  ------------------
  607|   158k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  608|   158k|		return (p);
  609|       |#if HAVE_EILSEQ  /*{*/
  610|    605|    if (errno == EILSEQ) {
  ------------------
  |  Branch (610:9): [True: 605, False: 0]
  ------------------
  611|    605|	    if (archive_mstring_get_utf8(
  ------------------
  |  Branch (611:10): [True: 605, False: 0]
  ------------------
  612|    605|	        entry->archive, &entry->ae_pathname, &p) == 0)
  613|    605|		    return (p);
  614|    605|    }
  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|   114k|{
  624|   114k|	const char *p;
  625|   114k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (625:6): [True: 94.7k, False: 19.9k]
  ------------------
  626|   114k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  627|  94.7k|		return (p);
  628|  19.9k|	if (errno == ENOMEM)
  ------------------
  |  Branch (628:6): [True: 0, False: 19.9k]
  ------------------
  629|      0|		__archive_errx(1, "No memory");
  630|  19.9k|	return (NULL);
  631|  19.9k|}
archive_entry_pathname_w:
  635|   167k|{
  636|   167k|	const wchar_t *p;
  637|   167k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (637:6): [True: 133k, False: 34.6k]
  ------------------
  638|   167k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  639|   133k|		return (p);
  640|  34.6k|	if (errno == ENOMEM)
  ------------------
  |  Branch (640:6): [True: 0, False: 34.6k]
  ------------------
  641|      0|		__archive_errx(1, "No memory");
  642|  34.6k|	return (NULL);
  643|  34.6k|}
archive_entry_perm:
  654|    219|{
  655|    219|	return (~AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|    219|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  656|    219|}
archive_entry_perm_is_set:
  660|  19.1k|{
  661|  19.1k|	return (entry->ae_set & AE_SET_PERM);
  ------------------
  |  |  148|  19.1k|#define	AE_SET_PERM	512
  ------------------
  662|  19.1k|}
archive_entry_rdev_is_set:
  666|  1.42k|{
  667|  1.42k|	return (entry->ae_set & AE_SET_RDEV);
  ------------------
  |  |  152|  1.42k|#define	AE_SET_RDEV	8192
  ------------------
  668|  1.42k|}
archive_entry_size:
  712|   194k|{
  713|   194k|	return (entry->ae_stat.aest_size);
  714|   194k|}
archive_entry_size_is_set:
  718|  92.5k|{
  719|  92.5k|	return (entry->ae_set & AE_SET_SIZE);
  ------------------
  |  |  145|  92.5k|#define	AE_SET_SIZE	64
  ------------------
  720|  92.5k|}
archive_entry_symlink:
  746|  4.44k|{
  747|  4.44k|	const char *p;
  748|  4.44k|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|  4.44k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (748:6): [True: 4.35k, False: 90]
  ------------------
  749|  4.35k|		return (NULL);
  750|     90|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (750:6): [True: 90, False: 0]
  ------------------
  751|     90|	    entry->archive, &entry->ae_linkname, &p) == 0)
  752|     90|		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|     89|{
  761|     89|	if ((entry->ae_set & AE_SET_HARDLINK) != 0) {
  ------------------
  |  |  139|     89|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (761:6): [True: 0, False: 89]
  ------------------
  762|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  763|      0|	}
  764|     89|	entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|     89|#define	AE_SET_SYMLINK	2
  ------------------
  765|     89|}
archive_entry_symlink_w:
  789|    184|{
  790|    184|	const wchar_t *p;
  791|    184|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|    184|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (791:6): [True: 95, False: 89]
  ------------------
  792|     95|		return (NULL);
  793|     89|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (793:6): [True: 89, False: 0]
  ------------------
  794|     89|	    entry->archive, &entry->ae_linkname, &p) == 0)
  795|     89|		return (p);
  796|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (796:6): [True: 0, False: 0]
  ------------------
  797|      0|		__archive_errx(1, "No memory");
  798|      0|	return (NULL);
  799|      0|}
archive_entry_uid:
  815|  92.5k|{
  816|  92.5k|	return (entry->ae_stat.aest_uid);
  817|  92.5k|}
archive_entry_uid_is_set:
  821|  19.1k|{
  822|  19.1k|	return (entry->ae_set & AE_SET_UID);
  ------------------
  |  |  150|  19.1k|#define	AE_SET_UID	2048
  ------------------
  823|  19.1k|}
archive_entry_uname:
  827|  6.98k|{
  828|  6.98k|	const char *p;
  829|  6.98k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_uname, &p) == 0)
  ------------------
  |  Branch (829:6): [True: 6.98k, False: 0]
  ------------------
  830|  6.98k|		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|  92.5k|{
  868|  92.5k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  92.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  92.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
  869|  92.5k|}
archive_entry_is_metadata_encrypted:
  873|  92.5k|{
  874|  92.5k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  92.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  92.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  875|  92.5k|}
archive_entry_is_encrypted:
  879|  92.5k|{
  880|  92.5k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  169|  92.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|  92.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  881|  92.5k|}
archive_entry_set_filetype:
  889|  62.6k|{
  890|  62.6k|	entry->stat_valid = 0;
  891|  62.6k|	entry->acl.mode &= ~AE_IFMT;
  ------------------
  |  |  215|  62.6k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  892|  62.6k|	entry->acl.mode |= AE_IFMT & type;
  ------------------
  |  |  215|  62.6k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  893|  62.6k|	entry->ae_set |= AE_SET_FILETYPE;
  ------------------
  |  |  149|  62.6k|#define	AE_SET_FILETYPE	1024
  ------------------
  894|  62.6k|}
archive_entry_copy_fflags_text:
  908|  7.32k|{
  909|  7.32k|	return archive_entry_copy_fflags_text_len(entry, flags, strlen(flags));
  910|  7.32k|}
archive_entry_copy_fflags_text_len:
  915|  7.32k|{
  916|  7.32k|	archive_mstring_copy_mbs_len(&entry->ae_fflags_text, flags, flags_length);
  917|  7.32k|	return (ae_strtofflags(flags, flags_length,
  918|  7.32k|		    &entry->ae_fflags_set, &entry->ae_fflags_clear));
  919|  7.32k|}
archive_entry_set_gid:
  932|  71.3k|{
  933|  71.3k|	if (g < 0) {
  ------------------
  |  Branch (933:6): [True: 448, False: 70.8k]
  ------------------
  934|    448|		g = 0;
  935|    448|	}
  936|  71.3k|	entry->stat_valid = 0;
  937|  71.3k|	entry->ae_stat.aest_gid = g;
  938|  71.3k|	entry->ae_set |= AE_SET_GID;
  ------------------
  |  |  151|  71.3k|#define	AE_SET_GID	4096
  ------------------
  939|  71.3k|}
archive_entry_set_gname:
  943|  1.17k|{
  944|  1.17k|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  945|  1.17k|}
__archive_entry_copy_gname_l:
  979|  6.98k|{
  980|  6.98k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_gname, name, len, sc));
  981|  6.98k|}
archive_entry_set_ino:
  985|   152k|{
  986|   152k|	if (ino < 0) {
  ------------------
  |  Branch (986:6): [True: 0, False: 152k]
  ------------------
  987|      0|		entry->stat_valid = 0;
  988|      0|		entry->ae_set &= ~AE_SET_INO;
  ------------------
  |  |  146|      0|#define	AE_SET_INO	128
  ------------------
  989|      0|		return;
  990|      0|	}
  991|   152k|	entry->stat_valid = 0;
  992|   152k|	entry->ae_set |= AE_SET_INO;
  ------------------
  |  |  146|   152k|#define	AE_SET_INO	128
  ------------------
  993|   152k|	entry->ae_stat.aest_ino = ino;
  994|   152k|}
archive_entry_set_hardlink:
 1011|     57|{
 1012|     57|	if (target == NULL) {
  ------------------
  |  Branch (1012:6): [True: 1, False: 56]
  ------------------
 1013|      1|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      1|#define	AE_SET_HARDLINK	1
  ------------------
 1014|      1|		if (entry->ae_set & AE_SET_SYMLINK) {
  ------------------
  |  |  140|      1|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1014:7): [True: 0, False: 1]
  ------------------
 1015|      0|			return;
 1016|      0|		}
 1017|     56|	} else {
 1018|     56|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|     56|#define	AE_SET_HARDLINK	1
  ------------------
 1019|     56|	}
 1020|     57|	entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|     57|#define	AE_SET_SYMLINK	2
  ------------------
 1021|     57|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1022|     57|}
archive_entry_copy_hardlink:
 1038|  4.32k|{
 1039|  4.32k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1039:6): [True: 0, False: 4.32k]
  |  Branch (1039:24): [True: 0, False: 0]
  ------------------
 1040|      0|		return;
 1041|  4.32k|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1042|  4.32k|	if (target != NULL)
  ------------------
  |  Branch (1042:6): [True: 4.32k, False: 0]
  ------------------
 1043|  4.32k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  4.32k|#define	AE_SET_HARDLINK	1
  ------------------
 1044|      0|	else
 1045|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1046|  4.32k|}
archive_entry_update_hardlink_utf8:
 1062|    959|{
 1063|    959|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1063:6): [True: 0, False: 959]
  |  Branch (1063:24): [True: 0, False: 0]
  ------------------
 1064|      0|		return (0);
 1065|    959|	if (target != NULL)
  ------------------
  |  Branch (1065:6): [True: 959, False: 0]
  ------------------
 1066|    959|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    959|#define	AE_SET_HARDLINK	1
  ------------------
 1067|      0|	else
 1068|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1069|    959|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1069:6): [True: 269, False: 690]
  ------------------
 1070|    959|	    &entry->ae_linkname, target) == 0)
 1071|    269|		return (1);
 1072|    690|	if (errno == ENOMEM)
  ------------------
  |  Branch (1072:6): [True: 0, False: 690]
  ------------------
 1073|      0|		__archive_errx(1, "No memory");
 1074|    690|	return (0);
 1075|    690|}
__archive_entry_copy_hardlink_l:
 1080|  5.38k|{
 1081|  5.38k|	int r;
 1082|       |
 1083|  5.38k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1083:6): [True: 0, False: 5.38k]
  |  Branch (1083:24): [True: 0, False: 0]
  ------------------
 1084|      0|		return (0);
 1085|  5.38k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1086|  5.38k|	    target, len, sc);
 1087|  5.38k|	if (target != NULL && r == 0)
  ------------------
  |  Branch (1087:6): [True: 5.38k, False: 0]
  |  Branch (1087:24): [True: 5.38k, False: 0]
  ------------------
 1088|  5.38k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  5.38k|#define	AE_SET_HARDLINK	1
  ------------------
 1089|      0|	else
 1090|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1091|  5.38k|	return (r);
 1092|  5.38k|}
archive_entry_set_atime:
 1096|  45.8k|{
 1097|  45.8k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  45.8k|	do {	\
  |  |  113|  45.8k|		t += ns / 1000000000; \
  |  |  114|  45.8k|		ns %= 1000000000; \
  |  |  115|  45.8k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 45.8k]
  |  |  ------------------
  |  |  116|  45.8k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 45.8k]
  |  |  ------------------
  ------------------
 1098|  45.8k|	entry->stat_valid = 0;
 1099|  45.8k|	entry->ae_set |= AE_SET_ATIME;
  ------------------
  |  |  141|  45.8k|#define	AE_SET_ATIME	4
  ------------------
 1100|  45.8k|	entry->ae_stat.aest_atime = t;
 1101|  45.8k|	entry->ae_stat.aest_atime_nsec = ns;
 1102|  45.8k|}
archive_entry_unset_atime:
 1106|  4.71k|{
 1107|  4.71k|	archive_entry_set_atime(entry, 0, 0);
 1108|  4.71k|	entry->ae_set &= ~AE_SET_ATIME;
  ------------------
  |  |  141|  4.71k|#define	AE_SET_ATIME	4
  ------------------
 1109|  4.71k|}
archive_entry_set_birthtime:
 1113|  4.92k|{
 1114|  4.92k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  4.92k|	do {	\
  |  |  113|  4.92k|		t += ns / 1000000000; \
  |  |  114|  4.92k|		ns %= 1000000000; \
  |  |  115|  4.92k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 4.92k]
  |  |  ------------------
  |  |  116|  4.92k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 4.92k]
  |  |  ------------------
  ------------------
 1115|  4.92k|	entry->stat_valid = 0;
 1116|  4.92k|	entry->ae_set |= AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  4.92k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1117|  4.92k|	entry->ae_stat.aest_birthtime = t;
 1118|  4.92k|	entry->ae_stat.aest_birthtime_nsec = ns;
 1119|  4.92k|}
archive_entry_unset_birthtime:
 1123|  4.92k|{
 1124|  4.92k|	archive_entry_set_birthtime(entry, 0, 0);
 1125|  4.92k|	entry->ae_set &= ~AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  4.92k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1126|  4.92k|}
archive_entry_set_ctime:
 1130|  52.5k|{
 1131|  52.5k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  52.5k|	do {	\
  |  |  113|  52.5k|		t += ns / 1000000000; \
  |  |  114|  52.5k|		ns %= 1000000000; \
  |  |  115|  52.5k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 52.5k]
  |  |  ------------------
  |  |  116|  52.5k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 52.5k]
  |  |  ------------------
  ------------------
 1132|  52.5k|	entry->stat_valid = 0;
 1133|  52.5k|	entry->ae_set |= AE_SET_CTIME;
  ------------------
  |  |  142|  52.5k|#define	AE_SET_CTIME	8
  ------------------
 1134|  52.5k|	entry->ae_stat.aest_ctime = t;
 1135|  52.5k|	entry->ae_stat.aest_ctime_nsec = ns;
 1136|  52.5k|}
archive_entry_unset_ctime:
 1140|  4.70k|{
 1141|  4.70k|	archive_entry_set_ctime(entry, 0, 0);
 1142|  4.70k|	entry->ae_set &= ~AE_SET_CTIME;
  ------------------
  |  |  142|  4.70k|#define	AE_SET_CTIME	8
  ------------------
 1143|  4.70k|}
archive_entry_set_dev:
 1147|   146k|{
 1148|   146k|	entry->stat_valid = 0;
 1149|   146k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|   146k|#define	AE_SET_DEV	256
  ------------------
 1150|   146k|	entry->ae_stat.aest_dev_is_broken_down = 0;
 1151|   146k|	entry->ae_stat.aest_dev = d;
 1152|   146k|}
archive_entry_set_devmajor:
 1156|  5.90k|{
 1157|  5.90k|	entry->stat_valid = 0;
 1158|  5.90k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  5.90k|#define	AE_SET_DEV	256
  ------------------
 1159|  5.90k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1160|  5.90k|	entry->ae_stat.aest_devmajor = m;
 1161|  5.90k|}
archive_entry_set_devminor:
 1165|  5.90k|{
 1166|  5.90k|	entry->stat_valid = 0;
 1167|  5.90k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  5.90k|#define	AE_SET_DEV	256
  ------------------
 1168|  5.90k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1169|  5.90k|	entry->ae_stat.aest_devminor = m;
 1170|  5.90k|}
archive_entry_set_link:
 1175|    676|{
 1176|    676|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1177|    676|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|    676|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1177:6): [True: 676, False: 0]
  ------------------
 1178|    676|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    676|#define	AE_SET_HARDLINK	1
  ------------------
 1179|    676|	}
 1180|    676|}
archive_entry_set_mode:
 1243|  67.5k|{
 1244|  67.5k|	entry->stat_valid = 0;
 1245|  67.5k|	entry->acl.mode = m;
 1246|  67.5k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|  67.5k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|  67.5k|#define	AE_SET_FILETYPE	1024
  ------------------
 1247|  67.5k|}
archive_entry_set_mtime:
 1251|  87.6k|{
 1252|  87.6k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  87.6k|	do {	\
  |  |  113|  87.6k|		t += ns / 1000000000; \
  |  |  114|  87.6k|		ns %= 1000000000; \
  |  |  115|  87.6k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 87.6k]
  |  |  ------------------
  |  |  116|  87.6k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 87.6k]
  |  |  ------------------
  ------------------
 1253|  87.6k|	entry->stat_valid = 0;
 1254|  87.6k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|  87.6k|#define	AE_SET_MTIME	16
  ------------------
 1255|  87.6k|	entry->ae_stat.aest_mtime = t;
 1256|  87.6k|	entry->ae_stat.aest_mtime_nsec = ns;
 1257|  87.6k|}
archive_entry_unset_mtime:
 1261|    256|{
 1262|    256|	archive_entry_set_mtime(entry, 0, 0);
 1263|    256|	entry->ae_set &= ~AE_SET_MTIME;
  ------------------
  |  |  143|    256|#define	AE_SET_MTIME	16
  ------------------
 1264|    256|}
archive_entry_set_nlink:
 1268|  10.1k|{
 1269|  10.1k|	entry->stat_valid = 0;
 1270|  10.1k|	entry->ae_stat.aest_nlink = nlink;
 1271|  10.1k|}
archive_entry_set_pathname:
 1275|    660|{
 1276|    660|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1277|    660|}
archive_entry_copy_pathname:
 1287|  14.9k|{
 1288|  14.9k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1289|  14.9k|}
archive_entry_copy_pathname_w:
 1293|  5.76k|{
 1294|  5.76k|	archive_mstring_copy_wcs(&entry->ae_pathname, name);
 1295|  5.76k|}
archive_entry_update_pathname_utf8:
 1299|  31.7k|{
 1300|  31.7k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1300:6): [True: 5.34k, False: 26.4k]
  ------------------
 1301|  31.7k|	    &entry->ae_pathname, name) == 0)
 1302|  5.34k|		return (1);
 1303|  26.4k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1303:6): [True: 0, False: 26.4k]
  ------------------
 1304|      0|		__archive_errx(1, "No memory");
 1305|  26.4k|	return (0);
 1306|  26.4k|}
__archive_entry_copy_pathname_l:
 1311|  69.5k|{
 1312|  69.5k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_pathname,
 1313|  69.5k|	    name, len, sc));
 1314|  69.5k|}
archive_entry_set_perm:
 1318|  26.3k|{
 1319|  26.3k|	entry->stat_valid = 0;
 1320|  26.3k|	entry->acl.mode &= AE_IFMT;
  ------------------
  |  |  215|  26.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1321|  26.3k|	entry->acl.mode |= ~AE_IFMT & p;
  ------------------
  |  |  215|  26.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1322|  26.3k|	entry->ae_set |= AE_SET_PERM;
  ------------------
  |  |  148|  26.3k|#define	AE_SET_PERM	512
  ------------------
 1323|  26.3k|}
archive_entry_set_rdev:
 1327|  9.30k|{
 1328|  9.30k|	entry->stat_valid = 0;
 1329|  9.30k|	entry->ae_stat.aest_rdev = m;
 1330|  9.30k|	entry->ae_stat.aest_rdev_is_broken_down = 0;
 1331|  9.30k|	entry->ae_stat.aest_rdevmajor = 0;
 1332|  9.30k|	entry->ae_stat.aest_rdevminor = 0;
 1333|  9.30k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  9.30k|#define	AE_SET_RDEV	8192
  ------------------
 1334|  9.30k|}
archive_entry_set_rdevmajor:
 1338|  7.35k|{
 1339|  7.35k|	entry->stat_valid = 0;
 1340|  7.35k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1341|  7.35k|	entry->ae_stat.aest_rdev = 0;
 1342|  7.35k|	entry->ae_stat.aest_rdevmajor = m;
 1343|  7.35k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  7.35k|#define	AE_SET_RDEV	8192
  ------------------
 1344|  7.35k|}
archive_entry_set_rdevminor:
 1348|  7.33k|{
 1349|  7.33k|	entry->stat_valid = 0;
 1350|  7.33k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1351|  7.33k|	entry->ae_stat.aest_rdev = 0;
 1352|  7.33k|	entry->ae_stat.aest_rdevminor = m;
 1353|  7.33k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  7.33k|#define	AE_SET_RDEV	8192
  ------------------
 1354|  7.33k|}
archive_entry_set_size:
 1358|  91.9k|{
 1359|  91.9k|	if (s < 0) {
  ------------------
  |  Branch (1359:6): [True: 0, False: 91.9k]
  ------------------
 1360|      0|		s = 0;
 1361|      0|	}
 1362|  91.9k|	entry->stat_valid = 0;
 1363|  91.9k|	entry->ae_stat.aest_size = s;
 1364|  91.9k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|  91.9k|#define	AE_SET_SIZE	64
  ------------------
 1365|  91.9k|}
archive_entry_unset_size:
 1369|    153|{
 1370|    153|	archive_entry_set_size(entry, 0);
 1371|    153|	entry->ae_set &= ~AE_SET_SIZE;
  ------------------
  |  |  145|    153|#define	AE_SET_SIZE	64
  ------------------
 1372|    153|}
archive_entry_set_symlink:
 1388|  4.45k|{
 1389|  4.45k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|  4.45k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1389:6): [True: 4.45k, False: 0]
  |  Branch (1389:26): [True: 0, False: 4.45k]
  ------------------
 1390|      0|		return;
 1391|  4.45k|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1392|  4.45k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  4.45k|#define	AE_SET_HARDLINK	1
  ------------------
 1393|  4.45k|	if (linkname == NULL)
  ------------------
  |  Branch (1393:6): [True: 4.45k, False: 0]
  ------------------
 1394|  4.45k|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|  4.45k|#define	AE_SET_SYMLINK	2
  ------------------
 1395|      0|	else
 1396|      0|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1397|  4.45k|}
archive_entry_set_symlink_type:
 1401|  1.19k|{
 1402|  1.19k|	entry->ae_symlink_type = type;
 1403|  1.19k|}
archive_entry_copy_symlink:
 1420|    275|{
 1421|    275|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1421:6): [True: 0, False: 275]
  |  Branch (1421:26): [True: 0, False: 0]
  ------------------
 1422|      0|		return;
 1423|    275|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1424|    275|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|    275|#define	AE_SET_HARDLINK	1
  ------------------
 1425|    275|	if (linkname == NULL)
  ------------------
  |  Branch (1425:6): [True: 0, False: 275]
  ------------------
 1426|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1427|    275|	else
 1428|    275|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|    275|#define	AE_SET_SYMLINK	2
  ------------------
 1429|    275|}
archive_entry_copy_symlink_w:
 1433|      1|{
 1434|      1|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1434:6): [True: 0, False: 1]
  |  Branch (1434:26): [True: 0, False: 0]
  ------------------
 1435|      0|		return;
 1436|      1|	archive_mstring_copy_wcs(&entry->ae_linkname, linkname);
 1437|      1|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      1|#define	AE_SET_HARDLINK	1
  ------------------
 1438|      1|	if (linkname == NULL)
  ------------------
  |  Branch (1438:6): [True: 0, False: 1]
  ------------------
 1439|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1440|      1|	else
 1441|      1|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|      1|#define	AE_SET_SYMLINK	2
  ------------------
 1442|      1|}
archive_entry_update_symlink_utf8:
 1446|  1.19k|{
 1447|  1.19k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1447:6): [True: 0, False: 1.19k]
  |  Branch (1447:26): [True: 0, False: 0]
  ------------------
 1448|      0|		return (0);
 1449|  1.19k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  1.19k|#define	AE_SET_HARDLINK	1
  ------------------
 1450|  1.19k|	if (linkname == NULL)
  ------------------
  |  Branch (1450:6): [True: 0, False: 1.19k]
  ------------------
 1451|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1452|  1.19k|	else
 1453|  1.19k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  1.19k|#define	AE_SET_SYMLINK	2
  ------------------
 1454|  1.19k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1454:6): [True: 411, False: 779]
  ------------------
 1455|  1.19k|	    &entry->ae_linkname, linkname) == 0)
 1456|    411|		return (1);
 1457|    779|	if (errno == ENOMEM)
  ------------------
  |  Branch (1457:6): [True: 0, False: 779]
  ------------------
 1458|      0|		__archive_errx(1, "No memory");
 1459|    779|	return (0);
 1460|    779|}
__archive_entry_copy_symlink_l:
 1465|  1.56k|{
 1466|  1.56k|	int r;
 1467|       |
 1468|  1.56k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1468:6): [True: 0, False: 1.56k]
  |  Branch (1468:26): [True: 0, False: 0]
  ------------------
 1469|      0|		return (0);
 1470|  1.56k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  1.56k|#define	AE_SET_HARDLINK	1
  ------------------
 1471|  1.56k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1472|  1.56k|	    linkname, len, sc);
 1473|  1.56k|	if (linkname == NULL || r != 0)
  ------------------
  |  Branch (1473:6): [True: 0, False: 1.56k]
  |  Branch (1473:26): [True: 322, False: 1.23k]
  ------------------
 1474|    322|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|    322|#define	AE_SET_SYMLINK	2
  ------------------
 1475|  1.23k|	else
 1476|  1.23k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  1.23k|#define	AE_SET_SYMLINK	2
  ------------------
 1477|  1.56k|	return (r);
 1478|  1.56k|}
archive_entry_set_uid:
 1482|  72.3k|{
 1483|  72.3k|	if (u < 0) {
  ------------------
  |  Branch (1483:6): [True: 720, False: 71.5k]
  ------------------
 1484|    720|		u = 0;
 1485|    720|	}
 1486|  72.3k|	entry->stat_valid = 0;
 1487|  72.3k|	entry->ae_stat.aest_uid = u;
 1488|  72.3k|	entry->ae_set |= AE_SET_UID;
  ------------------
  |  |  150|  72.3k|#define	AE_SET_UID	2048
  ------------------
 1489|  72.3k|}
archive_entry_set_uname:
 1493|    210|{
 1494|    210|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1495|    210|}
archive_entry_copy_uname:
 1505|    130|{
 1506|    130|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1507|    130|}
archive_entry_set_is_data_encrypted:
 1528|  14.0k|{
 1529|  14.0k|	if (is_encrypted) {
  ------------------
  |  Branch (1529:6): [True: 14.0k, False: 0]
  ------------------
 1530|  14.0k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|  14.0k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1531|  14.0k|	} else {
 1532|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1533|      0|	}
 1534|  14.0k|}
archive_entry_set_is_metadata_encrypted:
 1538|      5|{
 1539|      5|	if (is_encrypted) {
  ------------------
  |  Branch (1539:6): [True: 5, False: 0]
  ------------------
 1540|      5|		entry->encryption |= AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|      5|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1541|      5|	} else {
 1542|      0|		entry->encryption &= ~AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|      0|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1543|      0|	}
 1544|      5|}
__archive_entry_copy_uname_l:
 1549|  6.98k|{
 1550|  6.98k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_uname,
 1551|  6.98k|	    name, len, sc));
 1552|  6.98k|}
archive_entry_copy_mac_metadata:
 1564|   257k|{
 1565|   257k|	void *metadata;
 1566|       |
 1567|   257k|	if (p == NULL || s == 0) {
  ------------------
  |  Branch (1567:6): [True: 257k, False: 0]
  |  Branch (1567:19): [True: 0, False: 0]
  ------------------
 1568|   257k|		free(entry->mac_metadata);
 1569|   257k|		entry->mac_metadata = NULL;
 1570|   257k|		entry->mac_metadata_size = 0;
 1571|   257k|	} else {
 1572|      0|		metadata = malloc(s);
 1573|      0|		if (metadata == NULL)
  ------------------
  |  Branch (1573:7): [True: 0, False: 0]
  ------------------
 1574|      0|			abort();
 1575|      0|		memcpy(metadata, p, s);
 1576|      0|		free(entry->mac_metadata);
 1577|      0|		entry->mac_metadata = metadata;
 1578|      0|		entry->mac_metadata_size = s;
 1579|      0|	}
 1580|   257k|}
archive_entry_digest:
 1585|  92.5k|{
 1586|  92.5k|	switch (type) {
 1587|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1587:2): [True: 0, False: 92.5k]
  ------------------
 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: 92.5k]
  ------------------
 1590|      0|		return entry->digest.rmd160;
 1591|  92.5k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|  92.5k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1591:2): [True: 92.5k, False: 0]
  ------------------
 1592|  92.5k|		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: 92.5k]
  ------------------
 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: 92.5k]
  ------------------
 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: 92.5k]
  ------------------
 1598|      0|		return entry->digest.sha512;
 1599|      0|	default:
  ------------------
  |  Branch (1599:2): [True: 0, False: 92.5k]
  ------------------
 1600|       |		return NULL;
 1601|  92.5k|	}
 1602|  92.5k|}
archive_entry_acl:
 1655|    219|{
 1656|    219|	return &entry->acl;
 1657|    219|}
archive_entry.c:ae_strtofflags:
 2149|  7.32k|{
 2150|  7.32k|	const char *start, *end;
 2151|  7.32k|	const struct flag *flag;
 2152|  7.32k|	unsigned long set, clear;
 2153|  7.32k|	const char *failed;
 2154|       |
 2155|  7.32k|	set = clear = 0;
 2156|  7.32k|	start = s;
 2157|  7.32k|	failed = NULL;
 2158|       |	/* Find start of first token. */
 2159|  7.32k|	while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2159:9): [True: 7.32k, False: 0]
  |  Branch (2159:19): [True: 0, False: 7.32k]
  |  Branch (2159:39): [True: 0, False: 7.32k]
  |  Branch (2159:58): [True: 0, False: 7.32k]
  ------------------
 2160|      0|		start++;
 2161|      0|		l--;
 2162|      0|	}
 2163|  16.1k|	while (l > 0) {
  ------------------
  |  Branch (2163:9): [True: 8.78k, False: 7.32k]
  ------------------
 2164|  8.78k|		size_t length;
 2165|       |		/* Locate end of token. */
 2166|  8.78k|		end = start;
 2167|  61.4k|		while (l > 0 && *end != '\t'  &&
  ------------------
  |  Branch (2167:10): [True: 54.3k, False: 7.10k]
  |  Branch (2167:19): [True: 54.3k, False: 0]
  ------------------
 2168|  54.3k|		    *end != ' '  &&  *end != ',') {
  ------------------
  |  Branch (2168:7): [True: 54.3k, False: 0]
  |  Branch (2168:24): [True: 52.6k, False: 1.67k]
  ------------------
 2169|  52.6k|			end++;
 2170|  52.6k|			l--;
 2171|  52.6k|		}
 2172|  8.78k|		length = end - start;
 2173|   174k|		for (flag = fileflags; flag->name != NULL; flag++) {
  ------------------
  |  Branch (2173:26): [True: 166k, False: 8.55k]
  ------------------
 2174|   166k|			size_t flag_length = strlen(flag->name);
 2175|   166k|			if (length == flag_length
  ------------------
  |  Branch (2175:8): [True: 35.1k, False: 131k]
  ------------------
 2176|  35.1k|			    && memcmp(start, flag->name, length) == 0) {
  ------------------
  |  Branch (2176:11): [True: 0, False: 35.1k]
  ------------------
 2177|       |				/* Matched "noXXXX", so reverse the sense. */
 2178|      0|				clear |= flag->set;
 2179|      0|				set |= flag->clear;
 2180|      0|				break;
 2181|   166k|			} else if (length == flag_length - 2
  ------------------
  |  Branch (2181:15): [True: 26.3k, False: 140k]
  ------------------
 2182|  26.3k|			    && memcmp(start, flag->name + 2, length) == 0) {
  ------------------
  |  Branch (2182:11): [True: 228, False: 26.1k]
  ------------------
 2183|       |				/* Matched "XXXX", so don't reverse. */
 2184|    228|				set |= flag->set;
 2185|    228|				clear |= flag->clear;
 2186|    228|				break;
 2187|    228|			}
 2188|   166k|		}
 2189|       |		/* Ignore unknown flag names. */
 2190|  8.78k|		if (flag->name == NULL  &&  failed == NULL)
  ------------------
  |  Branch (2190:7): [True: 8.55k, False: 228]
  |  Branch (2190:31): [True: 7.09k, False: 1.45k]
  ------------------
 2191|  7.09k|			failed = start;
 2192|       |
 2193|       |		/* Find start of next token. */
 2194|  8.78k|		start = end;
 2195|  10.4k|		while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2195:10): [True: 3.12k, False: 7.32k]
  |  Branch (2195:20): [True: 0, False: 3.12k]
  |  Branch (2195:40): [True: 0, False: 3.12k]
  |  Branch (2195:59): [True: 1.67k, False: 1.45k]
  ------------------
 2196|  1.67k|			start++;
 2197|  1.67k|			l--;
 2198|  1.67k|		}
 2199|       |
 2200|  8.78k|	}
 2201|       |
 2202|  7.32k|	if (setp)
  ------------------
  |  Branch (2202:6): [True: 7.32k, False: 0]
  ------------------
 2203|  7.32k|		*setp = set;
 2204|  7.32k|	if (clrp)
  ------------------
  |  Branch (2204:6): [True: 7.32k, False: 0]
  ------------------
 2205|  7.32k|		*clrp = clear;
 2206|       |
 2207|       |	/* Return location of first failure. */
 2208|  7.32k|	return (failed);
 2209|  7.32k|}

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

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

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

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

archive_read.c:archive_ckd_mul_size:
  187|    304|{
  188|    304|#if USE_STDCKDINT
  189|    304|	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|    304|}
archive_read_support_filter_lz4.c:archive_ckd_add_size:
  119|    272|{
  120|    272|#if USE_STDCKDINT
  121|    272|	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|    272|}
archive_read_support_filter_zstd.c:archive_ckd_add_size:
  119|    272|{
  120|    272|#if USE_STDCKDINT
  121|    272|	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|    272|}
archive_read_support_format_ar.c:archive_ckd_mul_u64:
  205|  13.6k|{
  206|  13.6k|#if USE_STDCKDINT
  207|  13.6k|	return ckd_mul(result, a, b);
  208|       |#elif USE_BUILTIN
  209|       |	return __builtin_mul_overflow(a, b, result);
  210|       |#elif USE_INTSAFE
  211|       |	ULONGLONG res;
  212|       |	int ret;
  213|       |
  214|       |	ret = ULongLongMult(a, b, &res);
  215|       |	*result = (uint64_t)res;
  216|       |	return ret;
  217|       |#else
  218|       |	if (b != 0 && a > UINT64_MAX / b)
  219|       |		return 1;
  220|       |	*result = a * b;
  221|       |	return 0;
  222|       |#endif
  223|  13.6k|}
archive_read_support_format_ar.c:archive_ckd_add_u64:
  137|  13.6k|{
  138|  13.6k|#if USE_STDCKDINT
  139|  13.6k|	return ckd_add(result, a, b);
  140|       |#elif USE_BUILTIN
  141|       |	return __builtin_add_overflow(a, b, result);
  142|       |#elif USE_INTSAFE
  143|       |	ULONGLONG res;
  144|       |	int ret;
  145|       |
  146|       |	ret = ULongLongAdd(a, b, &res);
  147|       |	*result = (uint64_t)res;
  148|       |	return ret;
  149|       |#else
  150|       |	if (a > UINT64_MAX - b)
  151|       |		return 1;
  152|       |	*result = a + b;
  153|       |	return 0;
  154|       |#endif
  155|  13.6k|}
archive_read_support_format_mtree.c:archive_ckd_mul_i64:
  160|  2.05k|{
  161|  2.05k|#if USE_STDCKDINT
  162|  2.05k|	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|  2.05k|}
archive_read_support_format_mtree.c:archive_ckd_sub_i64:
  228|  1.78k|{
  229|  1.78k|#if USE_STDCKDINT
  230|  1.78k|	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|  1.78k|}
archive_read_support_format_mtree.c:archive_ckd_add_i64:
   94|    262|{
   95|    262|#if USE_STDCKDINT
   96|    262|	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|    262|}
archive_read_support_format_rar.c:archive_ckd_mul_size:
  187|  13.3k|{
  188|  13.3k|#if USE_STDCKDINT
  189|  13.3k|	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|  13.3k|}
archive_read_support_format_rar5.c:archive_ckd_mul_u64:
  205|   428k|{
  206|   428k|#if USE_STDCKDINT
  207|   428k|	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|   428k|}
archive_read_support_format_rar5.c:archive_ckd_add_u64:
  137|   424k|{
  138|   424k|#if USE_STDCKDINT
  139|   424k|	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|   424k|}
archive_read_support_format_raw.c:archive_ckd_add_i64:
   94|    350|{
   95|    350|#if USE_STDCKDINT
   96|    350|	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|    350|}
archive_read_support_format_tar.c:archive_ckd_mul_i64:
  160|   373k|{
  161|   373k|#if USE_STDCKDINT
  162|   373k|	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|   373k|}
archive_read_support_format_tar.c:archive_ckd_add_i64:
   94|   372k|{
   95|   372k|#if USE_STDCKDINT
   96|   372k|	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|   372k|}
archive_read_support_format_warc.c:archive_ckd_mul_i64:
  160|  26.7k|{
  161|  26.7k|#if USE_STDCKDINT
  162|  26.7k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  26.7k|}
archive_read_support_format_warc.c:archive_ckd_add_i64:
   94|  26.7k|{
   95|  26.7k|#if USE_STDCKDINT
   96|  26.7k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  26.7k|}
archive_read_support_format_xar.c:archive_ckd_mul_size:
  187|      8|{
  188|      8|#if USE_STDCKDINT
  189|      8|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|      8|}
archive_read_support_format_xar.c:archive_ckd_mul_u64:
  205|  93.1k|{
  206|  93.1k|#if USE_STDCKDINT
  207|  93.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|  93.1k|}
archive_read_support_format_xar.c:archive_ckd_add_u64:
  137|  93.1k|{
  138|  93.1k|#if USE_STDCKDINT
  139|  93.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|  93.1k|}
archive_read_support_format_7zip.c:archive_ckd_add_i64:
   94|  9.93k|{
   95|  9.93k|#if USE_STDCKDINT
   96|  9.93k|	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|  9.93k|}
archive_read_support_format_7zip.c:archive_ckd_add_size:
  119|  1.68k|{
  120|  1.68k|#if USE_STDCKDINT
  121|  1.68k|	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|  1.68k|}
archive_read_support_format_7zip.c:archive_ckd_mul_i64:
  160|  2.23k|{
  161|  2.23k|#if USE_STDCKDINT
  162|  2.23k|	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|  2.23k|}

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

__archive_pack_find:
  320|    278|{
  321|    278|	const struct format	*format;
  322|       |
  323|    278|	format = bsearch(name, formats,
  324|    278|	    sizeof(formats)/sizeof(formats[0]),
  325|    278|	    sizeof(formats[0]), compare_format);
  326|    278|	if (format == 0)
  ------------------
  |  Branch (326:6): [True: 18, False: 260]
  ------------------
  327|     18|		return (NULL);
  328|    260|	return (format->pack);
  329|    278|}
archive_pack_dev.c:pack_bsdos:
  257|     25|{
  258|     25|	dev_t dev = 0;
  259|       |
  260|     25|	if (n == 2) {
  ------------------
  |  Branch (260:6): [True: 12, False: 13]
  ------------------
  261|     12|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  184|     12|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  185|     12|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  262|     12|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  182|     12|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (262:7): [True: 12, False: 0]
  ------------------
  263|     12|			*error = iMajorError;
  264|     12|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  183|     12|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (264:7): [True: 12, False: 0]
  ------------------
  265|     12|			*error = iMinorError;
  266|     13|	} else if (n == 3) {
  ------------------
  |  Branch (266:13): [True: 13, False: 0]
  ------------------
  267|     13|		dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]);
  ------------------
  |  |  251|     13|#define	makedev_12_12_8(x,y,z)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  252|     13|					 (((y) <<  8) & 0x000fff00) | \
  |  |  253|     13|					 (((z) <<  0) & 0x000000ff)))
  ------------------
  268|     13|		if ((unsigned long)major_12_12_8(dev) != numbers[0])
  ------------------
  |  |  248|     13|#define	major_12_12_8(x)	((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (268:7): [True: 9, False: 4]
  ------------------
  269|      9|			*error = iMajorError;
  270|     13|		if ((unsigned long)unit_12_12_8(dev) != numbers[1])
  ------------------
  |  |  249|     13|#define	unit_12_12_8(x)		((int32_t)(((x) & 0x000fff00) >>  8))
  ------------------
  |  Branch (270:7): [True: 13, False: 0]
  ------------------
  271|     13|			*error = "invalid unit number";
  272|     13|		if ((unsigned long)subunit_12_12_8(dev) != numbers[2])
  ------------------
  |  |  250|     13|#define	subunit_12_12_8(x)	((int32_t)(((x) & 0x000000ff) >>  0))
  ------------------
  |  Branch (272:7): [True: 7, False: 6]
  ------------------
  273|      7|			*error = "invalid subunit number";
  274|     13|	} else
  275|      0|		*error = tooManyFields;
  276|     25|	return (dev);
  277|     25|}
archive_pack_dev.c:compare_format:
  307|    624|{
  308|    624|	const char		*name;
  309|    624|	const struct format	*format;
  310|       |
  311|    624|	name = key;
  312|    624|	format = element;
  313|       |
  314|    624|	return (strcmp(name, format->name));
  315|    624|}

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

archive_ppmd8.c:Ppmd8_Construct:
   65|  12.5k|{
   66|  12.5k|  unsigned i, k, m;
   67|       |
   68|  12.5k|  p->Base = 0;
   69|       |
   70|   490k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   490k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   490k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   490k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   490k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   490k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   490k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   490k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   490k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 478k, False: 12.5k]
  ------------------
   71|   478k|  {
   72|   478k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 327k, False: 151k]
  ------------------
   73|  1.61M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.13M, False: 478k]
  ------------------
   74|   478k|    p->Indx2Units[i] = (Byte)k;
   75|   478k|  }
   76|       |
   77|  12.5k|  p->NS2BSIndx[0] = (0 << 1);
   78|  12.5k|  p->NS2BSIndx[1] = (1 << 1);
   79|  12.5k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  12.5k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  75.5k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 62.9k, False: 12.5k]
  ------------------
   83|  62.9k|    p->NS2Indx[i] = (Byte)i;
   84|  3.22M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 3.20M, False: 12.5k]
  ------------------
   85|  3.20M|  {
   86|  3.20M|    p->NS2Indx[i] = (Byte)m;
   87|  3.20M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 276k, False: 2.93M]
  ------------------
   88|   276k|      k = (++m) - 4;
   89|  3.20M|  }
   90|  12.5k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  11.0k|{
  101|  11.0k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 11.0k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  11.0k|  {
  103|  11.0k|    Ppmd8_Free(p);
  104|  11.0k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  11.0k|        4 - (size & 3);
  109|  11.0k|      #endif
  110|  11.0k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 11.0k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  11.0k|    p->Size = size;
  113|  11.0k|  }
  114|  11.0k|  return True;
  ------------------
  |  |   55|  11.0k|#define True 1
  ------------------
  115|  11.0k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  22.1k|{
   94|  22.1k|  free(p->Base);
   95|  22.1k|  p->Size = 0;
   96|  22.1k|  p->Base = 0;
   97|  22.1k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  11.0k|{
  412|  11.0k|  p->MaxOrder = maxOrder;
  413|  11.0k|  p->RestoreMethod = restoreMethod;
  414|  11.0k|  RestartModel(p);
  415|  11.0k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  11.0k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  11.0k|  p->DummySee.Summ = 0; /* unused */
  417|  11.0k|  p->DummySee.Count = 64; /* unused */
  418|  11.0k|}
archive_ppmd8.c:RestartModel:
  354|  11.1k|{
  355|  11.1k|  unsigned i, k, m, r;
  356|       |
  357|  11.1k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  11.1k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  11.1k|  RESET_TEXT(0);
  ------------------
  |  |  349|  11.1k|#define RESET_TEXT(offs) do {						\
  |  |  350|  11.1k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  11.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 11.1k]
  |  |  ------------------
  ------------------
  360|  11.1k|  p->HiUnit = p->Text + p->Size;
  361|  11.1k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.1k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.1k|#define UNIT_SIZE 12
  ------------------
  362|  11.1k|  p->GlueCount = 0;
  363|       |
  364|  11.1k|  p->OrderFall = p->MaxOrder;
  365|  11.1k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 7.01k, False: 4.15k]
  ------------------
  366|  11.1k|  p->PrevSuccess = 0;
  367|       |
  368|  11.1k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  11.1k|#define UNIT_SIZE 12
  ------------------
  369|  11.1k|  p->MinContext->Suffix = 0;
  370|  11.1k|  p->MinContext->NumStats = 255;
  371|  11.1k|  p->MinContext->Flags = 0;
  372|  11.1k|  p->MinContext->SummFreq = 256 + 1;
  373|  11.1k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  11.1k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  11.1k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  11.1k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  11.1k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  11.1k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  2.87M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 2.85M, False: 11.1k]
  ------------------
  377|  2.85M|  {
  378|  2.85M|    CPpmd_State *s = &p->FoundState[i];
  379|  2.85M|    s->Symbol = (Byte)i;
  380|  2.85M|    s->Freq = 1;
  381|  2.85M|    SetSuccessor(s, 0);
  382|  2.85M|  }
  383|       |
  384|   290k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 279k, False: 11.1k]
  ------------------
  385|   279k|  {
  386|  2.68M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 2.40M, False: 279k]
  ------------------
  387|  2.40M|      i++;
  388|  2.51M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 2.23M, False: 279k]
  ------------------
  389|  2.23M|    {
  390|  2.23M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.23M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.23M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.23M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  2.23M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  20.1M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 17.8M, False: 2.23M]
  ------------------
  393|  17.8M|        dest[r] = val;
  394|  2.23M|    }
  395|   279k|  }
  396|       |
  397|   279k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 268k, False: 11.1k]
  ------------------
  398|   268k|  {
  399|  3.11M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 2.84M, False: 268k]
  ------------------
  400|  2.84M|      i++;
  401|  8.84M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 8.57M, False: 268k]
  ------------------
  402|  8.57M|    {
  403|  8.57M|      CPpmd_See *s = &p->See[m][k];
  404|  8.57M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  8.57M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  8.57M|      s->Count = 7;
  406|  8.57M|    }
  407|   268k|  }
  408|  11.1k|}
archive_ppmd8.c:SetSuccessor:
  344|   391M|{
  345|   391M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  346|   391M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  347|   391M|}
archive_ppmd8.c:Ppmd8_RangeDec_Init:
 1131|  11.0k|{
 1132|  11.0k|  unsigned i;
 1133|  11.0k|  p->Low = 0;
 1134|  11.0k|  p->Range = 0xFFFFFFFF;
 1135|  11.0k|  p->Code = 0;
 1136|  55.4k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 44.3k, False: 11.0k]
  ------------------
 1137|  44.3k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  11.0k|  return (p->Code < 0xFFFFFFFF);
 1139|  11.0k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|   127M|{
 1166|   127M|  size_t charMask[256 / sizeof(size_t)];
 1167|   127M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 18.2M, False: 109M]
  ------------------
 1168|  18.2M|  {
 1169|  18.2M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  18.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  18.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1170|  18.2M|    unsigned i;
 1171|  18.2M|    UInt32 count, hiCnt;
 1172|  18.2M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1172:9): [True: 6.85M, False: 11.3M]
  ------------------
 1173|  6.85M|    {
 1174|  6.85M|      Byte symbol;
 1175|  6.85M|      RangeDec_Decode(p, 0, s->Freq);
 1176|  6.85M|      p->FoundState = s;
 1177|  6.85M|      symbol = s->Symbol;
 1178|  6.85M|      Ppmd8_Update1_0(p);
 1179|  6.85M|      return symbol;
 1180|  6.85M|    }
 1181|  11.3M|    p->PrevSuccess = 0;
 1182|  11.3M|    i = p->MinContext->NumStats;
 1183|  11.3M|    do
 1184|  79.3M|    {
 1185|  79.3M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 6.58M, False: 72.7M]
  ------------------
 1186|  6.58M|      {
 1187|  6.58M|        Byte symbol;
 1188|  6.58M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  6.58M|        p->FoundState = s;
 1190|  6.58M|        symbol = s->Symbol;
 1191|  6.58M|        Ppmd8_Update1(p);
 1192|  6.58M|        return symbol;
 1193|  6.58M|      }
 1194|  79.3M|    }
 1195|  72.7M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 68.0M, False: 4.77M]
  ------------------
 1196|  4.77M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 4.66k, False: 4.77M]
  ------------------
 1197|  4.66k|      return -2;
 1198|  4.77M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1199|  4.77M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  4.77M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  4.77M|	unsigned j;							\
  |  |  153|  23.8M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 19.0M, False: 4.77M]
  |  |  ------------------
  |  |  154|  19.0M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  19.0M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  19.0M|	}								\
  |  |  157|  4.77M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 4.77M]
  |  |  ------------------
  ------------------
 1200|  4.77M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1162|  4.77M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1201|  4.77M|    i = p->MinContext->NumStats;
 1202|  14.0M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  | 1162|  14.0M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1202:44): [True: 9.28M, False: 4.77M]
  ------------------
 1203|  4.77M|  }
 1204|   109M|  else
 1205|   109M|  {
 1206|   109M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|   109M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|   109M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|   109M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|   109M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   109M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|   109M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|   109M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 101M, False: 8.09M]
  ------------------
 1208|   101M|    {
 1209|   101M|      Byte symbol;
 1210|   101M|      RangeDec_Decode(p, 0, *prob);
 1211|   101M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|   101M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|   101M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|   101M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   101M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|   101M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|   101M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|   101M|      Ppmd8_UpdateBin(p);
 1214|   101M|      return symbol;
 1215|   101M|    }
 1216|  8.09M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1217|  8.09M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  8.09M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  8.09M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  8.09M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  8.09M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1219|  8.09M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  8.09M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  8.09M|	unsigned j;							\
  |  |  153|  40.4M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 32.3M, False: 8.09M]
  |  |  ------------------
  |  |  154|  32.3M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  32.3M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  32.3M|	}								\
  |  |  157|  8.09M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 8.09M]
  |  |  ------------------
  ------------------
 1220|  8.09M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1162|  8.09M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1221|  8.09M|    p->PrevSuccess = 0;
 1222|  8.09M|  }
 1223|  12.8M|  for (;;)
 1224|  18.1M|  {
 1225|  18.1M|    CPpmd_State *ps[256], *s;
 1226|  18.1M|    UInt32 freqSum, count, hiCnt;
 1227|  18.1M|    CPpmd_See *see;
 1228|  18.1M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1229|  18.1M|    do
 1230|  51.5M|    {
 1231|  51.5M|      p->OrderFall++;
 1232|  51.5M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1232:11): [True: 1.00k, False: 51.5M]
  ------------------
 1233|  1.00k|        return -1;
 1234|  51.5M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   97|  51.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   96|  51.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1235|  51.5M|    }
 1236|  51.5M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1236:12): [True: 33.3M, False: 18.1M]
  ------------------
 1237|  18.1M|    hiCnt = 0;
 1238|  18.1M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  18.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  18.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1239|  18.1M|    i = 0;
 1240|  18.1M|    num = p->MinContext->NumStats - numMasked;
 1241|  18.1M|    do
 1242|   735M|    {
 1243|   735M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1162|   735M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1244|   735M|      hiCnt += (s->Freq & k);
 1245|   735M|      ps[i] = s++;
 1246|   735M|      i -= k;
 1247|   735M|    }
 1248|   735M|    while (i != num);
  ------------------
  |  Branch (1248:12): [True: 717M, False: 18.1M]
  ------------------
 1249|       |    
 1250|  18.1M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1251|  18.1M|    freqSum += hiCnt;
 1252|  18.1M|    count = RangeDec_GetThreshold(p, freqSum);
 1253|       |    
 1254|  18.1M|    if (count < hiCnt)
  ------------------
  |  Branch (1254:9): [True: 12.8M, False: 5.32M]
  ------------------
 1255|  12.8M|    {
 1256|  12.8M|      Byte symbol;
 1257|  12.8M|      CPpmd_State **pps = ps;
 1258|   198M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1258:23): [True: 185M, False: 12.8M]
  ------------------
 1259|  12.8M|      s = *pps;
 1260|  12.8M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1261|  12.8M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  12.8M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  12.8M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  25.7M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 8.00M, False: 4.85M]
  |  |  |  Branch (113:39): [True: 247k, False: 7.75M]
  |  |  ------------------
  |  |  114|   247k|		(p)->Summ <<= 1;					\
  |  |  115|   247k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|   247k|    	}								\
  |  |  117|  12.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 12.8M]
  |  |  ------------------
  ------------------
 1262|  12.8M|      p->FoundState = s;
 1263|  12.8M|      symbol = s->Symbol;
 1264|  12.8M|      Ppmd8_Update2(p);
 1265|  12.8M|      return symbol;
 1266|  12.8M|    }
 1267|  5.32M|    if (count >= freqSum)
  ------------------
  |  Branch (1267:9): [True: 5.15k, False: 5.31M]
  ------------------
 1268|  5.15k|      return -2;
 1269|  5.31M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1270|  5.31M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1271|  16.1M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1162|  16.1M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1271:46): [True: 10.8M, False: 5.31M]
  ------------------
 1272|  5.31M|  }
 1273|  12.8M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1142|  36.3M|{
 1143|  36.3M|  return p->Code / (p->Range /= total);
 1144|  36.3M|}
archive_ppmd8.c:RangeDec_Decode:
 1147|   145M|{
 1148|   145M|  start *= p->Range;
 1149|   145M|  p->Low += start;
 1150|   145M|  p->Code -= start;
 1151|   145M|  p->Range *= size;
 1152|       |
 1153|   158M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   317M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 13.3M, False: 145M]
  ------------------
 1154|   145M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   291M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  12.2k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 12.2k, False: 145M]
  |  Branch (1154:27): [True: 12.2k, False: 0]
  ------------------
 1155|  13.3M|  {
 1156|  13.3M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1157|  13.3M|    p->Range <<= 8;
 1158|  13.3M|    p->Low <<= 8;
 1159|  13.3M|  }
 1160|   145M|}
archive_ppmd8.c:Ppmd8_Update1_0:
 1097|  6.85M|{
 1098|  6.85M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1099|  6.85M|  p->RunLength += p->PrevSuccess;
 1100|  6.85M|  p->MinContext->SummFreq += 4;
 1101|  6.85M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  6.85M|#define MAX_FREQ 124
  ------------------
  |  Branch (1101:7): [True: 42.3k, False: 6.81M]
  ------------------
 1102|  42.3k|    Rescale(p);
 1103|  6.85M|  NextContext(p);
 1104|  6.85M|}
archive_ppmd8.c:Rescale:
  975|  59.1k|{
  976|  59.1k|  unsigned i, adder, sumFreq, escFreq;
  977|  59.1k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|  59.1k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  59.1k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  59.1k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  59.1k|  CPpmd_State *s = p->FoundState;
  979|  59.1k|  {
  980|  59.1k|    CPpmd_State tmp = *s;
  981|   211k|    for (; s != stats; s--)
  ------------------
  |  Branch (981:12): [True: 152k, False: 59.1k]
  ------------------
  982|   152k|      s[0] = s[-1];
  983|  59.1k|    *s = tmp;
  984|  59.1k|  }
  985|  59.1k|  escFreq = p->MinContext->SummFreq - s->Freq;
  986|  59.1k|  s->Freq += 4;
  987|  59.1k|  adder = (p->OrderFall != 0
  988|       |      #ifdef PPMD8_FREEZE_SUPPORT
  989|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  990|       |      #endif
  991|  59.1k|      );
  992|  59.1k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  59.1k|  sumFreq = s->Freq;
  994|       |  
  995|  59.1k|  i = p->MinContext->NumStats;
  996|  59.1k|  do
  997|  2.80M|  {
  998|  2.80M|    escFreq -= (++s)->Freq;
  999|  2.80M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
 1000|  2.80M|    sumFreq += s->Freq;
 1001|  2.80M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1001:9): [True: 855k, False: 1.94M]
  ------------------
 1002|   855k|    {
 1003|   855k|      CPpmd_State *s1 = s;
 1004|   855k|      CPpmd_State tmp = *s1;
 1005|   855k|      do
 1006|  38.4M|        s1[0] = s1[-1];
 1007|  38.4M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1007:14): [True: 38.4M, False: 0]
  |  Branch (1007:31): [True: 37.6M, False: 855k]
  ------------------
 1008|   855k|      *s1 = tmp;
 1009|   855k|    }
 1010|  2.80M|  }
 1011|  2.80M|  while (--i);
  ------------------
  |  Branch (1011:10): [True: 2.74M, False: 59.1k]
  ------------------
 1012|       |  
 1013|  59.1k|  if (s->Freq == 0)
  ------------------
  |  Branch (1013:7): [True: 12.3k, False: 46.7k]
  ------------------
 1014|  12.3k|  {
 1015|  12.3k|    unsigned numStats = p->MinContext->NumStats;
 1016|  12.3k|    unsigned n0, n1;
 1017|  18.2k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1017:24): [True: 5.88k, False: 12.3k]
  ------------------
 1018|  12.3k|    escFreq += i;
 1019|  12.3k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1020|  12.3k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1020:9): [True: 3.91k, False: 8.44k]
  ------------------
 1021|  3.91k|    {
 1022|  3.91k|      CPpmd_State tmp = *stats;
 1023|  3.91k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  3.91k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  3.91k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 3.76k, False: 151]
  ------------------
 1025|  3.76k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  3.76k|#define MAX_FREQ 124
  ------------------
 1026|  3.91k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  3.91k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  3.91k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  3.91k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  3.91k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.91k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  3.91k|      return;
 1030|  3.91k|    }
 1031|  8.44k|    n0 = (numStats + 2) >> 1;
 1032|  8.44k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1033|  8.44k|    if (n0 != n1)
  ------------------
  |  Branch (1033:9): [True: 6.72k, False: 1.71k]
  ------------------
 1034|  6.72k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  6.72k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  6.72k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1035|  8.44k|    p->MinContext->Flags &= ~0x08;
 1036|  8.44k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  8.44k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  8.44k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  8.44k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1037|  8.44k|    i = p->MinContext->NumStats;
 1038|  50.2k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1038:73): [True: 41.8k, False: 8.44k]
  ------------------
 1039|  8.44k|  }
 1040|  55.1k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1041|  55.1k|  p->MinContext->Flags |= 0x4;
 1042|  55.1k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|  55.1k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  55.1k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  55.1k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  55.1k|}
archive_ppmd8.c:InsertNode:
  118|   102M|{
  119|   102M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|   102M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|   102M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|   102M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|   102M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|   102M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|   102M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|   102M|  p->Stamps[indx]++;
  124|   102M|}
archive_ppmd8.c:ShrinkUnits:
  255|  4.04M|{
  256|  4.04M|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  4.04M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  257|  4.04M|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  4.04M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  258|  4.04M|  if (i0 == i1)
  ------------------
  |  Branch (258:7): [True: 662k, False: 3.38M]
  ------------------
  259|   662k|    return oldPtr;
  260|  3.38M|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (260:7): [True: 3.37M, False: 5.67k]
  ------------------
  261|  3.37M|  {
  262|  3.37M|    void *ptr = RemoveNode(p, i1);
  263|  3.37M|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  245|  3.37M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  3.37M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  3.37M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  3.37M|	UInt32 n = num;							\
  |  |  249|  5.11M|	do {								\
  |  |  250|  5.11M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  5.11M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 1.73M, False: 3.37M]
  |  |  ------------------
  |  |  252|  3.37M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 3.37M]
  |  |  ------------------
  ------------------
  264|  3.37M|    InsertNode(p, oldPtr, i0);
  265|  3.37M|    return ptr;
  266|  3.37M|  }
  267|  5.67k|  SplitBlock(p, oldPtr, i0, i1);
  268|  5.67k|  return oldPtr;
  269|  3.38M|}
archive_ppmd8.c:RemoveNode:
  127|  51.9M|{
  128|  51.9M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  51.9M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  51.9M|  p->FreeList[indx] = node->Next;
  130|  51.9M|  p->Stamps[indx]--;
  131|  51.9M|  return node;
  132|  51.9M|}
archive_ppmd8.c:SplitBlock:
  135|  5.89M|{
  136|  5.89M|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  5.89M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  5.89M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|  5.89M|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|  5.89M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  5.89M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|  5.89M|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  5.89M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 412k, False: 5.48M]
  ------------------
  139|   412k|  {
  140|   412k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|   412k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|   412k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|   412k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   412k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|   412k|  }
  143|  5.89M|  InsertNode(p, ptr, i);
  144|  5.89M|}
archive_ppmd8.c:NextContext:
 1070|   114M|{
 1071|   114M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|   114M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|   114M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   114M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|   114M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 71.2M, False: 43.3M]
  |  Branch (1072:28): [True: 61.4M, False: 9.81M]
  ------------------
 1073|  61.4M|    p->MinContext = p->MaxContext = c;
 1074|  53.1M|  else
 1075|  53.1M|  {
 1076|  53.1M|    UpdateModel(p);
 1077|  53.1M|    p->MinContext = p->MaxContext;
 1078|  53.1M|  }
 1079|   114M|}
archive_ppmd8.c:UpdateModel:
  806|  66.0M|{
  807|  66.0M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  66.0M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  66.0M|  CTX_PTR c;
  809|  66.0M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  66.0M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  66.0M|  CPpmd_State *s = NULL;
  812|       |  
  813|  66.0M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  66.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (813:7): [True: 61.7M, False: 4.26M]
  |  Branch (813:45): [True: 60.0M, False: 1.72M]
  ------------------
  814|  60.0M|  {
  815|  60.0M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  60.0M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  60.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  60.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  60.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|       |    
  817|  60.0M|    if (c->NumStats == 0)
  ------------------
  |  Branch (817:9): [True: 36.2M, False: 23.8M]
  ------------------
  818|  36.2M|    {
  819|  36.2M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  36.2M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  36.2M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  820|  36.2M|      if (s->Freq < 32)
  ------------------
  |  Branch (820:11): [True: 36.2M, False: 1.46k]
  ------------------
  821|  36.2M|        s->Freq++;
  822|  36.2M|    }
  823|  23.8M|    else
  824|  23.8M|    {
  825|  23.8M|      s = STATS(c);
  ------------------
  |  |   30|  23.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  23.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  23.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|  23.8M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (826:11): [True: 14.6M, False: 9.12M]
  ------------------
  827|  14.6M|      {
  828|   186M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (828:28): [True: 171M, False: 14.6M]
  ------------------
  829|  14.6M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (829:13): [True: 6.08M, False: 8.60M]
  ------------------
  830|  6.08M|        {
  831|  6.08M|          SwapStates(&s[0], &s[-1]);
  832|  6.08M|          s--;
  833|  6.08M|        }
  834|  14.6M|      }
  835|  23.8M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  23.8M|#define MAX_FREQ 124
  ------------------
  |  Branch (835:11): [True: 23.5M, False: 212k]
  ------------------
  836|  23.5M|      {
  837|  23.5M|        s->Freq += 2;
  838|  23.5M|        c->SummFreq += 2;
  839|  23.5M|      }
  840|  23.8M|    }
  841|  60.0M|  }
  842|       |  
  843|  66.0M|  c = p->MaxContext;
  844|  66.0M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (844:7): [True: 9.81M, False: 56.2M]
  |  Branch (844:28): [True: 9.64M, False: 173k]
  ------------------
  845|  9.64M|  {
  846|  9.64M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  9.64M|#define True 1
  ------------------
  847|  9.64M|    if (cs == 0)
  ------------------
  |  Branch (847:9): [True: 488, False: 9.64M]
  ------------------
  848|    488|    {
  849|    488|      SetSuccessor(p->FoundState, 0);
  850|    488|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    488|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  851|    488|    }
  852|  9.64M|    else
  853|  9.64M|    {
  854|  9.64M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  9.64M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  9.64M|      p->MaxContext = cs;
  856|  9.64M|    }
  857|  9.64M|    return;
  858|  9.64M|  }
  859|       |  
  860|  56.3M|  *p->Text++ = p->FoundState->Symbol;
  861|  56.3M|  successor = REF(p->Text);
  ------------------
  |  |   24|  56.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  862|  56.3M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (862:7): [True: 44, False: 56.3M]
  ------------------
  863|     44|  {
  864|     44|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  554|     44|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  865|     44|    return;
  866|     44|  }
  867|       |  
  868|  56.3M|  if (!fSuccessor)
  ------------------
  |  Branch (868:7): [True: 3.07M, False: 53.2M]
  ------------------
  869|  3.07M|  {
  870|  3.07M|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  871|  3.07M|    if (cs == NULL)
  ------------------
  |  Branch (871:9): [True: 24, False: 3.07M]
  ------------------
  872|     24|    {
  873|     24|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|     24|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  874|     24|      return;
  875|     24|    }
  876|  3.07M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  3.07M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  877|  3.07M|  }
  878|  53.2M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |   96|  53.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (878:12): [True: 18.7M, False: 34.5M]
  ------------------
  879|  18.7M|  {
  880|  18.7M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  18.7M|#define False 0
  ------------------
  881|  18.7M|    if (cs == NULL)
  ------------------
  |  Branch (881:9): [True: 260, False: 18.7M]
  ------------------
  882|    260|    {
  883|    260|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|    260|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  884|    260|      return;
  885|    260|    }
  886|  18.7M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  18.7M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  887|  18.7M|  }
  888|       |  
  889|  56.3M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (889:7): [True: 2.03M, False: 54.3M]
  ------------------
  890|  2.03M|  {
  891|  2.03M|    successor = fSuccessor;
  892|  2.03M|    p->Text -= (p->MaxContext != p->MinContext);
  893|  2.03M|  }
  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|  56.3M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  904|  56.3M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  905|       |  
  906|   107M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  51.4M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  51.4M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  51.4M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  51.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (906:10): [True: 51.4M, False: 56.3M]
  ------------------
  907|  51.4M|  {
  908|  51.4M|    unsigned ns1;
  909|  51.4M|    UInt32 cf, sf;
  910|  51.4M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (910:9): [True: 19.6M, False: 31.8M]
  ------------------
  911|  19.6M|    {
  912|  19.6M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (912:11): [True: 13.2M, False: 6.39M]
  ------------------
  913|  13.2M|      {
  914|       |        /* Expand for one UNIT */
  915|  13.2M|        unsigned oldNU = (ns1 + 1) >> 1;
  916|  13.2M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  13.2M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  917|  13.2M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  13.2M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (917:13): [True: 12.8M, False: 372k]
  ------------------
  918|  12.8M|        {
  919|  12.8M|          void *ptr = AllocUnits(p, i + 1);
  920|  12.8M|          void *oldPtr;
  921|  12.8M|          if (!ptr)
  ------------------
  |  Branch (921:15): [True: 458, False: 12.8M]
  ------------------
  922|    458|          {
  923|    458|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    458|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  924|    458|            return;
  925|    458|          }
  926|  12.8M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  12.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  12.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  12.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  12.8M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  245|  12.8M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  12.8M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  12.8M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  12.8M|	UInt32 n = num;							\
  |  |  249|  19.1M|	do {								\
  |  |  250|  19.1M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  19.1M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 6.31M, False: 12.8M]
  |  |  ------------------
  |  |  252|  12.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 12.8M]
  |  |  ------------------
  ------------------
  928|  12.8M|          InsertNode(p, oldPtr, i);
  929|  12.8M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  12.8M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  12.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  930|  12.8M|        }
  931|  13.2M|      }
  932|  19.6M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  933|  19.6M|    }
  934|  31.8M|    else
  935|  31.8M|    {
  936|  31.8M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  937|  31.8M|      if (!s2)
  ------------------
  |  Branch (937:11): [True: 747, False: 31.8M]
  ------------------
  938|    747|      {
  939|    747|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    747|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  940|    747|        return;
  941|    747|      }
  942|  31.8M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  31.8M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  31.8M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  943|  31.8M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  31.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  944|  31.8M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  31.8M|#define MAX_FREQ 124
  ------------------
  |  Branch (944:11): [True: 31.8M, False: 13.7k]
  ------------------
  945|  31.8M|        s2->Freq <<= 1;
  946|  13.7k|      else
  947|  13.7k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  13.7k|#define MAX_FREQ 124
  ------------------
  948|  31.8M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  949|  31.8M|    }
  950|  51.4M|    cf = 2 * fFreq * (c->SummFreq + 6);
  951|  51.4M|    sf = (UInt32)s0 + c->SummFreq;
  952|  51.4M|    if (cf < 6 * sf)
  ------------------
  |  Branch (952:9): [True: 25.8M, False: 25.6M]
  ------------------
  953|  25.8M|    {
  954|  25.8M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  955|  25.8M|      c->SummFreq += 4;
  956|  25.8M|    }
  957|  25.6M|    else
  958|  25.6M|    {
  959|  25.6M|      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
  960|  25.6M|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  961|  25.6M|    }
  962|  51.4M|    {
  963|  51.4M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  51.4M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  51.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  51.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  51.4M|      SetSuccessor(s2, successor);
  965|  51.4M|      s2->Symbol = fSymbol;
  966|  51.4M|      s2->Freq = (Byte)cf;
  967|  51.4M|      c->Flags |= flag;
  968|  51.4M|      c->NumStats = (Byte)(ns1 + 1);
  969|  51.4M|    }
  970|  51.4M|  }
  971|  56.3M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  56.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  56.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  56.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  56.3M|}
archive_ppmd8.c:SwapStates:
  444|  43.7M|{
  445|  43.7M|  CPpmd_State tmp = *t1;
  446|  43.7M|  *t1 = *t2;
  447|  43.7M|  *t2 = tmp;
  448|  43.7M|}
archive_ppmd8.c:CreateSuccessors:
  619|  28.4M|{
  620|  28.4M|  CPpmd_State upState;
  621|  28.4M|  Byte flags;
  622|  28.4M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  28.4M|#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|  28.4M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  625|  28.4M|  unsigned numPs = 0;
  626|       |  
  627|  28.4M|  if (!skip)
  ------------------
  |  Branch (627:7): [True: 18.7M, False: 9.64M]
  ------------------
  628|  18.7M|    ps[numPs++] = p->FoundState;
  629|       |  
  630|   136M|  while (c->Suffix)
  ------------------
  |  Branch (630:10): [True: 136M, False: 382k]
  ------------------
  631|   136M|  {
  632|   136M|    CPpmd_Void_Ref successor;
  633|   136M|    CPpmd_State *s;
  634|   136M|    c = SUFFIX(c);
  ------------------
  |  |   32|   136M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|   136M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|   136M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   136M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|   136M|    if (s1)
  ------------------
  |  Branch (635:9): [True: 28.1M, False: 107M]
  ------------------
  636|  28.1M|    {
  637|  28.1M|      s = s1;
  638|  28.1M|      s1 = NULL;
  639|  28.1M|    }
  640|   107M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (640:14): [True: 27.6M, False: 80.3M]
  ------------------
  641|  27.6M|    {
  642|   144M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  27.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  27.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  27.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (642:26): [True: 116M, False: 27.6M]
  ------------------
  643|  27.6M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  27.6M|#define MAX_FREQ 124
  ------------------
  |  Branch (643:11): [True: 27.5M, False: 47.7k]
  ------------------
  644|  27.5M|      {
  645|  27.5M|        s->Freq++;
  646|  27.5M|        c->SummFreq++;
  647|  27.5M|      }
  648|  27.6M|    }
  649|  80.3M|    else
  650|  80.3M|    {
  651|  80.3M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  80.3M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  80.3M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  652|  80.3M|      s->Freq = (Byte)(s->Freq + (!SUFFIX(c)->NumStats & (s->Freq < 24)));
  ------------------
  |  |   32|  80.3M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  80.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  80.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  80.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  653|  80.3M|    }
  654|   136M|    successor = SUCCESSOR(s);
  ------------------
  |  |  341|   136M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  655|   136M|    if (successor != upBranch)
  ------------------
  |  Branch (655:9): [True: 28.0M, False: 108M]
  ------------------
  656|  28.0M|    {
  657|  28.0M|      c = CTX(successor);
  ------------------
  |  |   29|  28.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  28.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  28.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|  28.0M|      if (numPs == 0)
  ------------------
  |  Branch (658:11): [True: 701k, False: 27.3M]
  ------------------
  659|   701k|        return c;
  660|  27.3M|      break;
  661|  28.0M|    }
  662|   108M|    ps[numPs++] = s;
  663|   108M|  }
  664|       |  
  665|  27.7M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |   96|  27.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  666|  27.7M|  SetSuccessor(&upState, upBranch + 1);
  667|  27.7M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  668|       |
  669|  27.7M|  if (c->NumStats == 0)
  ------------------
  |  Branch (669:7): [True: 14.6M, False: 13.0M]
  ------------------
  670|  14.6M|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   31|  14.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  14.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  671|  13.0M|  else
  672|  13.0M|  {
  673|  13.0M|    UInt32 cf, s0;
  674|  13.0M|    CPpmd_State *s;
  675|  63.2M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  13.0M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  13.0M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  13.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:24): [True: 50.2M, False: 13.0M]
  ------------------
  676|  13.0M|    cf = s->Freq - 1;
  677|  13.0M|    s0 = c->SummFreq - c->NumStats - cf;
  678|  13.0M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (678:32): [True: 8.30M, False: 4.77M]
  ------------------
  679|  13.0M|  }
  680|       |
  681|   154M|  while (numPs != 0)
  ------------------
  |  Branch (681:10): [True: 126M, False: 27.7M]
  ------------------
  682|   126M|  {
  683|       |    /* Create Child */
  684|   126M|    CTX_PTR c1; /* = AllocContext(p); */
  685|   126M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (685:9): [True: 90.7M, False: 36.1M]
  ------------------
  686|  90.7M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  90.7M|#define UNIT_SIZE 12
  ------------------
  687|  36.1M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (687:14): [True: 23.3M, False: 12.7M]
  ------------------
  688|  23.3M|      c1 = (CTX_PTR)RemoveNode(p, 0);
  689|  12.7M|    else
  690|  12.7M|    {
  691|  12.7M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  692|  12.7M|      if (!c1)
  ------------------
  |  Branch (692:11): [True: 772, False: 12.7M]
  ------------------
  693|    772|        return NULL;
  694|  12.7M|    }
  695|   126M|    c1->NumStats = 0;
  696|   126M|    c1->Flags = flags;
  697|   126M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|   126M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   126M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  698|   126M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|   126M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  699|   126M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|   126M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  700|   126M|    c = c1;
  701|   126M|  }
  702|       |
  703|  27.7M|  return c;
  704|  27.7M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  16.5M|{
  206|  16.5M|  unsigned i;
  207|  16.5M|  void *retVal;
  208|  16.5M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 2.88k, False: 16.5M]
  ------------------
  209|  2.88k|  {
  210|  2.88k|    GlueFreeBlocks(p);
  211|  2.88k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 1.38k, False: 1.50k]
  ------------------
  212|  1.38k|      return RemoveNode(p, indx);
  213|  2.88k|  }
  214|  16.5M|  i = indx;
  215|  16.5M|  do
  216|   413M|  {
  217|   413M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   413M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   413M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   413M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   413M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   413M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   413M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   413M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   413M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 10.6M, False: 402M]
  ------------------
  218|  10.6M|    {
  219|  10.6M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  10.6M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  10.6M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  10.6M|      p->GlueCount--;
  221|  10.6M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 10.6M, False: 1.97k]
  ------------------
  222|  10.6M|    }
  223|   413M|  }
  224|   402M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 396M, False: 5.89M]
  ------------------
  225|  5.89M|  retVal = RemoveNode(p, i);
  226|  5.89M|  SplitBlock(p, retVal, i, indx);
  227|  5.89M|  return retVal;
  228|  16.5M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|  2.88k|{
  148|  2.88k|  CPpmd8_Node_Ref head = 0;
  149|  2.88k|  CPpmd8_Node_Ref *prev = &head;
  150|  2.88k|  unsigned i;
  151|       |
  152|  2.88k|  p->GlueCount = 1 << 13;
  153|  2.88k|  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.88k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 151, False: 2.73k]
  ------------------
  158|    151|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|   112k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   112k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   112k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   112k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   112k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   112k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   112k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   112k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   112k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 109k, False: 2.88k]
  ------------------
  162|   109k|  {
  163|   109k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|   109k|    p->FreeList[i] = 0;
  165|  25.4M|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 25.3M, False: 109k]
  ------------------
  166|  25.3M|    {
  167|  25.3M|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  25.3M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  25.3M|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 15.9M, False: 9.35M]
  ------------------
  169|  15.9M|      {
  170|  15.9M|        CPpmd8_Node *node2;
  171|  15.9M|        *prev = next;
  172|  15.9M|        prev = &(node->Next);
  173|  29.8M|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  29.8M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 13.9M, False: 15.9M]
  ------------------
  174|  13.9M|        {
  175|  13.9M|          node->NU += node2->NU;
  176|  13.9M|          node2->NU = 0;
  177|  13.9M|        }
  178|  15.9M|      }
  179|  25.3M|      next = node->Next;
  180|  25.3M|    }
  181|   109k|  }
  182|  2.88k|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  15.9M|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 15.9M, False: 2.88k]
  ------------------
  186|  15.9M|  {
  187|  15.9M|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  15.9M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  15.9M|    unsigned nu;
  189|  15.9M|    head = node->Next;
  190|  15.9M|    nu = node->NU;
  191|  15.9M|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 4.58M, False: 11.3M]
  ------------------
  192|  4.58M|      continue;
  193|  11.3M|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 260, False: 11.3M]
  ------------------
  194|    260|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|    260|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|    260|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|    260|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|    260|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|    260|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    260|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    260|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    260|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  11.3M|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  11.3M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 617k, False: 10.7M]
  ------------------
  196|   617k|    {
  197|   617k|      unsigned k = I2U(--i);
  ------------------
  |  |   19|   617k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|   617k|      InsertNode(p, node + k, nu - k - 1);
  199|   617k|    }
  200|  11.3M|    InsertNode(p, node, i);
  201|  11.3M|  }
  202|  2.88k|}
archive_ppmd8.c:RestoreModel:
  562|  2.02k|{
  563|  2.02k|  CTX_PTR c;
  564|  2.02k|  CPpmd_State *s;
  565|  2.02k|  RESET_TEXT(0);
  ------------------
  |  |  349|  2.02k|#define RESET_TEXT(offs) do {						\
  |  |  350|  2.02k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  2.02k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 2.02k]
  |  |  ------------------
  ------------------
  566|  7.18k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|  5.16k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  5.16k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  5.16k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.16k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:27): [True: 5.16k, False: 2.02k]
  ------------------
  567|  5.16k|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (567:9): [True: 3.47k, False: 1.68k]
  ------------------
  568|  3.47k|    {
  569|  3.47k|      s = STATS(c);
  ------------------
  |  |   30|  3.47k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  3.47k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  3.47k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  3.47k|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  571|  3.47k|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|  3.47k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.47k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  572|  3.47k|      SpecialFreeUnit(p, s);
  573|  3.47k|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  3.47k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.47k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  3.47k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.47k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|  3.47k|    }
  575|  1.68k|    else
  576|  1.68k|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  577|       | 
  578|  9.82k|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  7.80k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  7.80k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  7.80k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  7.80k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:10): [True: 7.80k, False: 2.02k]
  ------------------
  579|  7.80k|    if (!c->NumStats)
  ------------------
  |  Branch (579:9): [True: 5.02k, False: 2.78k]
  ------------------
  580|  5.02k|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  5.02k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  5.02k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  5.02k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  5.02k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  5.02k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  5.02k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  581|  2.78k|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (581:14): [True: 81, False: 2.70k]
  ------------------
  582|     81|      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|  2.02k|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (601:7): [True: 73, False: 1.94k]
  |  Branch (601:59): [True: 0, False: 1.94k]
  ------------------
  602|     73|    RestartModel(p);
  603|  1.94k|  else
  604|  1.94k|  {
  605|  27.1k|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (605:12): [True: 25.1k, False: 1.94k]
  ------------------
  606|  25.1k|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|  25.1k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  25.1k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  25.1k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  25.1k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.94k|    do
  608|  1.94k|    {
  609|  1.94k|      CutOff(p, p->MaxContext, 0);
  610|  1.94k|      ExpandTextArea(p);
  611|  1.94k|    }
  612|  1.94k|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (612:12): [True: 0, False: 1.94k]
  ------------------
  613|  1.94k|    p->GlueCount = 0;
  614|  1.94k|    p->OrderFall = p->MaxOrder;
  615|  1.94k|  }
  616|  2.02k|}
archive_ppmd8.c:SpecialFreeUnit:
  277|  50.2M|{
  278|  50.2M|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (278:7): [True: 50.2M, False: 2.49k]
  ------------------
  279|  50.2M|    InsertNode(p, ptr, 0);
  280|  2.49k|  else
  281|  2.49k|  {
  282|       |    #ifdef PPMD8_FREEZE_SUPPORT
  283|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  284|       |    #endif
  285|  2.49k|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|  2.49k|#define UNIT_SIZE 12
  ------------------
  286|  2.49k|  }
  287|  50.2M|}
archive_ppmd8.c:Refresh:
  421|  4.03M|{
  422|  4.03M|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  423|  4.03M|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|  4.03M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  4.03M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  4.03M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  4.03M|  ctx->Stats = REF(s);
  ------------------
  |  |   24|  4.03M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  425|       |  #ifdef PPMD8_FREEZE_SUPPORT
  426|       |  /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */
  427|       |  scale |= (ctx->SummFreq >= ((UInt32)1 << 15));
  428|       |  #endif
  429|  4.03M|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  430|  4.03M|  escFreq = ctx->SummFreq - s->Freq;
  431|  4.03M|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  432|  4.03M|  do
  433|  8.73M|  {
  434|  8.73M|    escFreq -= (++s)->Freq;
  435|  8.73M|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  436|  8.73M|    flags |= 0x08 * (s->Symbol >= 0x40);
  437|  8.73M|  }
  438|  8.73M|  while (--i);
  ------------------
  |  Branch (438:10): [True: 4.69M, False: 4.03M]
  ------------------
  439|  4.03M|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  440|  4.03M|  ctx->Flags = (Byte)flags;
  441|  4.03M|}
archive_ppmd8.c:GetUsedMemory:
  543|  3.89k|{
  544|  3.89k|  UInt32 v = 0;
  545|  3.89k|  unsigned i;
  546|   151k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   151k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   151k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   151k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   151k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   151k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   151k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   151k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   151k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (546:15): [True: 148k, False: 3.89k]
  ------------------
  547|   148k|    v += p->Stamps[i] * I2U(i);
  ------------------
  |  |   19|   148k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  548|  3.89k|  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
  ------------------
  |  |   17|  3.89k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  3.89k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  549|  3.89k|}
archive_ppmd8.c:CutOff:
  451|   127M|{
  452|   127M|  int i;
  453|   127M|  unsigned tmp;
  454|   127M|  CPpmd_State *s;
  455|       |  
  456|   127M|  if (!ctx->NumStats)
  ------------------
  |  Branch (456:7): [True: 99.7M, False: 27.5M]
  ------------------
  457|  99.7M|  {
  458|  99.7M|    s = ONE_STATE(ctx);
  ------------------
  |  |   31|  99.7M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  99.7M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  459|  99.7M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
  ------------------
  |  |   96|  99.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (459:9): [True: 95.4M, False: 4.27M]
  ------------------
  460|  95.4M|    {
  461|  95.4M|      if (order < p->MaxOrder)
  ------------------
  |  Branch (461:11): [True: 88.6M, False: 6.87M]
  ------------------
  462|  88.6M|        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  88.6M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  88.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  88.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  6.87M|      else
  464|  6.87M|        SetSuccessor(s, 0);
  465|  95.4M|      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
  ------------------
  |  |  341|   190M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 46.0M, False: 49.4M]
  |  |  ------------------
  ------------------
  |  Branch (465:27): [True: 10.0M, False: 39.4M]
  ------------------
  466|  56.0M|        return REF(ctx);
  ------------------
  |  |   24|  56.0M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  467|  95.4M|    }
  468|  43.7M|    SpecialFreeUnit(p, ctx);
  469|  43.7M|    return 0;
  470|  99.7M|  }
  471|       |
  472|  27.5M|  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
  ------------------
  |  |   27|  27.5M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  27.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  473|       |
  474|   100M|  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  27.5M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  27.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  27.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|   100M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|   100M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   100M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:46): [True: 72.7M, False: 27.5M]
  ------------------
  475|  72.7M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
  ------------------
  |  |   96|  72.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (475:9): [True: 33.3M, False: 39.4M]
  ------------------
  476|  33.3M|    {
  477|  33.3M|      CPpmd_State *s2 = STATS(ctx) + (i--);
  ------------------
  |  |   30|  33.3M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  33.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  33.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  33.3M|      SetSuccessor(s, 0);
  479|  33.3M|      SwapStates(s, s2);
  480|  33.3M|    }
  481|  39.4M|    else if (order < p->MaxOrder)
  ------------------
  |  Branch (481:14): [True: 38.6M, False: 711k]
  ------------------
  482|  38.6M|      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  38.6M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  38.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  38.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   711k|    else
  484|   711k|      SetSuccessor(s, 0);
  485|       |    
  486|  27.5M|  if (i != ctx->NumStats && order)
  ------------------
  |  Branch (486:7): [True: 21.2M, False: 6.30M]
  |  Branch (486:29): [True: 21.2M, False: 1.94k]
  ------------------
  487|  21.2M|  {
  488|  21.2M|    ctx->NumStats = (Byte)i;
  489|  21.2M|    s = STATS(ctx);
  ------------------
  |  |   30|  21.2M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  21.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  21.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  21.2M|    if (i < 0)
  ------------------
  |  Branch (490:9): [True: 6.50M, False: 14.7M]
  ------------------
  491|  6.50M|    {
  492|  6.50M|      FreeUnits(p, s, tmp);
  493|  6.50M|      SpecialFreeUnit(p, ctx);
  494|  6.50M|      return 0;
  495|  6.50M|    }
  496|  14.7M|    if (i == 0)
  ------------------
  |  Branch (496:9): [True: 10.6M, False: 4.03M]
  ------------------
  497|  10.6M|    {
  498|  10.6M|      ctx->Flags = (Byte)((ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  499|  10.6M|      *ONE_STATE(ctx) = *s;
  ------------------
  |  |   31|  10.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  10.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  500|  10.6M|      FreeUnits(p, s, tmp);
  501|       |      /* 9.31: the code was fixed. It's was not BUG, if Freq <= MAX_FREQ = 124 */
  502|  10.6M|      ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  10.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  10.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  10.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  10.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  503|  10.6M|    }
  504|  4.03M|    else
  505|  4.03M|      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
  506|  14.7M|  }
  507|  21.0M|  return REF(ctx);
  ------------------
  |  |   24|  21.0M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  508|  27.5M|}
archive_ppmd8.c:MoveUnitsUp:
  290|  27.5M|{
  291|  27.5M|  unsigned indx = U2I(nu);
  ------------------
  |  |   18|  27.5M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  292|  27.5M|  void *ptr;
  293|  27.5M|  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
  ------------------
  |  |   24|   472k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  |  Branch (293:7): [True: 27.0M, False: 472k]
  |  Branch (293:53): [True: 4.74k, False: 467k]
  ------------------
  294|  27.0M|    return oldPtr;
  295|   467k|  ptr = RemoveNode(p, indx);
  296|   467k|  MyMem12Cpy(ptr, oldPtr, nu);
  ------------------
  |  |  245|   467k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|   467k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|   467k|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|   467k|	UInt32 n = num;							\
  |  |  249|   654k|	do {								\
  |  |  250|   654k|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|   654k|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 187k, False: 467k]
  |  |  ------------------
  |  |  252|   467k|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 467k]
  |  |  ------------------
  ------------------
  297|   467k|  if ((Byte*)oldPtr != p->UnitsStart)
  ------------------
  |  Branch (297:7): [True: 467k, False: 256]
  ------------------
  298|   467k|    InsertNode(p, oldPtr, indx);
  299|    256|  else
  300|    256|    p->UnitsStart += U2B(I2U(indx));
  ------------------
  |  |   17|    256|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|    256|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  301|   467k|  return ptr;
  302|  27.5M|}
archive_ppmd8.c:FreeUnits:
  272|  17.1M|{
  273|  17.1M|  InsertNode(p, ptr, U2I(nu));
  ------------------
  |  |   18|  17.1M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  274|  17.1M|}
archive_ppmd8.c:ExpandTextArea:
  305|  1.94k|{
  306|  1.94k|  UInt32 count[PPMD_NUM_INDEXES];
  307|  1.94k|  unsigned i;
  308|  1.94k|  memset(count, 0, sizeof(count));
  309|  1.94k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (309:7): [True: 0, False: 1.94k]
  ------------------
  310|      0|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  311|       |  
  312|  1.94k|  {
  313|  1.94k|    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
  314|  50.9k|    for (; node->Stamp == EMPTY_NODE; node += node->NU)
  ------------------
  |  |   62|  50.9k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (314:12): [True: 48.9k, False: 1.94k]
  ------------------
  315|  48.9k|    {
  316|  48.9k|      node->Stamp = 0;
  317|  48.9k|      count[U2I(node->NU)]++;
  ------------------
  |  |   18|  48.9k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  318|  48.9k|    }
  319|  1.94k|    p->UnitsStart = (Byte *)node;
  320|  1.94k|  }
  321|       |  
  322|  75.9k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  75.9k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  75.9k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  75.9k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  75.9k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  75.9k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  75.9k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  75.9k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  75.9k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:15): [True: 74.0k, False: 1.94k]
  ------------------
  323|  74.0k|  {
  324|  74.0k|    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
  325|  53.3M|    while (count[i] != 0)
  ------------------
  |  Branch (325:12): [True: 53.2M, False: 74.0k]
  ------------------
  326|  53.2M|    {
  327|  53.2M|      CPpmd8_Node *node = NODE(*next);
  ------------------
  |  |   59|  53.2M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  328|  53.3M|      while (node->Stamp == 0)
  ------------------
  |  Branch (328:14): [True: 48.9k, False: 53.2M]
  ------------------
  329|  48.9k|      {
  330|  48.9k|        *next = node->Next;
  331|  48.9k|        node = NODE(*next);
  ------------------
  |  |   59|  48.9k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  332|  48.9k|        p->Stamps[i]--;
  333|  48.9k|        if (--count[i] == 0)
  ------------------
  |  Branch (333:13): [True: 2.71k, False: 46.2k]
  ------------------
  334|  2.71k|          break;
  335|  48.9k|      }
  336|  53.2M|      next = &node->Next;
  337|  53.2M|    }
  338|  74.0k|  }
  339|  1.94k|}
archive_ppmd8.c:ReduceOrder:
  707|  3.07M|{
  708|  3.07M|  CPpmd_State *s = NULL;
  709|  3.07M|  CTX_PTR c1 = c;
  710|  3.07M|  CPpmd_Void_Ref upBranch = REF(p->Text);
  ------------------
  |  |   24|  3.07M|  #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|  3.07M|  SetSuccessor(p->FoundState, upBranch);
  720|  3.07M|  p->OrderFall++;
  721|       |
  722|  3.07M|  for (;;)
  723|  4.83M|  {
  724|  4.83M|    if (s1)
  ------------------
  |  Branch (724:9): [True: 2.57M, False: 2.25M]
  ------------------
  725|  2.57M|    {
  726|  2.57M|      c = SUFFIX(c);
  ------------------
  |  |   32|  2.57M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  2.57M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  2.57M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.57M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  727|  2.57M|      s = s1;
  728|  2.57M|      s1 = NULL;
  729|  2.57M|    }
  730|  2.25M|    else
  731|  2.25M|    {
  732|  2.25M|      if (!c->Suffix)
  ------------------
  |  Branch (732:11): [True: 492k, False: 1.76M]
  ------------------
  733|   492k|      {
  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|   492k|        return c;
  743|   492k|      }
  744|  1.76M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.76M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.76M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.76M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.76M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  1.76M|      if (c->NumStats)
  ------------------
  |  Branch (745:11): [True: 841k, False: 918k]
  ------------------
  746|   841k|      {
  747|   841k|        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
  ------------------
  |  |   30|   841k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|   841k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   841k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (747:13): [True: 507k, False: 333k]
  ------------------
  748|  1.42M|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (748:30): [True: 917k, False: 507k]
  ------------------
  749|   841k|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|   841k|#define MAX_FREQ 124
  ------------------
  |  Branch (749:13): [True: 840k, False: 1.35k]
  ------------------
  750|   840k|        {
  751|   840k|          s->Freq += 2;
  752|   840k|          c->SummFreq += 2;
  753|   840k|        }
  754|   841k|      }
  755|   918k|      else
  756|   918k|      {
  757|   918k|        s = ONE_STATE(c);
  ------------------
  |  |   31|   918k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   918k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  758|   918k|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  759|   918k|      }
  760|  1.76M|    }
  761|  4.33M|    if (SUCCESSOR(s))
  ------------------
  |  |  341|  4.33M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 2.58M, False: 1.75M]
  |  |  ------------------
  ------------------
  762|  2.58M|      break;
  763|       |    #ifdef PPMD8_FREEZE_SUPPORT
  764|       |    ps[numPs++] = s;
  765|       |    #endif
  766|  1.75M|    SetSuccessor(s, upBranch);
  767|  1.75M|    p->OrderFall++;
  768|  1.75M|  }
  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|  2.58M|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  341|  2.58M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (781:7): [True: 38.1k, False: 2.54M]
  ------------------
  782|  38.1k|  {
  783|  38.1k|    CTX_PTR successor;
  784|  38.1k|    CPpmd_State *s2 = p->FoundState;
  785|  38.1k|    p->FoundState = s;
  786|       |
  787|  38.1k|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|  38.1k|#define False 0
  ------------------
  788|  38.1k|    if (successor == NULL)
  ------------------
  |  Branch (788:9): [True: 24, False: 38.1k]
  ------------------
  789|     24|      SetSuccessor(s, 0);
  790|  38.1k|    else
  791|  38.1k|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|  38.1k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  792|  38.1k|    p->FoundState = s2;
  793|  38.1k|  }
  794|       |  
  795|  2.58M|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (795:7): [True: 32.8k, False: 2.55M]
  |  Branch (795:28): [True: 32.8k, False: 0]
  ------------------
  796|  32.8k|  {
  797|  32.8k|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  341|  32.8k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  798|  32.8k|    p->Text--;
  799|  32.8k|  }
  800|  2.58M|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  341|  2.58M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (800:7): [True: 24, False: 2.58M]
  ------------------
  801|     24|    return NULL;
  802|  2.58M|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|  2.58M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  2.58M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.58M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  2.58M|}
archive_ppmd8.c:AllocUnits:
  231|  44.7M|{
  232|  44.7M|  UInt32 numBytes;
  233|  44.7M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 18.8M, False: 25.9M]
  ------------------
  234|  18.8M|    return RemoveNode(p, indx);
  235|  25.9M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  25.9M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  25.9M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  25.9M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 22.1M, False: 3.75M]
  ------------------
  237|  22.1M|  {
  238|  22.1M|    void *retVal = p->LoUnit;
  239|  22.1M|    p->LoUnit += numBytes;
  240|  22.1M|    return retVal;
  241|  22.1M|  }
  242|  3.75M|  return AllocUnitsRare(p, indx);
  243|  25.9M|}
archive_ppmd8.c:Ppmd8_Update1:
 1082|  6.58M|{
 1083|  6.58M|  CPpmd_State *s = p->FoundState;
 1084|  6.58M|  s->Freq += 4;
 1085|  6.58M|  p->MinContext->SummFreq += 4;
 1086|  6.58M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1086:7): [True: 4.31M, False: 2.26M]
  ------------------
 1087|  4.31M|  {
 1088|  4.31M|    SwapStates(&s[0], &s[-1]);
 1089|  4.31M|    p->FoundState = --s;
 1090|  4.31M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  4.31M|#define MAX_FREQ 124
  ------------------
  |  Branch (1090:9): [True: 514, False: 4.31M]
  ------------------
 1091|    514|      Rescale(p);
 1092|  4.31M|  }
 1093|  6.58M|  NextContext(p);
 1094|  6.58M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|   101M|{
 1108|   101M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|   101M|  p->PrevSuccess = 1;
 1110|   101M|  p->RunLength++;
 1111|   101M|  NextContext(p);
 1112|   101M|}
archive_ppmd8.c:Ppmd8_MakeEscFreq:
 1046|  18.1M|{
 1047|  18.1M|  CPpmd_See *see;
 1048|  18.1M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1048:7): [True: 15.7M, False: 2.41M]
  ------------------
 1049|  15.7M|  {
 1050|  15.7M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1051|  15.7M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1052|  15.7M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1053|  15.7M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  15.7M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  15.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  15.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  15.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  15.7M|        p->MinContext->Flags;
 1055|  15.7M|    {
 1056|  15.7M|      unsigned r = (see->Summ >> see->Shift);
 1057|  15.7M|      see->Summ = (UInt16)(see->Summ - r);
 1058|  15.7M|      *escFreq = r + (r == 0);
 1059|  15.7M|    }
 1060|  15.7M|  }
 1061|  2.41M|  else
 1062|  2.41M|  {
 1063|  2.41M|    see = &p->DummySee;
 1064|  2.41M|    *escFreq = 1;
 1065|  2.41M|  }
 1066|  18.1M|  return see;
 1067|  18.1M|}
archive_ppmd8.c:Ppmd8_Update2:
 1115|  12.8M|{
 1116|  12.8M|  p->MinContext->SummFreq += 4;
 1117|  12.8M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  12.8M|#define MAX_FREQ 124
  ------------------
  |  Branch (1117:7): [True: 16.2k, False: 12.8M]
  ------------------
 1118|  16.2k|    Rescale(p);
 1119|  12.8M|  p->RunLength = p->InitRL;
 1120|  12.8M|  UpdateModel(p);
 1121|  12.8M|  p->MinContext = p->MaxContext;
 1122|  12.8M|}

__archive_rb_tree_init:
   97|  3.76k|{
   98|  3.76k|	rbt->rbt_ops = ops;
   99|       |	*((struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE;
  ------------------
  |  |   89|  3.76k|#define	RB_SENTINEL_NODE	NULL
  ------------------
  100|  3.76k|}
__archive_rb_tree_find_node:
  104|    652|{
  105|    652|	archive_rbto_compare_key_fn compare_key = rbt->rbt_ops->rbto_compare_key;
  106|    652|	struct archive_rb_node *parent = rbt->rbt_root;
  107|       |
  108|  1.75k|	while (!RB_SENTINEL_P(parent)) {
  ------------------
  |  |   53|  1.75k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (108:9): [True: 1.75k, False: 0]
  ------------------
  109|  1.75k|		const signed int diff = (*compare_key)(parent, key);
  110|  1.75k|		if (diff == 0)
  ------------------
  |  Branch (110:7): [True: 652, False: 1.10k]
  ------------------
  111|    652|			return parent;
  112|  1.10k|		parent = parent->rb_nodes[diff > 0];
  113|  1.10k|	}
  114|       |
  115|      0|	return NULL;
  116|    652|}
__archive_rb_tree_insert_node:
  159|  2.00k|{
  160|  2.00k|	archive_rbto_compare_nodes_fn compare_nodes = rbt->rbt_ops->rbto_compare_nodes;
  161|  2.00k|	struct archive_rb_node *parent, *tmp;
  162|  2.00k|	unsigned int position;
  163|  2.00k|	int rebalance;
  164|       |
  165|  2.00k|	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|  2.00k|	parent = (struct archive_rb_node *)(void *)&rbt->rbt_root;
  175|  2.00k|	position = RB_DIR_LEFT;
  ------------------
  |  |   39|  2.00k|#define	RB_DIR_LEFT		0
  ------------------
  176|       |
  177|       |	/*
  178|       |	 * Find out where to place this new leaf.
  179|       |	 */
  180|  11.0k|	while (!RB_SENTINEL_P(tmp)) {
  ------------------
  |  |   53|  11.0k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (180:9): [True: 9.71k, False: 1.34k]
  ------------------
  181|  9.71k|		const signed int diff = (*compare_nodes)(tmp, self);
  182|  9.71k|		if (diff == 0) {
  ------------------
  |  Branch (182:7): [True: 658, False: 9.05k]
  ------------------
  183|       |			/*
  184|       |			 * Node already exists; don't insert.
  185|       |			 */
  186|    658|			return F;
  ------------------
  |  |   92|    658|#define	F	0
  ------------------
  187|    658|		}
  188|  9.05k|		parent = tmp;
  189|  9.05k|		position = (diff > 0);
  190|  9.05k|		tmp = parent->rb_nodes[position];
  191|  9.05k|	}
  192|       |
  193|       |	/*
  194|       |	 * Initialize the node and insert as a leaf into the tree.
  195|       |	 */
  196|  1.34k|	RB_SET_FATHER(self, parent);
  ------------------
  |  |   51|  1.34k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  1.34k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.34k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.34k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  1.34k|	RB_SET_POSITION(self, position);
  ------------------
  |  |   73|  1.34k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    938|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 938, False: 405]
  |  |  ------------------
  |  |   74|  1.34k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|    405|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  198|  1.34k|	if (parent == (struct archive_rb_node *)(void *)&rbt->rbt_root) {
  ------------------
  |  Branch (198:6): [True: 63, False: 1.28k]
  ------------------
  199|     63|		RB_MARK_BLACK(self);		/* root is always black */
  ------------------
  |  |   69|     63|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|     63|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  200|     63|		rebalance = F;
  ------------------
  |  |   92|     63|#define	F	0
  ------------------
  201|  1.28k|	} else {
  202|       |		/*
  203|       |		 * All new nodes are colored red.  We only need to rebalance
  204|       |		 * if our parent is also red.
  205|       |		 */
  206|  1.28k|		RB_MARK_RED(self);
  ------------------
  |  |   68|  1.28k|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.28k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  207|  1.28k|		rebalance = RB_RED_P(parent);
  ------------------
  |  |   66|  1.28k|#define	RB_RED_P(rb) 		(!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0)
  |  |  ------------------
  |  |  |  |   53|  2.56k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |               #define	RB_RED_P(rb) 		(!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0)
  |  |  ------------------
  |  |  |  |   46|  1.28k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (66:25): [True: 1.28k, False: 0]
  |  |  |  Branch (66:47): [True: 1.18k, False: 94]
  |  |  ------------------
  ------------------
  208|  1.28k|	}
  209|  1.34k|	self->rb_left = parent->rb_nodes[position];
  ------------------
  |  |   42|  1.34k|#define	rb_left			rb_nodes[RB_DIR_LEFT]
  |  |  ------------------
  |  |  |  |   39|  1.34k|#define	RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
  210|  1.34k|	self->rb_right = parent->rb_nodes[position];
  ------------------
  |  |   43|  1.34k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  1.34k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  211|  1.34k|	parent->rb_nodes[position] = self;
  212|       |
  213|       |	/*
  214|       |	 * Rebalance tree after insertion
  215|       |	 */
  216|  1.34k|	if (rebalance)
  ------------------
  |  Branch (216:6): [True: 1.18k, False: 157]
  ------------------
  217|  1.18k|		__archive_rb_tree_insert_rebalance(rbt, self);
  218|       |
  219|  1.34k|	return T;
  ------------------
  |  |   91|  1.34k|#define T	1
  ------------------
  220|  2.00k|}
__archive_rb_tree_iterate:
  677|    210|{
  678|    210|	const unsigned int other = direction ^ RB_DIR_OTHER;
  ------------------
  |  |   41|    210|#define	RB_DIR_OTHER		1
  ------------------
  679|       |
  680|    210|	if (self == NULL) {
  ------------------
  |  Branch (680:6): [True: 22, False: 188]
  ------------------
  681|     22|		self = rbt->rbt_root;
  682|     22|		if (RB_SENTINEL_P(self))
  ------------------
  |  |   53|     22|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 5, False: 17]
  |  |  ------------------
  ------------------
  683|      5|			return NULL;
  684|     67|		while (!RB_SENTINEL_P(self->rb_nodes[direction]))
  ------------------
  |  |   53|     67|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (684:10): [True: 50, False: 17]
  ------------------
  685|     50|			self = self->rb_nodes[direction];
  686|     17|		return self;
  687|     22|	}
  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|    188|	if (RB_SENTINEL_P(self->rb_nodes[direction])) {
  ------------------
  |  |   53|    188|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 97, False: 91]
  |  |  ------------------
  ------------------
  693|    173|		while (!RB_ROOT_P(rbt, self)) {
  ------------------
  |  |   71|    173|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  ------------------
  |  Branch (693:10): [True: 169, False: 4]
  ------------------
  694|    169|			if (other == (unsigned int)RB_POSITION(self))
  ------------------
  |  |   63|    169|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|    169|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   40|     76|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   39|     93|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 76, False: 93]
  |  |  ------------------
  ------------------
  |  Branch (694:8): [True: 93, False: 76]
  ------------------
  695|     93|				return RB_FATHER(self);
  ------------------
  |  |   49|     93|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|     93|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|     93|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|     93|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|     76|			self = RB_FATHER(self);
  ------------------
  |  |   49|     76|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|     76|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|     76|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|     76|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  697|     76|		}
  698|      4|		return NULL;
  699|     97|	}
  700|       |
  701|       |	/*
  702|       |	 * Advance down one in current direction and go down as far as possible
  703|       |	 * in the opposite direction.
  704|       |	 */
  705|     91|	self = self->rb_nodes[direction];
  706|    158|	while (!RB_SENTINEL_P(self->rb_nodes[other]))
  ------------------
  |  |   53|    158|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (706:9): [True: 67, False: 91]
  ------------------
  707|     67|		self = self->rb_nodes[other];
  708|     91|	return self;
  709|    188|}
archive_rb.c:__archive_rb_tree_insert_rebalance:
  275|  1.18k|{
  276|  1.18k|	struct archive_rb_node * father = RB_FATHER(self);
  ------------------
  |  |   49|  1.18k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  1.18k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.18k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.18k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|  1.18k|	struct archive_rb_node * grandpa;
  278|  1.18k|	struct archive_rb_node * uncle;
  279|  1.18k|	unsigned int which;
  280|  1.18k|	unsigned int other;
  281|       |
  282|  1.97k|	for (;;) {
  283|       |		/*
  284|       |		 * We are red and our parent is red, therefore we must have a
  285|       |		 * grandfather and he must be black.
  286|       |		 */
  287|  1.97k|		grandpa = RB_FATHER(father);
  ------------------
  |  |   49|  1.97k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  1.97k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.97k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.97k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  1.97k|		which = (father == grandpa->rb_right);
  ------------------
  |  |   43|  1.97k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  1.97k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  289|  1.97k|		other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  1.97k|#define	RB_DIR_OTHER		1
  ------------------
  290|  1.97k|		uncle = grandpa->rb_nodes[other];
  291|       |
  292|  1.97k|		if (RB_BLACK_P(uncle))
  ------------------
  |  |   67|  1.97k|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  3.94k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 598, False: 1.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|  1.37k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 402, False: 971]
  |  |  ------------------
  ------------------
  293|  1.00k|			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|    971|		RB_MARK_BLACK(uncle);
  ------------------
  |  |   69|    971|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    971|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  302|    971|		RB_MARK_BLACK(father);
  ------------------
  |  |   69|    971|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    971|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  303|    971|		if (RB_ROOT_P(rbt, grandpa)) {
  ------------------
  |  |   71|    971|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  |  |  ------------------
  |  |  |  Branch (71:28): [True: 104, False: 867]
  |  |  ------------------
  ------------------
  304|       |			/*
  305|       |			 * If our grandpa is root, don't bother
  306|       |			 * setting him to red, just return.
  307|       |			 */
  308|    104|			return;
  309|    104|		}
  310|    867|		RB_MARK_RED(grandpa);
  ------------------
  |  |   68|    867|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    867|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  311|    867|		self = grandpa;
  312|    867|		father = RB_FATHER(self);
  ------------------
  |  |   49|    867|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|    867|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    867|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    867|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|    867|		if (RB_BLACK_P(father)) {
  ------------------
  |  |   67|    867|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  1.73k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 0, False: 867]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|    867|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 82, False: 785]
  |  |  ------------------
  ------------------
  314|       |			/*
  315|       |			 * If our great-grandpa is black, we're done.
  316|       |			 */
  317|     82|			return;
  318|     82|		}
  319|    867|	}
  320|       |
  321|       |	/*
  322|       |	 * Case 2&3: our uncle is black.
  323|       |	 */
  324|  1.00k|	if (self == father->rb_nodes[other]) {
  ------------------
  |  Branch (324:6): [True: 353, False: 647]
  ------------------
  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|    353|		__archive_rb_tree_reparent_nodes(father, other);
  332|    353|	}
  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.00k|	__archive_rb_tree_reparent_nodes(grandpa, which);
  340|       |
  341|       |	/*
  342|       |	 * Final step: Set the root to black.
  343|       |	 */
  344|  1.00k|	RB_MARK_BLACK(rbt->rbt_root);
  ------------------
  |  |   69|  1.00k|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.00k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  345|  1.00k|}
archive_rb.c:__archive_rb_tree_reparent_nodes:
  233|  1.35k|{
  234|  1.35k|	const unsigned int other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  1.35k|#define	RB_DIR_OTHER		1
  ------------------
  235|  1.35k|	struct archive_rb_node * const grandpa = RB_FATHER(old_father);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  1.35k|	struct archive_rb_node * const old_child = old_father->rb_nodes[which];
  237|  1.35k|	struct archive_rb_node * const new_father = old_child;
  238|  1.35k|	struct archive_rb_node * const new_child = old_father;
  239|       |
  240|  1.35k|	if (new_father == NULL)
  ------------------
  |  Branch (240:6): [True: 0, False: 1.35k]
  ------------------
  241|      0|		return;
  242|       |	/*
  243|       |	 * Exchange descendant linkages.
  244|       |	 */
  245|  1.35k|	grandpa->rb_nodes[RB_POSITION(old_father)] = new_father;
  ------------------
  |  |   63|  1.35k|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|  1.35k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   40|    812|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   39|    541|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 812, False: 541]
  |  |  ------------------
  ------------------
  246|  1.35k|	new_child->rb_nodes[which] = old_child->rb_nodes[other];
  247|  1.35k|	new_father->rb_nodes[other] = new_child;
  248|       |
  249|       |	/*
  250|       |	 * Update ancestor linkages
  251|       |	 */
  252|  1.35k|	RB_SET_FATHER(new_father, grandpa);
  ------------------
  |  |   51|  1.35k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  1.35k|	RB_SET_FATHER(new_child, new_father);
  ------------------
  |  |   51|  1.35k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|       |
  255|       |	/*
  256|       |	 * Exchange properties between new_father and new_child.  The only
  257|       |	 * change is that new_child's position is now on the other side.
  258|       |	 */
  259|  1.35k|	RB_SWAP_PROPERTIES(new_father, new_child);
  ------------------
  |  |   78|  1.35k|#define RB_SWAP_PROPERTIES(a, b) do { \
  |  |   79|  1.35k|    uintptr_t xorinfo = ((a)->rb_info ^ (b)->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
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|  1.35k|    (a)->rb_info ^= xorinfo; \
  |  |   81|  1.35k|    (b)->rb_info ^= xorinfo; \
  |  |   82|  1.35k|  } while (/*CONSTCOND*/ 0)
  |  |  ------------------
  |  |  |  Branch (82:26): [Folded, False: 1.35k]
  |  |  ------------------
  ------------------
  260|  1.35k|	RB_SET_POSITION(new_child, other);
  ------------------
  |  |   73|  1.35k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    368|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 368, False: 985]
  |  |  ------------------
  |  |   74|  1.35k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|    985|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  261|       |
  262|       |	/*
  263|       |	 * Make sure to reparent the new child to ourself.
  264|       |	 */
  265|  1.35k|	if (!RB_SENTINEL_P(new_child->rb_nodes[which])) {
  ------------------
  |  |   53|  1.35k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (265:6): [True: 488, False: 865]
  ------------------
  266|    488|		RB_SET_FATHER(new_child->rb_nodes[which], new_child);
  ------------------
  |  |   51|    488|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|    488|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    488|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    488|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|    488|		RB_SET_POSITION(new_child->rb_nodes[which], which);
  ------------------
  |  |   73|    488|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    402|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 402, False: 86]
  |  |  ------------------
  |  |   74|    488|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|     86|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  268|    488|	}
  269|       |
  270|  1.35k|}

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

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

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

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

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

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

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

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

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

archive_read_support_filter_lrzip:
   61|  3.66k|{
   62|  3.66k|	struct archive_read *a = (struct archive_read *)_a;
   63|       |
   64|  3.66k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (64:6): [True: 0, False: 3.66k]
  ------------------
   65|  3.66k|				&lrzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  3.66k|#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|  3.66k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.66k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   70|  3.66k|	    "Using external lrzip program for lrzip decompression");
   71|  3.66k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  3.66k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   72|  3.66k|}
archive_read_support_filter_lrzip.c:lrzip_bidder_bid:
   80|  4.14k|{
   81|  4.14k|	const unsigned char *p;
   82|  4.14k|	int i;
   83|       |
   84|  4.14k|	(void)b; /* UNUSED */
   85|       |	/* Start by looking at the first six bytes of the header, which
   86|       |	 * is all fixed layout. */
   87|  4.14k|	p = __archive_read_filter_ahead(f, 6, NULL);
   88|  4.14k|	if (p == NULL)
  ------------------
  |  Branch (88:6): [True: 85, False: 4.06k]
  ------------------
   89|     85|		return (0);
   90|       |
   91|  4.06k|	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   45|  4.06k|#define LRZIP_HEADER_MAGIC "LRZI"
  ------------------
              	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   46|  4.06k|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (91:6): [True: 4.05k, False: 2]
  ------------------
   92|  4.05k|		return (0);
   93|       |
   94|       |	/* current major version is always 0, verify this */
   95|      2|	if (p[LRZIP_HEADER_MAGIC_LEN])
  ------------------
  |  |   46|      2|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (95:6): [True: 2, False: 0]
  ------------------
   96|      2|		return 0;
   97|       |	/* support only v0.6+ lrzip for sanity */
   98|      0|	i = p[LRZIP_HEADER_MAGIC_LEN + 1];
  ------------------
  |  |   46|      0|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
   99|      0|	if ((i < 6) || (i > 10))
  ------------------
  |  Branch (99:6): [True: 0, False: 0]
  |  Branch (99:17): [True: 0, False: 0]
  ------------------
  100|      0|		return 0;
  101|       |
  102|      0|	return (48);
  103|      0|}

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

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

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

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

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

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

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

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

archive_read_support_format_ar:
   99|  3.66k|{
  100|  3.66k|	struct archive_read *a = (struct archive_read *)_a;
  101|  3.66k|	struct ar *ar;
  102|  3.66k|	int r;
  103|       |
  104|  3.66k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  3.66k|	do { \
  |  |  180|  3.66k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  3.66k|			(allowed_states), (function_name)); \
  |  |  182|  3.66k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  3.66k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 3.66k]
  |  |  ------------------
  |  |  183|  3.66k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  3.66k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 3.66k]
  |  |  ------------------
  ------------------
  105|  3.66k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
  106|       |
  107|  3.66k|	ar = calloc(1, sizeof(*ar));
  108|  3.66k|	if (ar == NULL) {
  ------------------
  |  Branch (108:6): [True: 0, False: 3.66k]
  ------------------
  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|  3.66k|	ar->strtab = NULL;
  113|       |
  114|  3.66k|	r = __archive_read_register_format(a,
  115|  3.66k|	    ar,
  116|  3.66k|	    "ar",
  117|  3.66k|	    archive_read_format_ar_bid,
  118|  3.66k|	    NULL,
  119|  3.66k|	    archive_read_format_ar_read_header,
  120|  3.66k|	    archive_read_format_ar_read_data,
  121|  3.66k|	    archive_read_format_ar_skip,
  122|  3.66k|	    NULL,
  123|  3.66k|	    archive_read_format_ar_cleanup,
  124|  3.66k|	    NULL,
  125|  3.66k|	    NULL);
  126|       |
  127|  3.66k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  3.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (127:6): [True: 0, False: 3.66k]
  ------------------
  128|      0|		free(ar);
  129|  3.66k|	return (r);
  130|  3.66k|}
archive_read_support_format_ar.c:archive_read_format_ar_cleanup:
  134|  3.66k|{
  135|  3.66k|	struct ar *ar = a->format->data;
  136|       |
  137|  3.66k|	free(ar->strtab);
  138|  3.66k|	free(ar);
  139|  3.66k|	a->format->data = NULL;
  140|       |
  141|  3.66k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  142|  3.66k|}
archive_read_support_format_ar.c:archive_read_format_ar_bid:
  146|  3.59k|{
  147|  3.59k|	const void *h;
  148|       |
  149|  3.59k|	(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|  3.59k|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (155:6): [True: 16, False: 3.58k]
  ------------------
  156|     16|		return (-1);
  157|  3.58k|	if (memcmp(h, "!<arch>\n", 8) == 0) {
  ------------------
  |  Branch (157:6): [True: 38, False: 3.54k]
  ------------------
  158|     38|		return (64);
  159|     38|	}
  160|  3.54k|	return (-1);
  161|  3.58k|}
archive_read_support_format_ar.c:archive_read_format_ar_read_header:
  398|  2.12k|{
  399|  2.12k|	struct ar *ar = a->format->data;
  400|  2.12k|	int64_t unconsumed;
  401|  2.12k|	const void *header_data;
  402|  2.12k|	int ret;
  403|       |
  404|  2.12k|	if (!ar->read_global_header) {
  ------------------
  |  Branch (404:6): [True: 38, False: 2.09k]
  ------------------
  405|       |		/*
  406|       |		 * We are at the beginning of the archive now,
  407|       |		 * so we have to consume the ar global header first.
  408|       |		 */
  409|     38|		__archive_read_consume(a, 8);
  410|     38|		ar->read_global_header = 1;
  411|       |		/* Set a default format code for now. */
  412|     38|		a->archive.archive_format = ARCHIVE_FORMAT_AR;
  ------------------
  |  |  376|     38|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  413|     38|	}
  414|       |
  415|       |	/* Read the header for the next file entry. */
  416|  2.12k|	if ((header_data = __archive_read_ahead(a, 60, NULL)) == NULL)
  ------------------
  |  Branch (416:6): [True: 8, False: 2.12k]
  ------------------
  417|       |		/* Broken header. */
  418|      8|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  419|       |
  420|  2.12k|	unconsumed = 60;
  421|       |
  422|  2.12k|	ret = _ar_read_header(a, entry, ar, (const char *)header_data, &unconsumed);
  423|       |
  424|  2.12k|	if (unconsumed)
  ------------------
  |  Branch (424:6): [True: 859, False: 1.26k]
  ------------------
  425|    859|		__archive_read_consume(a, unconsumed);
  426|       |
  427|  2.12k|	return ret;
  428|  2.12k|}
archive_read_support_format_ar.c:_ar_read_header:
  166|  2.12k|{
  167|  2.12k|	char filename[AR_name_size + 1];
  168|  2.12k|	uint64_t number; /* Used to hold parsed numbers before validation. */
  169|  2.12k|	char *p;
  170|  2.12k|	const void *b;
  171|       |
  172|       |	/* Verify the magic signature on the file header. */
  173|  2.12k|	if (strncmp(h + AR_fmag_offset, "`\n", 2) != 0) {
  ------------------
  |  |   81|  2.12k|#define AR_fmag_offset 58
  ------------------
  |  Branch (173:6): [True: 27, False: 2.09k]
  ------------------
  174|     27|		archive_set_error(&a->archive, EINVAL,
  175|     27|		    "Incorrect file header signature");
  176|     27|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     27|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  177|     27|	}
  178|       |
  179|       |	/* Copy filename into work buffer. */
  180|  2.09k|	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   69|  2.09k|#define AR_name_offset 0
  ------------------
              	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   70|  2.09k|#define AR_name_size 16
  ------------------
  181|  2.09k|	filename[AR_name_size] = '\0';
  ------------------
  |  |   70|  2.09k|#define AR_name_size 16
  ------------------
  182|       |
  183|       |	/*
  184|       |	 * Guess the format variant based on the filename.
  185|       |	 */
  186|  2.09k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR) {
  ------------------
  |  |  376|  2.09k|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (186:6): [True: 59, False: 2.03k]
  ------------------
  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|     59|		if (strncmp(filename, "#1/", 3) == 0)
  ------------------
  |  Branch (194:7): [True: 19, False: 40]
  ------------------
  195|     19|			a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
  ------------------
  |  |  378|     19|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|     19|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  196|     40|		else if (strchr(filename, '/') != NULL)
  ------------------
  |  Branch (196:12): [True: 18, False: 22]
  ------------------
  197|     18|			a->archive.archive_format = ARCHIVE_FORMAT_AR_GNU;
  ------------------
  |  |  377|     18|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|     18|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  198|     22|		else if (strncmp(filename, "__.SYMDEF", 9) == 0)
  ------------------
  |  Branch (198:12): [True: 0, False: 22]
  ------------------
  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|     59|	}
  206|       |
  207|       |	/* Update format name from the code. */
  208|  2.09k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR_GNU)
  ------------------
  |  |  377|  2.09k|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|  2.09k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (208:6): [True: 980, False: 1.11k]
  ------------------
  209|    980|		a->archive.archive_format_name = "ar (GNU/SVR4)";
  210|  1.11k|	else if (a->archive.archive_format == ARCHIVE_FORMAT_AR_BSD)
  ------------------
  |  |  378|  1.11k|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|  1.11k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (210:11): [True: 1.09k, False: 22]
  ------------------
  211|  1.09k|		a->archive.archive_format_name = "ar (BSD)";
  212|     22|	else
  213|     22|		a->archive.archive_format_name = "ar";
  214|       |
  215|       |	/*
  216|       |	 * Remove trailing spaces from the filename.  GNU and BSD
  217|       |	 * variants both pad filename area out with spaces.
  218|       |	 * This will only be wrong if GNU/SVR4 'ar' implementations
  219|       |	 * omit trailing '/' for 16-char filenames and we have
  220|       |	 * a 16-char filename that ends in ' '.
  221|       |	 */
  222|  2.09k|	p = filename + AR_name_size - 1;
  ------------------
  |  |   70|  2.09k|#define AR_name_size 16
  ------------------
  223|  3.11k|	while (p >= filename && *p == ' ') {
  ------------------
  |  Branch (223:9): [True: 3.11k, False: 0]
  |  Branch (223:26): [True: 1.02k, False: 2.09k]
  ------------------
  224|  1.02k|		*p = '\0';
  225|  1.02k|		p--;
  226|  1.02k|	}
  227|       |
  228|       |	/*
  229|       |	 * Remove trailing slash unless first character is '/'.
  230|       |	 * (BSD entries never end in '/', so this will only trim
  231|       |	 * GNU-format entries.  GNU special entries start with '/'
  232|       |	 * and are not terminated in '/', so we don't trim anything
  233|       |	 * that starts with '/'.)
  234|       |	 */
  235|  2.09k|	if (filename[0] != '/' && p > filename && *p == '/') {
  ------------------
  |  Branch (235:6): [True: 1.87k, False: 218]
  |  Branch (235:28): [True: 1.85k, False: 24]
  |  Branch (235:44): [True: 0, False: 1.85k]
  ------------------
  236|      0|		*p = '\0';
  237|      0|	}
  238|       |
  239|  2.09k|	if (p < filename) {
  ------------------
  |  Branch (239:6): [True: 0, False: 2.09k]
  ------------------
  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|  2.09k|	ar_parse_common_header(ar, entry, h);
  250|       |
  251|       |	/*
  252|       |	 * '//' is the GNU filename table.
  253|       |	 * Later entries can refer to names in this table.
  254|       |	 */
  255|  2.09k|	if (strcmp(filename, "//") == 0) {
  ------------------
  |  Branch (255:6): [True: 5, False: 2.08k]
  ------------------
  256|      5|		char *st;
  257|      5|		size_t entry_size;
  258|       |
  259|      5|		archive_entry_copy_pathname(entry, filename);
  260|       |		/* Get the size of the filename table. */
  261|      5|		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|      5|#define AR_size_offset 48
  ------------------
              		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   80|      5|#define AR_size_size 10
  ------------------
  262|      5|		if (number > SIZE_MAX || number > 1024 * 1024 * 1024) {
  ------------------
  |  Branch (262:7): [True: 0, False: 5]
  |  Branch (262:28): [True: 0, False: 5]
  ------------------
  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|      5|		entry_size = (size_t)number;
  268|      5|		if (entry_size == 0) {
  ------------------
  |  Branch (268:7): [True: 0, False: 5]
  ------------------
  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|      5|		if (ar->strtab != NULL) {
  ------------------
  |  Branch (273:7): [True: 0, False: 5]
  ------------------
  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|      5|		st = malloc(entry_size);
  281|      5|		if (st == NULL) {
  ------------------
  |  Branch (281:7): [True: 0, False: 5]
  ------------------
  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|      5|		ar->strtab = st;
  287|      5|		ar->strtab_size = entry_size;
  288|       |
  289|      5|		if (*unconsumed) {
  ------------------
  |  Branch (289:7): [True: 5, False: 0]
  ------------------
  290|      5|			__archive_read_consume(a, *unconsumed);
  291|      5|			*unconsumed = 0;
  292|      5|		}
  293|       |
  294|      5|		if ((b = __archive_read_ahead(a, entry_size, NULL)) == NULL)
  ------------------
  |  Branch (294:7): [True: 0, False: 5]
  ------------------
  295|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  296|      5|		memcpy(st, b, entry_size);
  297|      5|		__archive_read_consume(a, entry_size);
  298|       |		/* All contents are consumed. */
  299|      5|		ar->entry_bytes_remaining = 0;
  300|      5|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  301|       |
  302|       |		/* Parse the filename table. */
  303|      5|		return (ar_parse_gnu_filename_table(a));
  304|      5|	}
  305|       |
  306|       |	/*
  307|       |	 * GNU variant handles long filenames by storing /<number>
  308|       |	 * to indicate a name stored in the filename table.
  309|       |	 * XXX TODO: Verify that it's all digits... Don't be fooled
  310|       |	 * by "/9xyz" XXX
  311|       |	 */
  312|  2.08k|	if (filename[0] == '/' && filename[1] >= '0' && filename[1] <= '9') {
  ------------------
  |  Branch (312:6): [True: 213, False: 1.87k]
  |  Branch (312:28): [True: 204, False: 9]
  |  Branch (312:50): [True: 204, False: 0]
  ------------------
  313|    204|		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   69|    204|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   70|    204|#define AR_name_size 16
  ------------------
  314|       |		/* Fail if we can't look up the real name. */
  315|    204|		if (ar->strtab == NULL || number >= ar->strtab_size) {
  ------------------
  |  Branch (315:7): [True: 0, False: 204]
  |  Branch (315:29): [True: 0, False: 204]
  ------------------
  316|      0|			archive_set_error(&a->archive, EINVAL,
  317|      0|			    "Can't find long filename for GNU/SVR4 archive entry");
  318|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  319|      0|		}
  320|       |
  321|    204|		archive_entry_copy_pathname(entry, &ar->strtab[(size_t)number]);
  322|    204|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    204|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  323|    204|	}
  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|  1.88k|	if (strncmp(filename, "#1/", 3) == 0) {
  ------------------
  |  Branch (330:6): [True: 1.25k, False: 626]
  ------------------
  331|  1.25k|		size_t bsd_name_length;
  332|       |
  333|       |		/* Parse the size of the name, adjust the file size. */
  334|  1.25k|		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   69|  1.25k|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   70|  1.25k|#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.25k|		if (number > SIZE_MAX - 1
  ------------------
  |  Branch (340:7): [True: 0, False: 1.25k]
  ------------------
  341|  1.25k|		    || number > 1024 * 1024
  ------------------
  |  Branch (341:10): [True: 0, False: 1.25k]
  ------------------
  342|  1.25k|		    || number > (uint64_t)ar->entry_bytes_remaining) {
  ------------------
  |  Branch (342:10): [True: 2, False: 1.25k]
  ------------------
  343|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  344|      2|			    "Bad input file size");
  345|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  346|      2|		}
  347|  1.25k|		bsd_name_length = (size_t)number;
  348|  1.25k|		ar->entry_bytes_remaining -= bsd_name_length;
  349|       |		/* Adjust file size reported to client. */
  350|  1.25k|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  351|       |
  352|  1.25k|		if (*unconsumed) {
  ------------------
  |  Branch (352:7): [True: 1.25k, False: 0]
  ------------------
  353|  1.25k|			__archive_read_consume(a, *unconsumed);
  354|  1.25k|			*unconsumed = 0;
  355|  1.25k|		}
  356|       |
  357|       |		/* Read the long name into memory. */
  358|  1.25k|		if ((b = __archive_read_ahead(a, bsd_name_length, NULL)) == NULL) {
  ------------------
  |  Branch (358:7): [True: 0, False: 1.25k]
  ------------------
  359|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  360|      0|			    "Truncated input file");
  361|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  362|      0|		}
  363|       |		/* Store it in the entry. */
  364|  1.25k|		p = malloc(bsd_name_length + 1);
  365|  1.25k|		if (p == NULL) {
  ------------------
  |  Branch (365:7): [True: 0, False: 1.25k]
  ------------------
  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.25k|		strncpy(p, b, bsd_name_length);
  371|  1.25k|		p[bsd_name_length] = '\0';
  372|       |
  373|  1.25k|		__archive_read_consume(a, bsd_name_length);
  374|       |
  375|  1.25k|		archive_entry_copy_pathname(entry, p);
  376|  1.25k|		free(p);
  377|  1.25k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  378|  1.25k|	}
  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|    626|	archive_entry_copy_pathname(entry, filename);
  392|    626|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    626|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  393|  1.88k|}
archive_read_support_format_ar.c:ar_parse_common_header:
  434|  2.09k|{
  435|  2.09k|	int64_t n;
  436|       |
  437|       |	/* Copy remaining header */
  438|  2.09k|	archive_entry_set_mtime(entry,
  439|  2.09k|	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   71|  2.09k|#define AR_date_offset 16
  ------------------
              	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   72|  2.09k|#define AR_date_size 12
  ------------------
  440|  2.09k|	archive_entry_set_uid(entry,
  441|  2.09k|	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   73|  2.09k|#define AR_uid_offset 28
  ------------------
              	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   74|  2.09k|#define AR_uid_size 6
  ------------------
  442|  2.09k|	archive_entry_set_gid(entry,
  443|  2.09k|	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   75|  2.09k|#define AR_gid_offset 34
  ------------------
              	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   76|  2.09k|#define AR_gid_size 6
  ------------------
  444|  2.09k|	archive_entry_set_mode(entry,
  445|  2.09k|	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   77|  2.09k|#define AR_mode_offset 40
  ------------------
              	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   78|  2.09k|#define AR_mode_size 8
  ------------------
  446|  2.09k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  2.09k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  447|  2.09k|	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|  2.09k|#define AR_size_offset 48
  ------------------
              	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   80|  2.09k|#define AR_size_size 10
  ------------------
  448|       |
  449|  2.09k|	ar->entry_offset = 0;
  450|  2.09k|	ar->entry_padding = n % 2;
  451|  2.09k|	archive_entry_set_size(entry, n);
  452|  2.09k|	ar->entry_bytes_remaining = n;
  453|  2.09k|}
archive_read_support_format_ar.c:ar_atol8:
  551|  2.09k|{
  552|  2.09k|	uint64_t l;
  553|  2.09k|	unsigned int digit, base;
  554|       |
  555|  2.09k|	base = 8;
  556|       |
  557|  9.22k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (557:10): [True: 5.08k, False: 4.13k]
  |  Branch (557:23): [True: 2.11k, False: 2.02k]
  |  Branch (557:38): [True: 7.13k, False: 70]
  ------------------
  558|  7.13k|		p++;
  559|       |
  560|  2.09k|	l = 0;
  561|  2.09k|	digit = *p - '0';
  562|  2.40k|	while (*p >= '0' && digit < base && char_cnt-- > 0) {
  ------------------
  |  Branch (562:9): [True: 965, False: 1.44k]
  |  Branch (562:22): [True: 313, False: 652]
  |  Branch (562:38): [True: 313, False: 0]
  ------------------
  563|    313|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (563:7): [True: 0, False: 313]
  ------------------
  564|    313|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (564:7): [True: 0, False: 313]
  ------------------
  565|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  566|      0|			break;
  567|      0|		}
  568|    313|		digit = *++p - '0';
  569|    313|	}
  570|  2.09k|	return (l);
  571|  2.09k|}
archive_read_support_format_ar.c:ar_atol10:
  575|  9.83k|{
  576|  9.83k|	uint64_t l;
  577|  9.83k|	unsigned int base, digit;
  578|       |
  579|  9.83k|	base = 10;
  580|       |
  581|  36.1k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (581:10): [True: 17.0k, False: 19.1k]
  |  Branch (581:23): [True: 11.0k, False: 8.10k]
  |  Branch (581:38): [True: 26.3k, False: 1.73k]
  ------------------
  582|  26.3k|		p++;
  583|  9.83k|	l = 0;
  584|  9.83k|	digit = *p - '0';
  585|  23.1k|	while (*p >= '0' && digit < base  && char_cnt-- > 0) {
  ------------------
  |  Branch (585:9): [True: 15.9k, False: 7.23k]
  |  Branch (585:22): [True: 13.8k, False: 2.06k]
  |  Branch (585:39): [True: 13.3k, False: 547]
  ------------------
  586|  13.3k|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (586:7): [True: 0, False: 13.3k]
  ------------------
  587|  13.3k|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (587:7): [True: 0, False: 13.3k]
  ------------------
  588|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  589|      0|			break;
  590|      0|		}
  591|  13.3k|		digit = *++p - '0';
  592|  13.3k|	}
  593|  9.83k|	return (l);
  594|  9.83k|}
archive_read_support_format_ar.c:ar_parse_gnu_filename_table:
  514|      5|{
  515|      5|	struct ar *ar = a->format->data;
  516|      5|	char *p;
  517|      5|	size_t size;
  518|       |
  519|      5|	size = ar->strtab_size;
  520|       |
  521|      5|	for (p = ar->strtab; p < ar->strtab + size - 1; ++p) {
  ------------------
  |  Branch (521:23): [True: 0, False: 5]
  ------------------
  522|      0|		if (*p == '/') {
  ------------------
  |  Branch (522:7): [True: 0, False: 0]
  ------------------
  523|      0|			*p++ = '\0';
  524|      0|			if (*p != '\n')
  ------------------
  |  Branch (524:8): [True: 0, False: 0]
  ------------------
  525|      0|				goto bad_string_table;
  526|      0|			*p = '\0';
  527|      0|		}
  528|      0|	}
  529|       |	/*
  530|       |	 * GNU ar always pads the table to an even size.
  531|       |	 * The pad character is either '\n' or '`'.
  532|       |	 */
  533|      5|	if (p != ar->strtab + size && *p != '\n' && *p != '`')
  ------------------
  |  Branch (533:6): [True: 5, False: 0]
  |  Branch (533:32): [True: 5, False: 0]
  |  Branch (533:46): [True: 0, False: 5]
  ------------------
  534|      0|		goto bad_string_table;
  535|       |
  536|       |	/* Enforce zero termination. */
  537|      5|	ar->strtab[size - 1] = '\0';
  538|       |
  539|      5|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  540|       |
  541|      0|bad_string_table:
  542|      0|	archive_set_error(&a->archive, EINVAL,
  543|      0|	    "Invalid string table");
  544|      0|	free(ar->strtab);
  545|      0|	ar->strtab = NULL;
  546|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  547|      5|}
archive_read_support_format_ar.c:archive_read_format_ar_read_data:
  458|  4.39k|{
  459|  4.39k|	struct ar *ar = a->format->data;
  460|  4.39k|	ssize_t bytes_read;
  461|       |
  462|  4.39k|	if (ar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (462:6): [True: 1.15k, False: 3.24k]
  ------------------
  463|  1.15k|		__archive_read_consume(a, ar->entry_bytes_unconsumed);
  464|  1.15k|		ar->entry_bytes_unconsumed = 0;
  465|  1.15k|	}
  466|       |
  467|  4.39k|	if (ar->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (467:6): [True: 1.15k, False: 3.24k]
  ------------------
  468|  1.15k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  469|  1.15k|		if (bytes_read == 0) {
  ------------------
  |  Branch (469:7): [True: 1, False: 1.15k]
  ------------------
  470|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  471|      1|			    "Truncated ar archive");
  472|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  473|      1|		}
  474|  1.15k|		if (bytes_read < 0)
  ------------------
  |  Branch (474:7): [True: 0, False: 1.15k]
  ------------------
  475|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  476|  1.15k|		if (bytes_read > ar->entry_bytes_remaining)
  ------------------
  |  Branch (476:7): [True: 1.15k, False: 1]
  ------------------
  477|  1.15k|			bytes_read = (ssize_t)ar->entry_bytes_remaining;
  478|  1.15k|		*size = bytes_read;
  479|  1.15k|		ar->entry_bytes_unconsumed = bytes_read;
  480|  1.15k|		*offset = ar->entry_offset;
  481|  1.15k|		ar->entry_offset += bytes_read;
  482|  1.15k|		ar->entry_bytes_remaining -= bytes_read;
  483|  1.15k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  484|  3.24k|	} else {
  485|  3.24k|		if (__archive_read_consume(a, ar->entry_padding) < 0)
  ------------------
  |  Branch (485:7): [True: 0, False: 3.24k]
  ------------------
  486|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  487|  3.24k|		ar->entry_padding = 0;
  488|  3.24k|		*buff = NULL;
  489|  3.24k|		*size = 0;
  490|  3.24k|		*offset = ar->entry_offset;
  491|  3.24k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  3.24k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  492|  3.24k|	}
  493|  4.39k|}
archive_read_support_format_ar.c:archive_read_format_ar_skip:
  497|  2.09k|{
  498|  2.09k|	struct ar *ar = a->format->data;
  499|       |
  500|  2.09k|	if (__archive_read_consume(a,
  ------------------
  |  Branch (500:6): [True: 0, False: 2.09k]
  ------------------
  501|  2.09k|	    ar->entry_bytes_remaining + ar->entry_padding +
  502|  2.09k|	    ar->entry_bytes_unconsumed) < 0)
  503|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  504|       |
  505|  2.09k|	ar->entry_bytes_remaining = 0;
  506|  2.09k|	ar->entry_bytes_unconsumed = 0;
  507|  2.09k|	ar->entry_padding = 0;
  508|       |
  509|  2.09k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.09k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  510|  2.09k|}

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

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

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

archive_read_support_format_iso9660:
  457|  3.66k|{
  458|  3.66k|	struct archive_read *a = (struct archive_read *)_a;
  459|  3.66k|	struct iso9660 *iso9660;
  460|  3.66k|	int r;
  461|       |
  462|  3.66k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  3.66k|	do { \
  |  |  180|  3.66k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  3.66k|			(allowed_states), (function_name)); \
  |  |  182|  3.66k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  3.66k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 3.66k]
  |  |  ------------------
  |  |  183|  3.66k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  3.66k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 3.66k]
  |  |  ------------------
  ------------------
  463|  3.66k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  464|       |
  465|  3.66k|	iso9660 = calloc(1, sizeof(*iso9660));
  466|  3.66k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (466:6): [True: 0, False: 3.66k]
  ------------------
  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|  3.66k|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  324|  3.66k|#define ISO9660_MAGIC   0x96609660
  ------------------
  471|  3.66k|	iso9660->cache_files.first = NULL;
  472|  3.66k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  473|  3.66k|	iso9660->re_files.first = NULL;
  474|  3.66k|	iso9660->re_files.last = &(iso9660->re_files.first);
  475|       |	/* Enable to support Joliet extensions by default.	*/
  476|  3.66k|	iso9660->opt_support_joliet = 1;
  477|       |	/* Enable to support Rock Ridge extensions by default.	*/
  478|  3.66k|	iso9660->opt_support_rockridge = 1;
  479|       |
  480|  3.66k|	r = __archive_read_register_format(a,
  481|  3.66k|	    iso9660,
  482|  3.66k|	    "iso9660",
  483|  3.66k|	    archive_read_format_iso9660_bid,
  484|  3.66k|	    archive_read_format_iso9660_options,
  485|  3.66k|	    archive_read_format_iso9660_read_header,
  486|  3.66k|	    archive_read_format_iso9660_read_data,
  487|  3.66k|	    archive_read_format_iso9660_read_data_skip,
  488|  3.66k|	    NULL,
  489|  3.66k|	    archive_read_format_iso9660_cleanup,
  490|  3.66k|	    NULL,
  491|  3.66k|	    NULL);
  492|       |
  493|  3.66k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  3.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (493:6): [True: 0, False: 3.66k]
  ------------------
  494|      0|		free(iso9660);
  495|  3.66k|	return (r);
  496|  3.66k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  501|  3.59k|{
  502|  3.59k|	struct iso9660 *iso9660 = a->format->data;
  503|  3.59k|	ssize_t bytes_read;
  504|  3.59k|	const unsigned char *h;
  505|  3.59k|	int seenTerminator;
  506|       |
  507|       |	/* If there's already a better bid than we can ever
  508|       |	   make, don't bother testing. */
  509|  3.59k|	if (best_bid > 48)
  ------------------
  |  Branch (509:6): [True: 1.65k, False: 1.94k]
  ------------------
  510|  1.65k|		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|  1.94k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  518|  1.94k|	h = __archive_read_ahead(a,
  519|  1.94k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  517|  1.94k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|  1.94k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  1.94k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   82|  1.94k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  520|  1.94k|	    &bytes_read);
  521|  1.94k|	if (h == NULL)
  ------------------
  |  Branch (521:6): [True: 1.46k, False: 478]
  ------------------
  522|  1.46k|	    return (-1);
  523|       |
  524|       |	/* Skip the reserved area. */
  525|    478|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  517|    478|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    478|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    478|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  526|    478|	h += RESERVED_AREA;
  ------------------
  |  |  517|    478|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    478|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    478|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  527|       |
  528|       |	/* Check each volume descriptor. */
  529|    478|	seenTerminator = 0;
  530|    749|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   82|    749|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (530:9): [True: 749, False: 0]
  ------------------
  531|    749|	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    271|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    271|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  532|       |		/* Do not handle undefined Volume Descriptor Type. */
  533|    749|		if (h[0] >= 4 && h[0] <= 254)
  ------------------
  |  Branch (533:7): [True: 368, False: 381]
  |  Branch (533:20): [True: 213, False: 155]
  ------------------
  534|    213|			return (0);
  535|       |		/* Standard Identifier must be "CD001" */
  536|    536|		if (memcmp(h + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (536:7): [True: 73, False: 463]
  ------------------
  537|     73|			return (0);
  538|    463|		if (isPVD(iso9660, h))
  ------------------
  |  Branch (538:7): [True: 162, False: 301]
  ------------------
  539|    162|			continue;
  540|    301|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (540:7): [True: 271, False: 30]
  ------------------
  541|    271|			if (isJolietSVD(iso9660, h))
  ------------------
  |  Branch (541:8): [True: 33, False: 238]
  ------------------
  542|     33|				continue;
  543|    271|		}
  544|    268|		if (isBootRecord(h))
  ------------------
  |  Branch (544:7): [True: 9, False: 259]
  ------------------
  545|      9|			continue;
  546|    259|		if (isEVD(h))
  ------------------
  |  Branch (546:7): [True: 0, False: 259]
  ------------------
  547|      0|			continue;
  548|    259|		if (isSVD(h))
  ------------------
  |  Branch (548:7): [True: 67, False: 192]
  ------------------
  549|     67|			continue;
  550|    192|		if (isVolumePartition(iso9660, h))
  ------------------
  |  Branch (550:7): [True: 0, False: 192]
  ------------------
  551|      0|			continue;
  552|    192|		if (isVDSetTerminator(h)) {
  ------------------
  |  Branch (552:7): [True: 135, False: 57]
  ------------------
  553|    135|			seenTerminator = 1;
  554|    135|			break;
  555|    135|		}
  556|     57|		return (0);
  557|    192|	}
  558|       |	/*
  559|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  560|       |	 * Volume Descriptor Set Terminator.
  561|       |	 */
  562|    135|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (562:6): [True: 135, False: 0]
  |  Branch (562:24): [True: 134, False: 1]
  ------------------
  563|    134|		return (48);
  564|       |
  565|       |	/* We didn't find a valid PVD; return a bid of zero. */
  566|      1|	return (0);
  567|    135|}
archive_read_support_format_iso9660.c:isPVD:
  860|    463|{
  861|    463|	const unsigned char *p;
  862|    463|	ssize_t logical_block_size;
  863|    463|	int32_t volume_block;
  864|    463|	int32_t location;
  865|    463|	int i;
  866|       |
  867|       |	/* Type of the Primary Volume Descriptor must be 1. */
  868|    463|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   86|    463|#define PVD_type_offset 0
  ------------------
  |  Branch (868:6): [True: 271, False: 192]
  ------------------
  869|    271|		return (0);
  870|       |
  871|       |	/* PVD version must be 1. */
  872|    192|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   90|    192|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    192|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    192|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    192|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    192|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (872:6): [True: 0, False: 192]
  ------------------
  873|      0|		return (0);
  874|       |
  875|       |	/* Reserved field must be 0. */
  876|    192|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|    192|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    192|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    192|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    192|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    192|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|    192|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|    192|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (876:6): [True: 0, False: 192]
  ------------------
  877|      0|		return (0);
  878|       |
  879|       |	/* Reserved field must be 0. */
  880|    192|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    192|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    192|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    192|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    192|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    192|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    192|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    192|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    192|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    192|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    192|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    192|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    192|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|    192|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|    192|#define PVD_reserved2_size 8
  ------------------
  |  Branch (880:6): [True: 1, False: 191]
  ------------------
  881|      1|		return (0);
  882|       |
  883|       |	/* Volume space size must be encoded according to 7.3.3 */
  884|    191|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |  100|    191|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    191|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    191|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    191|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    191|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    191|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    191|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    191|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    191|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    191|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    191|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    191|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    191|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    191|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    191|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (884:6): [True: 3, False: 188]
  ------------------
  885|      3|		return (0);
  886|      3|	}
  887|    188|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|    188|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    188|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    188|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    188|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    188|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    188|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    188|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    188|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    188|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    188|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    188|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    188|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    188|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    188|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    188|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  888|    188|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    188|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (888:6): [True: 1, False: 187]
  ------------------
  889|      1|		return (0);
  890|       |
  891|       |	/* Reserved field must be 0. */
  892|    187|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    187|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    187|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    187|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    187|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    187|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    187|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    187|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    187|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    187|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    187|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    187|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    187|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    187|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    187|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    187|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    187|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|    187|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|    187|#define PVD_reserved3_size 32
  ------------------
  |  Branch (892:6): [True: 2, False: 185]
  ------------------
  893|      2|		return (0);
  894|       |
  895|       |	/* Volume set size must be encoded according to 7.2.3 */
  896|    185|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  104|    185|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    185|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    185|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    185|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    185|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    185|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    185|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    185|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    185|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    185|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    185|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    185|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    185|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    185|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    185|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    185|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    185|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    185|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  103|    185|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (896:6): [True: 2, False: 183]
  ------------------
  897|      2|		return (0);
  898|      2|	}
  899|       |
  900|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  901|    183|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  106|    183|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    183|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    183|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|    183|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|    183|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|    183|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    183|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    183|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    183|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    183|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    183|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    183|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    183|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    183|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    183|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    183|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    183|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    183|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    183|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    183|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  105|    183|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (901:6): [True: 2, False: 181]
  ------------------
  902|      2|		return (0);
  903|      2|	}
  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|    181|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  108|    181|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    181|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    181|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    181|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    181|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    181|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    181|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    181|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    181|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    181|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    181|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    181|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    181|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    181|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    181|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    181|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    181|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    181|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    181|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    181|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    181|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    181|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    181|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (908:6): [True: 2, False: 179]
  ------------------
  909|      2|		return (0);
  910|      2|	}
  911|    179|	logical_block_size =
  912|    179|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|    179|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    179|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    179|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    179|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    179|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    179|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    179|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    179|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    179|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    179|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    179|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    179|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    179|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    179|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    179|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    179|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    179|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    179|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    179|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    179|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    179|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    179|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    179|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  913|    179|	if (logical_block_size <= 0)
  ------------------
  |  Branch (913:6): [True: 1, False: 178]
  ------------------
  914|      1|		return (0);
  915|       |
  916|       |	/* Path Table size must be encoded according to 7.3.3 */
  917|    178|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  110|    178|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    178|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    178|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    178|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    178|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    178|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    178|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    178|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    178|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    178|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    178|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    178|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    178|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    178|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    178|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    178|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    178|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    178|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    178|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    178|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    178|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    178|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    178|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    178|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  109|    178|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (917:6): [True: 3, False: 175]
  ------------------
  918|      3|		return (0);
  919|      3|	}
  920|       |
  921|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  922|    175|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  144|    175|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    175|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    175|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    175|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    175|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    175|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    175|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    175|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    175|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    175|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    175|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    175|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    175|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    175|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    175|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    175|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    175|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    175|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    175|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    175|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    175|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    175|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    175|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    175|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    175|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    175|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    175|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    175|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    175|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    175|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    175|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    175|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    175|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    175|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    175|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    175|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    175|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    175|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    175|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    175|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    175|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    175|#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|    175|#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|    175|#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|    175|#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|    175|#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|    175|#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|    175|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    175|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    175|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    175|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    175|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    175|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    175|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    175|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    175|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    175|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    175|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|    175|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (922:6): [True: 1, False: 174]
  ------------------
  923|      1|		return (0);
  924|       |
  925|       |	/* Location of Occurrence of Type L Path Table must be
  926|       |	 * available location,
  927|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  928|    174|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|    174|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    174|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    174|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    174|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    174|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    174|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    174|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    174|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    174|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    174|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    174|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    174|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    174|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    174|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    174|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    174|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    174|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    174|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    174|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    174|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    174|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    174|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|    174|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|    174|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    174|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    174|#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|    174|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  929|    174|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    174|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (929:6): [True: 1, False: 173]
  |  Branch (929:40): [True: 1, False: 172]
  ------------------
  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|    172|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|    172|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|    172|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    172|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    172|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    172|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    172|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    172|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    172|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    172|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    172|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    172|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    172|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    172|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    172|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    172|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    172|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    172|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    172|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    172|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    172|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    172|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    172|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    172|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    172|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    172|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    172|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|    172|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|    172|#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|    172|#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|    172|#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|    172|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  938|    172|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    171|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (938:7): [True: 171, False: 1]
  |  Branch (938:23): [True: 1, False: 170]
  ------------------
  939|    171|	    || location >= volume_block)
  ------------------
  |  Branch (939:9): [True: 1, False: 170]
  ------------------
  940|      2|		return (0);
  941|       |
  942|       |	/* Reserved field must be 0. */
  943|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  944|    339|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  147|    339|#define PVD_reserved4_size 1
  ------------------
  |  Branch (944:14): [True: 170, False: 169]
  ------------------
  945|    170|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  146|    170|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    170|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    170|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    170|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    170|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    170|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    170|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    170|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    170|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    170|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    170|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    170|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    170|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    170|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    170|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    170|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    170|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    170|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    170|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    170|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    170|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    170|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    170|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    170|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    170|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    170|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    170|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    170|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    170|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    170|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    170|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    170|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    170|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    170|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    170|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    170|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    170|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    170|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    170|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    170|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    170|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    170|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    170|#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|    170|#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|    170|#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|    170|#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|    170|#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|    170|#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|    170|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    170|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    170|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    170|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    170|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    170|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    170|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    170|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|    170|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|    170|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|    170|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|    170|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|    170|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (945:7): [True: 64, False: 106]
  ------------------
  946|     64|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  146|     64|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     64|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     64|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     64|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     64|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     64|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     64|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     64|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     64|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     64|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     64|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     64|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     64|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     64|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     64|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     64|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     64|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     64|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     64|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     64|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     64|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     64|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     64|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     64|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     64|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     64|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     64|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     64|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     64|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     64|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     64|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     64|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     64|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     64|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     64|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     64|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     64|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     64|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     64|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     64|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     64|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     64|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     64|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     64|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     64|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     64|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     64|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     64|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     64|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     64|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     64|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     64|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     64|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     64|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     64|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     64|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     64|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     64|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     64|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     64|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     64|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (946:10): [True: 1, False: 63]
  ------------------
  947|      1|			return (0);
  948|       |
  949|       |	/* Reserved field must be 0. */
  950|    169|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    169|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    169|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    169|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    169|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    169|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    169|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    169|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    169|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    169|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    169|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    169|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    169|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    169|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    169|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    169|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    169|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    169|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    169|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    169|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    169|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    169|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    169|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    169|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    169|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    169|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    169|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    169|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    169|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    169|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    169|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    169|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    169|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    169|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    169|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    169|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    169|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    169|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    169|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    169|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    169|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    169|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    169|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    169|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    169|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    169|#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|    169|#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|    169|#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|    169|#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|    169|#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|    169|#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|    169|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    169|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    169|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    169|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    169|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    169|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    169|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    169|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    169|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    169|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    169|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    169|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    169|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    169|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|    169|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|    169|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|    169|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    169|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    169|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    169|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    169|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    169|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    169|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    169|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    169|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    169|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    169|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    169|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    169|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    169|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    169|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    169|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    169|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    169|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    169|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    169|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    169|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    169|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    169|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    169|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    169|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    169|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    169|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    169|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    169|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    169|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    169|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    169|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    169|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    169|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    169|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    169|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    169|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    169|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    169|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    169|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    169|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    169|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    169|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    169|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    169|#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|    169|#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|    169|#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|    169|#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|    169|#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|    169|#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|    169|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    169|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    169|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    169|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    169|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    169|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    169|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    169|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    169|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    169|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|    169|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|    169|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|    169|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|    169|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|    169|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (950:6): [True: 1, False: 168]
  ------------------
  951|      1|		return (0);
  952|       |
  953|       |	/* XXX TODO: Check other values for sanity; reject more
  954|       |	 * malformed PVDs. XXX */
  955|       |
  956|       |	/* Read Root Directory Record in Volume Descriptor. */
  957|    168|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|    168|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|    168|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    168|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|    168|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    168|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    168|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    168|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    168|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    168|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    168|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    168|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    168|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    168|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    168|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    168|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    168|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    168|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    168|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    168|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    168|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    168|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    168|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    168|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    168|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    168|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    168|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    168|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    168|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    168|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    168|#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|    168|#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|    168|#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|    168|#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|    168|#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|    168|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  958|    168|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (958:6): [True: 6, False: 162]
  ------------------
  959|      6|		return (0);
  960|      6|	}
  961|       |
  962|    162|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (962:6): [True: 161, False: 1]
  ------------------
  963|    161|		iso9660->logical_block_size = logical_block_size;
  964|    161|		iso9660->volume_block = volume_block;
  965|    161|		iso9660->volume_size =
  966|    161|		    logical_block_size * (uint64_t)volume_block;
  967|    161|		iso9660->primary.location =
  968|    161|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|    161|#define DR_extent_offset 2
  ------------------
  969|    161|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|    161|#define DR_size_offset 10
  ------------------
  970|    161|	}
  971|       |
  972|    162|	return (48);
  973|    168|}
archive_read_support_format_iso9660.c:isNull:
  599|  1.27k|{
  600|  1.27k|	if (bytes == 0)
  ------------------
  |  Branch (600:6): [True: 0, False: 1.27k]
  ------------------
  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.27k|	return (h[offset] == 0 &&
  ------------------
  |  Branch (607:10): [True: 1.27k, False: 7]
  ------------------
  608|  1.27k|	    (bytes == 1 ||
  ------------------
  |  Branch (608:7): [True: 195, False: 1.07k]
  ------------------
  609|  1.07k|	    memcmp(h + offset, h + offset + 1, bytes - 1) == 0));
  ------------------
  |  Branch (609:6): [True: 1.06k, False: 12]
  ------------------
  610|  1.27k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3242|  1.06k|{
 3243|  1.06k|	return (p[0] == p[7]
  ------------------
  |  Branch (3243:10): [True: 1.05k, False: 5]
  ------------------
 3244|  1.05k|		&& p[1] == p[6]
  ------------------
  |  Branch (3244:6): [True: 1.05k, False: 5]
  ------------------
 3245|  1.05k|		&& p[2] == p[5]
  ------------------
  |  Branch (3245:6): [True: 1.04k, False: 6]
  ------------------
 3246|  1.04k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3246:6): [True: 1.04k, False: 4]
  ------------------
 3247|  1.06k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3236|    884|isValid723Integer(const unsigned char *p) {
 3237|    884|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3237:10): [True: 881, False: 3]
  |  Branch (3237:26): [True: 876, False: 5]
  ------------------
 3238|    884|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  976|    349|isRootDirectoryRecord(const unsigned char *p) {
  977|    349|	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|    349|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    349|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    349|#define DR_length_offset 0
  ------------------
  |  Branch (981:6): [True: 0, False: 349]
  |  Branch (981:34): [True: 0, False: 349]
  ------------------
  982|      0|		return (0);
  983|      0|	}
  984|       |
  985|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
  986|    349|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  200|    349|#define DR_extent_offset 2
  ------------------
  |  Branch (986:6): [True: 3, False: 346]
  ------------------
  987|      3|		return (0);
  988|      3|	}
  989|       |
  990|       |	/* The root directory size must be a 7.3.3 integer. */
  991|    346|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  202|    346|#define DR_size_offset 10
  ------------------
  |  Branch (991:6): [True: 11, False: 335]
  ------------------
  992|     11|		return (0);
  993|     11|	}
  994|       |
  995|       |	/* According to the standard, certain bits must be one or zero:
  996|       |	 * Bit 1: must be 1 (this is a directory)
  997|       |	 * Bit 2: must be 0 (not an associated file)
  998|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
  999|       |	 * Bit 7: must be 0 (final directory record for this file)
 1000|       |	 */
 1001|    335|	flags = p[DR_flags_offset];
  ------------------
  |  |  206|    335|#define DR_flags_offset 25
  ------------------
 1002|    335|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1002:6): [True: 0, False: 335]
  ------------------
 1003|      0|		return (0);
 1004|      0|	}
 1005|       |
 1006|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1007|    335|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  212|    335|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1007:6): [True: 2, False: 333]
  ------------------
 1008|      2|		return (0);
 1009|      2|	}
 1010|       |
 1011|       |	/* Root directory name is a single zero byte... */
 1012|    333|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  214|    333|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  216|    333|#define DR_name_offset 33
  ------------------
  |  Branch (1012:6): [True: 0, False: 333]
  |  Branch (1012:36): [True: 4, False: 329]
  ------------------
 1013|      4|		return (0);
 1014|      4|	}
 1015|       |
 1016|       |	/* Nothing looked wrong, so let's accept it. */
 1017|    329|	return (1);
 1018|    333|}
archive_read_support_format_iso9660.c:isJolietSVD:
  674|    271|{
  675|    271|	const unsigned char *p;
  676|    271|	ssize_t logical_block_size;
  677|    271|	int32_t volume_block;
  678|       |
  679|       |	/* Check if current sector is a kind of Supplementary Volume
  680|       |	 * Descriptor. */
  681|    271|	if (!isSVD(h))
  ------------------
  |  Branch (681:6): [True: 171, False: 100]
  ------------------
  682|    171|		return (0);
  683|       |
  684|       |	/* FIXME: do more validations according to joliet spec. */
  685|       |
  686|       |	/* check if this SVD contains joliet extension! */
  687|    100|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  173|    100|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|    100|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  172|    100|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  688|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  689|    100|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (689:6): [True: 92, False: 8]
  |  Branch (689:21): [True: 42, False: 50]
  ------------------
  690|     42|		int level = 0;
  691|       |
  692|     42|		if (p[2] == '@')
  ------------------
  |  Branch (692:7): [True: 12, False: 30]
  ------------------
  693|     12|			level = 1;
  694|     30|		else if (p[2] == 'C')
  ------------------
  |  Branch (694:12): [True: 1, False: 29]
  ------------------
  695|      1|			level = 2;
  696|     29|		else if (p[2] == 'E')
  ------------------
  |  Branch (696:12): [True: 20, False: 9]
  ------------------
  697|     20|			level = 3;
  698|      9|		else /* not joliet */
  699|      9|			return (0);
  700|       |
  701|     33|		iso9660->seenJoliet = level;
  702|       |
  703|     33|	} else /* not joliet */
  704|     58|		return (0);
  705|       |
  706|     33|	logical_block_size =
  707|     33|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|     33|#define SVD_logical_block_size_offset 128
  ------------------
  708|     33|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|     33|#define SVD_volume_space_size_offset 80
  ------------------
  709|       |
  710|     33|	iso9660->logical_block_size = logical_block_size;
  711|     33|	iso9660->volume_block = volume_block;
  712|     33|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  713|       |	/* Read Root Directory Record in Volume Descriptor. */
  714|     33|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|     33|#define SVD_root_directory_record_offset 156
  ------------------
  715|     33|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|     33|#define DR_extent_offset 2
  ------------------
  716|     33|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|     33|#define DR_size_offset 10
  ------------------
  717|       |
  718|     33|	return (48);
  719|    100|}
archive_read_support_format_iso9660.c:isBootRecord:
  614|    268|{
  615|       |
  616|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  617|    268|	if (h[0] != 0)
  ------------------
  |  Branch (617:6): [True: 259, False: 9]
  ------------------
  618|    259|		return (0);
  619|       |
  620|       |	/* Volume Descriptor Version must be 1. */
  621|      9|	if (h[6] != 1)
  ------------------
  |  Branch (621:6): [True: 0, False: 9]
  ------------------
  622|      0|		return (0);
  623|       |
  624|      9|	return (1);
  625|      9|}
archive_read_support_format_iso9660.c:isEVD:
  782|    259|{
  783|    259|	const unsigned char *p;
  784|    259|	ssize_t logical_block_size;
  785|    259|	int32_t volume_block;
  786|    259|	int32_t location;
  787|       |
  788|       |
  789|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  790|    259|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   86|    259|#define PVD_type_offset 0
  ------------------
  |  Branch (790:6): [True: 171, False: 88]
  ------------------
  791|    171|		return (0);
  792|       |
  793|       |	/* EVD version must be 2. */
  794|     88|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   90|     88|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|     88|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|     88|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|     88|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|     88|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (794:6): [True: 88, False: 0]
  ------------------
  795|     88|		return (0);
  796|       |
  797|       |	/* Reserved field must be 0. */
  798|      0|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (798:6): [True: 0, False: 0]
  ------------------
  799|      0|		return (0);
  800|       |
  801|       |	/* Reserved field must be 0. */
  802|      0|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|      0|#define PVD_reserved2_size 8
  ------------------
  |  Branch (802:6): [True: 0, False: 0]
  ------------------
  803|      0|		return (0);
  804|       |
  805|       |	/* Reserved field must be 0. */
  806|      0|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|      0|#define PVD_reserved3_size 32
  ------------------
  |  Branch (806:6): [True: 0, False: 0]
  ------------------
  807|      0|		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|      0|	logical_block_size =
  813|      0|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  814|      0|	if (logical_block_size <= 0)
  ------------------
  |  Branch (814:6): [True: 0, False: 0]
  ------------------
  815|      0|		return (0);
  816|       |
  817|      0|	volume_block =
  818|      0|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  819|      0|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (819:6): [True: 0, False: 0]
  ------------------
  820|      0|		return (0);
  821|       |
  822|       |	/* File structure version must be 2 for ISO9660:1999. */
  823|      0|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (823:6): [True: 0, False: 0]
  ------------------
  824|      0|		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|      0|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  830|      0|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (830:6): [True: 0, False: 0]
  |  Branch (830:40): [True: 0, False: 0]
  ------------------
  831|      0|		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|      0|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  837|      0|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (837:7): [True: 0, False: 0]
  |  Branch (837:23): [True: 0, False: 0]
  ------------------
  838|      0|	    || location >= volume_block)
  ------------------
  |  Branch (838:9): [True: 0, False: 0]
  ------------------
  839|      0|		return (0);
  840|       |
  841|       |	/* Reserved field must be 0. */
  842|      0|	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  147|      0|#define PVD_reserved4_size 1
  ------------------
  |  Branch (842:6): [True: 0, False: 0]
  ------------------
  843|      0|		return (0);
  844|       |
  845|       |	/* Reserved field must be 0. */
  846|      0|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|      0|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (846:6): [True: 0, False: 0]
  ------------------
  847|      0|		return (0);
  848|       |
  849|       |	/* Read Root Directory Record in Volume Descriptor. */
  850|      0|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  851|      0|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (851:6): [True: 0, False: 0]
  ------------------
  852|      0|		return (0);
  853|      0|	}
  854|       |
  855|      0|	return (48);
  856|      0|}
archive_read_support_format_iso9660.c:isSVD:
  723|    530|{
  724|    530|	const unsigned char *p;
  725|    530|	ssize_t logical_block_size;
  726|    530|	int32_t volume_block;
  727|    530|	int32_t location;
  728|       |
  729|       |
  730|       |	/* Type 2 means it's a SVD. */
  731|    530|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  162|    530|#define SVD_type_offset 0
  ------------------
  |  Branch (731:6): [True: 332, False: 198]
  ------------------
  732|    332|		return (0);
  733|       |
  734|       |	/* Reserved field must be 0. */
  735|    198|	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    198|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  170|    198|#define SVD_reserved1_size	8
  ------------------
  |  Branch (735:6): [True: 2, False: 196]
  ------------------
  736|      2|		return (0);
  737|    196|	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    196|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  185|    196|#define SVD_reserved2_size	1
  ------------------
  |  Branch (737:6): [True: 1, False: 195]
  ------------------
  738|      1|		return (0);
  739|    195|	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    195|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  187|    195|#define SVD_reserved3_size	653
  ------------------
  |  Branch (739:6): [True: 6, False: 189]
  ------------------
  740|      6|		return (0);
  741|       |
  742|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  743|    189|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  183|    189|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (743:6): [True: 1, False: 188]
  ------------------
  744|      1|		return (0);
  745|       |
  746|    188|	logical_block_size =
  747|    188|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|    188|#define SVD_logical_block_size_offset 128
  ------------------
  748|    188|	if (logical_block_size <= 0)
  ------------------
  |  Branch (748:6): [True: 1, False: 187]
  ------------------
  749|      1|		return (0);
  750|       |
  751|    187|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|    187|#define SVD_volume_space_size_offset 80
  ------------------
  752|    187|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    187|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (752:6): [True: 1, False: 186]
  ------------------
  753|      1|		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|    186|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  178|    186|#define SVD_type_L_path_table_offset 140
  ------------------
  759|    186|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    186|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (759:6): [True: 3, False: 183]
  |  Branch (759:40): [True: 1, False: 182]
  ------------------
  760|      4|		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|    182|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  179|    182|#define SVD_type_M_path_table_offset 148
  ------------------
  767|    182|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    181|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (767:7): [True: 181, False: 1]
  |  Branch (767:23): [True: 0, False: 181]
  ------------------
  768|    182|	    || location >= volume_block)
  ------------------
  |  Branch (768:9): [True: 1, False: 181]
  ------------------
  769|      1|		return (0);
  770|       |
  771|       |	/* Read Root Directory Record in Volume Descriptor. */
  772|    181|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|    181|#define SVD_root_directory_record_offset 156
  ------------------
  773|    181|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (773:6): [True: 14, False: 167]
  ------------------
  774|     14|		return (0);
  775|     14|	}
  776|       |
  777|    167|	return (48);
  778|    181|}
archive_read_support_format_iso9660.c:isVolumePartition:
  629|    192|{
  630|    192|	int32_t location;
  631|       |
  632|       |	/* Type of the Volume Partition Descriptor must be 3. */
  633|    192|	if (h[0] != 3)
  ------------------
  |  Branch (633:6): [True: 192, False: 0]
  ------------------
  634|    192|		return (0);
  635|       |
  636|       |	/* Volume Descriptor Version must be 1. */
  637|      0|	if (h[6] != 1)
  ------------------
  |  Branch (637:6): [True: 0, False: 0]
  ------------------
  638|      0|		return (0);
  639|       |	/* Unused Field */
  640|      0|	if (h[7] != 0)
  ------------------
  |  Branch (640:6): [True: 0, False: 0]
  ------------------
  641|      0|		return (0);
  642|       |
  643|      0|	location = archive_le32dec(h + 72);
  644|      0|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (644:6): [True: 0, False: 0]
  ------------------
  645|      0|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (645:6): [True: 0, False: 0]
  ------------------
  646|      0|		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|    192|{
  656|       |
  657|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  658|    192|	if (h[0] != 255)
  ------------------
  |  Branch (658:6): [True: 51, False: 141]
  ------------------
  659|     51|		return (0);
  660|       |
  661|       |	/* Volume Descriptor Version must be 1. */
  662|    141|	if (h[6] != 1)
  ------------------
  |  Branch (662:6): [True: 0, False: 141]
  ------------------
  663|      0|		return (0);
  664|       |
  665|       |	/* Reserved field must be 0. */
  666|    141|	if (!isNull(h, 7, 2048-7))
  ------------------
  |  Branch (666:6): [True: 6, False: 135]
  ------------------
  667|      6|		return (0);
  668|       |
  669|    135|	return (1);
  670|    141|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1234|    720|{
 1235|    720|	struct iso9660 *iso9660 = a->format->data;
 1236|    720|	struct file_info *file;
 1237|    720|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  233|    720|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1238|       |
 1239|    720|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1239:6): [True: 134, False: 586]
  ------------------
 1240|    134|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  372|    134|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1241|    134|		a->archive.archive_format_name = "ISO9660";
 1242|    134|	}
 1243|       |
 1244|    720|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1244:6): [True: 134, False: 586]
  ------------------
 1245|    134|		r = choose_volume(a, iso9660);
 1246|    134|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    134|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1246:7): [True: 16, False: 118]
  ------------------
 1247|     16|			return (r);
 1248|    134|	}
 1249|       |
 1250|    704|	file = NULL;/* Eliminate a warning. */
 1251|       |	/* Get the next entry that appears after the current offset. */
 1252|    704|	r = next_entry_seek(a, iso9660, &file);
 1253|    704|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    704|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1253:6): [True: 164, False: 540]
  ------------------
 1254|    164|		return (r);
 1255|       |
 1256|    540|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1256:6): [True: 11, False: 529]
  ------------------
 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|    529|	} else {
 1315|    529|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1316|    529|		if (path == NULL) {
  ------------------
  |  Branch (1316:7): [True: 0, False: 529]
  ------------------
 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|    529|		} else {
 1322|    529|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    529|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1323|    529|			archive_entry_set_pathname(entry, path);
 1324|    529|		}
 1325|    529|	}
 1326|       |
 1327|    540|	iso9660->entry_bytes_remaining = file->size;
 1328|       |	/* Offset for sparse-file-aware clients. */
 1329|    540|	iso9660->entry_sparse_offset = 0;
 1330|       |
 1331|    540|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1331:6): [True: 70, False: 470]
  ------------------
 1332|     70|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     70|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1333|     70|		    "File is beyond end-of-media: %s",
 1334|     70|		    archive_entry_pathname(entry));
 1335|     70|		iso9660->entry_bytes_remaining = 0;
 1336|     70|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     70|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1337|     70|	}
 1338|       |
 1339|       |	/* Set up the entry structure with information about this entry. */
 1340|    470|	archive_entry_set_mode(entry, file->mode);
 1341|    470|	archive_entry_set_uid(entry, file->uid);
 1342|    470|	archive_entry_set_gid(entry, file->gid);
 1343|    470|	archive_entry_set_nlink(entry, file->nlinks);
 1344|    470|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  311|    470|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1344:6): [True: 1, False: 469]
  ------------------
 1345|      1|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1346|    469|	else
 1347|    469|		archive_entry_unset_birthtime(entry);
 1348|    470|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  312|    470|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1348:6): [True: 214, False: 256]
  ------------------
 1349|    214|		archive_entry_set_mtime(entry, file->mtime, 0);
 1350|    256|	else
 1351|    256|		archive_entry_unset_mtime(entry);
 1352|    470|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  314|    470|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1352:6): [True: 215, False: 255]
  ------------------
 1353|    215|		archive_entry_set_ctime(entry, file->ctime, 0);
 1354|    255|	else
 1355|    255|		archive_entry_unset_ctime(entry);
 1356|    470|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  313|    470|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1356:6): [True: 214, False: 256]
  ------------------
 1357|    214|		archive_entry_set_atime(entry, file->atime, 0);
 1358|    256|	else
 1359|    256|		archive_entry_unset_atime(entry);
 1360|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1361|    470|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1362|    470|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1363|    470|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1363:6): [True: 0, False: 470]
  ------------------
 1364|      0|		archive_entry_copy_symlink(entry, file->symlink.s);
 1365|       |
 1366|       |	/* Note: If the input isn't seekable, we can't rewind to
 1367|       |	 * return the same body again, so if the next entry refers to
 1368|       |	 * the same data, we have to return it as a hardlink to the
 1369|       |	 * original entry. */
 1370|    470|	if (file->number != -1 &&
  ------------------
  |  Branch (1370:6): [True: 347, False: 123]
  ------------------
 1371|    347|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1371:6): [True: 58, False: 289]
  ------------------
 1372|     58|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1372:7): [True: 1, False: 57]
  ------------------
 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|     57|			archive_entry_set_hardlink(entry,
 1393|     57|			    iso9660->previous_pathname.s);
 1394|     58|		archive_entry_unset_size(entry);
 1395|     58|		iso9660->entry_bytes_remaining = 0;
 1396|     58|		return (rd_r);
 1397|     58|	}
 1398|       |
 1399|    412|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  215|    412|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  221|    824|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1399:6): [True: 264, False: 148]
  ------------------
 1400|    264|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1400:6): [True: 78, False: 186]
  ------------------
 1401|     78|		int64_t r64;
 1402|       |
 1403|     78|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1404|     78|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1404:7): [True: 0, False: 78]
  ------------------
 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|     78|		iso9660->current_position = (uint64_t)r64;
 1423|     78|	}
 1424|       |
 1425|       |	/* Initialize zisofs variables. */
 1426|    412|	iso9660->entry_zisofs.pz = file->pz;
 1427|    412|	if (file->pz) {
  ------------------
  |  Branch (1427:6): [True: 0, False: 412]
  ------------------
 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|    412|	iso9660->previous_number = file->number;
 1444|    412|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1444:6): [True: 10, False: 402]
  ------------------
 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|    412|		archive_strcpy(
  ------------------
  |  |  165|    402|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    804|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 402]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1450|    412|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1451|       |
 1452|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1453|    412|	iso9660->entry_content = file->contents.first;
 1454|    412|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1454:6): [True: 26, False: 386]
  ------------------
 1455|     26|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1456|       |
 1457|    412|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    412|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1457:6): [True: 148, False: 264]
  ------------------
 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|    412|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  233|    412|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1465:6): [True: 3, False: 409]
  ------------------
 1466|      3|		return (rd_r);
 1467|    409|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    409|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1468|    412|}
archive_read_support_format_iso9660.c:choose_volume:
 1145|    134|{
 1146|    134|	struct file_info *file;
 1147|    134|	int64_t skipsize;
 1148|    134|	struct vd *vd;
 1149|    134|	const void *block;
 1150|    134|	char seenJoliet;
 1151|       |
 1152|    134|	vd = &(iso9660->primary);
 1153|    134|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1153:6): [True: 0, False: 134]
  ------------------
 1154|      0|		iso9660->seenJoliet = 0;
 1155|    134|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1155:6): [True: 19, False: 115]
  ------------------
 1156|     19|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1156:3): [True: 2, False: 17]
  ------------------
 1157|       |		/* This condition is unlikely; by way of caution. */
 1158|      2|		vd = &(iso9660->joliet);
 1159|       |
 1160|    134|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|    134|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1161|    134|	skipsize = __archive_read_consume(a, skipsize);
 1162|    134|	if (skipsize < 0)
  ------------------
  |  Branch (1162:6): [True: 2, False: 132]
  ------------------
 1163|      2|		return ((int)skipsize);
 1164|    132|	iso9660->current_position = skipsize;
 1165|       |
 1166|    132|	block = __archive_read_ahead(a, vd->size, NULL);
 1167|    132|	if (block == NULL) {
  ------------------
  |  Branch (1167:6): [True: 1, False: 131]
  ------------------
 1168|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1169|      1|		    "Failed to read full block when scanning "
 1170|      1|		    "ISO9660 directory list");
 1171|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1172|      1|	}
 1173|       |
 1174|       |	/*
 1175|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1176|       |	 * avoid converting special name 0x00(Current Directory) and
 1177|       |	 * next byte to UCS2.
 1178|       |	 */
 1179|    131|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1180|    131|	iso9660->seenJoliet = 0;
 1181|    131|	file = parse_file_info(a, NULL, block, vd->size);
 1182|    131|	if (file == NULL)
  ------------------
  |  Branch (1182:6): [True: 9, False: 122]
  ------------------
 1183|      9|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1184|    122|	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|    122|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1190:6): [True: 121, False: 1]
  |  Branch (1190:35): [True: 29, False: 92]
  ------------------
 1191|     29|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1191:9): [True: 0, False: 29]
  ------------------
 1192|      0|		iso9660->seenJoliet = 0;
 1193|       |
 1194|    122|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1194:6): [True: 121, False: 1]
  |  Branch (1194:35): [True: 92, False: 29]
  ------------------
 1195|     92|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1195:9): [True: 17, False: 75]
  ------------------
 1196|       |		/* Switch reading data from primary to joliet. */
 1197|     17|		vd = &(iso9660->joliet);
 1198|     17|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|     17|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1199|     17|		skipsize -= iso9660->current_position;
 1200|     17|		skipsize = __archive_read_consume(a, skipsize);
 1201|     17|		if (skipsize < 0)
  ------------------
  |  Branch (1201:7): [True: 2, False: 15]
  ------------------
 1202|      2|			return ((int)skipsize);
 1203|     15|		iso9660->current_position += skipsize;
 1204|       |
 1205|     15|		block = __archive_read_ahead(a, vd->size, NULL);
 1206|     15|		if (block == NULL) {
  ------------------
  |  Branch (1206:7): [True: 1, False: 14]
  ------------------
 1207|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1208|      1|			    "Failed to read full block when scanning "
 1209|      1|			    "ISO9660 directory list");
 1210|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1211|      1|		}
 1212|     14|		iso9660->seenJoliet = 0;
 1213|     14|		file = parse_file_info(a, NULL, block, vd->size);
 1214|     14|		if (file == NULL)
  ------------------
  |  Branch (1214:7): [True: 1, False: 13]
  ------------------
 1215|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1216|     13|		iso9660->seenJoliet = seenJoliet;
 1217|     13|	}
 1218|       |
 1219|       |	/* Store the root directory in the pending list. */
 1220|    118|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  451|    118|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  233|    118|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1220:6): [True: 0, False: 118]
  ------------------
 1221|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1222|    118|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1222:6): [True: 29, False: 89]
  ------------------
 1223|     29|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  373|     29|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  372|     29|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1224|     29|		a->archive.archive_format_name =
 1225|     29|		    "ISO9660 with Rockridge extensions";
 1226|     29|	}
 1227|       |
 1228|    118|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    118|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1229|    118|}
archive_read_support_format_iso9660.c:parse_file_info:
 1821|    893|{
 1822|    893|	struct iso9660 *iso9660 = a->format->data;
 1823|    893|	struct file_info *file, *filep;
 1824|    893|	size_t name_len;
 1825|    893|	const unsigned char *rr_start, *rr_end;
 1826|    893|	const unsigned char *p;
 1827|    893|	size_t dr_len = 0;
 1828|    893|	uint64_t fsize, offset;
 1829|    893|	int32_t location;
 1830|    893|	int flags;
 1831|       |
 1832|    893|	if (reclen != 0)
  ------------------
  |  Branch (1832:6): [True: 892, False: 1]
  ------------------
 1833|    892|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  196|    892|#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|    893|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1838:6): [True: 1, False: 892]
  |  Branch (1838:21): [True: 0, False: 892]
  |  Branch (1838:40): [True: 10, False: 882]
  ------------------
 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|    882|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  214|    882|#define DR_name_len_offset 32
  ------------------
 1844|    882|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  200|    882|#define DR_extent_offset 2
  ------------------
 1845|    882|	fsize = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  202|    882|#define DR_size_offset 10
  ------------------
 1846|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1847|    882|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1847:6): [True: 3, False: 879]
  |  Branch (1847:32): [True: 4, False: 875]
  ------------------
 1848|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1849|      7|		    "Invalid length of file identifier");
 1850|      7|		return (NULL);
 1851|      7|	}
 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|    875|	if (location > 0 &&
  ------------------
  |  Branch (1858:6): [True: 433, False: 442]
  ------------------
 1859|    433|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1859:6): [True: 2, False: 431]
  ------------------
 1860|    433|	       / iso9660->logical_block_size))
 1861|    433|			> (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|    873|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1868:6): [True: 551, False: 322]
  |  Branch (1868:20): [True: 2, False: 549]
  ------------------
 1869|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1870|      2|		    "Invalid location of extent of file");
 1871|      2|		return (NULL);
 1872|      2|	}
 1873|       |
 1874|       |	/* Sanity check that this entry does not create a cycle. */
 1875|    871|	offset = iso9660->logical_block_size * (uint64_t)location;
 1876|  1.79k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1876:23): [True: 921, False: 869]
  ------------------
 1877|    921|		if (filep->offset == offset) {
  ------------------
  |  Branch (1877:7): [True: 2, False: 919]
  ------------------
 1878|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1879|      2|			    "Directory structure contains loop");
 1880|      2|			return (NULL);
 1881|      2|		}
 1882|    921|	}
 1883|       |
 1884|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1885|    869|	file = calloc(1, sizeof(*file));
 1886|    869|	if (file == NULL) {
  ------------------
  |  Branch (1886:6): [True: 0, False: 869]
  ------------------
 1887|      0|		archive_set_error(&a->archive, ENOMEM,
 1888|      0|		    "No memory for file entry");
 1889|      0|		return (NULL);
 1890|      0|	}
 1891|    869|	file->parent = parent;
 1892|    869|	file->offset = offset;
 1893|    869|	file->size = fsize;
 1894|    869|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  204|    869|#define DR_date_offset 18
  ------------------
  |  Branch (1894:6): [True: 375, False: 494]
  ------------------
 1895|    375|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    375|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    375|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  314|    375|#define CTIME_IS_SET 8
  ------------------
 1896|    375|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  204|    375|#define DR_date_offset 18
  ------------------
 1897|    375|		file->ctime = file->atime = file->mtime;
 1898|    375|	}
 1899|    869|	file->rede_files.first = NULL;
 1900|    869|	file->rede_files.last = &(file->rede_files.first);
 1901|       |
 1902|    869|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  216|    869|#define DR_name_offset 33
  ------------------
 1903|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1904|       |	 * before fidgeting the name_len below. */
 1905|    869|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1905:29): [True: 229, False: 640]
  ------------------
 1906|    869|	rr_end = isodirrec + dr_len;
 1907|       |
 1908|    869|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1908:6): [True: 21, False: 848]
  ------------------
 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|    848|	} else {
 1945|       |		/* Chop off trailing ';1' from files. */
 1946|    848|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1946:7): [True: 670, False: 178]
  |  Branch (1946:23): [True: 339, False: 331]
  ------------------
 1947|    339|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1947:5): [True: 297, False: 42]
  ------------------
 1948|    297|			name_len -= 2;
 1949|       |		/* Chop off trailing '.' from filenames. */
 1950|    848|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1950:7): [True: 670, False: 178]
  |  Branch (1950:23): [True: 8, False: 662]
  ------------------
 1951|      8|			--name_len;
 1952|       |
 1953|    848|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    848|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1954|    848|	}
 1955|       |
 1956|    869|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  206|    869|#define DR_flags_offset 25
  ------------------
 1957|    869|	if (flags & 0x02)
  ------------------
  |  Branch (1957:6): [True: 387, False: 482]
  ------------------
 1958|    387|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    387|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1959|    482|	else
 1960|    482|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    482|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1961|    869|	if (flags & 0x80)
  ------------------
  |  Branch (1961:6): [True: 103, False: 766]
  ------------------
 1962|    103|		file->multi_extent = 1;
 1963|    766|	else
 1964|    766|		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|    869|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1974:6): [True: 322, False: 547]
  |  Branch (1974:25): [True: 221, False: 101]
  ------------------
 1975|       |		/* If file->size is zero, its location points wrong place,
 1976|       |		 * and so we should not use it for the file number.
 1977|       |		 * When the location has negative value, it can be used
 1978|       |		 * for the file number.
 1979|       |		 */
 1980|    221|		file->number = -1;
 1981|       |		/* Do not appear before any directory entries. */
 1982|    221|		file->offset = -1;
 1983|    221|	} else
 1984|    648|		file->number = (int64_t)(uint32_t)location;
 1985|       |
 1986|       |	/* Rockridge extensions overwrite information from above. */
 1987|    869|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (1987:6): [True: 125, False: 744]
  ------------------
 1988|    125|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (1988:7): [True: 125, False: 0]
  |  Branch (1988:25): [True: 42, False: 83]
  ------------------
 1989|     42|			p = rr_start;
 1990|     42|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (1990:8): [True: 39, False: 3]
  ------------------
 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|     39|				iso9660->suspOffset = p[6];
 2008|     39|				iso9660->seenSUSP = 1;
 2009|     39|				rr_start += 7;
 2010|     39|			}
 2011|     42|		}
 2012|    125|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2012:7): [True: 39, False: 86]
  ------------------
 2013|     39|			int r;
 2014|       |
 2015|     39|			file->name_continues = 0;
 2016|     39|			file->symlink_continues = 0;
 2017|     39|			rr_start += iso9660->suspOffset;
 2018|     39|			r = parse_rockridge(a, file, rr_start, rr_end);
 2019|     39|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2019:8): [True: 3, False: 36]
  ------------------
 2020|      3|				goto fail;
 2021|       |			/*
 2022|       |			 * A file size of symbolic link files in ISO images
 2023|       |			 * made by makefs is not zero and its location is
 2024|       |			 * the same as those of next regular file. That is
 2025|       |			 * the same as hard like file and it causes unexpected
 2026|       |			 * error.
 2027|       |			 */
 2028|     36|			if (file->size > 0 &&
  ------------------
  |  Branch (2028:8): [True: 1, False: 35]
  ------------------
 2029|      1|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|      1|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|      1|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2029:8): [True: 0, False: 1]
  ------------------
 2030|      0|				file->size = 0;
 2031|      0|				file->number = -1;
 2032|      0|				file->offset = -1;
 2033|      0|			}
 2034|     36|		} else
 2035|       |			/* If there isn't SUSP, disable parsing
 2036|       |			 * rock ridge extensions. */
 2037|     86|			iso9660->opt_support_rockridge = 0;
 2038|    125|	}
 2039|       |
 2040|    866|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2041|       |	/* Tell file's parent how many children that parent has. */
 2042|    866|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2042:6): [True: 731, False: 135]
  |  Branch (2042:24): [True: 292, False: 439]
  ------------------
 2043|    292|		parent->subdirs++;
 2044|       |
 2045|    866|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2045:6): [True: 29, False: 837]
  ------------------
 2046|     29|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2046:7): [True: 0, False: 29]
  |  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|     29|		} else if (file->re) {
  ------------------
  |  Branch (2056:14): [True: 0, False: 29]
  ------------------
 2057|       |			/*
 2058|       |			 * Sanity check: file's parent is rr_moved.
 2059|       |			 */
 2060|      0|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2060:8): [True: 0, False: 0]
  |  Branch (2060:26): [True: 0, False: 0]
  ------------------
 2061|      0|				archive_set_error(&a->archive,
 2062|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2063|      0|				    "Invalid Rockridge RE");
 2064|      0|				goto fail;
 2065|      0|			}
 2066|       |			/*
 2067|       |			 * Sanity check: file does not have "CL" extension.
 2068|       |			 */
 2069|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2069:8): [True: 0, False: 0]
  ------------------
 2070|      0|				archive_set_error(&a->archive,
 2071|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2072|      0|				    "Invalid Rockridge RE and CL");
 2073|      0|				goto fail;
 2074|      0|			}
 2075|       |			/*
 2076|       |			 * Sanity check: The file type must be a directory.
 2077|       |			 */
 2078|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2078:8): [True: 0, False: 0]
  ------------------
 2079|      0|				archive_set_error(&a->archive,
 2080|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2081|      0|				    "Invalid Rockridge RE");
 2082|      0|				goto fail;
 2083|      0|			}
 2084|     29|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2084:14): [True: 0, False: 29]
  |  Branch (2084:32): [True: 0, False: 0]
  ------------------
 2085|      0|			file->rr_moved_has_re_only = 0;
 2086|     29|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2086:12): [True: 0, False: 29]
  |  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|     29|		if (file->cl_offset) {
  ------------------
  |  Branch (2089:7): [True: 0, False: 29]
  ------------------
 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|     29|	}
 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|    866|	register_file(iso9660, file);
 2161|    866|	return (file);
 2162|      3|fail:
 2163|      3|	archive_string_free(&file->name);
 2164|      3|	free(file);
 2165|       |	return (NULL);
 2166|    866|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3251|    897|{
 3252|    897|	int year = v[0];
 3253|    897|	int month = v[1];
 3254|    897|	int day = v[2];
 3255|    897|	int hour = v[3];
 3256|    897|	int minute = v[4];
 3257|    897|	int second = v[5];
 3258|    897|	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|    897|	if (year == 0
  ------------------
  |  Branch (3262:6): [True: 330, False: 567]
  ------------------
 3263|    330|	    && month == 0
  ------------------
  |  Branch (3263:9): [True: 286, False: 44]
  ------------------
 3264|    286|	    && day == 0
  ------------------
  |  Branch (3264:9): [True: 269, False: 17]
  ------------------
 3265|    269|	    && hour == 0
  ------------------
  |  Branch (3265:9): [True: 264, False: 5]
  ------------------
 3266|    264|	    && minute == 0
  ------------------
  |  Branch (3266:9): [True: 256, False: 8]
  ------------------
 3267|    256|	    && second == 0
  ------------------
  |  Branch (3267:9): [True: 241, False: 15]
  ------------------
 3268|    241|	    && gmt_off == 0)
  ------------------
  |  Branch (3268:9): [True: 207, False: 34]
  ------------------
 3269|    207|		return 0;
 3270|       |	/*
 3271|       |	 * Sanity-test each individual field
 3272|       |	 */
 3273|       |	/* Year can have any value */
 3274|       |	/* Month must be 1-12 */
 3275|    690|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3275:6): [True: 94, False: 596]
  |  Branch (3275:19): [True: 58, False: 538]
  ------------------
 3276|    152|		return 0;
 3277|       |	/* Day must be 1-31 */
 3278|    538|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3278:6): [True: 63, False: 475]
  |  Branch (3278:17): [True: 43, False: 432]
  ------------------
 3279|    106|		return 0;
 3280|       |	/* Hour must be 0-23 */
 3281|    432|	if (hour > 23)
  ------------------
  |  Branch (3281:6): [True: 9, False: 423]
  ------------------
 3282|      9|		return 0;
 3283|       |	/* Minute must be 0-59 */
 3284|    423|	if (minute > 59)
  ------------------
  |  Branch (3284:6): [True: 17, False: 406]
  ------------------
 3285|     17|		return 0;
 3286|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3287|       |	/* BUT: we should probably allow for the time being in UTC, which
 3288|       |	   allows up to 61 seconds in a minute in certain cases */
 3289|    406|	if (second > 61)
  ------------------
  |  Branch (3289:6): [True: 14, False: 392]
  ------------------
 3290|     14|		return 0;
 3291|       |	/* Offset from GMT must be -48 to +52 */
 3292|    392|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3292:6): [True: 3, False: 389]
  |  Branch (3292:23): [True: 9, False: 380]
  ------------------
 3293|     12|		return 0;
 3294|       |
 3295|       |	/* All tests pass, this is OK */
 3296|    380|	return 1;
 3297|    392|}
archive_read_support_format_iso9660.c:isodate7:
 3301|    380|{
 3302|    380|	struct tm tm;
 3303|    380|	int offset;
 3304|    380|	time_t t;
 3305|       |
 3306|    380|	memset(&tm, 0, sizeof(tm));
 3307|    380|	tm.tm_year = v[0];
 3308|    380|	tm.tm_mon = v[1] - 1;
 3309|    380|	tm.tm_mday = v[2];
 3310|    380|	tm.tm_hour = v[3];
 3311|    380|	tm.tm_min = v[4];
 3312|    380|	tm.tm_sec = v[5];
 3313|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3314|    380|	offset = ((const signed char *)v)[6];
 3315|    380|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3315:6): [True: 380, False: 0]
  |  Branch (3315:22): [True: 377, False: 3]
  ------------------
 3316|    377|		tm.tm_hour -= offset / 4;
 3317|    377|		tm.tm_min -= (offset % 4) * 15;
 3318|    377|	}
 3319|    380|	t = time_from_tm(&tm);
 3320|    380|	if (t == (time_t)-1)
  ------------------
  |  Branch (3320:6): [True: 0, False: 380]
  ------------------
 3321|      0|		return ((time_t)0);
 3322|    380|	return (t);
 3323|    380|}
archive_read_support_format_iso9660.c:time_from_tm:
 3416|    380|{
 3417|       |#if HAVE__MKGMTIME
 3418|       |        return _mkgmtime(t);
 3419|       |#elif HAVE_TIMEGM
 3420|       |        /* Use platform timegm() if available. */
 3421|    380|        return (timegm(t));
 3422|       |#else
 3423|       |        /* Else use direct calculation using POSIX assumptions. */
 3424|       |        /* First, fix up tm_yday based on the year/month/day. */
 3425|       |        if (mktime(t) == (time_t)-1)
 3426|       |                return ((time_t)-1);
 3427|       |        /* Then we can compute timegm() from first principles. */
 3428|       |        return (t->tm_sec
 3429|       |            + t->tm_min * 60
 3430|       |            + t->tm_hour * 3600
 3431|       |            + t->tm_yday * 86400
 3432|       |            + (t->tm_year - 70) * 31536000
 3433|       |            + ((t->tm_year - 69) / 4) * 86400
 3434|       |            - ((t->tm_year - 1) / 100) * 86400
 3435|       |            + ((t->tm_year + 299) / 400) * 86400);
 3436|       |#endif
 3437|    380|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2171|     39|{
 2172|     39|	struct iso9660 *iso9660 = a->format->data;
 2173|     39|	int entry_seen = 0;
 2174|       |
 2175|     77|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2175:9): [True: 76, False: 1]
  ------------------
 2176|     76|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2176:9): [True: 50, False: 26]
  |  Branch (2176:24): [True: 44, False: 6]
  ------------------
 2177|     44|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2177:9): [True: 42, False: 2]
  |  Branch (2177:24): [True: 39, False: 3]
  ------------------
 2178|     39|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2178:9): [True: 39, False: 0]
  ------------------
 2179|     39|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2179:9): [True: 38, False: 1]
  ------------------
 2180|     38|		const unsigned char *data = p + 4;
 2181|     38|		int data_length = p[2] - 4;
 2182|     38|		int version = p[3];
 2183|       |
 2184|     38|		switch(p[0]) {
 2185|      2|		case 'C':
  ------------------
  |  Branch (2185:3): [True: 2, False: 36]
  ------------------
 2186|      2|			if (p[1] == 'E') {
  ------------------
  |  Branch (2186:8): [True: 0, False: 2]
  ------------------
 2187|      0|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 0]
  |  Branch (2187:25): [True: 0, False: 0]
  ------------------
 2188|       |					/*
 2189|       |					 * CE extension comprises:
 2190|       |					 *   8 byte sector containing extension
 2191|       |					 *   8 byte offset w/in above sector
 2192|       |					 *   8 byte length of continuation
 2193|       |					 */
 2194|      0|					int32_t location =
 2195|      0|					    archive_le32dec(data);
 2196|      0|					file->ce_offset =
 2197|      0|					    archive_le32dec(data+8);
 2198|      0|					file->ce_size =
 2199|      0|					    archive_le32dec(data+16);
 2200|      0|					if (register_CE(a, location, file)
  ------------------
  |  Branch (2200:10): [True: 0, False: 0]
  ------------------
 2201|      0|					    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2202|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2203|      0|				}
 2204|      0|			}
 2205|      2|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2205:13): [True: 0, False: 2]
  ------------------
 2206|      0|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2206:9): [True: 0, False: 0]
  |  Branch (2206:25): [True: 0, False: 0]
  ------------------
 2207|      0|					file->cl_offset = (uint64_t)
 2208|      0|					    iso9660->logical_block_size *
 2209|      0|					    (uint64_t)archive_le32dec(data);
 2210|      0|					iso9660->seenRockridge = 1;
 2211|      0|				}
 2212|      0|			}
 2213|      2|			break;
 2214|      2|		case 'N':
  ------------------
  |  Branch (2214:3): [True: 1, False: 37]
  ------------------
 2215|      1|			if (p[1] == 'M') {
  ------------------
  |  Branch (2215:8): [True: 0, False: 1]
  ------------------
 2216|      0|				if (version == 1) {
  ------------------
  |  Branch (2216:9): [True: 0, False: 0]
  ------------------
 2217|      0|					parse_rockridge_NM1(file,
 2218|      0|					    data, data_length);
 2219|      0|					iso9660->seenRockridge = 1;
 2220|      0|				}
 2221|      0|			}
 2222|      1|			break;
 2223|      1|		case 'P':
  ------------------
  |  Branch (2223:3): [True: 1, False: 37]
  ------------------
 2224|       |			/*
 2225|       |			 * PD extension is padding;
 2226|       |			 * contents are always ignored.
 2227|       |			 *
 2228|       |			 * PL extension won't appear;
 2229|       |			 * contents are always ignored.
 2230|       |			 */
 2231|      1|			if (p[1] == 'N') {
  ------------------
  |  Branch (2231:8): [True: 0, False: 1]
  ------------------
 2232|      0|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2232:9): [True: 0, False: 0]
  |  Branch (2232:25): [True: 0, False: 0]
  ------------------
 2233|      0|					file->rdev = archive_le32dec(data);
 2234|      0|					file->rdev <<= 32;
 2235|      0|					file->rdev |=
 2236|      0|					    archive_le32dec(data + 8);
 2237|      0|					iso9660->seenRockridge = 1;
 2238|      0|				}
 2239|      0|			}
 2240|      1|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2240:13): [True: 0, False: 1]
  ------------------
 2241|       |				/*
 2242|       |				 * PX extension comprises:
 2243|       |				 *   8 bytes for mode,
 2244|       |				 *   8 bytes for nlinks,
 2245|       |				 *   8 bytes for uid,
 2246|       |				 *   8 bytes for gid,
 2247|       |				 *   8 bytes for inode.
 2248|       |				 */
 2249|      0|				if (version == 1) {
  ------------------
  |  Branch (2249:9): [True: 0, False: 0]
  ------------------
 2250|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2250:10): [True: 0, False: 0]
  ------------------
 2251|      0|						file->mode = (__LA_MODE_T)
 2252|      0|						    archive_le32dec(data);
 2253|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2253:10): [True: 0, False: 0]
  ------------------
 2254|      0|						file->nlinks =
 2255|      0|						    archive_le32dec(data + 8);
 2256|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2256:10): [True: 0, False: 0]
  ------------------
 2257|      0|						file->uid =
 2258|      0|						    archive_le32dec(data + 16);
 2259|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2259:10): [True: 0, False: 0]
  ------------------
 2260|      0|						file->gid =
 2261|      0|						    archive_le32dec(data + 24);
 2262|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2262:10): [True: 0, False: 0]
  ------------------
 2263|      0|						file->number =
 2264|      0|						    archive_le32dec(data + 32);
 2265|      0|					iso9660->seenRockridge = 1;
 2266|      0|				}
 2267|      0|			}
 2268|      1|			break;
 2269|      1|		case 'R':
  ------------------
  |  Branch (2269:3): [True: 1, False: 37]
  ------------------
 2270|      1|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2270:8): [True: 0, False: 1]
  |  Branch (2270:23): [True: 0, False: 0]
  ------------------
 2271|      0|				file->re = 1;
 2272|      0|				iso9660->seenRockridge = 1;
 2273|      0|			}
 2274|      1|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2274:13): [True: 0, False: 1]
  |  Branch (2274:28): [True: 0, False: 0]
  ------------------
 2275|       |				/*
 2276|       |				 * RR extension comprises:
 2277|       |				 *    one byte flag value
 2278|       |				 * This extension is obsolete,
 2279|       |				 * so contents are always ignored.
 2280|       |				 */
 2281|      0|			}
 2282|      1|			break;
 2283|      0|		case 'S':
  ------------------
  |  Branch (2283:3): [True: 0, False: 38]
  ------------------
 2284|      0|			if (p[1] == 'L') {
  ------------------
  |  Branch (2284:8): [True: 0, False: 0]
  ------------------
 2285|      0|				if (version == 1) {
  ------------------
  |  Branch (2285:9): [True: 0, False: 0]
  ------------------
 2286|      0|					parse_rockridge_SL1(file,
 2287|      0|					    data, data_length);
 2288|      0|					iso9660->seenRockridge = 1;
 2289|      0|				}
 2290|      0|			}
 2291|      0|			else if (p[1] == 'T'
  ------------------
  |  Branch (2291:13): [True: 0, False: 0]
  ------------------
 2292|      0|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2292:11): [True: 0, False: 0]
  |  Branch (2292:31): [True: 0, False: 0]
  ------------------
 2293|       |				/*
 2294|       |				 * ST extension marks end of this
 2295|       |				 * block of SUSP entries.
 2296|       |				 *
 2297|       |				 * It allows SUSP to coexist with
 2298|       |				 * non-SUSP uses of the System
 2299|       |				 * Use Area by placing non-SUSP data
 2300|       |				 * after SUSP data.
 2301|       |				 */
 2302|      0|				iso9660->seenSUSP = 0;
 2303|      0|				iso9660->seenRockridge = 0;
 2304|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2305|      0|			}
 2306|      0|			break;
 2307|     30|		case 'T':
  ------------------
  |  Branch (2307:3): [True: 30, False: 8]
  ------------------
 2308|     30|			if (p[1] == 'F') {
  ------------------
  |  Branch (2308:8): [True: 30, False: 0]
  ------------------
 2309|     30|				if (version == 1) {
  ------------------
  |  Branch (2309:9): [True: 29, False: 1]
  ------------------
 2310|     29|					parse_rockridge_TF1(file,
 2311|     29|					    data, data_length);
 2312|     29|					iso9660->seenRockridge = 1;
 2313|     29|				}
 2314|     30|			}
 2315|     30|			break;
 2316|      2|		case 'Z':
  ------------------
  |  Branch (2316:3): [True: 2, False: 36]
  ------------------
 2317|      2|			if (p[1] == 'F') {
  ------------------
  |  Branch (2317:8): [True: 1, False: 1]
  ------------------
 2318|      1|				if (version == 1)
  ------------------
  |  Branch (2318:9): [True: 1, False: 0]
  ------------------
 2319|      1|					parse_rockridge_ZF1(file,
 2320|      1|					    data, data_length);
 2321|      1|			}
 2322|      2|			break;
 2323|      1|		default:
  ------------------
  |  Branch (2323:3): [True: 1, False: 37]
  ------------------
 2324|      1|			break;
 2325|     38|		}
 2326|       |
 2327|     38|		p += p[2];
 2328|     38|		entry_seen = 1;
 2329|     38|	}
 2330|       |
 2331|     39|	if (entry_seen)
  ------------------
  |  Branch (2331:6): [True: 36, False: 3]
  ------------------
 2332|     36|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     36|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2333|      3|	else {
 2334|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2335|      3|				  "Tried to parse Rockridge extensions, but none found");
 2336|      3|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2337|      3|	}
 2338|     39|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2556|     29|{
 2557|     29|	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|     29|	if (data_length < 1)
  ------------------
  |  Branch (2568:6): [True: 1, False: 28]
  ------------------
 2569|      1|		return;
 2570|     28|	flag = data[0];
 2571|     28|	++data;
 2572|     28|	--data_length;
 2573|     28|	if (flag & 0x80) {
  ------------------
  |  Branch (2573:6): [True: 17, False: 11]
  ------------------
 2574|       |		/* Use 17-byte time format. */
 2575|     17|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2575:7): [True: 16, False: 1]
  |  Branch (2575:21): [True: 16, False: 0]
  ------------------
 2576|       |			/* Create time. */
 2577|     16|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2577:8): [True: 0, False: 16]
  ------------------
 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|     16|			data += 17;
 2582|     16|			data_length -= 17;
 2583|     16|		}
 2584|     17|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2584:7): [True: 16, False: 1]
  |  Branch (2584:21): [True: 15, False: 1]
  ------------------
 2585|       |			/* Modify time. */
 2586|     15|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2586:8): [True: 0, False: 15]
  ------------------
 2587|      0|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      0|#define MTIME_IS_SET 2
  ------------------
 2588|      0|				file->mtime = isodate17(data);
 2589|      0|			}
 2590|     15|			data += 17;
 2591|     15|			data_length -= 17;
 2592|     15|		}
 2593|     17|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2593:7): [True: 17, False: 0]
  |  Branch (2593:21): [True: 16, False: 1]
  ------------------
 2594|       |			/* Access time. */
 2595|     16|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2595:8): [True: 0, False: 16]
  ------------------
 2596|      0|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      0|#define ATIME_IS_SET 4
  ------------------
 2597|      0|				file->atime = isodate17(data);
 2598|      0|			}
 2599|     16|			data += 17;
 2600|     16|			data_length -= 17;
 2601|     16|		}
 2602|     17|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2602:7): [True: 17, False: 0]
  |  Branch (2602:21): [True: 15, False: 2]
  ------------------
 2603|       |			/* Attribute change time. */
 2604|     15|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2604:8): [True: 0, False: 15]
  ------------------
 2605|      0|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      0|#define CTIME_IS_SET 8
  ------------------
 2606|      0|				file->ctime = isodate17(data);
 2607|      0|			}
 2608|     15|		}
 2609|     17|	} else {
 2610|       |		/* Use 7-byte time format. */
 2611|     11|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2611:7): [True: 7, False: 4]
  |  Branch (2611:21): [True: 6, False: 1]
  ------------------
 2612|       |			/* Create time. */
 2613|      6|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2613:8): [True: 1, False: 5]
  ------------------
 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|      6|			data += 7;
 2618|      6|			data_length -= 7;
 2619|      6|		}
 2620|     11|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2620:7): [True: 7, False: 4]
  |  Branch (2620:21): [True: 6, False: 1]
  ------------------
 2621|       |			/* Modify time. */
 2622|      6|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2622:8): [True: 1, False: 5]
  ------------------
 2623|      1|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      1|#define MTIME_IS_SET 2
  ------------------
 2624|      1|				file->mtime = isodate7(data);
 2625|      1|			}
 2626|      6|			data += 7;
 2627|      6|			data_length -= 7;
 2628|      6|		}
 2629|     11|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2629:7): [True: 9, False: 2]
  |  Branch (2629:21): [True: 8, False: 1]
  ------------------
 2630|       |			/* Access time. */
 2631|      8|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2631:8): [True: 1, False: 7]
  ------------------
 2632|      1|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      1|#define ATIME_IS_SET 4
  ------------------
 2633|      1|				file->atime = isodate7(data);
 2634|      1|			}
 2635|      8|			data += 7;
 2636|      8|			data_length -= 7;
 2637|      8|		}
 2638|     11|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2638:7): [True: 9, False: 2]
  |  Branch (2638:21): [True: 8, False: 1]
  ------------------
 2639|       |			/* Attribute change time. */
 2640|      8|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2640:8): [True: 2, False: 6]
  ------------------
 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|      8|		}
 2645|     11|	}
 2646|     28|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3327|     62|{
 3328|       |	/* First 16 bytes are all ASCII digits */
 3329|    380|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3329:18): [True: 367, False: 13]
  ------------------
 3330|    367|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3330:7): [True: 11, False: 356]
  |  Branch (3330:21): [True: 38, False: 318]
  ------------------
 3331|     49|			return 0;
 3332|    367|	}
 3333|       |
 3334|     13|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3335|     13|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3336|     13|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3337|     13|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3338|     13|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3339|     13|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3340|     13|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3341|     13|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3342|     13|	int gmt_off = (signed char)v[16];
 3343|       |
 3344|     13|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3344:6): [True: 7, False: 6]
  |  Branch (3344:19): [True: 7, False: 0]
  |  Branch (3344:33): [True: 7, False: 0]
  ------------------
 3345|      7|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3345:9): [True: 7, False: 0]
  |  Branch (3345:22): [True: 7, False: 0]
  |  Branch (3345:37): [True: 7, False: 0]
  ------------------
 3346|      7|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3346:9): [True: 6, False: 1]
  |  Branch (3346:28): [True: 0, False: 6]
  ------------------
 3347|      0|		return 0;
 3348|       |	/*
 3349|       |	 * Sanity-test each individual field
 3350|       |	 */
 3351|       |
 3352|       |	/* Year must be 1900-2300 */
 3353|       |	/* (Not specified in ECMA-119, but these seem
 3354|       |	   like reasonable limits. */
 3355|     13|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3355:6): [True: 7, False: 6]
  |  Branch (3355:21): [True: 2, False: 4]
  ------------------
 3356|      9|		return 0;
 3357|       |	/* Month must be 1-12 */
 3358|      4|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3358:6): [True: 0, False: 4]
  |  Branch (3358:19): [True: 1, False: 3]
  ------------------
 3359|      1|		return 0;
 3360|       |	/* Day must be 1-31 */
 3361|      3|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3361:6): [True: 0, False: 3]
  |  Branch (3361:17): [True: 0, False: 3]
  ------------------
 3362|      0|		return 0;
 3363|       |	/* Hour must be 0-23 */
 3364|      3|	if (hour > 23)
  ------------------
  |  Branch (3364:6): [True: 1, False: 2]
  ------------------
 3365|      1|		return 0;
 3366|       |	/* Minute must be 0-59 */
 3367|      2|	if (minute > 59)
  ------------------
  |  Branch (3367:6): [True: 0, False: 2]
  ------------------
 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|      2|	if (second > 61)
  ------------------
  |  Branch (3372:6): [True: 0, False: 2]
  ------------------
 3373|      0|		return 0;
 3374|       |	/* Hundredths must be 0-99 */
 3375|      2|	if (hundredths > 99)
  ------------------
  |  Branch (3375:6): [True: 0, False: 2]
  ------------------
 3376|      0|		return 0;
 3377|       |	/* Offset from GMT must be -48 to +52 */
 3378|      2|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3378:6): [True: 2, False: 0]
  |  Branch (3378:23): [True: 0, False: 0]
  ------------------
 3379|      2|		return 0;
 3380|       |
 3381|       |	/* All tests pass, this is OK */
 3382|      0|	return 1;
 3383|       |
 3384|      2|}
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|    866|{
 2759|       |
 2760|    866|	file->use_next = iso9660->use_files;
 2761|    866|	iso9660->use_files = file;
 2762|    866|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3117|    772|{
 3118|    772|	uint64_t file_key, parent_key;
 3119|    772|	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|    772|	key <<= 16;
 3124|    772|	key += heap->used & 0xFFFF;
 3125|       |
 3126|       |	/* Expand our pending files list as necessary. */
 3127|    772|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3127:6): [True: 118, False: 654]
  ------------------
 3128|    118|		struct file_info **new_pending_files;
 3129|    118|		size_t new_size;
 3130|       |
 3131|    118|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3131:7): [True: 118, False: 0]
  ------------------
 3132|    118|			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|    118|		new_pending_files = (struct file_info **)
 3140|    118|		    calloc(new_size, sizeof(new_pending_files[0]));
 3141|    118|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3141:7): [True: 0, False: 118]
  ------------------
 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|    118|		if (heap->allocated)
  ------------------
  |  Branch (3146:7): [True: 0, False: 118]
  ------------------
 3147|      0|			memcpy(new_pending_files, heap->files,
 3148|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3149|    118|		free(heap->files);
 3150|    118|		heap->files = new_pending_files;
 3151|    118|		heap->allocated = new_size;
 3152|    118|	}
 3153|       |
 3154|    772|	file_key = file->key = key;
 3155|       |
 3156|       |	/*
 3157|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3158|       |	 */
 3159|    772|	hole = heap->used++;
 3160|  1.14k|	while (hole > 0) {
  ------------------
  |  Branch (3160:9): [True: 849, False: 291]
  ------------------
 3161|    849|		parent = (hole - 1) / 2;
 3162|    849|		parent_key = heap->files[parent]->key;
 3163|    849|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3163:7): [True: 481, False: 368]
  ------------------
 3164|    481|			heap->files[hole] = file;
 3165|    481|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    481|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3166|    481|		}
 3167|       |		/* Move parent into hole <==> move hole up tree. */
 3168|    368|		heap->files[hole] = heap->files[parent];
 3169|    368|		hole = parent;
 3170|    368|	}
 3171|    291|	heap->files[0] = file;
 3172|       |
 3173|    291|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    291|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3174|    772|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2791|    704|{
 2792|    704|	struct file_info *file;
 2793|    704|	int r;
 2794|       |
 2795|    704|	r = next_cache_entry(a, iso9660, pfile);
 2796|    704|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    704|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2796:6): [True: 147, False: 557]
  ------------------
 2797|    147|		return (r);
 2798|    557|	file = *pfile;
 2799|       |
 2800|       |	/* Don't waste time seeking for zero-length bodies. */
 2801|    557|	if (file->size == 0)
  ------------------
  |  Branch (2801:6): [True: 180, False: 377]
  ------------------
 2802|    180|		file->offset = iso9660->current_position;
 2803|       |
 2804|       |	/* flush any remaining bytes from the last round to ensure
 2805|       |	 * we're positioned */
 2806|    557|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2806:6): [True: 0, False: 557]
  ------------------
 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|    557|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2812:6): [True: 36, False: 521]
  ------------------
 2813|     36|		int64_t step;
 2814|       |
 2815|     36|		step = file->offset - iso9660->current_position;
 2816|     36|		step = __archive_read_consume(a, step);
 2817|     36|		if (step < 0)
  ------------------
  |  Branch (2817:7): [True: 17, False: 19]
  ------------------
 2818|     17|			return ((int)step);
 2819|     19|		iso9660->current_position = file->offset;
 2820|     19|	}
 2821|       |
 2822|       |	/* We found body of file; handle it now. */
 2823|    540|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    540|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2824|    557|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2829|    704|{
 2830|    704|	struct file_info *file;
 2831|    704|	struct {
 2832|    704|		struct file_info	*first;
 2833|    704|		struct file_info	**last;
 2834|    704|	}	empty_files;
 2835|    704|	int64_t number;
 2836|    704|	int count;
 2837|       |
 2838|    704|	file = cache_get_entry(iso9660);
 2839|    704|	if (file != NULL) {
  ------------------
  |  Branch (2839:6): [True: 214, False: 490]
  ------------------
 2840|    214|		*pfile = file;
 2841|    214|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    214|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2842|    214|	}
 2843|       |
 2844|    490|	for (;;) {
 2845|    490|		struct file_info *re, *d;
 2846|       |
 2847|    490|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  453|    490|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2848|    490|		if (file == NULL) {
  ------------------
  |  Branch (2848:7): [True: 68, False: 422]
  ------------------
 2849|       |			/*
 2850|       |			 * If directory entries all which are descendant of
 2851|       |			 * rr_moved are still remaining, expose their.
 2852|       |			 */
 2853|     68|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2853:8): [True: 0, False: 68]
  ------------------
 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|     68|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2858:11): [True: 0, False: 68]
  ------------------
 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|     68|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2863:8): [True: 0, False: 68]
  ------------------
 2864|      0|				return (next_cache_entry(a, iso9660, pfile));
 2865|     68|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     68|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2866|     68|		}
 2867|       |
 2868|    422|		if (file->cl_offset) {
  ------------------
  |  Branch (2868:7): [True: 0, False: 422]
  ------------------
 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|    422|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|    422|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|    422|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2918:14): [True: 214, False: 208]
  ------------------
 2919|    214|			int r;
 2920|       |
 2921|       |			/* Read file entries in this dir. */
 2922|    214|			r = read_children(a, file);
 2923|    214|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    214|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2923:8): [True: 79, False: 135]
  ------------------
 2924|     79|				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|    343|		break;
 2961|    422|	}
 2962|       |
 2963|    343|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  215|    343|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  216|    686|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2963:6): [True: 135, False: 208]
  |  Branch (2963:44): [True: 27, False: 181]
  ------------------
 2964|    162|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    162|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2965|       |
 2966|    181|	count = 0;
 2967|    181|	number = file->number;
 2968|    181|	iso9660->cache_files.first = NULL;
 2969|    181|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2970|    181|	empty_files.first = NULL;
 2971|    181|	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|    429|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2975:9): [True: 357, False: 72]
  ------------------
 2976|    357|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2976:7): [True: 110, False: 247]
  ------------------
 2977|    248|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2977:7): [True: 138, False: 109]
  ------------------
 2978|    248|		if (file->number == -1) {
  ------------------
  |  Branch (2978:7): [True: 82, False: 166]
  ------------------
 2979|       |			/* This file has the same offset
 2980|       |			 * but it's wrong offset which empty files
 2981|       |			 * and symlink files have.
 2982|       |			 * NOTE: This wrong offset was recorded by
 2983|       |			 * old mkisofs utility. If ISO images is
 2984|       |			 * created by latest mkisofs, this does not
 2985|       |			 * happen.
 2986|       |			 */
 2987|     82|			file->next = NULL;
 2988|     82|			*empty_files.last = file;
 2989|     82|			empty_files.last = &(file->next);
 2990|    166|		} else {
 2991|    166|			count++;
 2992|    166|			cache_add_entry(iso9660, file);
 2993|    166|		}
 2994|    248|		file = next_entry(iso9660);
  ------------------
  |  |  453|    248|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2995|    248|	}
 2996|       |
 2997|    181|	if (count == 0) {
  ------------------
  |  Branch (2997:6): [True: 99, False: 82]
  ------------------
 2998|     99|		*pfile = file;
 2999|     99|		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|     99|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2999:11): [True: 0, False: 99]
  ------------------
 3000|     99|	}
 3001|     82|	if (file->number == -1) {
  ------------------
  |  Branch (3001:6): [True: 28, False: 54]
  ------------------
 3002|     28|		file->next = NULL;
 3003|     28|		*empty_files.last = file;
 3004|     28|		empty_files.last = &(file->next);
 3005|     54|	} else {
 3006|     54|		count++;
 3007|     54|		cache_add_entry(iso9660, file);
 3008|     54|	}
 3009|       |
 3010|     82|	if (count > 1) {
  ------------------
  |  Branch (3010:6): [True: 64, False: 18]
  ------------------
 3011|       |		/* The count is the same as number of hardlink,
 3012|       |		 * so much so that each nlinks of files in cache_file
 3013|       |		 * is overwritten by value of the count.
 3014|       |		 */
 3015|     64|		for (file = iso9660->cache_files.first;
 3016|    266|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3016:7): [True: 202, False: 64]
  ------------------
 3017|    202|			file->nlinks = count;
 3018|     64|	}
 3019|       |	/* If there are empty files, that files are added
 3020|       |	 * to the tail of the cache_files. */
 3021|     82|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3021:6): [True: 28, False: 54]
  ------------------
 3022|     28|		*iso9660->cache_files.last = empty_files.first;
 3023|     28|		iso9660->cache_files.last = empty_files.last;
 3024|     28|	}
 3025|     82|	*pfile = cache_get_entry(iso9660);
 3026|     82|	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|     82|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3026:10): [True: 0, False: 82]
  ------------------
 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|    181|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3102|    786|{
 3103|    786|	struct file_info *file;
 3104|       |
 3105|    786|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3105:6): [True: 296, False: 490]
  ------------------
 3106|    296|		iso9660->cache_files.first = file->next;
 3107|    296|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3107:7): [True: 63, False: 233]
  ------------------
 3108|     63|			iso9660->cache_files.last =
 3109|     63|			    &(iso9660->cache_files.first);
 3110|    296|	}
 3111|    786|	return (file);
 3112|    786|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3178|    738|{
 3179|    738|	uint64_t a_key, b_key, c_key;
 3180|    738|	size_t a, b, c;
 3181|    738|	struct file_info *r, *tmp;
 3182|       |
 3183|    738|	if (heap->used < 1)
  ------------------
  |  Branch (3183:6): [True: 68, False: 670]
  ------------------
 3184|     68|		return (NULL);
 3185|       |
 3186|       |	/*
 3187|       |	 * The first file in the list is the earliest; we'll return this.
 3188|       |	 */
 3189|    670|	r = heap->files[0];
 3190|       |
 3191|       |	/*
 3192|       |	 * Move the last item in the heap to the root of the tree
 3193|       |	 */
 3194|    670|	heap->files[0] = heap->files[--(heap->used)];
 3195|       |
 3196|       |	/*
 3197|       |	 * Rebalance the heap.
 3198|       |	 */
 3199|    670|	a = 0; /* Starting element and its heap key */
 3200|    670|	a_key = heap->files[a]->key;
 3201|  1.41k|	for (;;) {
 3202|  1.41k|		b = a + a + 1; /* First child */
 3203|  1.41k|		if (b >= heap->used)
  ------------------
  |  Branch (3203:7): [True: 560, False: 852]
  ------------------
 3204|    560|			return (r);
 3205|    852|		b_key = heap->files[b]->key;
 3206|    852|		c = b + 1; /* Use second child if it is smaller. */
 3207|    852|		if (c < heap->used) {
  ------------------
  |  Branch (3207:7): [True: 707, False: 145]
  ------------------
 3208|    707|			c_key = heap->files[c]->key;
 3209|    707|			if (c_key < b_key) {
  ------------------
  |  Branch (3209:8): [True: 288, False: 419]
  ------------------
 3210|    288|				b = c;
 3211|    288|				b_key = c_key;
 3212|    288|			}
 3213|    707|		}
 3214|    852|		if (a_key <= b_key)
  ------------------
  |  Branch (3214:7): [True: 110, False: 742]
  ------------------
 3215|    110|			return (r);
 3216|    742|		tmp = heap->files[a];
 3217|    742|		heap->files[a] = heap->files[b];
 3218|    742|		heap->files[b] = tmp;
 3219|    742|		a = b;
 3220|    742|	}
 3221|    670|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3094|    220|{
 3095|       |	file->next = NULL;
 3096|    220|	*iso9660->cache_files.last = file;
 3097|    220|	iso9660->cache_files.last = &(file->next);
 3098|    220|}
archive_read_support_format_iso9660.c:re_get_entry:
 3046|     68|{
 3047|     68|	struct file_info *file;
 3048|       |
 3049|     68|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3049:6): [True: 0, False: 68]
  ------------------
 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|     68|	return (file);
 3056|     68|}
archive_read_support_format_iso9660.c:read_children:
 1022|    214|{
 1023|    214|	struct iso9660 *iso9660 = a->format->data;
 1024|    214|	const unsigned char *b, *p;
 1025|    214|	struct file_info *multi;
 1026|    214|	size_t step, skip_size;
 1027|       |
 1028|       |	/* flush any remaining bytes from the last round to ensure
 1029|       |	 * we're positioned */
 1030|    214|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1030:6): [True: 0, False: 214]
  ------------------
 1031|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1032|      0|		iso9660->entry_bytes_unconsumed = 0;
 1033|      0|	}
 1034|    214|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1034:6): [True: 19, False: 195]
  ------------------
 1035|     19|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     19|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1036|     19|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1037|     19|		    parent->name.s,
 1038|     19|		    (intmax_t)iso9660->current_position,
 1039|     19|		    (intmax_t)parent->offset);
 1040|     19|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     19|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1041|     19|	}
 1042|    195|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1042:6): [True: 35, False: 160]
  ------------------
 1043|     35|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     35|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1044|     35|		    "Directory is beyond end-of-media: %s",
 1045|     35|		    parent->name.s);
 1046|     35|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     35|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1047|     35|	}
 1048|    160|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1048:6): [True: 76, False: 84]
  ------------------
 1049|     76|		int64_t skipsize;
 1050|       |
 1051|     76|		skipsize = parent->offset - iso9660->current_position;
 1052|     76|		skipsize = __archive_read_consume(a, skipsize);
 1053|     76|		if (skipsize < 0)
  ------------------
  |  Branch (1053:7): [True: 6, False: 70]
  ------------------
 1054|      6|			return ((int)skipsize);
 1055|     70|		iso9660->current_position = parent->offset;
 1056|     70|	}
 1057|       |
 1058|    154|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1059|    154|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1060|    154|	b = __archive_read_ahead(a, step, NULL);
 1061|    154|	if (b == NULL) {
  ------------------
  |  Branch (1061:6): [True: 2, False: 152]
  ------------------
 1062|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1063|      2|		    "Failed to read full block when scanning "
 1064|      2|		    "ISO9660 directory list");
 1065|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1066|      2|	}
 1067|    152|	iso9660->current_position += step;
 1068|    152|	multi = NULL;
 1069|    152|	skip_size = step;
 1070|    511|	while (step) {
  ------------------
  |  Branch (1070:9): [True: 376, False: 135]
  ------------------
 1071|    376|		p = b;
 1072|    376|		b += iso9660->logical_block_size;
 1073|    376|		step -= iso9660->logical_block_size;
 1074|   233k|		for (; p < b && b - p > DR_name_offset && *p != 0 && *p <= b - p;
  ------------------
  |  |  216|   466k|#define DR_name_offset 33
  ------------------
  |  Branch (1074:10): [True: 233k, False: 0]
  |  Branch (1074:19): [True: 233k, False: 113]
  |  Branch (1074:45): [True: 233k, False: 246]
  |  Branch (1074:56): [True: 233k, False: 0]
  ------------------
 1075|   233k|			p += *p) {
 1076|   233k|			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|   233k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   233k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1084:8): [True: 232k, False: 657]
  ------------------
 1085|   232k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  216|   232k|#define DR_name_offset 33
  ------------------
  |  Branch (1085:11): [True: 82, False: 232k]
  ------------------
 1086|     82|				continue;
 1087|       |			/* Skip '..' entry. */
 1088|   233k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   233k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1088:8): [True: 232k, False: 657]
  ------------------
 1089|   232k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  216|   232k|#define DR_name_offset 33
  ------------------
  |  Branch (1089:11): [True: 232k, False: 91]
  ------------------
 1090|   232k|				continue;
 1091|    748|			child = parse_file_info(a, parent, p, b - p);
 1092|    748|			if (child == NULL) {
  ------------------
  |  Branch (1092:8): [True: 17, False: 731]
  ------------------
 1093|     17|				__archive_read_consume(a, skip_size);
 1094|     17|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1095|     17|			}
 1096|    731|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1096:8): [True: 731, False: 0]
  ------------------
 1097|    731|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1097:9): [True: 103, False: 628]
  |  Branch (1097:32): [True: 44, False: 584]
  ------------------
 1098|    147|				struct content *con;
 1099|       |
 1100|    147|				if (multi == NULL) {
  ------------------
  |  Branch (1100:9): [True: 70, False: 77]
  ------------------
 1101|     70|					multi = child;
 1102|     70|					multi->contents.first = NULL;
 1103|     70|					multi->contents.last =
 1104|     70|					    &(multi->contents.first);
 1105|     70|				}
 1106|    147|				con = malloc(sizeof(struct content));
 1107|    147|				if (con == NULL) {
  ------------------
  |  Branch (1107:9): [True: 0, False: 147]
  ------------------
 1108|      0|					archive_set_error(
 1109|      0|					    &a->archive, ENOMEM,
 1110|      0|					    "No memory for multi extent");
 1111|      0|					__archive_read_consume(a, skip_size);
 1112|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1113|      0|				}
 1114|    147|				con->offset = child->offset;
 1115|    147|				con->size = child->size;
 1116|    147|				con->next = NULL;
 1117|    147|				*multi->contents.last = con;
 1118|    147|				multi->contents.last = &(con->next);
 1119|    147|				if (multi == child) {
  ------------------
  |  Branch (1119:9): [True: 70, False: 77]
  ------------------
 1120|     70|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  451|     70|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1120:10): [True: 0, False: 70]
  ------------------
 1121|     70|					    != ARCHIVE_OK)
  ------------------
  |  |  233|     70|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1122|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1123|     77|				} else {
 1124|     77|					multi->size += child->size;
 1125|     77|					if (!child->multi_extent)
  ------------------
  |  Branch (1125:10): [True: 44, False: 33]
  ------------------
 1126|     44|						multi = NULL;
 1127|     77|				}
 1128|    147|			} else
 1129|    584|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  451|    584|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  233|    584|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1129:9): [True: 0, False: 584]
  ------------------
 1130|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1131|    731|		}
 1132|    376|	}
 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|    678|{
 3442|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3443|       |	// to 1000, then something is very, very wrong.
 3444|    678|	if (depth > 1000) {
  ------------------
  |  Branch (3444:6): [True: 0, False: 678]
  ------------------
 3445|      0|		return NULL;
 3446|      0|	}
 3447|    678|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    547|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3447:6): [True: 547, False: 131]
  |  Branch (3447:30): [True: 149, False: 398]
  ------------------
 3448|    149|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3448:7): [True: 0, False: 149]
  ------------------
 3449|      0|			return NULL;
 3450|      0|		}
 3451|    149|		archive_strcat(as, "/");
 3452|    149|	}
 3453|    678|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    678|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3453:6): [True: 63, False: 615]
  ------------------
 3454|     63|		archive_strcat(as, ".");
 3455|    615|	else
 3456|    615|		archive_string_concat(as, &file->name);
 3457|    678|	return (as->s);
 3458|    678|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1472|    586|{
 1473|       |	/* Because read_next_header always does an explicit skip
 1474|       |	 * to the next entry, we don't need to do anything here. */
 1475|    586|	(void)a; /* UNUSED */
 1476|    586|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    586|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1477|    586|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1722|    809|{
 1723|    809|	struct iso9660 *iso9660 = a->format->data;
 1724|    809|	ssize_t bytes_read;
 1725|       |
 1726|    809|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1726:6): [True: 108, False: 701]
  ------------------
 1727|    108|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1728|    108|		iso9660->entry_bytes_unconsumed = 0;
 1729|    108|	}
 1730|       |
 1731|    809|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1731:6): [True: 704, False: 105]
  ------------------
 1732|    704|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1732:7): [True: 34, False: 670]
  ------------------
 1733|     34|			iso9660->entry_content = iso9660->entry_content->next;
 1734|    704|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1734:7): [True: 686, False: 18]
  ------------------
 1735|    686|			*buff = NULL;
 1736|    686|			*size = 0;
 1737|    686|			*offset = iso9660->entry_sparse_offset;
 1738|    686|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    686|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1739|    686|		}
 1740|       |		/* Seek forward to the start of the entry. */
 1741|     18|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1741:7): [True: 11, False: 7]
  ------------------
 1742|     11|			int64_t step;
 1743|       |
 1744|     11|			step = iso9660->entry_content->offset -
 1745|     11|			    iso9660->current_position;
 1746|     11|			step = __archive_read_consume(a, step);
 1747|     11|			if (step < 0)
  ------------------
  |  Branch (1747:8): [True: 1, False: 10]
  ------------------
 1748|      1|				return ((int)step);
 1749|     10|			iso9660->current_position =
 1750|     10|			    iso9660->entry_content->offset;
 1751|     10|		}
 1752|     17|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1752:7): [True: 7, False: 10]
  ------------------
 1753|      7|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1754|      7|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1755|      7|			    iso9660->pathname.s,
 1756|      7|			    (intmax_t)iso9660->entry_content->offset,
 1757|      7|			    (intmax_t)iso9660->current_position);
 1758|      7|			*buff = NULL;
 1759|      7|			*size = 0;
 1760|      7|			*offset = iso9660->entry_sparse_offset;
 1761|      7|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      7|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1762|      7|		}
 1763|     10|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1764|     10|	}
 1765|    115|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1765:6): [True: 0, False: 115]
  ------------------
 1766|      0|		return (zisofs_read_data(a, buff, size, offset));
 1767|       |
 1768|    115|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1769|    115|	if (bytes_read == 0)
  ------------------
  |  Branch (1769:6): [True: 7, False: 108]
  ------------------
 1770|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1771|      7|		    "Truncated input file");
 1772|    115|	if (*buff == NULL)
  ------------------
  |  Branch (1772:6): [True: 7, False: 108]
  ------------------
 1773|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1774|    108|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1774:6): [True: 101, False: 7]
  ------------------
 1775|    101|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1776|    108|	*size = bytes_read;
 1777|    108|	*offset = iso9660->entry_sparse_offset;
 1778|    108|	iso9660->entry_sparse_offset += bytes_read;
 1779|    108|	iso9660->entry_bytes_remaining -= bytes_read;
 1780|    108|	iso9660->entry_bytes_unconsumed = bytes_read;
 1781|    108|	iso9660->current_position += bytes_read;
 1782|    108|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    108|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1783|    115|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1787|  3.66k|{
 1788|  3.66k|	struct iso9660 *iso9660 = a->format->data;
 1789|  3.66k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  3.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1790|       |
 1791|  3.66k|	release_files(iso9660);
 1792|  3.66k|	free(iso9660->read_ce_req.reqs);
 1793|  3.66k|	archive_string_free(&iso9660->pathname);
 1794|  3.66k|	archive_string_free(&iso9660->previous_pathname);
 1795|  3.66k|	free(iso9660->pending_files.files);
 1796|  3.66k|#ifdef HAVE_ZLIB_H
 1797|  3.66k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1798|  3.66k|	free(iso9660->entry_zisofs.block_pointers);
 1799|  3.66k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1799:6): [True: 0, False: 3.66k]
  ------------------
 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|  3.66k|#endif
 1807|  3.66k|	free(iso9660->utf16be_path);
 1808|  3.66k|	free(iso9660->utf16be_previous_path);
 1809|  3.66k|	free(iso9660);
 1810|       |	a->format->data = NULL;
 1811|  3.66k|	return (r);
 1812|  3.66k|}
archive_read_support_format_iso9660.c:release_files:
 2766|  3.66k|{
 2767|  3.66k|	struct content *con, *connext;
 2768|  3.66k|	struct file_info *file;
 2769|       |
 2770|  3.66k|	file = iso9660->use_files;
 2771|  4.53k|	while (file != NULL) {
  ------------------
  |  Branch (2771:9): [True: 866, False: 3.66k]
  ------------------
 2772|    866|		struct file_info *next = file->use_next;
 2773|       |
 2774|    866|		archive_string_free(&file->name);
 2775|    866|		archive_string_free(&file->symlink);
 2776|    866|		free(file->utf16be_name);
 2777|    866|		con = file->contents.first;
 2778|  1.01k|		while (con != NULL) {
  ------------------
  |  Branch (2778:10): [True: 147, False: 866]
  ------------------
 2779|    147|			connext = con->next;
 2780|    147|			free(con);
 2781|    147|			con = connext;
 2782|    147|		}
 2783|    866|		free(file);
 2784|    866|		file = next;
 2785|    866|	}
 2786|  3.66k|}

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

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

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

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

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

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

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

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

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

archive_array_append:
  250|    451|{
  251|    451|	return archive_string_append(as, p, s);
  252|    451|}
archive_string_concat:
  256|    615|{
  257|    615|	if (archive_string_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (257:6): [True: 0, False: 615]
  ------------------
  258|      0|		__archive_errx(1, "Out of memory");
  259|    615|}
archive_wstring_concat:
  264|  8.90k|{
  265|  8.90k|	if (archive_wstring_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (265:6): [True: 0, False: 8.90k]
  ------------------
  266|      0|		__archive_errx(1, "Out of memory");
  267|  8.90k|}
archive_string_free:
  271|  5.09M|{
  272|  5.09M|	as->length = 0;
  273|  5.09M|	as->buffer_length = 0;
  274|  5.09M|	free(as->s);
  275|       |	as->s = NULL;
  276|  5.09M|}
archive_wstring_free:
  280|  1.56M|{
  281|  1.56M|	as->length = 0;
  282|  1.56M|	as->buffer_length = 0;
  283|  1.56M|	free(as->s);
  284|       |	as->s = NULL;
  285|  1.56M|}
archive_wstring_ensure:
  289|   126k|{
  290|   126k|	return (struct archive_wstring *)
  291|   126k|		archive_string_ensure((struct archive_string *)as,
  292|   126k|					s * sizeof(wchar_t));
  293|   126k|}
archive_string_ensure:
  298|  9.98M|{
  299|  9.98M|	char *p;
  300|  9.98M|	size_t new_length;
  301|       |
  302|       |	/* If buffer is already big enough, don't reallocate. */
  303|  9.98M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (303:6): [True: 9.49M, False: 490k]
  |  Branch (303:15): [True: 9.44M, False: 54.4k]
  ------------------
  304|  9.44M|		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|   544k|	if (as->buffer_length < 32)
  ------------------
  |  Branch (313:6): [True: 490k, False: 54.4k]
  ------------------
  314|       |		/* Start with a minimum 32-character buffer. */
  315|   490k|		new_length = 32;
  316|  54.4k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (316:11): [True: 54.1k, False: 323]
  ------------------
  317|       |		/* Buffers under 8k are doubled for speed. */
  318|  54.1k|		new_length = as->buffer_length + as->buffer_length;
  319|    323|	else {
  320|       |		/* Buffers 8k and over grow by at least 25% each time. */
  321|    323|		new_length = as->buffer_length + as->buffer_length / 4;
  322|       |		/* Be safe: If size wraps, fail. */
  323|    323|		if (new_length < as->buffer_length) {
  ------------------
  |  Branch (323:7): [True: 0, False: 323]
  ------------------
  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|    323|	}
  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|   544k|	if (new_length < s)
  ------------------
  |  Branch (335:6): [True: 143k, False: 401k]
  ------------------
  336|   143k|		new_length = s;
  337|       |	/* Now we can reallocate the buffer. */
  338|   544k|	p = realloc(as->s, new_length);
  339|   544k|	if (p == NULL) {
  ------------------
  |  Branch (339:6): [True: 0, False: 544k]
  ------------------
  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|   544k|	as->s = p;
  347|   544k|	as->buffer_length = new_length;
  348|   544k|	return (as);
  349|   544k|}
archive_strncat:
  360|   250k|{
  361|   250k|	size_t s;
  362|   250k|	const char *p, *pp;
  363|       |
  364|   250k|	p = (const char *)_p;
  365|       |
  366|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  367|   250k|	s = 0;
  368|   250k|	pp = p;
  369|   152M|	while (s < n && *pp) {
  ------------------
  |  Branch (369:9): [True: 151M, False: 125k]
  |  Branch (369:18): [True: 151M, False: 124k]
  ------------------
  370|   151M|		pp++;
  371|   151M|		s++;
  372|   151M|	}
  373|   250k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (373:6): [True: 0, False: 250k]
  ------------------
  374|      0|		__archive_errx(1, "Out of memory");
  375|   250k|	return (as);
  376|   250k|}
archive_wstrncat:
  380|  7.08k|{
  381|  7.08k|	size_t s;
  382|  7.08k|	const wchar_t *pp;
  383|       |
  384|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  385|  7.08k|	s = 0;
  386|  7.08k|	pp = p;
  387|   103k|	while (s < n && *pp) {
  ------------------
  |  Branch (387:9): [True: 96.8k, False: 7.05k]
  |  Branch (387:18): [True: 96.7k, False: 31]
  ------------------
  388|  96.7k|		pp++;
  389|  96.7k|		s++;
  390|  96.7k|	}
  391|  7.08k|	if ((as = archive_wstring_append(as, p, s)) == NULL)
  ------------------
  |  Branch (391:6): [True: 0, False: 7.08k]
  ------------------
  392|      0|		__archive_errx(1, "Out of memory");
  393|  7.08k|	return (as);
  394|  7.08k|}
archive_strcat:
  398|   108k|{
  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|   108k|	return archive_strncat(as, p, 0x1000000);
  406|   108k|}
archive_wstrcat:
  410|     31|{
  411|       |	/* Ditto. */
  412|     31|	return archive_wstrncat(as, p, 0x1000000);
  413|     31|}
archive_strappend_char:
  417|  9.01M|{
  418|  9.01M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (418:6): [True: 0, False: 9.01M]
  ------------------
  419|      0|		__archive_errx(1, "Out of memory");
  420|  9.01M|	return (as);
  421|  9.01M|}
archive_wstrappend_wchar:
  425|     31|{
  426|     31|	if ((as = archive_wstring_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (426:6): [True: 0, False: 31]
  ------------------
  427|      0|		__archive_errx(1, "Out of memory");
  428|     31|	return (as);
  429|     31|}
archive_wstring_append_from_mbs:
  623|   106k|{
  624|   106k|	size_t r;
  625|   106k|	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|   106k|	size_t mbs_length = len;
  632|   106k|	const char *mbs = p;
  633|   106k|	wchar_t *wcs;
  634|   106k|#if HAVE_MBRTOWC
  635|   106k|	mbstate_t shift_state;
  636|       |
  637|   106k|	memset(&shift_state, 0, sizeof(shift_state));
  638|   106k|#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|   106k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (643:6): [True: 0, False: 106k]
  ------------------
  644|      0|		return (-1);
  645|   106k|	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|  1.09M|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (651:9): [True: 1.02M, False: 71.8k]
  |  Branch (651:17): [True: 1.02M, 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|  1.02M|#if HAVE_MBRTOWC
  669|  1.02M|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  670|       |#else
  671|       |		r = mbtowc(wcs, mbs, mbs_length);
  672|       |#endif
  673|  1.02M|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (673:7): [True: 34.6k, False: 991k]
  |  Branch (673:26): [True: 0, False: 991k]
  ------------------
  674|  34.6k|			ret_val = -1;
  675|  34.6k|			break;
  676|  34.6k|		}
  677|   991k|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (677:7): [True: 0, False: 991k]
  |  Branch (677:17): [True: 0, False: 991k]
  ------------------
  678|      0|			break;
  679|   991k|		wcs++;
  680|       |		// wcs_length--;
  681|   991k|		mbs += r;
  682|   991k|		mbs_length -= r;
  683|   991k|	}
  684|   106k|	dest->length = wcs - dest->s;
  685|   106k|	dest->s[dest->length] = L'\0';
  686|   106k|	return (ret_val);
  687|   106k|}
archive_string_append_from_wcs:
  821|  5.64k|{
  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|  5.64k|	int n, ret_val = 0;
  829|  5.64k|	char *p;
  830|  5.64k|	char *end;
  831|  5.64k|#if HAVE_WCRTOMB
  832|  5.64k|	mbstate_t shift_state;
  833|       |
  834|  5.64k|	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|  5.64k|	if (archive_string_ensure(as, as->length + len + 1) == NULL)
  ------------------
  |  Branch (844:6): [True: 0, False: 5.64k]
  ------------------
  845|      0|		return (-1);
  846|       |
  847|  5.64k|	p = as->s + as->length;
  848|  5.64k|	end = as->s + as->buffer_length - MB_CUR_MAX -1;
  849|  62.1k|	while (*w != L'\0' && len > 0) {
  ------------------
  |  Branch (849:9): [True: 56.5k, False: 5.64k]
  |  Branch (849:24): [True: 56.5k, False: 0]
  ------------------
  850|  56.5k|		if (p >= end) {
  ------------------
  |  Branch (850:7): [True: 955, False: 55.6k]
  ------------------
  851|    955|			as->length = p - as->s;
  852|    955|			as->s[as->length] = '\0';
  853|       |			/* Re-allocate buffer for MBS. */
  854|    955|			if (archive_string_ensure(as,
  ------------------
  |  Branch (854:8): [True: 0, False: 955]
  ------------------
  855|    955|			    as->length + max(len * 2,
  ------------------
  |  |   78|    955|#define max(a, b)       ((a)>(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (78:26): [True: 955, False: 0]
  |  |  ------------------
  ------------------
  856|    955|			    (size_t)MB_CUR_MAX) + 1) == NULL)
  857|      0|				return (-1);
  858|    955|			p = as->s + as->length;
  859|    955|			end = as->s + as->buffer_length - MB_CUR_MAX -1;
  860|    955|		}
  861|  56.5k|#if HAVE_WCRTOMB
  862|  56.5k|		n = wcrtomb(p, *w++, &shift_state);
  863|       |#else
  864|       |		n = wctomb(p, *w++);
  865|       |#endif
  866|  56.5k|		if (n == -1) {
  ------------------
  |  Branch (866:7): [True: 0, False: 56.5k]
  ------------------
  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|  56.5k|			p += n;
  877|  56.5k|		len--;
  878|  56.5k|	}
  879|  5.64k|	as->length = p - as->s;
  880|  5.64k|	as->s[as->length] = '\0';
  881|  5.64k|	return (ret_val);
  882|  5.64k|}
archive_string_conversion_to_charset:
 1782|  85.7k|{
 1783|  85.7k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   89|  85.7k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1784|       |
 1785|  85.7k|	if (best_effort)
  ------------------
  |  Branch (1785:6): [True: 85.7k, False: 0]
  ------------------
 1786|  85.7k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  85.7k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1787|  85.7k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1788|  85.7k|}
archive_string_conversion_from_charset:
 1793|  36.7k|{
 1794|  36.7k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   91|  36.7k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1795|       |
 1796|  36.7k|	if (best_effort)
  ------------------
  |  Branch (1796:6): [True: 36.7k, False: 0]
  ------------------
 1797|  36.7k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  36.7k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1798|  36.7k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1799|  36.7k|}
archive_string_default_conversion_for_read:
 1855|  1.97k|{
 1856|  1.97k|	(void)a; /* UNUSED */
 1857|       |	return (NULL);
 1858|  1.97k|}
archive_string_conversion_free:
 1873|  3.66k|{
 1874|  3.66k|	struct archive_string_conv *sc; 
 1875|  3.66k|	struct archive_string_conv *sc_next; 
 1876|       |
 1877|  4.63k|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1877:22): [True: 967, False: 3.66k]
  ------------------
 1878|    967|		sc_next = sc->next;
 1879|    967|		free_sconv_object(sc);
 1880|    967|	}
 1881|  3.66k|	a->sconv = NULL;
 1882|  3.66k|	free(a->current_code);
 1883|       |	a->current_code = NULL;
 1884|  3.66k|}
archive_string_conversion_charset_name:
 1891|  2.67k|{
 1892|  2.67k|	if (sc == NULL) {
  ------------------
  |  Branch (1892:6): [True: 0, False: 2.67k]
  ------------------
 1893|      0|		return "current locale";
 1894|      0|	}
 1895|  2.67k|	if (sc->flag & SCONV_TO_CHARSET)
  ------------------
  |  |   89|  2.67k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1895:6): [True: 0, False: 2.67k]
  ------------------
 1896|      0|		return (sc->to_charset);
 1897|  2.67k|	else
 1898|  2.67k|		return (sc->from_charset);
 1899|  2.67k|}
archive_strncpy_l:
 2014|   216k|{
 2015|   216k|	as->length = 0;
 2016|   216k|	return (archive_strncat_l(as, _p, n, sc));
 2017|   216k|}
archive_strncat_l:
 2022|   216k|{
 2023|   216k|	const void *s;
 2024|   216k|	size_t length = 0;
 2025|   216k|	int i, r = 0, r2;
 2026|       |
 2027|   216k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2027:6): [True: 216k, False: 0]
  |  Branch (2027:20): [True: 152k, False: 64.5k]
  ------------------
 2028|   152k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|  90.2k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  90.2k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  90.2k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2028:7): [True: 90.2k, False: 62.0k]
  |  Branch (2028:21): [True: 2.69k, False: 87.5k]
  ------------------
 2029|  2.69k|			length = utf16nbytes(_p, n);
 2030|   149k|		else
 2031|   149k|			length = mbsnbytes(_p, n);
 2032|   152k|	}
 2033|       |
 2034|       |	/* We must allocate memory even if there is no data for conversion
 2035|       |	 * or copy. This simulates archive_string_append behavior. */
 2036|   216k|	if (length == 0) {
  ------------------
  |  Branch (2036:6): [True: 78.0k, False: 138k]
  ------------------
 2037|  78.0k|		size_t tn = 1;
 2038|  78.0k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  47.3k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  47.3k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  47.3k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2038:7): [True: 47.3k, False: 30.7k]
  |  Branch (2038:21): [True: 0, False: 47.3k]
  ------------------
 2039|      0|			tn = 2;
 2040|  78.0k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2040:7): [True: 0, False: 78.0k]
  ------------------
 2041|      0|			return (-1);
 2042|  78.0k|		as->s[as->length] = 0;
 2043|  78.0k|		if (tn == 2)
  ------------------
  |  Branch (2043:7): [True: 0, False: 78.0k]
  ------------------
 2044|      0|			as->s[as->length+1] = 0;
 2045|  78.0k|		return (0);
 2046|  78.0k|	}
 2047|       |
 2048|       |	/*
 2049|       |	 * If sc is NULL, we just make a copy.
 2050|       |	 */
 2051|   138k|	if (sc == NULL) {
  ------------------
  |  Branch (2051:6): [True: 50.2k, False: 88.5k]
  ------------------
 2052|  50.2k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2052:7): [True: 0, False: 50.2k]
  ------------------
 2053|      0|			return (-1);/* No memory */
 2054|  50.2k|		return (0);
 2055|  50.2k|	}
 2056|       |
 2057|  88.5k|	s = _p;
 2058|  88.5k|	i = 0;
 2059|  88.5k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2059:6): [True: 40.4k, False: 48.1k]
  ------------------
 2060|  40.4k|		sc->utftmp.length = 0;
 2061|  40.4k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2062|  40.4k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2062:7): [True: 31.4k, False: 8.98k]
  |  Branch (2062:18): [True: 0, False: 31.4k]
  ------------------
 2063|      0|			return (r2);
 2064|  40.4k|		if (r > r2)
  ------------------
  |  Branch (2064:7): [True: 31.4k, False: 8.98k]
  ------------------
 2065|  31.4k|			r = r2;
 2066|  40.4k|		s = sc->utftmp.s;
 2067|  40.4k|		length = sc->utftmp.length;
 2068|  40.4k|		++i;
 2069|  40.4k|	}
 2070|  88.5k|	r2 = sc->converter[i](as, s, length, sc);
 2071|  88.5k|	if (r > r2)
  ------------------
  |  Branch (2071:6): [True: 21.5k, False: 66.9k]
  ------------------
 2072|  21.5k|		r = r2;
 2073|  88.5k|	return (r);
 2074|  88.5k|}
archive_string_dirname:
 2078|  2.05k|{
 2079|       |	/* strip trailing separators */
 2080|  2.15k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2080:9): [True: 2.08k, False: 73]
  |  Branch (2080:27): [True: 104, False: 1.98k]
  ------------------
 2081|    104|		as->length--;
 2082|       |	/* strip final component */
 2083|  8.32k|	while (as->length > 0 && as->s[as->length - 1] != '/')
  ------------------
  |  Branch (2083:9): [True: 7.44k, False: 885]
  |  Branch (2083:27): [True: 6.27k, False: 1.16k]
  ------------------
 2084|  6.27k|		as->length--;
 2085|       |	/* empty path -> cwd */
 2086|  2.05k|	if (as->length == 0)
  ------------------
  |  Branch (2086:6): [True: 885, False: 1.16k]
  ------------------
 2087|    885|		return (archive_strcat(as, "."));
 2088|       |	/* strip separator(s) */
 2089|  2.33k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2089:9): [True: 1.84k, False: 493]
  |  Branch (2089:27): [True: 1.17k, False: 676]
  ------------------
 2090|  1.17k|		as->length--;
 2091|       |	/* terminate */
 2092|  1.16k|	as->s[as->length] = '\0';
 2093|  1.16k|	return (as);
 2094|  2.05k|}
archive_mstring_clean:
 3928|  1.55M|{
 3929|  1.55M|	archive_wstring_free(&(aes->aes_wcs));
 3930|  1.55M|	archive_string_free(&(aes->aes_mbs));
 3931|  1.55M|	archive_string_free(&(aes->aes_utf8));
 3932|  1.55M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3933|  1.55M|	aes->aes_set = 0;
 3934|  1.55M|}
archive_mstring_get_utf8:
 3948|   115k|{
 3949|   115k|	struct archive_string_conv *sc;
 3950|   115k|	int r;
 3951|       |
 3952|       |	/* If we already have a UTF8 form, return that immediately. */
 3953|   115k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   115k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3953:6): [True: 26.2k, False: 89.0k]
  ------------------
 3954|  26.2k|		*p = aes->aes_utf8.s;
 3955|  26.2k|		return (0);
 3956|  26.2k|	}
 3957|       |
 3958|  89.0k|	*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|  89.0k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|  89.0k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3984:6): [True: 3.27k, False: 85.7k]
  ------------------
 3985|  3.27k|		const char *pm; /* unused */
 3986|  3.27k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3987|  3.27k|	}
 3988|  89.0k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  89.0k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3988:6): [True: 85.7k, False: 3.27k]
  ------------------
 3989|  85.7k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3990|  85.7k|		if (sc == NULL)
  ------------------
  |  Branch (3990:7): [True: 0, False: 85.7k]
  ------------------
 3991|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3992|  85.7k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 3993|  85.7k|		    aes->aes_mbs.length, sc);
 3994|  85.7k|		if (a == NULL)
  ------------------
  |  Branch (3994:7): [True: 85.7k, False: 0]
  ------------------
 3995|  85.7k|			free_sconv_object(sc);
 3996|  85.7k|		if (r == 0) {
  ------------------
  |  Branch (3996:7): [True: 65.7k, False: 19.9k]
  ------------------
 3997|  65.7k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|  65.7k|#define	AES_SET_UTF8 2
  ------------------
 3998|  65.7k|			*p = aes->aes_utf8.s;
 3999|  65.7k|			return (0);/* success. */
 4000|  65.7k|		} else
 4001|  19.9k|			return (-1);/* failure. */
 4002|  85.7k|	}
 4003|  3.27k|	return (0);/* success. */
 4004|  89.0k|}
archive_mstring_get_mbs:
 4009|   216k|{
 4010|   216k|	struct archive_string_conv *sc;
 4011|   216k|	int r, ret = 0;
 4012|       |
 4013|       |	/* If we already have an MBS form, return that immediately. */
 4014|   216k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   216k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4014:6): [True: 129k, False: 87.2k]
  ------------------
 4015|   129k|		*p = aes->aes_mbs.s;
 4016|   129k|		return (ret);
 4017|   129k|	}
 4018|       |
 4019|  87.2k|	*p = NULL;
 4020|       |	/* If there's a WCS form, try converting with the native locale. */
 4021|  87.2k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|  87.2k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4021:6): [True: 5.64k, False: 81.5k]
  ------------------
 4022|  5.64k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  5.64k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4023|  5.64k|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 4024|  5.64k|		    aes->aes_wcs.s, aes->aes_wcs.length);
 4025|  5.64k|		*p = aes->aes_mbs.s;
 4026|  5.64k|		if (r == 0) {
  ------------------
  |  Branch (4026:7): [True: 5.64k, False: 0]
  ------------------
 4027|  5.64k|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|  5.64k|#define	AES_SET_MBS 1
  ------------------
 4028|  5.64k|			return (ret);
 4029|  5.64k|		} else
 4030|      0|			ret = -1;
 4031|  5.64k|	}
 4032|       |
 4033|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 4034|  81.5k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  81.5k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4034:6): [True: 1.21k, False: 80.3k]
  ------------------
 4035|  1.21k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  1.21k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4036|  1.21k|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4037|  1.21k|		if (sc == NULL)
  ------------------
  |  Branch (4037:7): [True: 0, False: 1.21k]
  ------------------
 4038|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4039|  1.21k|		r = archive_strncpy_l(&(aes->aes_mbs),
 4040|  1.21k|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4041|  1.21k|		if (a == NULL)
  ------------------
  |  Branch (4041:7): [True: 1.21k, False: 0]
  ------------------
 4042|  1.21k|			free_sconv_object(sc);
 4043|  1.21k|		*p = aes->aes_mbs.s;
 4044|  1.21k|		if (r == 0) {
  ------------------
  |  Branch (4044:7): [True: 0, False: 1.21k]
  ------------------
 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.21k|			ret = -1;/* failure. */
 4049|  1.21k|	}
 4050|  81.5k|	return (ret);
 4051|  81.5k|}
archive_mstring_get_wcs:
 4056|   182k|{
 4057|   182k|	int r, ret = 0;
 4058|       |
 4059|   182k|	(void)a;/* UNUSED */
 4060|       |	/* Return WCS form if we already have it. */
 4061|   182k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   182k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4061:6): [True: 47.1k, False: 135k]
  ------------------
 4062|  47.1k|		*wp = aes->aes_wcs.s;
 4063|  47.1k|		return (ret);
 4064|  47.1k|	}
 4065|       |
 4066|   135k|	*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|   135k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   135k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4094:6): [True: 34.7k, False: 100k]
  ------------------
 4095|  34.7k|		const char *p; /* unused */
 4096|  34.7k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4097|  34.7k|	}
 4098|       |	/* Try converting MBS to WCS using native locale. */
 4099|   135k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   135k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4099:6): [True: 100k, False: 34.7k]
  ------------------
 4100|   100k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   100k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4101|   100k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4102|   100k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4103|   100k|		if (r == 0) {
  ------------------
  |  Branch (4103:7): [True: 65.7k, False: 34.6k]
  ------------------
 4104|  65.7k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|  65.7k|#define	AES_SET_WCS 4
  ------------------
 4105|  65.7k|			*wp = aes->aes_wcs.s;
 4106|  65.7k|		} else
 4107|  34.6k|			ret = -1;/* failure. */
 4108|   100k|	}
 4109|   135k|	return (ret);
 4110|   182k|}
archive_mstring_copy_mbs:
 4180|  26.9k|{
 4181|  26.9k|	if (mbs == NULL) {
  ------------------
  |  Branch (4181:6): [True: 4.45k, False: 22.4k]
  ------------------
 4182|  4.45k|		aes->aes_set = 0;
 4183|  4.45k|		return (0);
 4184|  4.45k|	}
 4185|  22.4k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4186|  26.9k|}
archive_mstring_copy_mbs_len:
 4191|  29.8k|{
 4192|  29.8k|	if (mbs == NULL) {
  ------------------
  |  Branch (4192:6): [True: 0, False: 29.8k]
  ------------------
 4193|      0|		aes->aes_set = 0;
 4194|      0|		return (0);
 4195|      0|	}
 4196|  29.8k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  29.8k|#define	AES_SET_MBS 1
  ------------------
 4197|  29.8k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  29.8k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4198|  29.8k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  29.8k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4199|  29.8k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  29.8k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4200|  29.8k|	return (0);
 4201|  29.8k|}
archive_mstring_copy_wcs:
 4205|  5.76k|{
 4206|  5.76k|	return archive_mstring_copy_wcs_len(aes, wcs,
 4207|  5.76k|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4207:5): [True: 0, False: 5.76k]
  ------------------
 4208|  5.76k|}
archive_mstring_copy_wcs_len:
 4227|  5.76k|{
 4228|  5.76k|	if (wcs == NULL) {
  ------------------
  |  Branch (4228:6): [True: 0, False: 5.76k]
  ------------------
 4229|      0|		aes->aes_set = 0;
 4230|      0|		return (0);
 4231|      0|	}
 4232|  5.76k|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  222|  5.76k|#define	AES_SET_WCS 4
  ------------------
 4233|  5.76k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  5.76k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4234|  5.76k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  5.76k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4235|  5.76k|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|  5.76k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4236|  5.76k|	return (0);
 4237|  5.76k|}
archive_mstring_copy_mbs_len_l:
 4242|   100k|{
 4243|   100k|	int r;
 4244|       |
 4245|   100k|	if (mbs == NULL) {
  ------------------
  |  Branch (4245:6): [True: 4.45k, False: 95.9k]
  ------------------
 4246|  4.45k|		aes->aes_set = 0;
 4247|  4.45k|		return (0);
 4248|  4.45k|	}
 4249|  95.9k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  95.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4250|  95.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  95.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4251|  95.9k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  95.9k|#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|  95.9k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4314|  95.9k|	if (r == 0)
  ------------------
  |  Branch (4314:6): [True: 91.9k, False: 3.93k]
  ------------------
 4315|  91.9k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  91.9k|#define	AES_SET_MBS 1
  ------------------
 4316|  3.93k|	else
 4317|  3.93k|		aes->aes_set = 0;
 4318|  95.9k|#endif
 4319|  95.9k|	return (r);
 4320|   100k|}
archive_mstring_update_utf8:
 4335|  33.9k|{
 4336|  33.9k|	struct archive_string_conv *sc;
 4337|  33.9k|	int r;
 4338|       |
 4339|  33.9k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4339:6): [True: 0, False: 33.9k]
  ------------------
 4340|      0|		aes->aes_set = 0;
 4341|      0|		return (0); /* Succeeded in clearing everything. */
 4342|      0|	}
 4343|       |
 4344|       |	/* Save the UTF8 string. */
 4345|  33.9k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  33.9k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  67.8k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 33.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4346|       |
 4347|       |	/* Empty the mbs and wcs strings. */
 4348|  33.9k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  33.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4349|  33.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  33.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4350|       |
 4351|  33.9k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  33.9k|#define	AES_SET_UTF8 2
  ------------------
 4352|       |
 4353|  33.9k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4354|  33.9k|	if (sc == NULL)
  ------------------
  |  Branch (4354:6): [True: 0, False: 33.9k]
  ------------------
 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|  33.9k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  33.9k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 33.9k]
  |  |  ------------------
  ------------------
 4378|       |
 4379|  33.9k|	if (a == NULL)
  ------------------
  |  Branch (4379:6): [True: 33.9k, False: 0]
  ------------------
 4380|  33.9k|		free_sconv_object(sc);
 4381|  33.9k|	if (r != 0)
  ------------------
  |  Branch (4381:6): [True: 27.8k, False: 6.02k]
  ------------------
 4382|  27.8k|		return (-1);
 4383|  6.02k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  221|  6.02k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  220|  6.02k|#define	AES_SET_MBS 1
  ------------------
 4384|       |
 4385|       |	/* Try converting MBS to WCS, return false on failure. */
 4386|  6.02k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4386:6): [True: 0, False: 6.02k]
  ------------------
 4387|  6.02k|	    aes->aes_mbs.length))
 4388|      0|		return (-1);
 4389|  6.02k|#endif
 4390|       |
 4391|       |	/* All conversions succeeded. */
 4392|  6.02k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  221|  6.02k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  222|  6.02k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  220|  6.02k|#define	AES_SET_MBS 1
  ------------------
 4393|       |
 4394|  6.02k|	return (0);
 4395|  6.02k|}
archive_string.c:archive_string_append:
  226|  9.31M|{
  227|  9.31M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (227:6): [True: 0, False: 9.31M]
  ------------------
  228|      0|		return (NULL);
  229|  9.31M|	if (s)
  ------------------
  |  Branch (229:6): [True: 9.30M, False: 12.8k]
  ------------------
  230|  9.30M|		memmove(as->s + as->length, p, s);
  231|  9.31M|	as->length += s;
  232|  9.31M|	as->s[as->length] = 0;
  233|  9.31M|	return (as);
  234|  9.31M|}
archive_string.c:archive_wstring_append:
  238|  16.0k|{
  239|  16.0k|	if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (239:6): [True: 0, False: 16.0k]
  ------------------
  240|      0|		return (NULL);
  241|  16.0k|	if (s)
  ------------------
  |  Branch (241:6): [True: 11.1k, False: 4.83k]
  ------------------
  242|  11.1k|		wmemmove(as->s + as->length, p, s);
  243|  16.0k|	as->length += s;
  244|  16.0k|	as->s[as->length] = 0;
  245|  16.0k|	return (as);
  246|  16.0k|}
archive_string.c:get_sconv_object:
 1700|   122k|{
 1701|   122k|	struct archive_string_conv *sc;
 1702|   122k|	unsigned current_codepage;
 1703|       |
 1704|       |	/* Check if we have made the sconv object. */
 1705|   122k|	sc = find_sconv_object(a, fc, tc);
 1706|   122k|	if (sc != NULL)
  ------------------
  |  Branch (1706:6): [True: 684, False: 121k]
  ------------------
 1707|    684|		return (sc);
 1708|       |
 1709|   121k|	if (a == NULL)
  ------------------
  |  Branch (1709:6): [True: 120k, False: 967]
  ------------------
 1710|   120k|		current_codepage = get_current_codepage();
 1711|    967|	else
 1712|    967|		current_codepage = a->current_codepage;
 1713|       |
 1714|   121k|	sc = create_sconv_object(canonical_charset_name(fc),
 1715|   121k|	    canonical_charset_name(tc), current_codepage, flag);
 1716|   121k|	if (sc == NULL) {
  ------------------
  |  Branch (1716:6): [True: 0, False: 121k]
  ------------------
 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|   121k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1728:6): [True: 0, False: 121k]
  ------------------
 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|   121k|	if (a != NULL)
  ------------------
  |  Branch (1748:6): [True: 967, False: 120k]
  ------------------
 1749|    967|		add_sconv_object(a, sc);
 1750|   121k|	return (sc);
 1751|   121k|}
archive_string.c:find_sconv_object:
  912|   122k|{
  913|   122k|	struct archive_string_conv *sc; 
  914|       |
  915|   122k|	if (a == NULL)
  ------------------
  |  Branch (915:6): [True: 120k, False: 1.65k]
  ------------------
  916|   120k|		return (NULL);
  917|       |
  918|  3.27k|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (918:22): [True: 2.30k, False: 967]
  ------------------
  919|  2.30k|		if (strcmp(sc->from_charset, fc) == 0 &&
  ------------------
  |  Branch (919:7): [True: 684, False: 1.62k]
  ------------------
  920|    684|		    strcmp(sc->to_charset, tc) == 0)
  ------------------
  |  Branch (920:7): [True: 684, False: 0]
  ------------------
  921|    684|			break;
  922|  2.30k|	}
  923|  1.65k|	return (sc);
  924|   122k|}
archive_string.c:get_current_codepage:
 1678|   121k|{
 1679|   121k|	return (-1);/* Unknown */
 1680|   121k|}
archive_string.c:create_sconv_object:
 1173|   121k|{
 1174|   121k|	struct archive_string_conv *sc; 
 1175|       |
 1176|   121k|	sc = calloc(1, sizeof(*sc));
 1177|   121k|	if (sc == NULL)
  ------------------
  |  Branch (1177:6): [True: 0, False: 121k]
  ------------------
 1178|      0|		return (NULL);
 1179|   121k|	sc->next = NULL;
 1180|   121k|	sc->from_charset = strdup(fc);
 1181|   121k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1181:6): [True: 0, False: 121k]
  ------------------
 1182|      0|		free(sc);
 1183|      0|		return (NULL);
 1184|      0|	}
 1185|   121k|	sc->to_charset = strdup(tc);
 1186|   121k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1186:6): [True: 0, False: 121k]
  ------------------
 1187|      0|		free(sc->from_charset);
 1188|      0|		free(sc);
 1189|      0|		return (NULL);
 1190|      0|	}
 1191|   121k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|   121k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 121k]
  |  |  ------------------
  ------------------
 1192|       |
 1193|   121k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|   121k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1193:6): [True: 85.7k, False: 36.1k]
  ------------------
 1194|       |		/*
 1195|       |		 * Convert characters from the current locale charset to
 1196|       |		 * a specified charset.
 1197|       |		 */
 1198|  85.7k|		sc->from_cp = current_codepage;
 1199|  85.7k|		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|  85.7k|	} else if (flag & SCONV_FROM_CHARSET) {
  ------------------
  |  |   91|  36.1k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1204:13): [True: 36.1k, False: 0]
  ------------------
 1205|       |		/*
 1206|       |		 * Convert characters from a specified charset to
 1207|       |		 * the current locale charset.
 1208|       |		 */
 1209|  36.1k|		sc->to_cp = current_codepage;
 1210|  36.1k|		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|  36.1k|	}
 1216|       |
 1217|       |	/*
 1218|       |	 * Check if "from charset" and "to charset" are the same.
 1219|       |	 */
 1220|   121k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1220:6): [True: 0, False: 121k]
  ------------------
 1221|   121k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1221:7): [True: 0, False: 121k]
  |  Branch (1221:38): [True: 0, False: 0]
  ------------------
 1222|      0|		sc->same = 1;
 1223|   121k|	else
 1224|   121k|		sc->same = 0;
 1225|       |
 1226|       |	/*
 1227|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1228|       |	 */
 1229|   121k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1229:6): [True: 85.7k, False: 36.1k]
  ------------------
 1230|  85.7k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|  85.7k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1231|  36.1k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1231:11): [True: 0, False: 36.1k]
  ------------------
 1232|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1233|  36.1k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1233:11): [True: 0, False: 36.1k]
  ------------------
 1234|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  109|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1235|   121k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1235:6): [True: 35.9k, False: 85.9k]
  ------------------
 1236|  35.9k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  35.9k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1237|  85.9k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1237:11): [True: 103, False: 85.8k]
  ------------------
 1238|    103|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  108|    103|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1239|  85.8k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1239:11): [True: 31, False: 85.7k]
  ------------------
 1240|     31|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  110|     31|#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|   121k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   121k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1267:6): [True: 36.1k, False: 85.7k]
  ------------------
 1268|  36.1k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  112|  36.1k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  36.1k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  36.1k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  106|  36.1k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1268:6): [True: 36.0k, False: 22]
  ------------------
 1269|       |#if defined(__APPLE__)
 1270|       |		if (flag & SCONV_TO_UTF8)
 1271|       |			flag |= SCONV_NORMALIZATION_D;
 1272|       |		else
 1273|       |#endif
 1274|  36.0k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   98|  36.0k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1275|  36.0k|	}
 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|   121k|#if defined(HAVE_ICONV)
 1301|   121k|	sc->cd_w = (iconv_t)-1;
 1302|       |	/*
 1303|       |	 * Create an iconv object.
 1304|       |	 */
 1305|   121k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|   121k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|   121k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   121k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   121k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1305:7): [True: 85.7k, False: 36.1k]
  ------------------
 1306|  85.7k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  106|  85.7k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  112|  85.7k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  85.7k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  85.7k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1306:6): [True: 0, False: 85.7k]
  ------------------
 1307|   121k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|   121k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1307:6): [True: 0, False: 121k]
  ------------------
 1308|       |		/* This case we won't use iconv. */
 1309|      0|		sc->cd = (iconv_t)-1;
 1310|   121k|	} else {
 1311|   121k|		sc->cd = iconv_open(tc, fc);
 1312|   121k|		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
  ------------------
  |  |   93|     22|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1312:7): [True: 22, False: 121k]
  |  Branch (1312:32): [True: 0, False: 22]
  ------------------
 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|   121k|	}
 1350|   121k|#endif	/* HAVE_ICONV */
 1351|       |
 1352|   121k|	sc->flag = flag;
 1353|       |
 1354|       |	/*
 1355|       |	 * Set up converters.
 1356|       |	 */
 1357|   121k|	setup_converter(sc);
 1358|       |
 1359|   121k|	return (sc);
 1360|   121k|}
archive_string.c:make_codepage_from_charset:
 1683|   121k|{
 1684|   121k|	(void)charset; /* UNUSED */
 1685|   121k|	return (-1);/* Unknown */
 1686|   121k|}
archive_string.c:canonical_charset_name:
 1133|   243k|{
 1134|   243k|	char cs[16];
 1135|   243k|	char *p;
 1136|   243k|	const char *s;
 1137|       |
 1138|   243k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1138:6): [True: 0, False: 243k]
  |  Branch (1138:25): [True: 0, False: 243k]
  ------------------
 1139|   243k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1139:9): [True: 0, False: 243k]
  ------------------
 1140|      0|		return (charset);
 1141|       |
 1142|       |	/* Copy name to uppercase. */
 1143|   243k|	p = cs;
 1144|   243k|	s = charset;
 1145|  2.55M|	while (*s) {
  ------------------
  |  Branch (1145:9): [True: 2.31M, False: 243k]
  ------------------
 1146|  2.31M|		char c = *s++;
 1147|  2.31M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1147:7): [True: 0, False: 2.31M]
  |  Branch (1147:19): [True: 0, False: 0]
  ------------------
 1148|      0|			c -= 'a' - 'A';
 1149|  2.31M|		*p++ = c;
 1150|  2.31M|	}
 1151|   243k|	*p++ = '\0';
 1152|       |
 1153|   243k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1153:6): [True: 121k, False: 122k]
  ------------------
 1154|   122k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1154:6): [True: 0, False: 122k]
  ------------------
 1155|   121k|		return ("UTF-8");
 1156|   122k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1156:6): [True: 103, False: 121k]
  ------------------
 1157|   121k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1157:6): [True: 0, False: 121k]
  ------------------
 1158|    103|		return ("UTF-16BE");
 1159|   121k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1159:6): [True: 31, False: 121k]
  ------------------
 1160|   121k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1160:6): [True: 0, False: 121k]
  ------------------
 1161|     31|		return ("UTF-16LE");
 1162|   121k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1162:6): [True: 0, False: 121k]
  ------------------
 1163|      0|		return ("CP932");
 1164|   121k|	return (charset);
 1165|   121k|}
archive_string.c:add_sconv_object:
  931|    967|{
  932|    967|	struct archive_string_conv **psc; 
  933|       |
  934|       |	/* Add a new sconv to sconv list. */
  935|    967|	psc = &(a->sconv);
  936|  1.23k|	while (*psc != NULL)
  ------------------
  |  Branch (936:9): [True: 263, False: 967]
  ------------------
  937|    263|		psc = &((*psc)->next);
  938|    967|	*psc = sc;
  939|    967|}
archive_string.c:get_current_charset:
 1755|   122k|{
 1756|   122k|	const char *cur_charset;
 1757|       |
 1758|   122k|	if (a == NULL)
  ------------------
  |  Branch (1758:6): [True: 120k, False: 1.65k]
  ------------------
 1759|   120k|		cur_charset = default_iconv_charset("");
 1760|  1.65k|	else {
 1761|  1.65k|		cur_charset = default_iconv_charset(a->current_code);
 1762|  1.65k|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1762:7): [True: 935, False: 716]
  ------------------
 1763|    935|			a->current_code = strdup(cur_charset);
 1764|    935|			a->current_codepage = get_current_codepage();
 1765|    935|			a->current_oemcp = get_current_oemcp();
 1766|    935|		}
 1767|  1.65k|	}
 1768|   122k|	return (cur_charset);
 1769|   122k|}
archive_string.c:default_iconv_charset:
  445|   122k|default_iconv_charset(const char *charset) {
  446|   122k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (446:6): [True: 121k, False: 935]
  |  Branch (446:25): [True: 716, False: 120k]
  ------------------
  447|    716|		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|   121k|	return nl_langinfo(CODESET);
  453|       |#elif defined(__BIONIC__)
  454|       |	return "UTF-8";
  455|       |#else
  456|       |	return "";
  457|       |#endif
  458|   122k|}
archive_string.c:get_current_oemcp:
 1689|    935|{
 1690|    935|	return (-1);/* Unknown */
 1691|    935|}
archive_string.c:free_sconv_object:
 1367|   121k|{
 1368|   121k|	free(sc->from_charset);
 1369|   121k|	free(sc->to_charset);
 1370|   121k|	archive_string_free(&sc->utftmp);
 1371|   121k|#if HAVE_ICONV
 1372|   121k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1372:6): [True: 121k, False: 22]
  ------------------
 1373|   121k|		iconv_close(sc->cd);
 1374|   121k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1374:6): [True: 0, False: 121k]
  ------------------
 1375|      0|		iconv_close(sc->cd_w);
 1376|   121k|#endif
 1377|   121k|	free(sc);
 1378|   121k|}
archive_string.c:setup_converter:
  953|   121k|{
  954|       |
  955|       |	/* Reset. */
  956|   121k|	sc->nconverter = 0;
  957|       |
  958|       |	/*
  959|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  960|       |	 * made by libarchive2.x.
  961|       |	 */
  962|   121k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|   121k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (962:6): [True: 0, False: 121k]
  ------------------
  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|   121k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|   121k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   121k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   121k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (970:6): [True: 0, False: 121k]
  ------------------
  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|   121k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|   121k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   121k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   121k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1013:6): [True: 134, False: 121k]
  ------------------
 1014|       |		/*
 1015|       |		 * At least we should normalize a UTF-16BE string.
 1016|       |		 */
 1017|    134|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|    134|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1017:7): [True: 0, False: 134]
  ------------------
 1018|      0|			add_converter(sc,archive_string_normalize_D);
 1019|    134|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|    134|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1019:12): [True: 134, False: 0]
  ------------------
 1020|    134|			add_converter(sc, archive_string_normalize_C);
 1021|       |
 1022|    134|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|    134|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1022:7): [True: 0, False: 134]
  ------------------
 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|    134|#if defined(HAVE_ICONV)
 1045|    134|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1045:7): [True: 134, False: 0]
  ------------------
 1046|    134|			add_converter(sc, iconv_strncat_in_locale);
 1047|    134|			return;
 1048|    134|		}
 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|    134|	}
 1062|       |
 1063|   121k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|   121k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1063:6): [True: 35.9k, False: 85.7k]
  ------------------
 1064|       |		/*
 1065|       |		 * At least we should normalize a UTF-8 string.
 1066|       |		 */
 1067|  35.9k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|  35.9k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1067:7): [True: 0, False: 35.9k]
  ------------------
 1068|      0|			add_converter(sc,archive_string_normalize_D);
 1069|  35.9k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|  35.9k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1069:12): [True: 35.9k, False: 0]
  ------------------
 1070|  35.9k|			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|  35.9k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  35.9k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1078:7): [True: 0, False: 35.9k]
  ------------------
 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|  35.9k|	}
 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|   121k|#if HAVE_ICONV
 1101|   121k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1101:6): [True: 121k, False: 22]
  ------------------
 1102|   121k|		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|   121k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   121k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1108:7): [True: 35.9k, False: 85.7k]
  ------------------
 1109|  35.9k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  105|  35.9k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1109:7): [True: 0, False: 35.9k]
  ------------------
 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|   121k|		return;
 1114|   121k|	}
 1115|     22|#endif
 1116|       |
 1117|       |	/*
 1118|       |	 * Try conversion in the best effort or no conversion.
 1119|       |	 */
 1120|     22|	if ((sc->flag & SCONV_BEST_EFFORT) || sc->same)
  ------------------
  |  |   93|     22|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1120:6): [True: 22, False: 0]
  |  Branch (1120:40): [True: 0, False: 0]
  ------------------
 1121|     22|		add_converter(sc, best_effort_strncat_in_locale);
 1122|      0|	else
 1123|       |		/* Make sure we have no converter. */
 1124|      0|		sc->nconverter = 0;
 1125|     22|}
archive_string.c:add_converter:
  945|   157k|{
  946|   157k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (946:6): [True: 0, False: 157k]
  |  Branch (946:20): [True: 0, False: 157k]
  ------------------
  947|      0|		__archive_errx(1, "Programming error");
  948|   157k|	sc->converter[sc->nconverter++] = converter;
  949|   157k|}
archive_string.c:_utf8_to_unicode:
 2374|  75.1M|{
 2375|  75.1M|	static const char utf8_count[256] = {
 2376|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2377|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2378|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2379|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2380|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2381|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2382|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2383|  75.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2384|  75.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2385|  75.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2386|  75.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2387|  75.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2388|  75.1M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2389|  75.1M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2390|  75.1M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2391|  75.1M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2392|  75.1M|	};
 2393|  75.1M|	int ch, i;
 2394|  75.1M|	int cnt;
 2395|  75.1M|	uint32_t wc;
 2396|       |
 2397|       |	/* Sanity check. */
 2398|  75.1M|	if (n == 0)
  ------------------
  |  Branch (2398:6): [True: 38.7k, False: 75.1M]
  ------------------
 2399|  38.7k|		return (0);
 2400|       |	/*
 2401|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2402|       |	 */
 2403|  75.1M|	ch = (unsigned char)*s;
 2404|  75.1M|	if (ch == 0)
  ------------------
  |  Branch (2404:6): [True: 0, False: 75.1M]
  ------------------
 2405|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2406|  75.1M|	cnt = utf8_count[ch];
 2407|       |
 2408|       |	/* Invalid sequence or there are not plenty bytes. */
 2409|  75.1M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2409:6): [True: 1.46k, False: 75.1M]
  ------------------
 2410|  1.46k|		cnt = (int)n;
 2411|  1.60k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2411:15): [True: 511, False: 1.09k]
  ------------------
 2412|    511|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2412:8): [True: 369, False: 142]
  ------------------
 2413|    369|				cnt = i;
 2414|    369|				break;
 2415|    369|			}
 2416|    511|		}
 2417|  1.46k|		goto invalid_sequence;
 2418|  1.46k|	}
 2419|       |
 2420|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2421|  75.1M|	switch (cnt) {
 2422|  74.7M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2422:2): [True: 74.7M, False: 434k]
  ------------------
 2423|  74.7M|		*pwc = ch & 0x7f;
 2424|  74.7M|		return (cnt);
 2425|  91.6k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2425:2): [True: 91.6k, False: 75.0M]
  ------------------
 2426|  91.6k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2426:7): [True: 42.7k, False: 48.8k]
  ------------------
 2427|  42.7k|			cnt = 1;
 2428|  42.7k|			goto invalid_sequence;
 2429|  42.7k|		}
 2430|  48.8k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2431|  48.8k|		return (cnt);
 2432|   129k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2432:2): [True: 129k, False: 75.0M]
  ------------------
 2433|   129k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2433:7): [True: 43.2k, False: 85.7k]
  ------------------
 2434|  43.2k|			cnt = 1;
 2435|  43.2k|			goto invalid_sequence;
 2436|  43.2k|		}
 2437|  85.7k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2437:7): [True: 40.1k, False: 45.6k]
  ------------------
 2438|  40.1k|			cnt = 2;
 2439|  40.1k|			goto invalid_sequence;
 2440|  40.1k|		}
 2441|  45.6k|		wc = ((ch & 0x0f) << 12)
 2442|  45.6k|		    | ((s[1] & 0x3f) << 6)
 2443|  45.6k|		    | (s[2] & 0x3f);
 2444|  45.6k|		if (wc < 0x800)
  ------------------
  |  Branch (2444:7): [True: 167, False: 45.4k]
  ------------------
 2445|    167|			goto invalid_sequence;/* Overlong sequence. */
 2446|  45.4k|		break;
 2447|  45.4k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2447:2): [True: 807, False: 75.1M]
  ------------------
 2448|    807|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2448:7): [True: 31, False: 776]
  ------------------
 2449|     31|			cnt = 1;
 2450|     31|			goto invalid_sequence;
 2451|     31|		}
 2452|    776|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2452:7): [True: 19, False: 757]
  ------------------
 2453|     19|			cnt = 2;
 2454|     19|			goto invalid_sequence;
 2455|     19|		}
 2456|    757|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2456:7): [True: 2, False: 755]
  ------------------
 2457|      2|			cnt = 3;
 2458|      2|			goto invalid_sequence;
 2459|      2|		}
 2460|    755|		wc = ((ch & 0x07) << 18)
 2461|    755|		    | ((s[1] & 0x3f) << 12)
 2462|    755|		    | ((s[2] & 0x3f) << 6)
 2463|    755|		    | (s[3] & 0x3f);
 2464|    755|		if (wc < 0x10000)
  ------------------
  |  Branch (2464:7): [True: 0, False: 755]
  ------------------
 2465|      0|			goto invalid_sequence;/* Overlong sequence. */
 2466|    755|		break;
 2467|   213k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2467:2): [True: 213k, False: 74.9M]
  ------------------
 2468|   213k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2468:7): [True: 3.06k, False: 209k]
  |  Branch (2468:21): [True: 1, False: 209k]
  ------------------
 2469|  3.06k|			cnt = 2;
 2470|   209k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2470:12): [True: 14.1k, False: 195k]
  |  Branch (2470:26): [True: 1.20k, False: 12.9k]
  ------------------
 2471|  1.20k|			cnt = 4;
 2472|   208k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2472:12): [True: 12.9k, False: 195k]
  |  Branch (2472:26): [True: 1.16k, False: 11.7k]
  ------------------
 2473|  1.16k|			cnt = 5;
 2474|   207k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2474:12): [True: 183, False: 207k]
  |  Branch (2474:26): [True: 2.02k, False: 205k]
  ------------------
 2475|  2.20k|			cnt = 6;
 2476|   205k|		else
 2477|   205k|			cnt = 1;
 2478|   213k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2478:7): [True: 1.32k, False: 211k]
  ------------------
 2479|  1.32k|			cnt = (int)n;
 2480|   218k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2480:15): [True: 12.7k, False: 206k]
  ------------------
 2481|  12.7k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2481:8): [True: 7.01k, False: 5.71k]
  ------------------
 2482|  7.01k|				cnt = i;
 2483|  7.01k|				break;
 2484|  7.01k|			}
 2485|  12.7k|		}
 2486|   213k|		goto invalid_sequence;
 2487|  75.1M|	}
 2488|       |
 2489|       |	/* The code point larger than 0x10FFFF is not legal
 2490|       |	 * Unicode values. */
 2491|  46.2k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|  46.2k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2491:6): [True: 0, False: 46.2k]
  ------------------
 2492|      0|		goto invalid_sequence;
 2493|       |	/* Correctly gets a Unicode, returns used bytes. */
 2494|  46.2k|	*pwc = wc;
 2495|  46.2k|	return (cnt);
 2496|   340k|invalid_sequence:
 2497|   340k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|   340k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2498|   340k|	return (cnt * -1);
 2499|  46.2k|}
archive_string.c:unicode_to_utf16be:
 2679|  10.6k|{
 2680|  10.6k|	char *utf16 = p;
 2681|       |
 2682|  10.6k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2682:6): [True: 26, False: 10.6k]
  ------------------
 2683|       |		/* We have a code point that won't fit into a
 2684|       |		 * wchar_t; convert it to a surrogate pair. */
 2685|     26|		if (remaining < 4)
  ------------------
  |  Branch (2685:7): [True: 0, False: 26]
  ------------------
 2686|      0|			return (0);
 2687|     26|		uc -= 0x10000;
 2688|     26|		archive_be16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2689|     26|		archive_be16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2690|     26|		return (4);
 2691|  10.6k|	} else {
 2692|  10.6k|		if (remaining < 2)
  ------------------
  |  Branch (2692:7): [True: 0, False: 10.6k]
  ------------------
 2693|      0|			return (0);
 2694|  10.6k|		archive_be16enc(utf16, (uint16_t)uc);
 2695|  10.6k|		return (2);
 2696|  10.6k|	}
 2697|  10.6k|}
archive_string.c:unicode_to_utf16le:
 2701|  3.78k|{
 2702|  3.78k|	char *utf16 = p;
 2703|       |
 2704|  3.78k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2704:6): [True: 58, False: 3.72k]
  ------------------
 2705|       |		/* We have a code point that won't fit into a
 2706|       |		 * wchar_t; convert it to a surrogate pair. */
 2707|     58|		if (remaining < 4)
  ------------------
  |  Branch (2707:7): [True: 0, False: 58]
  ------------------
 2708|      0|			return (0);
 2709|     58|		uc -= 0x10000;
 2710|     58|		archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2711|     58|		archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2712|     58|		return (4);
 2713|  3.72k|	} else {
 2714|  3.72k|		if (remaining < 2)
  ------------------
  |  Branch (2714:7): [True: 0, False: 3.72k]
  ------------------
 2715|      0|			return (0);
 2716|  3.72k|		archive_le16enc(utf16, (uint16_t)uc);
 2717|  3.72k|		return (2);
 2718|  3.72k|	}
 2719|  3.78k|}
archive_string.c:unicode_to_utf8:
 2573|   389k|{
 2574|   389k|	char *_p = p;
 2575|       |
 2576|       |	/* Invalid Unicode char maps to Replacement character */
 2577|   389k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  133|   389k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2577:6): [True: 0, False: 389k]
  ------------------
 2578|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2579|       |	/* Translate code point to UTF8 */
 2580|   389k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2580:6): [True: 0, False: 389k]
  ------------------
 2581|      0|		if (remaining == 0)
  ------------------
  |  Branch (2581:7): [True: 0, False: 0]
  ------------------
 2582|      0|			return (0);
 2583|      0|		*p++ = (char)uc;
 2584|   389k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2584:13): [True: 43.6k, False: 346k]
  ------------------
 2585|  43.6k|		if (remaining < 2)
  ------------------
  |  Branch (2585:7): [True: 75, False: 43.5k]
  ------------------
 2586|     75|			return (0);
 2587|  43.5k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2588|  43.5k|		*p++ = 0x80 | (uc & 0x3f);
 2589|   346k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2589:13): [True: 344k, False: 1.36k]
  ------------------
 2590|   344k|		if (remaining < 3)
  ------------------
  |  Branch (2590:7): [True: 4.17k, False: 340k]
  ------------------
 2591|  4.17k|			return (0);
 2592|   340k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2593|   340k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2594|   340k|		*p++ = 0x80 | (uc & 0x3f);
 2595|   340k|	} else {
 2596|  1.36k|		if (remaining < 4)
  ------------------
  |  Branch (2596:7): [True: 2, False: 1.36k]
  ------------------
 2597|      2|			return (0);
 2598|  1.36k|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2599|  1.36k|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2600|  1.36k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2601|  1.36k|		*p++ = 0x80 | (uc & 0x3f);
 2602|  1.36k|	}
 2603|   385k|	return (p - _p);
 2604|   389k|}
archive_string.c:utf16be_to_unicode:
 2608|  33.9k|{
 2609|  33.9k|	return (utf16_to_unicode(pwc, s, n, 1));
 2610|  33.9k|}
archive_string.c:utf16_to_unicode:
 2620|  64.7k|{
 2621|  64.7k|	const char *utf16 = s;
 2622|  64.7k|	unsigned uc;
 2623|       |
 2624|  64.7k|	if (n == 0)
  ------------------
  |  Branch (2624:6): [True: 1.67k, False: 63.0k]
  ------------------
 2625|  1.67k|		return (0);
 2626|  63.0k|	if (n == 1) {
  ------------------
  |  Branch (2626:6): [True: 0, False: 63.0k]
  ------------------
 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|  63.0k|	if (be)
  ------------------
  |  Branch (2632:6): [True: 32.5k, False: 30.4k]
  ------------------
 2633|  32.5k|		uc = archive_be16dec(utf16);
 2634|  30.4k|	else
 2635|  30.4k|		uc = archive_le16dec(utf16);
 2636|  63.0k|	utf16 += 2;
 2637|       |		
 2638|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2639|  63.0k|	if (IS_HIGH_SURROGATE_LA(uc)) {
  ------------------
  |  |  130|  63.0k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 16.8k, False: 46.1k]
  |  |  |  Branch (130:53): [True: 11.6k, False: 5.22k]
  |  |  ------------------
  ------------------
 2640|  11.6k|		unsigned uc2;
 2641|       |
 2642|  11.6k|		if (n >= 4) {
  ------------------
  |  Branch (2642:7): [True: 11.6k, False: 2]
  ------------------
 2643|  11.6k|			if (be)
  ------------------
  |  Branch (2643:8): [True: 8.70k, False: 2.94k]
  ------------------
 2644|  8.70k|				uc2 = archive_be16dec(utf16);
 2645|  2.94k|			else
 2646|  2.94k|				uc2 = archive_le16dec(utf16);
 2647|  11.6k|		} else
 2648|      2|			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: 148, False: 11.5k]
  |  |  |  Branch (131:53): [True: 84, False: 64]
  |  |  ------------------
  ------------------
 2650|     84|			uc = combine_surrogate_pair(uc, uc2);
 2651|     84|			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|  51.4k|	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  132|   102k|#define IS_SURROGATE_PAIR_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 5.30k, False: 46.1k]
  |  |  |  Branch (132:53): [True: 1.66k, False: 3.64k]
  |  |  ------------------
  ------------------
              	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  133|  49.8k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2667:34): [True: 0, False: 49.8k]
  ------------------
 2668|       |	 	/* Undescribed code point should be U+FFFD
 2669|       |	 	* (replacement character). */
 2670|  1.66k|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  1.66k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2671|  1.66k|		return (((int)(utf16 - s)) * -1);
 2672|  1.66k|	}
 2673|  49.8k|	*pwc = uc;
 2674|  49.8k|	return ((int)(utf16 - s));
 2675|  51.4k|}
archive_string.c:combine_surrogate_pair:
 2515|  2.07k|{
 2516|  2.07k|	uc -= 0xD800;
 2517|  2.07k|	uc *= 0x400;
 2518|  2.07k|	uc += uc2 - 0xDC00;
 2519|  2.07k|	uc += 0x10000;
 2520|  2.07k|	return (uc);
 2521|  2.07k|}
archive_string.c:utf16le_to_unicode:
 2614|  30.8k|{
 2615|  30.8k|	return (utf16_to_unicode(pwc, s, n, 0));
 2616|  30.8k|}
archive_string.c:cesu8_to_unicode:
 2534|  75.1M|{
 2535|  75.1M|	uint32_t wc = 0;
 2536|  75.1M|	int cnt;
 2537|       |
 2538|  75.1M|	cnt = _utf8_to_unicode(&wc, s, n);
 2539|  75.1M|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  130|  43.4k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 23.9k, False: 19.5k]
  |  |  |  Branch (130:53): [True: 22.5k, False: 1.35k]
  |  |  ------------------
  ------------------
  |  Branch (2539:6): [True: 43.4k, False: 75.1M]
  ------------------
 2540|  22.5k|		uint32_t wc2 = 0;
 2541|  22.5k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2541:7): [True: 57, False: 22.5k]
  ------------------
 2542|       |			/* Invalid byte sequence. */
 2543|     57|			goto invalid_sequence;
 2544|     57|		}
 2545|  22.5k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2546|  22.5k|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  131|  2.04k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 2.04k, False: 0]
  |  |  |  Branch (131:53): [True: 1.99k, False: 54]
  |  |  ------------------
  ------------------
  |  Branch (2546:7): [True: 20.4k, False: 2.04k]
  ------------------
 2547|       |			/* Invalid byte sequence. */
 2548|  20.5k|			goto invalid_sequence;
 2549|  20.5k|		}
 2550|  1.99k|		wc = combine_surrogate_pair(wc, wc2);
 2551|  1.99k|		cnt = 6;
 2552|  75.1M|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|  20.8k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 1.35k, False: 19.5k]
  |  |  |  Branch (131:53): [True: 1.00k, False: 351]
  |  |  ------------------
  ------------------
  |  Branch (2552:13): [True: 20.8k, False: 75.1M]
  ------------------
 2553|       |		/* Invalid byte sequence. */
 2554|  1.00k|		goto invalid_sequence;
 2555|  1.00k|	}
 2556|  75.1M|	*pwc = wc;
 2557|  75.1M|	return (cnt);
 2558|  21.5k|invalid_sequence:
 2559|  21.5k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  21.5k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2560|  21.5k|	if (cnt > 0)
  ------------------
  |  Branch (2560:6): [True: 1.11k, False: 20.4k]
  ------------------
 2561|  1.11k|		cnt *= -1;
 2562|  21.5k|	return (cnt);
 2563|  75.1M|}
archive_string.c:iconv_strncat_in_locale:
 2104|  88.5k|{
 2105|  88.5k|	ICONV_CONST char *itp;
 2106|  88.5k|	size_t remaining;
 2107|  88.5k|	iconv_t cd;
 2108|  88.5k|	char *outp;
 2109|  88.5k|	size_t avail, bs;
 2110|  88.5k|	int return_value = 0; /* success */
 2111|  88.5k|	size_t to_size, from_size;
 2112|       |
 2113|  88.5k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|  88.5k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  88.5k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  88.5k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2113:6): [True: 0, False: 88.5k]
  ------------------
 2114|      0|		to_size = 2;
 2115|  88.5k|	else
 2116|  88.5k|		to_size = 1;
 2117|  88.5k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|  88.5k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  88.5k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  88.5k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2117:6): [True: 1.67k, False: 86.9k]
  ------------------
 2118|  1.67k|		from_size = 2;
 2119|  86.9k|	else
 2120|  86.9k|		from_size = 1;
 2121|       |
 2122|  88.5k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2122:6): [True: 0, False: 88.5k]
  ------------------
 2123|      0|		return (-1);
 2124|       |
 2125|  88.5k|	cd = sc->cd;
 2126|  88.5k|	itp = (char *)(uintptr_t)_p;
 2127|  88.5k|	remaining = length;
 2128|  88.5k|	outp = as->s + as->length;
 2129|  88.5k|	avail = as->buffer_length - as->length - to_size;
 2130|  1.40M|	while (remaining >= from_size) {
  ------------------
  |  Branch (2130:9): [True: 1.39M, False: 11.3k]
  ------------------
 2131|  1.39M|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2132|       |
 2133|  1.39M|		if (result != (size_t)-1)
  ------------------
  |  Branch (2133:7): [True: 77.2k, False: 1.31M]
  ------------------
 2134|  77.2k|			break; /* Conversion completed. */
 2135|       |
 2136|  1.31M|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2136:7): [True: 1.31M, False: 260]
  |  Branch (2136:26): [True: 0, False: 260]
  ------------------
 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.31M|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|  1.31M|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|  1.31M|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  1.31M|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  1.31M|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2142:8): [True: 76.7k, False: 1.24M]
  ------------------
 2143|  76.7k|				size_t rbytes;
 2144|  76.7k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  76.7k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2144:9): [True: 76.7k, False: 0]
  ------------------
 2145|  76.7k|					rbytes = sizeof(utf8_replacement_char);
 2146|      0|				else
 2147|      0|					rbytes = 2;
 2148|       |
 2149|  76.7k|				if (avail < rbytes) {
  ------------------
  |  Branch (2149:9): [True: 312, False: 76.4k]
  ------------------
 2150|    312|					as->length = outp - as->s;
 2151|    312|					bs = as->buffer_length +
 2152|    312|					    (remaining * to_size) + rbytes;
 2153|    312|					if (NULL ==
  ------------------
  |  Branch (2153:10): [True: 0, False: 312]
  ------------------
 2154|    312|					    archive_string_ensure(as, bs))
 2155|      0|						return (-1);
 2156|    312|					outp = as->s + as->length;
 2157|    312|					avail = as->buffer_length
 2158|    312|					    - as->length - to_size;
 2159|    312|				}
 2160|  76.7k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  76.7k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2160:9): [True: 76.7k, False: 0]
  ------------------
 2161|  76.7k|					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|  76.7k|				outp += rbytes;
 2167|  76.7k|				avail -= rbytes;
 2168|  1.24M|			} else {
 2169|       |				/* Skip the illegal input bytes. */
 2170|  1.24M|				*outp++ = '?';
 2171|  1.24M|				avail--;
 2172|  1.24M|			}
 2173|  1.31M|			itp += from_size;
 2174|  1.31M|			remaining -= from_size;
 2175|  1.31M|			return_value = -1; /* failure */
 2176|  1.31M|		} else {
 2177|       |			/* E2BIG no output buffer,
 2178|       |			 * Increase an output buffer.  */
 2179|    260|			as->length = outp - as->s;
 2180|    260|			bs = as->buffer_length + remaining * 2;
 2181|    260|			if (NULL == archive_string_ensure(as, bs))
  ------------------
  |  Branch (2181:8): [True: 0, False: 260]
  ------------------
 2182|      0|				return (-1);
 2183|    260|			outp = as->s + as->length;
 2184|    260|			avail = as->buffer_length - as->length - to_size;
 2185|    260|		}
 2186|  1.31M|	}
 2187|  88.5k|	as->length = outp - as->s;
 2188|  88.5k|	as->s[as->length] = 0;
 2189|  88.5k|	if (to_size == 2)
  ------------------
  |  Branch (2189:6): [True: 0, False: 88.5k]
  ------------------
 2190|      0|		as->s[as->length+1] = 0;
 2191|  88.5k|	return (return_value);
 2192|  88.5k|}
archive_string.c:archive_string_normalize_C:
 3006|  40.4k|{
 3007|  40.4k|	const char *s = (const char *)_p;
 3008|  40.4k|	char *p, *endp;
 3009|  40.4k|	uint32_t uc, uc2;
 3010|  40.4k|	size_t w;
 3011|  40.4k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3012|  40.4k|	int (*parse)(uint32_t *, const char *, size_t);
 3013|  40.4k|	size_t (*unparse)(char *, size_t, uint32_t);
 3014|       |
 3015|  40.4k|	always_replace = 1;
 3016|  40.4k|	ts = 1;/* text size. */
 3017|  40.4k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  40.4k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3017:6): [True: 0, False: 40.4k]
  ------------------
 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|  40.4k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  109|  40.4k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (3022:13): [True: 0, False: 40.4k]
  ------------------
 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|  40.4k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  40.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (3027:13): [True: 0, False: 40.4k]
  ------------------
 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|  40.4k|	} else {
 3032|       |		/*
 3033|       |		 * This case is going to be converted to another
 3034|       |		 * character-set through iconv.
 3035|       |		 */
 3036|  40.4k|		always_replace = 0;
 3037|  40.4k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  40.4k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3037:7): [True: 1.32k, False: 39.0k]
  ------------------
 3038|  1.32k|			unparse = unicode_to_utf16be;
 3039|  1.32k|			ts = 2;
 3040|  39.0k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  39.0k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3040:14): [True: 348, False: 38.7k]
  ------------------
 3041|    348|			unparse = unicode_to_utf16le;
 3042|    348|			ts = 2;
 3043|  38.7k|		} else {
 3044|  38.7k|			unparse = unicode_to_utf8;
 3045|  38.7k|		}
 3046|  40.4k|	}
 3047|       |
 3048|  40.4k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  40.4k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3048:6): [True: 1.32k, False: 39.0k]
  ------------------
 3049|  1.32k|		parse = utf16be_to_unicode;
 3050|  1.32k|		tm = 1;
 3051|  1.32k|		spair = 4;/* surrogate pair size in UTF-16. */
 3052|  39.0k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  39.0k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3052:13): [True: 348, False: 38.7k]
  ------------------
 3053|    348|		parse = utf16le_to_unicode;
 3054|    348|		tm = 1;
 3055|    348|		spair = 4;/* surrogate pair size in UTF-16. */
 3056|  38.7k|	} else {
 3057|  38.7k|		parse = cesu8_to_unicode;
 3058|  38.7k|		tm = ts;
 3059|  38.7k|		spair = 6;/* surrogate pair size in UTF-8. */
 3060|  38.7k|	}
 3061|       |
 3062|  40.4k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (3062:6): [True: 0, False: 40.4k]
  ------------------
 3063|      0|		return (-1);
 3064|       |
 3065|  40.4k|	p = as->s + as->length;
 3066|  40.4k|	endp = as->s + as->buffer_length - ts;
 3067|   416k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3067:9): [True: 410k, False: 5.99k]
  ------------------
 3068|   410k|		const char *ucptr, *uc2ptr;
 3069|       |
 3070|   410k|		if (n < 0) {
  ------------------
  |  Branch (3070:7): [True: 272k, False: 137k]
  ------------------
 3071|       |			/* Use a replaced unicode character. */
 3072|   272k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2936|   272k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|   276k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 3.31k, False: 272k]
  |  |  ------------------
  |  | 2938|  3.31k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|  3.31k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|  3.31k|	as->length = p - as->s;			\
  |  |  |  | 2929|  3.31k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 3.31k]
  |  |  |  |  ------------------
  |  |  |  | 2930|  3.31k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|  3.31k|		return (-1);			\
  |  |  |  | 2932|  3.31k|	p = as->s + as->length;			\
  |  |  |  | 2933|  3.31k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|  3.31k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 3.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|  3.31k|	}					\
  |  | 2940|   272k|	p += w;					\
  |  | 2941|   272k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 272k]
  |  |  ------------------
  ------------------
 3073|   272k|			s += n*-1;
 3074|   272k|			len -= n*-1;
 3075|   272k|			ret = -1;
 3076|   272k|			continue;
 3077|   272k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3077:14): [True: 710, False: 136k]
  |  Branch (3077:28): [True: 0, False: 136k]
  ------------------
 3078|       |			/* uc is converted from a surrogate pair.
 3079|       |			 * this should be treated as a changed code. */
 3080|    710|			ucptr = NULL;
 3081|   136k|		else
 3082|   136k|			ucptr = s;
 3083|   137k|		s += n;
 3084|   137k|		len -= n;
 3085|       |
 3086|       |		/* Read second code point. */
 3087|  74.7M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3087:10): [True: 74.6M, False: 115k]
  ------------------
 3088|  74.6M|			uint32_t ucx[FDC_MAX];
 3089|  74.6M|			int ccx[FDC_MAX];
 3090|  74.6M|			int cl, cx, i, nx, ucx_size;
 3091|  74.6M|			int LIndex,SIndex;
 3092|  74.6M|			uint32_t nfc;
 3093|       |
 3094|  74.6M|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3094:8): [True: 734, False: 74.6M]
  |  Branch (3094:23): [True: 0, False: 74.6M]
  ------------------
 3095|       |				/* uc2 is converted from a surrogate pair.
 3096|       |			 	 * this should be treated as a changed code. */
 3097|    734|				uc2ptr = NULL;
 3098|  74.6M|			else
 3099|  74.6M|				uc2ptr = s;
 3100|  74.6M|			s += n2;
 3101|  74.6M|			len -= n2;
 3102|       |
 3103|       |			/*
 3104|       |			 * If current second code point is out of decomposable
 3105|       |			 * code points, finding compositions is unneeded.
 3106|       |			 */
 3107|  74.6M|			if (!IS_DECOMPOSABLE_BLOCK(uc2)) {
  ------------------
  |  |  986|  74.6M|	(((uc)>>8) <= 0x1D2 && u_decomposable_blocks[(uc)>>8])
  |  |  ------------------
  |  |  |  Branch (986:3): [True: 74.6M, False: 738]
  |  |  |  Branch (986:25): [True: 41.8k, False: 74.6M]
  |  |  ------------------
  ------------------
 3108|  74.6M|				WRITE_UC();
  ------------------
  |  | 2949|  74.6M|#define WRITE_UC()	do {			\
  |  | 2950|  74.6M|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 74.6M, False: 1.33k]
  |  |  ------------------
  |  | 2951|  74.6M|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 21.3k, False: 74.5M]
  |  |  ------------------
  |  | 2952|  74.6M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|  21.3k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|  21.3k|	as->length = p - as->s;			\
  |  |  |  | 2929|  21.3k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 21.3k]
  |  |  |  |  ------------------
  |  |  |  | 2930|  21.3k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|  21.3k|		return (-1);			\
  |  |  |  | 2932|  21.3k|	p = as->s + as->length;			\
  |  |  |  | 2933|  21.3k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|  21.3k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 21.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  74.6M|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 74.6M, False: 0]
  |  |  ------------------
  |  | 2954|    156|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 156, False: 74.6M]
  |  |  ------------------
  |  | 2955|    156|			*p++ = *ucptr++;	\
  |  | 2956|    156|			/* FALL THROUGH */	\
  |  | 2957|  19.7k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 19.6k, False: 74.5M]
  |  |  ------------------
  |  | 2958|  19.7k|			*p++ = *ucptr++;	\
  |  | 2959|  19.7k|			/* FALL THROUGH */	\
  |  | 2960|  51.2k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 31.4k, False: 74.5M]
  |  |  ------------------
  |  | 2961|  51.2k|			*p++ = *ucptr++;	\
  |  | 2962|  51.2k|			/* FALL THROUGH */	\
  |  | 2963|  74.6M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 74.5M, False: 51.2k]
  |  |  ------------------
  |  | 2964|  74.6M|			*p++ = *ucptr;		\
  |  | 2965|  74.6M|			break;			\
  |  | 2966|  74.6M|		}				\
  |  | 2967|  74.6M|		ucptr = NULL;			\
  |  | 2968|  74.6M|	} else {				\
  |  | 2969|  1.33k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|  1.33k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|  1.33k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 1, False: 1.33k]
  |  |  |  |  ------------------
  |  |  |  | 2938|      1|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|      1|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|      1|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|      1|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|      1|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|      1|		return (-1);			\
  |  |  |  |  |  | 2932|      1|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|      1|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|      1|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|      1|	}					\
  |  |  |  | 2940|  1.33k|	p += w;					\
  |  |  |  | 2941|  1.33k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 1.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|  1.33k|	}					\
  |  | 2971|  74.6M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 74.6M]
  |  |  ------------------
  ------------------
 3109|  74.6M|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|  74.6M|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|  74.6M|	uc = uc2;				\
  |  | 2923|  74.6M|	ucptr = uc2ptr;				\
  |  | 2924|  74.6M|	n = n2;					\
  |  | 2925|  74.6M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 74.6M]
  |  |  ------------------
  ------------------
 3110|  74.6M|				continue;
 3111|  74.6M|			}
 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|  41.8k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2875|  41.8k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3120:8): [True: 17.3k, False: 24.5k]
  ------------------
 3121|  17.3k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2878|  17.3k|#define HC_LCOUNT	19
  ------------------
  |  Branch (3121:8): [True: 531, False: 16.8k]
  ------------------
 3122|       |				/*
 3123|       |				 * Hangul Composition.
 3124|       |				 * 1. Two current code points are L and V.
 3125|       |				 */
 3126|    531|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2876|    531|#define HC_VBASE	0x1161
  ------------------
 3127|    531|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2879|    176|#define HC_VCOUNT	21
  ------------------
  |  Branch (3127:9): [True: 176, False: 355]
  |  Branch (3127:24): [True: 39, False: 137]
  ------------------
 3128|       |					/* Make syllable of form LV. */
 3129|     39|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2913|     39|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|     39|	uc = new_uc;				\
  |  | 2915|     39|	ucptr = NULL;				\
  |  | 2916|     39|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 39]
  |  |  ------------------
  ------------------
 3130|     39|					    (LIndex * HC_VCOUNT + VIndex) *
 3131|     39|					     HC_TCOUNT);
 3132|    492|				} else {
 3133|    492|					WRITE_UC();
  ------------------
  |  | 2949|    492|#define WRITE_UC()	do {			\
  |  | 2950|    492|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 492, False: 0]
  |  |  ------------------
  |  | 2951|    492|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 0, False: 492]
  |  |  ------------------
  |  | 2952|    492|			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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|    492|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 492, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 492]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 0, False: 492]
  |  |  ------------------
  |  | 2958|      0|			*p++ = *ucptr++;	\
  |  | 2959|      0|			/* FALL THROUGH */	\
  |  | 2960|    492|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 492, False: 0]
  |  |  ------------------
  |  | 2961|    492|			*p++ = *ucptr++;	\
  |  | 2962|    492|			/* FALL THROUGH */	\
  |  | 2963|    492|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 0, False: 492]
  |  |  ------------------
  |  | 2964|    492|			*p++ = *ucptr;		\
  |  | 2965|    492|			break;			\
  |  | 2966|    492|		}				\
  |  | 2967|    492|		ucptr = NULL;			\
  |  | 2968|    492|	} 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|    492|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 492]
  |  |  ------------------
  ------------------
 3134|    492|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|    492|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|    492|	uc = uc2;				\
  |  | 2923|    492|	ucptr = uc2ptr;				\
  |  | 2924|    492|	n = n2;					\
  |  | 2925|    492|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 492]
  |  |  ------------------
  ------------------
 3135|    492|				}
 3136|    531|				continue;
 3137|  41.3k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2874|  41.3k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3137:15): [True: 4.50k, False: 36.8k]
  ------------------
 3138|  4.50k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2882|  45.8k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2878|  4.50k|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2881|  4.50k|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2879|  4.50k|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2880|  4.50k|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2880|  3.76k|#define HC_TCOUNT	28
  ------------------
  |  Branch (3138:8): [True: 3.76k, False: 741]
  |  Branch (3138:30): [True: 279, False: 3.48k]
  ------------------
 3139|       |				/*
 3140|       |				 * Hangul Composition.
 3141|       |				 * 2. Two current code points are LV and T.
 3142|       |				 */
 3143|    279|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2877|    279|#define HC_TBASE	0x11A7
  ------------------
 3144|    279|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2880|    274|#define HC_TCOUNT	28
  ------------------
  |  Branch (3144:9): [True: 274, False: 5]
  |  Branch (3144:23): [True: 21, False: 253]
  ------------------
 3145|       |					/* Make syllable of form LVT. */
 3146|     21|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2913|     21|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|     21|	uc = new_uc;				\
  |  | 2915|     21|	ucptr = NULL;				\
  |  | 2916|     21|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 21]
  |  |  ------------------
  ------------------
 3147|    258|				} else {
 3148|    258|					WRITE_UC();
  ------------------
  |  | 2949|    258|#define WRITE_UC()	do {			\
  |  | 2950|    258|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 240, False: 18]
  |  |  ------------------
  |  | 2951|    240|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 0, False: 240]
  |  |  ------------------
  |  | 2952|    240|			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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|    240|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 240, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 240]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 0, False: 240]
  |  |  ------------------
  |  | 2958|      0|			*p++ = *ucptr++;	\
  |  | 2959|      0|			/* FALL THROUGH */	\
  |  | 2960|    240|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 240, False: 0]
  |  |  ------------------
  |  | 2961|    240|			*p++ = *ucptr++;	\
  |  | 2962|    240|			/* FALL THROUGH */	\
  |  | 2963|    240|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 0, False: 240]
  |  |  ------------------
  |  | 2964|    240|			*p++ = *ucptr;		\
  |  | 2965|    240|			break;			\
  |  | 2966|    240|		}				\
  |  | 2967|    240|		ucptr = NULL;			\
  |  | 2968|    240|	} else {				\
  |  | 2969|     18|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|     18|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|     18|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  |  | 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|     18|	p += w;					\
  |  |  |  | 2941|     18|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|     18|	}					\
  |  | 2971|    258|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 258]
  |  |  ------------------
  ------------------
 3149|    258|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|    258|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|    258|	uc = uc2;				\
  |  | 2923|    258|	ucptr = uc2ptr;				\
  |  | 2924|    258|	n = n2;					\
  |  | 2925|    258|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 258]
  |  |  ------------------
  ------------------
 3150|    258|				}
 3151|    279|				continue;
 3152|  41.0k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3152:15): [True: 138, False: 40.9k]
  ------------------
 3153|       |				/* A composition to current code points
 3154|       |				 * is found. */
 3155|    138|				UPDATE_UC(nfc);
  ------------------
  |  | 2913|    138|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|    138|	uc = new_uc;				\
  |  | 2915|    138|	ucptr = NULL;				\
  |  | 2916|    138|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 138]
  |  |  ------------------
  ------------------
 3156|    138|				continue;
 3157|  40.9k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1007|  40.9k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 161, False: 40.7k]
  |  |  ------------------
  |  | 1008|  40.9k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3157:15): [True: 18.9k, False: 21.9k]
  ------------------
 3158|       |				/* Clearly 'uc2' the second code point is not
 3159|       |				 * a decomposable code. */
 3160|  18.9k|				WRITE_UC();
  ------------------
  |  | 2949|  18.9k|#define WRITE_UC()	do {			\
  |  | 2950|  18.9k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 18.9k, False: 25]
  |  |  ------------------
  |  | 2951|  18.9k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 3, False: 18.9k]
  |  |  ------------------
  |  | 2952|  18.9k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|      3|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|      3|	as->length = p - as->s;			\
  |  |  |  | 2929|      3|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  | 2930|      3|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|      3|		return (-1);			\
  |  |  |  | 2932|      3|	p = as->s + as->length;			\
  |  |  |  | 2933|      3|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|      3|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  18.9k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 18.9k, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 18.9k]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 0, False: 18.9k]
  |  |  ------------------
  |  | 2958|      0|			*p++ = *ucptr++;	\
  |  | 2959|      0|			/* FALL THROUGH */	\
  |  | 2960|  17.2k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 17.2k, False: 1.68k]
  |  |  ------------------
  |  | 2961|  17.2k|			*p++ = *ucptr++;	\
  |  | 2962|  17.2k|			/* FALL THROUGH */	\
  |  | 2963|  18.9k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 1.68k, False: 17.2k]
  |  |  ------------------
  |  | 2964|  18.9k|			*p++ = *ucptr;		\
  |  | 2965|  18.9k|			break;			\
  |  | 2966|  18.9k|		}				\
  |  | 2967|  18.9k|		ucptr = NULL;			\
  |  | 2968|  18.9k|	} else {				\
  |  | 2969|     25|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|     25|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|     25|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 0, False: 25]
  |  |  |  |  ------------------
  |  |  |  | 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|     25|	p += w;					\
  |  |  |  | 2941|     25|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|     25|	}					\
  |  | 2971|  18.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 18.9k]
  |  |  ------------------
  ------------------
 3161|  18.9k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|  18.9k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|  18.9k|	uc = uc2;				\
  |  | 2923|  18.9k|	ucptr = uc2ptr;				\
  |  | 2924|  18.9k|	n = n2;					\
  |  | 2925|  18.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 18.9k]
  |  |  ------------------
  ------------------
 3162|  18.9k|				continue;
 3163|  18.9k|			}
 3164|       |
 3165|       |			/*
 3166|       |			 * Collect following decomposable code points.
 3167|       |			 */
 3168|  21.9k|			cx = 0;
 3169|  21.9k|			ucx[0] = uc2;
 3170|  21.9k|			ccx[0] = cl;
 3171|  21.9k|			COLLECT_CPS(1);
  ------------------
  |  | 2976|  21.9k|#define COLLECT_CPS(start)	do {		\
  |  | 2977|  21.9k|	int _i;					\
  |  | 2978|  43.1k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2907|  43.1k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2978:19): [True: 43.1k, False: 4]
  |  |  ------------------
  |  | 2979|  43.1k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2980|  43.1k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2980:7): [True: 1.24k, False: 41.8k]
  |  |  ------------------
  |  | 2981|  43.1k|			break;			\
  |  | 2982|  43.1k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  41.8k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 154, False: 41.7k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  41.8k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2983|  41.8k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2983:7): [True: 20.7k, False: 21.1k]
  |  |  |  Branch (2983:19): [True: 20.7k, False: 47]
  |  |  |  Branch (2983:32): [True: 20.7k, False: 3]
  |  |  ------------------
  |  | 2984|  41.8k|			break;			\
  |  | 2985|  41.8k|		s += nx;			\
  |  | 2986|  21.1k|		len -= nx;			\
  |  | 2987|  21.1k|		cl = cx;			\
  |  | 2988|  21.1k|		ccx[_i] = cx;			\
  |  | 2989|  21.1k|	}					\
  |  | 2990|  21.9k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2907|  21.9k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2990:6): [True: 4, False: 21.9k]
  |  |  ------------------
  |  | 2991|      4|		ret = -1;			\
  |  | 2992|      4|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2907|      4|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2993|      4|	} else					\
  |  | 2994|  21.9k|		ucx_size = _i;			\
  |  | 2995|  21.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2995:10): [Folded, False: 21.9k]
  |  |  ------------------
  ------------------
 3172|       |
 3173|       |			/*
 3174|       |			 * Find a composed code in the collected code points.
 3175|       |			 */
 3176|  21.9k|			i = 1;
 3177|  64.8k|			while (i < ucx_size) {
  ------------------
  |  Branch (3177:11): [True: 42.8k, False: 21.9k]
  ------------------
 3178|  42.8k|				int j;
 3179|       |
 3180|  42.8k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3180:9): [True: 21.7k, False: 21.0k]
  ------------------
 3181|  21.7k|					i++;
 3182|  21.7k|					continue;
 3183|  21.7k|				}
 3184|       |
 3185|       |				/*
 3186|       |				 * nfc is composed of uc and ucx[i].
 3187|       |				 */
 3188|  21.0k|				UPDATE_UC(nfc);
  ------------------
  |  | 2913|  21.0k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|  21.0k|	uc = new_uc;				\
  |  | 2915|  21.0k|	ucptr = NULL;				\
  |  | 2916|  21.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 3189|       |
 3190|       |				/*
 3191|       |				 * Remove ucx[i] by shifting
 3192|       |				 * following code points.
 3193|       |				 */
 3194|  21.0k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3194:17): [True: 0, False: 21.0k]
  ------------------
 3195|      0|					ucx[j] = ucx[j+1];
 3196|      0|					ccx[j] = ccx[j+1];
 3197|      0|				}
 3198|  21.0k|				ucx_size --;
 3199|       |
 3200|       |				/*
 3201|       |				 * Collect following code points blocked
 3202|       |				 * by ucx[i] the removed code point.
 3203|       |				 */
 3204|  21.0k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3204:9): [True: 21.0k, False: 0]
  |  Branch (3204:25): [True: 21.0k, False: 0]
  ------------------
 3205|  21.0k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3205:9): [True: 20.0k, False: 1.00k]
  |  Branch (3205:19): [True: 632, False: 19.4k]
  ------------------
 3206|    632|					cl =  ccx[ucx_size-1];
 3207|    632|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 2976|    632|#define COLLECT_CPS(start)	do {		\
  |  | 2977|    632|	int _i;					\
  |  | 2978|  1.26k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2907|  1.26k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2978:19): [True: 1.26k, False: 0]
  |  |  ------------------
  |  | 2979|  1.26k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2980|  1.26k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2980:7): [True: 0, False: 1.26k]
  |  |  ------------------
  |  | 2981|  1.26k|			break;			\
  |  | 2982|  1.26k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  1.26k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 632, False: 632]
  |  |  |  |  ------------------
  |  |  |  | 1008|  1.26k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2983|  1.26k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2983:7): [True: 632, False: 632]
  |  |  |  Branch (2983:19): [True: 632, False: 0]
  |  |  |  Branch (2983:32): [True: 632, False: 0]
  |  |  ------------------
  |  | 2984|  1.26k|			break;			\
  |  | 2985|  1.26k|		s += nx;			\
  |  | 2986|    632|		len -= nx;			\
  |  | 2987|    632|		cl = cx;			\
  |  | 2988|    632|		ccx[_i] = cx;			\
  |  | 2989|    632|	}					\
  |  | 2990|    632|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2907|    632|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2990:6): [True: 0, False: 632]
  |  |  ------------------
  |  | 2991|      0|		ret = -1;			\
  |  | 2992|      0|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2907|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2993|      0|	} else					\
  |  | 2994|    632|		ucx_size = _i;			\
  |  | 2995|    632|} while (0)
  |  |  ------------------
  |  |  |  Branch (2995:10): [Folded, False: 632]
  |  |  ------------------
  ------------------
 3208|    632|				}
 3209|       |				/*
 3210|       |				 * Restart finding a composed code with
 3211|       |				 * the updated uc from the top of the
 3212|       |				 * collected code points.
 3213|       |				 */
 3214|  21.0k|				i = 0;
 3215|  21.0k|			}
 3216|       |
 3217|       |			/*
 3218|       |			 * Apparently the current code points are not
 3219|       |			 * decomposed characters or already composed.
 3220|       |			 */
 3221|  21.9k|			WRITE_UC();
  ------------------
  |  | 2949|  21.9k|#define WRITE_UC()	do {			\
  |  | 2950|  21.9k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 862, False: 21.0k]
  |  |  ------------------
  |  | 2951|    862|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 0, False: 862]
  |  |  ------------------
  |  | 2952|    862|			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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|    862|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 862, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 862]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|      3|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 3, False: 859]
  |  |  ------------------
  |  | 2958|      3|			*p++ = *ucptr++;	\
  |  | 2959|      3|			/* FALL THROUGH */	\
  |  | 2960|    469|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 466, False: 396]
  |  |  ------------------
  |  | 2961|    469|			*p++ = *ucptr++;	\
  |  | 2962|    469|			/* FALL THROUGH */	\
  |  | 2963|    862|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 393, False: 469]
  |  |  ------------------
  |  | 2964|    862|			*p++ = *ucptr;		\
  |  | 2965|    862|			break;			\
  |  | 2966|    862|		}				\
  |  | 2967|    862|		ucptr = NULL;			\
  |  | 2968|  21.0k|	} else {				\
  |  | 2969|  21.0k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|  21.0k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|  21.0k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 0, False: 21.0k]
  |  |  |  |  ------------------
  |  |  |  | 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|  21.0k|	p += w;					\
  |  |  |  | 2941|  21.0k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 21.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|  21.0k|	}					\
  |  | 2971|  21.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 21.9k]
  |  |  ------------------
  ------------------
 3222|  44.6k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3222:16): [True: 22.6k, False: 21.9k]
  ------------------
 3223|  22.6k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2936|  44.6k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|  22.6k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 3, False: 22.6k]
  |  |  ------------------
  |  | 2938|      3|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|      3|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|      3|	as->length = p - as->s;			\
  |  |  |  | 2929|      3|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  | 2930|      3|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|      3|		return (-1);			\
  |  |  |  | 2932|      3|	p = as->s + as->length;			\
  |  |  |  | 2933|      3|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|      3|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|      3|	}					\
  |  | 2940|  22.6k|	p += w;					\
  |  | 2941|  22.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 22.6k]
  |  |  ------------------
  ------------------
 3224|       |
 3225|       |			/*
 3226|       |			 * Flush out remaining canonical combining characters.
 3227|       |			 */
 3228|  21.9k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3228:8): [True: 20.7k, False: 1.24k]
  |  Branch (3228:18): [True: 35, False: 20.6k]
  |  Branch (3228:30): [True: 35, False: 0]
  ------------------
 3229|    758|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3229:12): [True: 755, False: 3]
  ------------------
 3230|    758|				    > 0) {
 3231|    755|					cx = CCC(ucx[0]);
  ------------------
  |  | 1007|    755|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 0, False: 755]
  |  |  ------------------
  |  | 1008|    755|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
 3232|    755|					if (cl > cx)
  ------------------
  |  Branch (3232:10): [True: 32, False: 723]
  ------------------
 3233|     32|						break;
 3234|    723|					s += nx;
 3235|    723|					len -= nx;
 3236|    723|					cl = cx;
 3237|    723|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2936|    723|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|    723|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 0, False: 723]
  |  |  ------------------
  |  | 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|    723|	p += w;					\
  |  | 2941|    723|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 723]
  |  |  ------------------
  ------------------
 3238|    723|				}
 3239|     35|			}
 3240|  21.9k|			break;
 3241|  21.9k|		}
 3242|   137k|		if (n2 < 0) {
  ------------------
  |  Branch (3242:7): [True: 81.1k, False: 56.3k]
  ------------------
 3243|  81.1k|			WRITE_UC();
  ------------------
  |  | 2949|  81.1k|#define WRITE_UC()	do {			\
  |  | 2950|  81.1k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 80.9k, False: 193]
  |  |  ------------------
  |  | 2951|  80.9k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 428, False: 80.5k]
  |  |  ------------------
  |  | 2952|  80.9k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|    428|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    428|	as->length = p - as->s;			\
  |  |  |  | 2929|    428|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 428]
  |  |  |  |  ------------------
  |  |  |  | 2930|    428|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    428|		return (-1);			\
  |  |  |  | 2932|    428|	p = as->s + as->length;			\
  |  |  |  | 2933|    428|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    428|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 428]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  80.9k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 80.9k, False: 0]
  |  |  ------------------
  |  | 2954|    164|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 164, False: 80.8k]
  |  |  ------------------
  |  | 2955|    164|			*p++ = *ucptr++;	\
  |  | 2956|    164|			/* FALL THROUGH */	\
  |  | 2957|    390|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 226, False: 80.7k]
  |  |  ------------------
  |  | 2958|    390|			*p++ = *ucptr++;	\
  |  | 2959|    390|			/* FALL THROUGH */	\
  |  | 2960|  1.76k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 1.37k, False: 79.6k]
  |  |  ------------------
  |  | 2961|  1.76k|			*p++ = *ucptr++;	\
  |  | 2962|  1.76k|			/* FALL THROUGH */	\
  |  | 2963|  80.9k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 79.2k, False: 1.76k]
  |  |  ------------------
  |  | 2964|  80.9k|			*p++ = *ucptr;		\
  |  | 2965|  80.9k|			break;			\
  |  | 2966|  80.9k|		}				\
  |  | 2967|  80.9k|		ucptr = NULL;			\
  |  | 2968|  80.9k|	} else {				\
  |  | 2969|    193|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    193|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    265|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 72, False: 193]
  |  |  |  |  ------------------
  |  |  |  | 2938|     72|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     72|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     72|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     72|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 72]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     72|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     72|		return (-1);			\
  |  |  |  |  |  | 2932|     72|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     72|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     72|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 72]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     72|	}					\
  |  |  |  | 2940|    193|	p += w;					\
  |  |  |  | 2941|    193|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 193]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    193|	}					\
  |  | 2971|  81.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 81.1k]
  |  |  ------------------
  ------------------
 3244|       |			/* Use a replaced unicode character. */
 3245|  81.1k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2936|  81.1k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|  82.0k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 857, False: 81.1k]
  |  |  ------------------
  |  | 2938|    857|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|    857|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    857|	as->length = p - as->s;			\
  |  |  |  | 2929|    857|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 857]
  |  |  |  |  ------------------
  |  |  |  | 2930|    857|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    857|		return (-1);			\
  |  |  |  | 2932|    857|	p = as->s + as->length;			\
  |  |  |  | 2933|    857|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    857|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 857]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|    857|	}					\
  |  | 2940|  81.1k|	p += w;					\
  |  | 2941|  81.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 81.1k]
  |  |  ------------------
  ------------------
 3246|  81.1k|			s += n2*-1;
 3247|  81.1k|			len -= n2*-1;
 3248|  81.1k|			ret = -1;
 3249|  81.1k|			continue;
 3250|  81.1k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3250:14): [True: 34.4k, False: 21.9k]
  ------------------
 3251|  34.4k|			WRITE_UC();
  ------------------
  |  | 2949|  34.4k|#define WRITE_UC()	do {			\
  |  | 2950|  34.4k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 34.3k, False: 55]
  |  |  ------------------
  |  | 2951|  34.3k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 634, False: 33.7k]
  |  |  ------------------
  |  | 2952|  34.3k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|    634|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    634|	as->length = p - as->s;			\
  |  |  |  | 2929|    634|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 634]
  |  |  |  |  ------------------
  |  |  |  | 2930|    634|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    634|		return (-1);			\
  |  |  |  | 2932|    634|	p = as->s + as->length;			\
  |  |  |  | 2933|    634|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    634|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 634]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  34.3k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 34.3k, False: 0]
  |  |  ------------------
  |  | 2954|    281|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 281, False: 34.0k]
  |  |  ------------------
  |  | 2955|    281|			*p++ = *ucptr++;	\
  |  | 2956|    281|			/* FALL THROUGH */	\
  |  | 2957|    281|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 0, False: 34.3k]
  |  |  ------------------
  |  | 2958|    281|			*p++ = *ucptr++;	\
  |  | 2959|    281|			/* FALL THROUGH */	\
  |  | 2960|  1.94k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 1.66k, False: 32.7k]
  |  |  ------------------
  |  | 2961|  1.94k|			*p++ = *ucptr++;	\
  |  | 2962|  1.94k|			/* FALL THROUGH */	\
  |  | 2963|  34.3k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 32.4k, False: 1.94k]
  |  |  ------------------
  |  | 2964|  34.3k|			*p++ = *ucptr;		\
  |  | 2965|  34.3k|			break;			\
  |  | 2966|  34.3k|		}				\
  |  | 2967|  34.3k|		ucptr = NULL;			\
  |  | 2968|  34.3k|	} else {				\
  |  | 2969|     55|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|     55|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|     56|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 1, False: 55]
  |  |  |  |  ------------------
  |  |  |  | 2938|      1|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|      1|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|      1|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|      1|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|      1|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|      1|		return (-1);			\
  |  |  |  |  |  | 2932|      1|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|      1|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|      1|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|      1|	}					\
  |  |  |  | 2940|     55|	p += w;					\
  |  |  |  | 2941|     55|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 55]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|     55|	}					\
  |  | 2971|  34.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 34.4k]
  |  |  ------------------
  ------------------
 3252|  34.4k|			break;
 3253|  34.4k|		}
 3254|   137k|	}
 3255|  40.4k|	as->length = p - as->s;
 3256|  40.4k|	as->s[as->length] = '\0';
 3257|  40.4k|	if (ts == 2)
  ------------------
  |  Branch (3257:6): [True: 1.67k, False: 38.7k]
  ------------------
 3258|  1.67k|		as->s[as->length+1] = '\0';
 3259|  40.4k|	return (ret);
 3260|  40.4k|}
archive_string.c:get_nfc:
 2886|  83.9k|{
 2887|  83.9k|	int t, b;
 2888|       |
 2889|  83.9k|	t = 0;
 2890|  83.9k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2891|   837k|	while (b >= t) {
  ------------------
  |  Branch (2891:9): [True: 774k, False: 62.7k]
  ------------------
 2892|   774k|		int m = (t + b) / 2;
 2893|   774k|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2893:7): [True: 428k, False: 346k]
  ------------------
 2894|   428k|			t = m + 1;
 2895|   346k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2895:12): [True: 280k, False: 65.6k]
  ------------------
 2896|   280k|			b = m - 1;
 2897|  65.6k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2897:12): [True: 22.9k, False: 42.6k]
  ------------------
 2898|  22.9k|			t = m + 1;
 2899|  42.6k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2899:12): [True: 21.4k, False: 21.2k]
  ------------------
 2900|  21.4k|			b = m - 1;
 2901|  21.2k|		else
 2902|  21.2k|			return (u_composition_table[m].nfc);
 2903|   774k|	}
 2904|  62.7k|	return (0);
 2905|  83.9k|}
archive_string.c:utf16nbytes:
 1992|  2.69k|{
 1993|  2.69k|	size_t s;
 1994|  2.69k|	const char *p, *pp;
 1995|       |
 1996|  2.69k|	if (_p == NULL)
  ------------------
  |  Branch (1996:6): [True: 0, False: 2.69k]
  ------------------
 1997|      0|		return (0);
 1998|  2.69k|	p = (const char *)_p;
 1999|       |
 2000|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 2001|  2.69k|	s = 0;
 2002|  2.69k|	pp = p;
 2003|  2.69k|	n >>= 1;
 2004|  65.4k|	while (s < n && (pp[0] || pp[1])) {
  ------------------
  |  Branch (2004:9): [True: 64.1k, False: 1.37k]
  |  Branch (2004:19): [True: 53.1k, False: 10.9k]
  |  Branch (2004:28): [True: 9.61k, False: 1.31k]
  ------------------
 2005|  62.7k|		pp += 2;
 2006|  62.7k|		s++;
 2007|  62.7k|	}
 2008|  2.69k|	return (s<<1);
 2009|  2.69k|}
archive_string.c:mbsnbytes:
 1972|   149k|{
 1973|   149k|	size_t s;
 1974|   149k|	const char *p, *pp;
 1975|       |
 1976|   149k|	if (_p == NULL)
  ------------------
  |  Branch (1976:6): [True: 0, False: 149k]
  ------------------
 1977|      0|		return (0);
 1978|   149k|	p = (const char *)_p;
 1979|       |
 1980|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1981|   149k|	s = 0;
 1982|   149k|	pp = p;
 1983|  77.9M|	while (s < n && *pp) {
  ------------------
  |  Branch (1983:9): [True: 77.8M, False: 121k]
  |  Branch (1983:18): [True: 77.7M, False: 27.7k]
  ------------------
 1984|  77.7M|		pp++;
 1985|  77.7M|		s++;
 1986|  77.7M|	}
 1987|   149k|	return (s);
 1988|   149k|}

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

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

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

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

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

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

