archive_acl_clear:
  129|   890k|{
  130|   890k|	struct archive_acl_entry *ap;
  131|       |
  132|   891k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 1.32k, False: 890k]
  ------------------
  133|  1.32k|		ap = acl->acl_head->next;
  134|  1.32k|		archive_mstring_clean(&acl->acl_head->name);
  135|  1.32k|		free(acl->acl_head);
  136|  1.32k|		acl->acl_head = ap;
  137|  1.32k|	}
  138|   890k|	free(acl->acl_text_w);
  139|   890k|	acl->acl_text_w = NULL;
  140|   890k|	free(acl->acl_text);
  141|   890k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   890k|	acl->acl_types = 0;
  144|   890k|	acl->acl_state = 0; /* Not counting. */
  145|   890k|}
archive_acl_count:
  380|    576|{
  381|    576|	int count;
  382|    576|	struct archive_acl_entry *ap;
  383|       |
  384|    576|	count = 0;
  385|    576|	ap = acl->acl_head;
  386|  1.89k|	while (ap != NULL) {
  ------------------
  |  Branch (386:9): [True: 1.32k, False: 576]
  ------------------
  387|  1.32k|		if ((ap->type & want_type) != 0)
  ------------------
  |  Branch (387:7): [True: 1.32k, False: 0]
  ------------------
  388|  1.32k|			count++;
  389|  1.32k|		ap = ap->next;
  390|  1.32k|	}
  391|       |
  392|    576|	if (count > 0 && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0))
  ------------------
  |  |  534|    204|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (392:6): [True: 204, False: 372]
  |  Branch (392:19): [True: 108, False: 96]
  ------------------
  393|    108|		count += 3;
  394|    576|	return (count);
  395|    576|}
archive_acl_reset:
  413|    576|{
  414|    576|	int count, cutoff;
  415|       |
  416|    576|	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|    576|	if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
  ------------------
  |  |  534|    576|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (423:6): [True: 173, False: 403]
  ------------------
  424|    173|		cutoff = 3;
  425|    403|	else
  426|    403|		cutoff = 0;
  427|       |
  428|    576|	if (count > cutoff)
  ------------------
  |  Branch (428:6): [True: 204, False: 372]
  ------------------
  429|    204|		acl->acl_state = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    204|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  430|    372|	else
  431|    372|		acl->acl_state = 0;
  432|    576|	acl->acl_p = acl->acl_head;
  433|    576|	return (count);
  434|    576|}
archive_acl_from_text_l:
 1506|    538|{
 1507|    538|	return archive_acl_from_text_nl(acl, text, strlen(text), want_type, sc);
 1508|    538|}
archive_acl_from_text_nl:
 1513|    576|{
 1514|    576|	struct {
 1515|    576|		const char *start;
 1516|    576|		const char *end;
 1517|    576|	} field[6], name;
 1518|       |
 1519|    576|	const char *s, *st, *text_end;
 1520|    576|	int numfields, fields, n, r, sol, ret;
 1521|    576|	int type, types, tag, permset, id;
 1522|    576|	size_t len;
 1523|    576|	char sep;
 1524|       |
 1525|    576|	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: 576]
  ------------------
 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|    294|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|    294|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (1529:2): [True: 294, False: 282]
  ------------------
 1530|    312|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|    312|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (1530:2): [True: 18, False: 558]
  ------------------
 1531|    312|		numfields = 5;
 1532|    312|		break;
 1533|    264|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  542|    264|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    264|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    264|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    264|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    264|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    264|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    264|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    264|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1533:2): [True: 264, False: 312]
  ------------------
 1534|    264|		numfields = 6;
 1535|    264|		break;
 1536|      0|	default:
  ------------------
  |  Branch (1536:2): [True: 0, False: 576]
  ------------------
 1537|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|    576|	}
 1539|       |
 1540|    576|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    576|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1541|    576|	types = 0;
 1542|    576|	text_end = (text == NULL) ? text : text + length;
  ------------------
  |  Branch (1542:13): [True: 0, False: 576]
  ------------------
 1543|       |
 1544|  32.7k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1544:9): [True: 32.7k, False: 0]
  |  Branch (1544:25): [True: 32.1k, False: 559]
  |  Branch (1544:39): [True: 32.1k, False: 17]
  ------------------
 1545|       |		/*
 1546|       |		 * Parse the fields out of the next entry,
 1547|       |		 * advance 'text' to start of next entry.
 1548|       |		 */
 1549|  32.1k|		fields = 0;
 1550|  60.8k|		do {
 1551|  60.8k|			const char *start, *end;
 1552|  60.8k|			next_field(&text, &length, &start, &end, &sep);
 1553|  60.8k|			if (fields < numfields) {
  ------------------
  |  Branch (1553:8): [True: 58.7k, False: 2.09k]
  ------------------
 1554|  58.7k|				field[fields].start = start;
 1555|  58.7k|				field[fields].end = end;
 1556|  58.7k|			}
 1557|  60.8k|			++fields;
 1558|  60.8k|		} while (sep == ':');
  ------------------
  |  Branch (1558:12): [True: 28.7k, False: 32.1k]
  ------------------
 1559|       |
 1560|       |		/* Set remaining fields to blank. */
 1561|   142k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1561:20): [True: 110k, False: 32.1k]
  ------------------
 1562|   110k|			field[n].start = field[n].end = NULL;
 1563|       |
 1564|  32.1k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1564:7): [True: 0, False: 32.1k]
  |  Branch (1564:33): [True: 0, False: 32.1k]
  ------------------
 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|  32.1k|		if (field[0].start == text_end) {
  ------------------
  |  Branch (1569:7): [True: 19, False: 32.1k]
  ------------------
 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|     19|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     19|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|     19|			continue;
 1579|     19|		}
 1580|       |
 1581|  32.1k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1581:7): [True: 234, False: 31.8k]
  ------------------
 1582|       |			/* Comment, skip entry */
 1583|    234|			continue;
 1584|    234|		}
 1585|       |
 1586|  31.8k|		n = 0;
 1587|  31.8k|		sol = 0;
 1588|  31.8k|		id = -1;
 1589|  31.8k|		permset = 0;
 1590|  31.8k|		name.start = name.end = NULL;
 1591|       |
 1592|  31.8k|		if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  31.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  31.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  31.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  31.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  31.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  31.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  31.8k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  31.8k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1592:7): [True: 23.7k, False: 8.16k]
  ------------------
 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|  23.7k|			s = field[0].start;
 1603|  23.7k|			len = field[0].end - field[0].start;
 1604|  23.7k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1604:8): [True: 3.79k, False: 19.9k]
  |  Branch (1604:22): [True: 2.77k, False: 1.02k]
  |  Branch (1604:35): [True: 356, False: 670]
  ------------------
 1605|  2.87k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1605:11): [True: 103, False: 253]
  ------------------
 1606|  2.87k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  535|  2.87k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1607|  2.87k|				if (len > 7)
  ------------------
  |  Branch (1607:9): [True: 103, False: 2.77k]
  ------------------
 1608|    103|					field[0].start += 7;
 1609|  2.77k|				else
 1610|  2.77k|					n = 1;
 1611|  2.87k|			} else
 1612|  20.8k|				type = want_type;
 1613|       |
 1614|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1615|  23.7k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1615:8): [True: 223, False: 23.4k]
  ------------------
 1616|  23.7k|			    &id) < 0) {
 1617|    223|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    223|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|    223|				continue;
 1619|    223|			}
 1620|       |			/* Field n+3 is optional. */
 1621|  23.4k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1621:8): [True: 23.1k, False: 297]
  |  Branch (1621:20): [True: 2.33k, False: 20.8k]
  ------------------
 1622|  2.33k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1622:8): [True: 105, False: 2.23k]
  ------------------
 1623|  2.33k|			    &id) < 0) {
 1624|    105|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    105|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1625|    105|				continue;
 1626|    105|			}
 1627|       |
 1628|  23.3k|			tag = 0;
 1629|  23.3k|			s = field[n].start;
 1630|  23.3k|			len = field[n].end - field[n].start;
 1631|       |
 1632|  23.3k|			if (len == 0) {
  ------------------
  |  Branch (1632:8): [True: 4.43k, False: 18.9k]
  ------------------
 1633|  4.43k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  4.43k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1634|  4.43k|				continue;
 1635|  4.43k|			}
 1636|       |
 1637|  18.9k|			st = s + 1; 
 1638|       |
 1639|  18.9k|			switch (*s) {
 1640|  1.75k|			case 'u':
  ------------------
  |  Branch (1640:4): [True: 1.75k, False: 17.1k]
  ------------------
 1641|  1.75k|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1641:9): [True: 976, False: 783]
  |  Branch (1641:22): [True: 280, False: 503]
  ------------------
 1642|    280|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1642:12): [True: 197, False: 83]
  ------------------
 1643|  1.17k|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|  1.17k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1644|  1.75k|				break;
 1645|  2.97k|			case 'g':
  ------------------
  |  Branch (1645:4): [True: 2.97k, False: 15.9k]
  ------------------
 1646|  2.97k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1646:9): [True: 2.03k, False: 931]
  |  Branch (1646:22): [True: 342, False: 589]
  ------------------
 1647|    342|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1647:12): [True: 175, False: 167]
  ------------------
 1648|  2.21k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|  2.21k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1649|  2.97k|				break;
 1650|  1.67k|			case 'o':
  ------------------
  |  Branch (1650:4): [True: 1.67k, False: 17.2k]
  ------------------
 1651|  1.67k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1651:9): [True: 852, False: 820]
  |  Branch (1651:22): [True: 645, False: 175]
  ------------------
 1652|    645|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1652:12): [True: 488, False: 157]
  ------------------
 1653|  1.34k|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  553|  1.34k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1654|  1.67k|				break;
 1655|    869|			case 'm':
  ------------------
  |  Branch (1655:4): [True: 869, False: 18.0k]
  ------------------
 1656|    869|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1656:9): [True: 467, False: 402]
  |  Branch (1656:22): [True: 253, False: 149]
  ------------------
 1657|    253|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1657:12): [True: 44, False: 209]
  ------------------
 1658|    511|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  552|    511|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1659|    869|				break;
 1660|  11.6k|			default:
  ------------------
  |  Branch (1660:4): [True: 11.6k, False: 7.27k]
  ------------------
 1661|  11.6k|					break;
 1662|  18.9k|			}
 1663|       |
 1664|  18.9k|			switch (tag) {
 1665|  1.34k|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|  1.34k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1665:4): [True: 1.34k, False: 17.6k]
  ------------------
 1666|  1.85k|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|  1.85k|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1666:4): [True: 511, False: 18.4k]
  ------------------
 1667|  1.85k|				if (fields == (n + 2)
  ------------------
  |  Branch (1667:9): [True: 705, False: 1.14k]
  ------------------
 1668|    705|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1668:12): [True: 702, False: 3]
  ------------------
 1669|    702|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1669:12): [True: 204, False: 498]
  ------------------
 1670|    702|				    field[n + 1].end, &permset)) {
 1671|       |					/* This is Solaris-style "other:rwx" */
 1672|    204|					sol = 1;
 1673|  1.64k|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1673:16): [True: 335, False: 1.31k]
  ------------------
 1674|    335|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1674:9): [True: 116, False: 219]
  ------------------
 1675|       |					/* Invalid mask or other field */
 1676|    116|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    116|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1677|    116|					continue;
 1678|    116|				}
 1679|  1.73k|				break;
 1680|  1.73k|			case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|  1.17k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1680:4): [True: 1.17k, False: 17.7k]
  ------------------
 1681|  3.38k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  3.38k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1681:4): [True: 2.21k, False: 16.7k]
  ------------------
 1682|  3.38k|				if (id != -1 ||
  ------------------
  |  Branch (1682:9): [True: 1.19k, False: 2.19k]
  ------------------
 1683|  2.88k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1683:9): [True: 1.68k, False: 505]
  ------------------
 1684|  2.88k|					name = field[n + 1];
 1685|  2.88k|					if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
  ------------------
  |  |  549|  2.88k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1685:10): [True: 1.10k, False: 1.77k]
  ------------------
 1686|  1.10k|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|  1.10k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1687|  1.77k|					else
 1688|  1.77k|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|  1.77k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1689|  2.88k|				}
 1690|  3.38k|				break;
 1691|  13.7k|			default:
  ------------------
  |  Branch (1691:4): [True: 13.7k, False: 5.23k]
  ------------------
 1692|       |				/* Invalid tag, skip entry */
 1693|  13.7k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  13.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1694|  13.7k|				continue;
 1695|  18.9k|			}
 1696|       |
 1697|       |			/*
 1698|       |			 * Without "default:" we expect mode in field 3
 1699|       |			 * Exception: Solaris other and mask fields
 1700|       |			 */
 1701|  5.12k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1701:8): [True: 4.78k, False: 335]
  |  Branch (1701:24): [True: 2.56k, False: 2.22k]
  ------------------
 1702|  4.78k|			    field[n + 2 - sol].end, &permset)) {
 1703|       |				/* Invalid mode, skip entry */
 1704|  2.56k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  2.56k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1705|  2.56k|				continue;
 1706|  2.56k|			}
 1707|  8.16k|		} else {
 1708|       |			/* NFS4 ACLs */
 1709|  8.16k|			s = field[0].start;
 1710|  8.16k|			len = field[0].end - field[0].start;
 1711|  8.16k|			tag = 0;
 1712|       |
 1713|  8.16k|			switch (len) {
 1714|    812|			case 4:
  ------------------
  |  Branch (1714:4): [True: 812, False: 7.35k]
  ------------------
 1715|    812|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1715:9): [True: 302, False: 510]
  ------------------
 1716|    302|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    302|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1717|    812|				break;
 1718|    833|			case 5:
  ------------------
  |  Branch (1718:4): [True: 833, False: 7.33k]
  ------------------
 1719|    833|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1719:9): [True: 305, False: 528]
  ------------------
 1720|    305|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    305|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1721|    833|				break;
 1722|  1.57k|			case 6:
  ------------------
  |  Branch (1722:4): [True: 1.57k, False: 6.58k]
  ------------------
 1723|  1.57k|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1723:9): [True: 544, False: 1.03k]
  ------------------
 1724|    544|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    544|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1725|  1.03k|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1725:14): [True: 443, False: 590]
  ------------------
 1726|    443|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|    443|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1727|  1.57k|				break;
 1728|    815|			case 9:
  ------------------
  |  Branch (1728:4): [True: 815, False: 7.35k]
  ------------------
 1729|    815|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1729:9): [True: 387, False: 428]
  ------------------
 1730|    387|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  554|    387|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1731|    815|				break;
 1732|  4.12k|			default:
  ------------------
  |  Branch (1732:4): [True: 4.12k, False: 4.03k]
  ------------------
 1733|  4.12k|				break;
 1734|  8.16k|			}
 1735|       |
 1736|  8.16k|			if (tag == 0) {
  ------------------
  |  Branch (1736:8): [True: 6.18k, False: 1.98k]
  ------------------
 1737|       |				/* Invalid tag, skip entry */
 1738|  6.18k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  6.18k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1739|  6.18k|				continue;
 1740|  6.18k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  548|  3.96k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1740:15): [True: 302, False: 1.67k]
  ------------------
 1741|  1.67k|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  550|  1.67k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1741:8): [True: 305, False: 1.37k]
  ------------------
 1742|    607|				n = 1;
 1743|    607|				name = field[1];
 1744|    607|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1744:9): [True: 77, False: 530]
  ------------------
 1745|     77|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     77|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1746|     77|					continue;
 1747|     77|				}
 1748|    607|			} else
 1749|  1.37k|				n = 0;
 1750|       |
 1751|  1.90k|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1751:8): [True: 208, False: 1.69k]
  ------------------
 1752|  1.90k|			    field[1 + n].end, &permset)) {
 1753|       |				/* Invalid NFSv4 perms, skip entry */
 1754|    208|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    208|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1755|    208|				continue;
 1756|    208|			}
 1757|  1.69k|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1757:8): [True: 334, False: 1.36k]
  ------------------
 1758|  1.69k|			    field[2 + n].end, &permset)) {
 1759|       |				/* Invalid NFSv4 flags, skip entry */
 1760|    334|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    334|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1761|    334|				continue;
 1762|    334|			}
 1763|  1.36k|			s = field[3 + n].start;
 1764|  1.36k|			len = field[3 + n].end - field[3 + n].start;
 1765|  1.36k|			type = 0;
 1766|  1.36k|			if (len == 4) {
  ------------------
  |  Branch (1766:8): [True: 401, False: 961]
  ------------------
 1767|    401|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1767:9): [True: 167, False: 234]
  ------------------
 1768|    167|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  537|    167|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1769|    961|			} else if (len == 5) {
  ------------------
  |  Branch (1769:15): [True: 529, False: 432]
  ------------------
 1770|    529|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1770:9): [True: 163, False: 366]
  ------------------
 1771|    163|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  536|    163|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1772|    366|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1772:14): [True: 52, False: 314]
  ------------------
 1773|     52|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  538|     52|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1774|    314|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1774:14): [True: 256, False: 58]
  ------------------
 1775|    256|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  539|    256|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1776|    529|			}
 1777|  1.36k|			if (type == 0) {
  ------------------
  |  Branch (1777:8): [True: 724, False: 638]
  ------------------
 1778|       |				/* Invalid entry type, skip entry */
 1779|    724|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    724|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1780|    724|				continue;
 1781|    724|			}
 1782|    638|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1782:8): [True: 123, False: 515]
  ------------------
 1783|    638|			    &id) < 0) {
 1784|    123|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    123|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1785|    123|				continue;
 1786|    123|			}
 1787|    638|		}
 1788|       |
 1789|       |		/* Add entry to the internal list. */
 1790|  3.07k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1791|  3.07k|		    tag, id, name.start, name.end - name.start, sc);
 1792|  3.07k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  3.07k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1792:7): [True: 0, False: 3.07k]
  ------------------
 1793|      0|			return (r);
 1794|  3.07k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  3.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 1.62k, False: 1.44k]
  ------------------
 1795|  1.62k|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.62k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1796|  3.07k|		types |= type;
 1797|  3.07k|	}
 1798|       |
 1799|       |	/* Reset ACL */
 1800|    576|	archive_acl_reset(acl, types);
 1801|       |
 1802|    576|	return (ret);
 1803|    576|}
archive_acl.c:acl_special:
  240|  3.07k|{
  241|  3.07k|	if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
  ------------------
  |  |  534|  6.14k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (241:6): [True: 2.40k, False: 664]
  ------------------
  242|  2.40k|	    && ((permset & ~007) == 0)) {
  ------------------
  |  Branch (242:9): [True: 2.40k, False: 0]
  ------------------
  243|  2.40k|		switch (tag) {
  ------------------
  |  Branch (243:11): [True: 540, False: 1.86k]
  ------------------
  244|     51|		case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|     51|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (244:3): [True: 51, False: 2.35k]
  ------------------
  245|     51|			acl->mode &= ~0700;
  246|     51|			acl->mode |= (permset & 7) << 6;
  247|     51|			return (0);
  248|     72|		case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|     72|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (248:3): [True: 72, False: 2.33k]
  ------------------
  249|     72|			acl->mode &= ~0070;
  250|     72|			acl->mode |= (permset & 7) << 3;
  251|     72|			return (0);
  252|    417|		case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    417|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (252:3): [True: 417, False: 1.99k]
  ------------------
  253|    417|			acl->mode &= ~0007;
  254|    417|			acl->mode |= permset & 7;
  255|    417|			return (0);
  256|  2.40k|		}
  257|  2.40k|	}
  258|  2.53k|	return (1);
  259|  3.07k|}
archive_acl.c:acl_new_entry:
  268|  2.53k|{
  269|  2.53k|	struct archive_acl_entry *ap, *aq;
  270|       |
  271|       |	/* Reject an invalid type */
  272|  2.53k|	switch (type) {
  273|  1.86k|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|  1.86k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (273:2): [True: 1.86k, False: 664]
  ------------------
  274|  2.01k|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|  2.01k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (274:2): [True: 149, False: 2.38k]
  ------------------
  275|  2.16k|	case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
  ------------------
  |  |  536|  2.16k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
  |  Branch (275:2): [True: 143, False: 2.38k]
  ------------------
  276|  2.32k|	case ARCHIVE_ENTRY_ACL_TYPE_DENY:
  ------------------
  |  |  537|  2.32k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
  |  Branch (276:2): [True: 167, False: 2.36k]
  ------------------
  277|  2.37k|	case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
  ------------------
  |  |  538|  2.37k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
  |  Branch (277:2): [True: 44, False: 2.48k]
  ------------------
  278|  2.53k|	case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
  ------------------
  |  |  539|  2.53k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
  |  Branch (278:2): [True: 161, False: 2.37k]
  ------------------
  279|  2.53k|		break;
  280|      0|	default:
  ------------------
  |  Branch (280:2): [True: 0, False: 2.53k]
  ------------------
  281|      0|		return (NULL);
  282|  2.53k|	}
  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|  2.53k|	if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  2.53k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  2.53k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  2.53k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  2.53k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  2.53k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  2.53k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  2.53k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  2.53k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (287:6): [True: 515, False: 2.01k]
  ------------------
  288|    515|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|    515|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    515|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    515|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    515|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    515|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    515|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    515|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    515|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (288:7): [True: 0, False: 515]
  ------------------
  289|      0|			return (NULL);
  290|      0|		}
  291|    515|		if (permset &
  ------------------
  |  Branch (291:7): [True: 0, False: 515]
  ------------------
  292|    515|		    ~(ARCHIVE_ENTRY_ACL_PERMS_NFS4
  ------------------
  |  |  495|    515|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|    515|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  496|    515|	    | ARCHIVE_ENTRY_ACL_READ_DATA		\
  |  |  ------------------
  |  |  |  |  472|    515|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  |  |  ------------------
  |  |  497|    515|	    | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 		\
  |  |  ------------------
  |  |  |  |  473|    515|#define	ARCHIVE_ENTRY_ACL_LIST_DIRECTORY      0x00000008
  |  |  ------------------
  |  |  498|    515|	    | ARCHIVE_ENTRY_ACL_WRITE_DATA		\
  |  |  ------------------
  |  |  |  |  474|    515|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  |  |  ------------------
  |  |  499|    515|	    | ARCHIVE_ENTRY_ACL_ADD_FILE		\
  |  |  ------------------
  |  |  |  |  475|    515|#define	ARCHIVE_ENTRY_ACL_ADD_FILE            0x00000010
  |  |  ------------------
  |  |  500|    515|	    | ARCHIVE_ENTRY_ACL_APPEND_DATA		\
  |  |  ------------------
  |  |  |  |  476|    515|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  |  |  ------------------
  |  |  501|    515|	    | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY	\
  |  |  ------------------
  |  |  |  |  477|    515|#define	ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY    0x00000020
  |  |  ------------------
  |  |  502|    515|	    | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  478|    515|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  |  |  ------------------
  |  |  503|    515|	    | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  479|    515|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  |  |  ------------------
  |  |  504|    515|	    | ARCHIVE_ENTRY_ACL_DELETE_CHILD		\
  |  |  ------------------
  |  |  |  |  480|    515|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  |  |  ------------------
  |  |  505|    515|	    | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES		\
  |  |  ------------------
  |  |  |  |  481|    515|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  |  |  ------------------
  |  |  506|    515|	    | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES	\
  |  |  ------------------
  |  |  |  |  482|    515|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  |  |  ------------------
  |  |  507|    515|	    | ARCHIVE_ENTRY_ACL_DELETE			\
  |  |  ------------------
  |  |  |  |  483|    515|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  |  |  ------------------
  |  |  508|    515|	    | ARCHIVE_ENTRY_ACL_READ_ACL		\
  |  |  ------------------
  |  |  |  |  484|    515|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  |  |  ------------------
  |  |  509|    515|	    | ARCHIVE_ENTRY_ACL_WRITE_ACL		\
  |  |  ------------------
  |  |  |  |  485|    515|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  |  |  ------------------
  |  |  510|    515|	    | ARCHIVE_ENTRY_ACL_WRITE_OWNER		\
  |  |  ------------------
  |  |  |  |  486|    515|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  |  |  ------------------
  |  |  511|    515|	    | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
  |  |  ------------------
  |  |  |  |  487|    515|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  |  |  ------------------
  ------------------
  293|    515|			| ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) {
  ------------------
  |  |  525|    515|	(ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT			\
  |  |  ------------------
  |  |  |  |  517|    515|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  |  |  ------------------
  |  |  526|    515|	    | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT		\
  |  |  ------------------
  |  |  |  |  518|    515|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  |  |  ------------------
  |  |  527|    515|	    | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT	\
  |  |  ------------------
  |  |  |  |  519|    515|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  |  |  ------------------
  |  |  528|    515|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY		\
  |  |  ------------------
  |  |  |  |  520|    515|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  |  |  ------------------
  |  |  529|    515|	    | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS		\
  |  |  ------------------
  |  |  |  |  521|    515|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  |  |  ------------------
  |  |  530|    515|	    | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS		\
  |  |  ------------------
  |  |  |  |  522|    515|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  |  |  ------------------
  |  |  531|    515|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
  |  |  ------------------
  |  |  |  |  516|    515|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  |  |  ------------------
  ------------------
  294|      0|			return (NULL);
  295|      0|		}
  296|  2.01k|	} else	if (type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  2.01k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  2.01k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  2.01k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  2.01k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (296:13): [True: 2.01k, False: 0]
  ------------------
  297|  2.01k|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  2.01k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  2.01k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  2.01k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  2.01k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (297:7): [True: 0, False: 2.01k]
  ------------------
  298|      0|			return (NULL);
  299|      0|		}
  300|  2.01k|		if (permset & ~ARCHIVE_ENTRY_ACL_PERMS_POSIX1E) {
  ------------------
  |  |  490|  2.01k|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|  2.01k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  491|  2.01k|	    | ARCHIVE_ENTRY_ACL_WRITE			\
  |  |  ------------------
  |  |  |  |  470|  2.01k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  |  |  ------------------
  |  |  492|  2.01k|	    | ARCHIVE_ENTRY_ACL_READ)
  |  |  ------------------
  |  |  |  |  471|  2.01k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  |  |  ------------------
  ------------------
  |  Branch (300:7): [True: 0, False: 2.01k]
  ------------------
  301|      0|			return (NULL);
  302|      0|		}
  303|  2.01k|	} else {
  304|      0|		return (NULL);
  305|      0|	}
  306|       |
  307|       |	/* Verify the tag is valid and compatible with NFS4 or POSIX.1e. */
  308|  2.53k|	switch (tag) {
  309|    433|	case ARCHIVE_ENTRY_ACL_USER:
  ------------------
  |  |  548|    433|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (309:2): [True: 433, False: 2.09k]
  ------------------
  310|    638|	case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    638|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (310:2): [True: 205, False: 2.32k]
  ------------------
  311|  2.11k|	case ARCHIVE_ENTRY_ACL_GROUP:
  ------------------
  |  |  550|  2.11k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (311:2): [True: 1.47k, False: 1.05k]
  ------------------
  312|  2.25k|	case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  2.25k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (312:2): [True: 141, False: 2.39k]
  ------------------
  313|       |		/* Tags valid in both NFS4 and POSIX.1e */
  314|  2.25k|		break;
  315|    141|	case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|    141|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (315:2): [True: 141, False: 2.39k]
  ------------------
  316|    195|	case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    195|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (316:2): [True: 54, False: 2.47k]
  ------------------
  317|       |		/* Tags valid only in POSIX.1e. */
  318|    195|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|    195|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|    195|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|    195|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|    195|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (318:7): [True: 0, False: 195]
  ------------------
  319|      0|			return (NULL);
  320|      0|		}
  321|    195|		break;
  322|    195|	case ARCHIVE_ENTRY_ACL_EVERYONE:
  ------------------
  |  |  554|     80|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
  |  Branch (322:2): [True: 80, False: 2.45k]
  ------------------
  323|       |		/* Tags valid only in NFS4. */
  324|     80|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|     80|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|     80|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|     80|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|     80|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|     80|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|     80|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|     80|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|     80|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (324:7): [True: 0, False: 80]
  ------------------
  325|      0|			return (NULL);
  326|      0|		}
  327|     80|		break;
  328|     80|	default:
  ------------------
  |  Branch (328:2): [True: 0, False: 2.53k]
  ------------------
  329|       |		/* No other values are valid. */
  330|      0|		return (NULL);
  331|  2.53k|	}
  332|       |
  333|  2.53k|	free(acl->acl_text_w);
  334|  2.53k|	acl->acl_text_w = NULL;
  335|  2.53k|	free(acl->acl_text);
  336|  2.53k|	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|  2.53k|	ap = acl->acl_head;
  345|  2.53k|	aq = NULL;
  346|  18.2k|	while (ap != NULL) {
  ------------------
  |  Branch (346:9): [True: 16.9k, False: 1.32k]
  ------------------
  347|  16.9k|		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
  ------------------
  |  |  542|  16.9k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  16.9k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  16.9k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  16.9k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  16.9k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  16.9k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  16.9k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  16.9k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (347:7): [True: 12.2k, False: 4.65k]
  ------------------
  348|  12.2k|		    ap->type == type && ap->tag == tag && ap->id == id) {
  ------------------
  |  Branch (348:7): [True: 11.2k, False: 1.05k]
  |  Branch (348:27): [True: 8.97k, False: 2.26k]
  |  Branch (348:45): [True: 7.31k, False: 1.66k]
  ------------------
  349|  7.31k|			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
  ------------------
  |  |  548|  12.5k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (349:8): [True: 1.05k, False: 6.26k]
  |  Branch (349:21): [True: 3.35k, False: 2.90k]
  ------------------
  350|  3.35k|			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
  ------------------
  |  |  550|  3.35k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (350:8): [True: 158, False: 3.19k]
  ------------------
  351|  1.21k|				ap->permset = permset;
  352|  1.21k|				return (ap);
  353|  1.21k|			}
  354|  7.31k|		}
  355|  15.7k|		aq = ap;
  356|  15.7k|		ap = ap->next;
  357|  15.7k|	}
  358|       |
  359|       |	/* Add a new entry to the end of the list. */
  360|  1.32k|	ap = calloc(1, sizeof(*ap));
  361|  1.32k|	if (ap == NULL)
  ------------------
  |  Branch (361:6): [True: 0, False: 1.32k]
  ------------------
  362|      0|		return (NULL);
  363|  1.32k|	if (aq == NULL)
  ------------------
  |  Branch (363:6): [True: 204, False: 1.11k]
  ------------------
  364|    204|		acl->acl_head = ap;
  365|  1.11k|	else
  366|  1.11k|		aq->next = ap;
  367|  1.32k|	ap->type = type;
  368|  1.32k|	ap->tag = tag;
  369|  1.32k|	ap->id = id;
  370|  1.32k|	ap->permset = permset;
  371|  1.32k|	acl->acl_types |= type;
  372|  1.32k|	return (ap);
  373|  1.32k|}
archive_acl.c:archive_acl_add_entry_len_l:
  209|  3.07k|{
  210|  3.07k|	struct archive_acl_entry *ap;
  211|  3.07k|	int r;
  212|       |
  213|  3.07k|	if (acl_special(acl, type, permset, tag) == 0)
  ------------------
  |  Branch (213:6): [True: 540, False: 2.53k]
  ------------------
  214|    540|		return ARCHIVE_OK;
  ------------------
  |  |  233|    540|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  215|  2.53k|	ap = acl_new_entry(acl, type, permset, tag, id);
  216|  2.53k|	if (ap == NULL) {
  ------------------
  |  Branch (216:6): [True: 0, False: 2.53k]
  ------------------
  217|       |		/* XXX Error XXX */
  218|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  219|      0|	}
  220|  2.53k|	if (name != NULL  &&  *name != '\0' && len > 0) {
  ------------------
  |  Branch (220:6): [True: 1.91k, False: 621]
  |  Branch (220:24): [True: 1.91k, False: 0]
  |  Branch (220:41): [True: 1.78k, False: 124]
  ------------------
  221|  1.78k|		r = archive_mstring_copy_mbs_len_l(&ap->name, name, len, sc);
  222|  1.78k|	} else {
  223|    745|		r = 0;
  224|    745|		archive_mstring_clean(&ap->name);
  225|    745|	}
  226|  2.53k|	if (r == 0)
  ------------------
  |  Branch (226:6): [True: 907, False: 1.62k]
  ------------------
  227|    907|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    907|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  228|  1.62k|	else if (errno == ENOMEM)
  ------------------
  |  Branch (228:11): [True: 0, False: 1.62k]
  ------------------
  229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|  1.62k|	else
  231|  1.62k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.62k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  232|  2.53k|}
archive_acl.c:isint:
 1812|  27.2k|{
 1813|  27.2k|	int n = 0;
 1814|  27.2k|	if (start >= end)
  ------------------
  |  Branch (1814:6): [True: 17.6k, False: 9.61k]
  ------------------
 1815|  17.6k|		return (0);
 1816|  20.6k|	while (start < end) {
  ------------------
  |  Branch (1816:9): [True: 18.9k, False: 1.64k]
  ------------------
 1817|  18.9k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1817:7): [True: 5.10k, False: 13.8k]
  |  Branch (1817:23): [True: 2.33k, False: 11.5k]
  ------------------
 1818|  7.43k|			return (0);
 1819|  11.5k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1819:7): [True: 345, False: 11.2k]
  ------------------
 1820|  11.2k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1820:8): [True: 204, False: 11.0k]
  |  Branch (1820:29): [True: 183, False: 21]
  ------------------
 1821|    528|			return (-1);
 1822|  11.0k|		} else {
 1823|  11.0k|			n *= 10;
 1824|  11.0k|			n += *start - '0';
 1825|  11.0k|		}
 1826|  11.0k|		start++;
 1827|  11.0k|	}
 1828|  1.64k|	*result = n;
 1829|  1.64k|	return (1);
 1830|  9.61k|}
archive_acl.c:ismode:
 1839|  5.48k|{
 1840|  5.48k|	const char *p;
 1841|       |
 1842|  5.48k|	if (start >= end)
  ------------------
  |  Branch (1842:6): [True: 1.98k, False: 3.50k]
  ------------------
 1843|  1.98k|		return (0);
 1844|  3.50k|	p = start;
 1845|  3.50k|	*permset = 0;
 1846|  12.2k|	while (p < end) {
  ------------------
  |  Branch (1846:9): [True: 9.79k, False: 2.42k]
  ------------------
 1847|  9.79k|		switch (*p++) {
 1848|  2.92k|		case 'r': case 'R':
  ------------------
  |  Branch (1848:3): [True: 1.42k, False: 8.37k]
  |  Branch (1848:13): [True: 1.49k, False: 8.30k]
  ------------------
 1849|  2.92k|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  471|  2.92k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1850|  2.92k|			break;
 1851|  1.06k|		case 'w': case 'W':
  ------------------
  |  Branch (1851:3): [True: 628, False: 9.16k]
  |  Branch (1851:13): [True: 441, False: 9.35k]
  ------------------
 1852|  1.06k|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  470|  1.06k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1853|  1.06k|			break;
 1854|  1.67k|		case 'x': case 'X':
  ------------------
  |  Branch (1854:3): [True: 657, False: 9.13k]
  |  Branch (1854:13): [True: 1.01k, False: 8.78k]
  ------------------
 1855|  1.67k|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|  1.67k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1856|  1.67k|			break;
 1857|  3.05k|		case '-':
  ------------------
  |  Branch (1857:3): [True: 3.05k, False: 6.74k]
  ------------------
 1858|  3.05k|			break;
 1859|  1.08k|		default:
  ------------------
  |  Branch (1859:3): [True: 1.08k, False: 8.71k]
  ------------------
 1860|  1.08k|			return (0);
 1861|  9.79k|		}
 1862|  9.79k|	}
 1863|  2.42k|	return (1);
 1864|  3.50k|}
archive_acl.c:is_nfs4_perms:
 1873|  1.90k|{
 1874|  1.90k|	const char *p = start;
 1875|       |
 1876|  10.1k|	while (p < end) {
  ------------------
  |  Branch (1876:9): [True: 8.44k, False: 1.69k]
  ------------------
 1877|  8.44k|		switch (*p++) {
 1878|    513|		case 'r':
  ------------------
  |  Branch (1878:3): [True: 513, False: 7.93k]
  ------------------
 1879|    513|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  472|    513|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1880|    513|			break;
 1881|    435|		case 'w':
  ------------------
  |  Branch (1881:3): [True: 435, False: 8.01k]
  ------------------
 1882|    435|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  474|    435|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1883|    435|			break;
 1884|    389|		case 'x':
  ------------------
  |  Branch (1884:3): [True: 389, False: 8.06k]
  ------------------
 1885|    389|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|    389|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1886|    389|			break;
 1887|    380|		case 'p':
  ------------------
  |  Branch (1887:3): [True: 380, False: 8.06k]
  ------------------
 1888|    380|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  476|    380|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1889|    380|			break;
 1890|    618|		case 'D':
  ------------------
  |  Branch (1890:3): [True: 618, False: 7.83k]
  ------------------
 1891|    618|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  480|    618|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1892|    618|			break;
 1893|    820|		case 'd':
  ------------------
  |  Branch (1893:3): [True: 820, False: 7.62k]
  ------------------
 1894|    820|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  483|    820|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1895|    820|			break;
 1896|    467|		case 'a':
  ------------------
  |  Branch (1896:3): [True: 467, False: 7.98k]
  ------------------
 1897|    467|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  481|    467|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1898|    467|			break;
 1899|    762|		case 'A':
  ------------------
  |  Branch (1899:3): [True: 762, False: 7.68k]
  ------------------
 1900|    762|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  482|    762|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1901|    762|			break;
 1902|    280|		case 'R':
  ------------------
  |  Branch (1902:3): [True: 280, False: 8.16k]
  ------------------
 1903|    280|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  478|    280|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1904|    280|			break;
 1905|    521|		case 'W':
  ------------------
  |  Branch (1905:3): [True: 521, False: 7.92k]
  ------------------
 1906|    521|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  479|    521|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1907|    521|			break;
 1908|  1.26k|		case 'c':
  ------------------
  |  Branch (1908:3): [True: 1.26k, False: 7.18k]
  ------------------
 1909|  1.26k|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  484|  1.26k|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1910|  1.26k|			break;
 1911|    394|		case 'C':
  ------------------
  |  Branch (1911:3): [True: 394, False: 8.05k]
  ------------------
 1912|    394|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  485|    394|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1913|    394|			break;
 1914|    224|		case 'o':
  ------------------
  |  Branch (1914:3): [True: 224, False: 8.22k]
  ------------------
 1915|    224|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  486|    224|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1916|    224|			break;
 1917|    869|		case 's':
  ------------------
  |  Branch (1917:3): [True: 869, False: 7.58k]
  ------------------
 1918|    869|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  487|    869|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1919|    869|			break;
 1920|    306|		case '-':
  ------------------
  |  Branch (1920:3): [True: 306, False: 8.14k]
  ------------------
 1921|    306|			break;
 1922|    208|		default:
  ------------------
  |  Branch (1922:3): [True: 208, False: 8.24k]
  ------------------
 1923|    208|			return(0);
 1924|  8.44k|		}
 1925|  8.44k|	}
 1926|  1.69k|	return (1);
 1927|  1.90k|}
archive_acl.c:is_nfs4_flags:
 1936|  1.69k|{
 1937|  1.69k|	const char *p = start;
 1938|       |
 1939|  5.01k|	while (p < end) {
  ------------------
  |  Branch (1939:9): [True: 3.64k, False: 1.36k]
  ------------------
 1940|  3.64k|		switch(*p++) {
 1941|    324|		case 'f':
  ------------------
  |  Branch (1941:3): [True: 324, False: 3.32k]
  ------------------
 1942|    324|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  517|    324|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1943|    324|			break;
 1944|    784|		case 'd':
  ------------------
  |  Branch (1944:3): [True: 784, False: 2.86k]
  ------------------
 1945|    784|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  518|    784|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1946|    784|			break;
 1947|    430|		case 'i':
  ------------------
  |  Branch (1947:3): [True: 430, False: 3.21k]
  ------------------
 1948|    430|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  520|    430|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1949|    430|			break;
 1950|    272|		case 'n':
  ------------------
  |  Branch (1950:3): [True: 272, False: 3.37k]
  ------------------
 1951|    272|			*permset |=
 1952|    272|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  519|    272|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1953|    272|			break;
 1954|    291|		case 'S':
  ------------------
  |  Branch (1954:3): [True: 291, False: 3.35k]
  ------------------
 1955|    291|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  521|    291|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1956|    291|			break;
 1957|    578|		case 'F':
  ------------------
  |  Branch (1957:3): [True: 578, False: 3.07k]
  ------------------
 1958|    578|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  522|    578|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1959|    578|			break;
 1960|    351|		case 'I':
  ------------------
  |  Branch (1960:3): [True: 351, False: 3.29k]
  ------------------
 1961|    351|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  516|    351|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1962|    351|			break;
 1963|    285|		case '-':
  ------------------
  |  Branch (1963:3): [True: 285, False: 3.36k]
  ------------------
 1964|    285|			break;
 1965|    334|		default:
  ------------------
  |  Branch (1965:3): [True: 334, False: 3.31k]
  ------------------
 1966|    334|			return (0);
 1967|  3.64k|		}
 1968|  3.64k|	}
 1969|  1.36k|	return (1);
 1970|  1.69k|}
archive_acl.c:next_field:
 1983|  60.8k|{
 1984|       |	/* Skip leading whitespace to find start of field. */
 1985|   108k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1985:9): [True: 108k, False: 58]
  |  Branch (1985:20): [True: 1.45k, False: 107k]
  |  Branch (1985:34): [True: 1.92k, False: 105k]
  |  Branch (1985:49): [True: 44.6k, False: 60.7k]
  ------------------
 1986|  48.0k|		(*p)++;
 1987|  48.0k|		(*l)--;
 1988|  48.0k|	}
 1989|  60.8k|	*start = *p;
 1990|       |
 1991|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1992|   320k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1992:9): [True: 319k, False: 467]
  |  Branch (1992:19): [True: 317k, False: 2.33k]
  |  Branch (1992:33): [True: 316k, False: 693]
  |  Branch (1992:48): [True: 289k, False: 27.6k]
  |  Branch (1992:63): [True: 287k, False: 1.46k]
  |  Branch (1992:77): [True: 260k, False: 27.5k]
  |  Branch (1992:91): [True: 259k, False: 645]
  ------------------
 1993|   259k|		(*p)++;
 1994|   259k|		(*l)--;
 1995|   259k|	}
 1996|  60.8k|	*end = *p;
 1997|       |
 1998|       |	/* Scan for the separator. */
 1999|  92.4k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1999:9): [True: 91.9k, False: 515]
  |  Branch (1999:19): [True: 90.0k, False: 1.87k]
  |  Branch (1999:33): [True: 61.3k, False: 28.7k]
  |  Branch (1999:47): [True: 32.2k, False: 29.0k]
  |  Branch (1999:62): [True: 31.5k, False: 668]
  ------------------
 2000|  31.5k|		(*p)++;
 2001|  31.5k|		(*l)--;
 2002|  31.5k|	}
 2003|  60.8k|	if (*l > 0)
  ------------------
  |  Branch (2003:6): [True: 60.3k, False: 515]
  ------------------
 2004|  60.3k|		*sep = **p;
 2005|    515|	else
 2006|    515|		*sep = '\0';
 2007|       |
 2008|       |	/* Handle in-field comments */
 2009|  60.8k|	if (*sep == '#') {
  ------------------
  |  Branch (2009:6): [True: 668, False: 60.1k]
  ------------------
 2010|  11.0k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (2010:10): [True: 10.9k, False: 22]
  |  Branch (2010:20): [True: 10.8k, False: 156]
  |  Branch (2010:34): [True: 10.3k, False: 490]
  ------------------
 2011|  10.3k|			(*p)++;
 2012|  10.3k|			(*l)--;
 2013|  10.3k|		}
 2014|    668|		if (*l > 0)
  ------------------
  |  Branch (2014:7): [True: 646, False: 22]
  ------------------
 2015|    646|			*sep = **p;
 2016|     22|		else
 2017|     22|			*sep = '\0';
 2018|    668|	}
 2019|       |
 2020|       |	/* Skip separator. */
 2021|  60.8k|	if (*l > 0) {
  ------------------
  |  Branch (2021:6): [True: 60.3k, False: 537]
  ------------------
 2022|  60.3k|		(*p)++;
 2023|  60.3k|		(*l)--;
 2024|  60.3k|	}
 2025|  60.8k|}

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

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

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

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

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

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

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

archive_read_support_filter_gzip.c:archive_le32dec:
  144|  1.68k|{
  145|  1.68k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  1.68k|	unsigned int p3 = p[3];
  151|  1.68k|	unsigned int p2 = p[2];
  152|  1.68k|	unsigned int p1 = p[1];
  153|  1.68k|	unsigned int p0 = p[0];
  154|       |
  155|  1.68k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  1.68k|}
archive_read_support_filter_gzip.c:archive_le16dec:
  115|    302|{
  116|    302|	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|    302|	unsigned int p1 = p[1];
  122|    302|	unsigned int p0 = p[0];
  123|       |
  124|    302|	return ((p1 << 8) | p0);
  125|    302|}
archive_read_support_filter_lz4.c:archive_le32dec:
  144|  42.5k|{
  145|  42.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|  42.5k|	unsigned int p3 = p[3];
  151|  42.5k|	unsigned int p2 = p[2];
  152|  42.5k|	unsigned int p1 = p[1];
  153|  42.5k|	unsigned int p0 = p[0];
  154|       |
  155|  42.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  42.5k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   91|    558|{
   92|    558|	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|    558|	unsigned int p3 = p[3];
   98|    558|	unsigned int p2 = p[2];
   99|    558|	unsigned int p1 = p[1];
  100|    558|	unsigned int p0 = p[0];
  101|       |
  102|    558|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    558|}
archive_read_support_filter_xz.c:archive_le32enc:
  216|    170|{
  217|    170|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    170|	p[0] = u & 0xff;
  220|    170|	p[1] = (u >> 8) & 0xff;
  221|    170|	p[2] = (u >> 16) & 0xff;
  222|    170|	p[3] = (u >> 24) & 0xff;
  223|    170|}
archive_read_support_filter_xz.c:archive_le32dec:
  144|  70.5k|{
  145|  70.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|  70.5k|	unsigned int p3 = p[3];
  151|  70.5k|	unsigned int p2 = p[2];
  152|  70.5k|	unsigned int p1 = p[1];
  153|  70.5k|	unsigned int p0 = p[0];
  154|       |
  155|  70.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  70.5k|}
archive_read_support_filter_xz.c:archive_le64dec:
  160|  23.5k|{
  161|  23.5k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  23.5k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  23.5k|}
archive_read_support_filter_zstd.c:archive_le32dec:
  144|  24.8k|{
  145|  24.8k|	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|  24.8k|	unsigned int p3 = p[3];
  151|  24.8k|	unsigned int p2 = p[2];
  152|  24.8k|	unsigned int p1 = p[1];
  153|  24.8k|	unsigned int p0 = p[0];
  154|       |
  155|  24.8k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  24.8k|}
archive_read_support_format_cab.c:archive_le32dec:
  144|   185k|{
  145|   185k|	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|   185k|	unsigned int p3 = p[3];
  151|   185k|	unsigned int p2 = p[2];
  152|   185k|	unsigned int p1 = p[1];
  153|   185k|	unsigned int p0 = p[0];
  154|       |
  155|   185k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   185k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  14.1k|{
  116|  14.1k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  14.1k|	unsigned int p1 = p[1];
  122|  14.1k|	unsigned int p0 = p[0];
  123|       |
  124|  14.1k|	return ((p1 << 8) | p0);
  125|  14.1k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|  2.61k|{
  198|  2.61k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  2.61k|	p[0] = u & 0xff;
  201|  2.61k|	p[1] = (u >> 8) & 0xff;
  202|  2.61k|}
archive_read_support_format_cab.c:archive_le32enc:
  216|    226|{
  217|    226|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    226|	p[0] = u & 0xff;
  220|    226|	p[1] = (u >> 8) & 0xff;
  221|    226|	p[2] = (u >> 16) & 0xff;
  222|    226|	p[3] = (u >> 24) & 0xff;
  223|    226|}
archive_read_support_format_cpio.c:archive_be16dec:
   61|  28.1k|{
   62|  28.1k|	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|  28.1k|	unsigned int p1 = p[1];
   68|  28.1k|	unsigned int p0 = p[0];
   69|       |
   70|  28.1k|	return ((p0 << 8) | p1);
   71|  28.1k|}
archive_read_support_format_cpio.c:archive_le16dec:
  115|  26.0k|{
  116|  26.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|  26.0k|	unsigned int p1 = p[1];
  122|  26.0k|	unsigned int p0 = p[0];
  123|       |
  124|  26.0k|	return ((p1 << 8) | p0);
  125|  26.0k|}
archive_read_support_format_iso9660.c:archive_le32dec:
  144|  3.54k|{
  145|  3.54k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  3.54k|	unsigned int p3 = p[3];
  151|  3.54k|	unsigned int p2 = p[2];
  152|  3.54k|	unsigned int p1 = p[1];
  153|  3.54k|	unsigned int p0 = p[0];
  154|       |
  155|  3.54k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  3.54k|}
archive_read_support_format_iso9660.c:archive_le16dec:
  115|    522|{
  116|    522|	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|    522|	unsigned int p1 = p[1];
  122|    522|	unsigned int p0 = p[0];
  123|       |
  124|    522|	return ((p1 << 8) | p0);
  125|    522|}
archive_read_support_format_iso9660.c:archive_be32dec:
   91|    464|{
   92|    464|	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|    464|	unsigned int p3 = p[3];
   98|    464|	unsigned int p2 = p[2];
   99|    464|	unsigned int p1 = p[1];
  100|    464|	unsigned int p0 = p[0];
  101|       |
  102|    464|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    464|}
archive_read_support_format_lha.c:archive_le32dec:
  144|  22.8k|{
  145|  22.8k|	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|  22.8k|	unsigned int p3 = p[3];
  151|  22.8k|	unsigned int p2 = p[2];
  152|  22.8k|	unsigned int p1 = p[1];
  153|  22.8k|	unsigned int p0 = p[0];
  154|       |
  155|  22.8k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  22.8k|}
archive_read_support_format_lha.c:archive_le16dec:
  115|  47.6k|{
  116|  47.6k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  47.6k|	unsigned int p1 = p[1];
  122|  47.6k|	unsigned int p0 = p[0];
  123|       |
  124|  47.6k|	return ((p1 << 8) | p0);
  125|  47.6k|}
archive_read_support_format_lha.c:archive_be16dec:
   61|     42|{
   62|     42|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|     42|	unsigned int p1 = p[1];
   68|     42|	unsigned int p0 = p[0];
   69|       |
   70|     42|	return ((p0 << 8) | p1);
   71|     42|}
archive_read_support_format_lha.c:archive_le64dec:
  160|    768|{
  161|    768|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    768|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    768|}
archive_read_support_format_rar.c:archive_le16dec:
  115|  55.8k|{
  116|  55.8k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  55.8k|	unsigned int p1 = p[1];
  122|  55.8k|	unsigned int p0 = p[0];
  123|       |
  124|  55.8k|	return ((p1 << 8) | p0);
  125|  55.8k|}
archive_read_support_format_rar.c:archive_le64dec:
  160|  1.08k|{
  161|  1.08k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  1.08k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  1.08k|}
archive_read_support_format_rar.c:archive_le32dec:
  144|  61.7k|{
  145|  61.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|  61.7k|	unsigned int p3 = p[3];
  151|  61.7k|	unsigned int p2 = p[2];
  152|  61.7k|	unsigned int p1 = p[1];
  153|  61.7k|	unsigned int p0 = p[0];
  154|       |
  155|  61.7k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  61.7k|}
archive_read_support_format_rar.c:archive_le32enc:
  216|   165k|{
  217|   165k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|   165k|	p[0] = u & 0xff;
  220|   165k|	p[1] = (u >> 8) & 0xff;
  221|   165k|	p[2] = (u >> 16) & 0xff;
  222|   165k|	p[3] = (u >> 24) & 0xff;
  223|   165k|}
archive_read_support_format_rar5.c:archive_le32dec:
  144|   130k|{
  145|   130k|	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|   130k|	unsigned int p3 = p[3];
  151|   130k|	unsigned int p2 = p[2];
  152|   130k|	unsigned int p1 = p[1];
  153|   130k|	unsigned int p0 = p[0];
  154|       |
  155|   130k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   130k|}
archive_read_support_format_rar5.c:archive_le64dec:
  160|    238|{
  161|    238|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    238|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    238|}
archive_read_support_format_rar5.c:archive_le16dec:
  115|    537|{
  116|    537|	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|    537|	unsigned int p1 = p[1];
  122|    537|	unsigned int p0 = p[0];
  123|       |
  124|    537|	return ((p1 << 8) | p0);
  125|    537|}
archive_read_support_format_rar5.c:archive_be24dec:
   75|   721k|{
   76|   721k|	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|   721k|	unsigned int p2 = p[2];
   82|   721k|	unsigned int p1 = p[1];
   83|   721k|	unsigned int p0 = p[0];
   84|       |
   85|   721k|	return ((p0 << 16) | (p1 << 8) | p2);
   86|   721k|}
archive_read_support_format_rar5.c:archive_be32dec:
   91|  12.1k|{
   92|  12.1k|	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|  12.1k|	unsigned int p3 = p[3];
   98|  12.1k|	unsigned int p2 = p[2];
   99|  12.1k|	unsigned int p1 = p[1];
  100|  12.1k|	unsigned int p0 = p[0];
  101|       |
  102|  12.1k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  12.1k|}
archive_read_support_format_rar5.c:archive_le32enc:
  216|  60.8k|{
  217|  60.8k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|  60.8k|	p[0] = u & 0xff;
  220|  60.8k|	p[1] = (u >> 8) & 0xff;
  221|  60.8k|	p[2] = (u >> 16) & 0xff;
  222|  60.8k|	p[3] = (u >> 24) & 0xff;
  223|  60.8k|}
archive_read_support_format_xar.c:archive_be32dec:
   91|  26.4k|{
   92|  26.4k|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|  26.4k|	unsigned int p3 = p[3];
   98|  26.4k|	unsigned int p2 = p[2];
   99|  26.4k|	unsigned int p1 = p[1];
  100|  26.4k|	unsigned int p0 = p[0];
  101|       |
  102|  26.4k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  26.4k|}
archive_read_support_format_xar.c:archive_be16dec:
   61|  3.15k|{
   62|  3.15k|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|  3.15k|	unsigned int p1 = p[1];
   68|  3.15k|	unsigned int p0 = p[0];
   69|       |
   70|  3.15k|	return ((p0 << 8) | p1);
   71|  3.15k|}
archive_read_support_format_xar.c:archive_be64dec:
  107|  2.08k|{
  108|  2.08k|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|  2.08k|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|  2.08k|}
archive_read_support_format_zip.c:archive_le16dec:
  115|   291k|{
  116|   291k|	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|   291k|	unsigned int p1 = p[1];
  122|   291k|	unsigned int p0 = p[0];
  123|       |
  124|   291k|	return ((p1 << 8) | p0);
  125|   291k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   457k|{
  145|   457k|	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|   457k|	unsigned int p3 = p[3];
  151|   457k|	unsigned int p2 = p[2];
  152|   457k|	unsigned int p1 = p[1];
  153|   457k|	unsigned int p0 = p[0];
  154|       |
  155|   457k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   457k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  44.4k|{
  161|  44.4k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  44.4k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  44.4k|}
archive_string.c:archive_be16enc:
  168|  14.2k|{
  169|  14.2k|	unsigned char *p = (unsigned char *)pp;
  170|       |
  171|  14.2k|	p[0] = (u >> 8) & 0xff;
  172|  14.2k|	p[1] = u & 0xff;
  173|  14.2k|}
archive_string.c:archive_le16enc:
  197|  4.36k|{
  198|  4.36k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  4.36k|	p[0] = u & 0xff;
  201|  4.36k|	p[1] = (u >> 8) & 0xff;
  202|  4.36k|}
archive_string.c:archive_be16dec:
   61|  50.6k|{
   62|  50.6k|	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|  50.6k|	unsigned int p1 = p[1];
   68|  50.6k|	unsigned int p0 = p[0];
   69|       |
   70|  50.6k|	return ((p0 << 8) | p1);
   71|  50.6k|}
archive_string.c:archive_le16dec:
  115|  30.2k|{
  116|  30.2k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  30.2k|	unsigned int p1 = p[1];
  122|  30.2k|	unsigned int p0 = p[0];
  123|       |
  124|  30.2k|	return ((p1 << 8) | p0);
  125|  30.2k|}
archive_read_support_format_7zip.c:archive_le32dec:
  144|   149k|{
  145|   149k|	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|   149k|	unsigned int p3 = p[3];
  151|   149k|	unsigned int p2 = p[2];
  152|   149k|	unsigned int p1 = p[1];
  153|   149k|	unsigned int p0 = p[0];
  154|       |
  155|   149k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   149k|}
archive_read_support_format_7zip.c:archive_le16dec:
  115|    685|{
  116|    685|	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|    685|	unsigned int p1 = p[1];
  122|    685|	unsigned int p0 = p[0];
  123|       |
  124|    685|	return ((p1 << 8) | p0);
  125|    685|}
archive_read_support_format_7zip.c:archive_be16dec:
   61|    192|{
   62|    192|	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|    192|	unsigned int p1 = p[1];
   68|    192|	unsigned int p0 = p[0];
   69|       |
   70|    192|	return ((p0 << 8) | p1);
   71|    192|}
archive_read_support_format_7zip.c:archive_be32dec:
   91|    749|{
   92|    749|	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|    749|	unsigned int p3 = p[3];
   98|    749|	unsigned int p2 = p[2];
   99|    749|	unsigned int p1 = p[1];
  100|    749|	unsigned int p0 = p[0];
  101|       |
  102|    749|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    749|}
archive_read_support_format_7zip.c:archive_be64dec:
  107|    138|{
  108|    138|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|    138|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|    138|}
archive_read_support_format_7zip.c:archive_le64dec:
  160|  5.66k|{
  161|  5.66k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  5.66k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  5.66k|}
archive_read_support_format_7zip.c:archive_le32enc:
  216|    127|{
  217|    127|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    127|	p[0] = u & 0xff;
  220|    127|	p[1] = (u >> 8) & 0xff;
  221|    127|	p[2] = (u >> 16) & 0xff;
  222|    127|	p[3] = (u >> 24) & 0xff;
  223|    127|}
archive_read_support_format_7zip.c:archive_le24dec:
  129|     40|{
  130|     40|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|       |	/* Store into unsigned temporaries before left shifting, to avoid
  133|       |	promotion to signed int and then left shifting into the sign bit,
  134|       |	which is undefined behaviour. */
  135|     40|	unsigned int p2 = p[2];
  136|     40|	unsigned int p1 = p[1];
  137|     40|	unsigned int p0 = p[0];
  138|       |
  139|     40|	return ((p2 << 16) | (p1 << 8) | p0);
  140|     40|}
archive_read_support_format_7zip.c:archive_le24enc:
  206|     40|{
  207|     40|	unsigned char *p = (unsigned char *)pp;
  208|       |
  209|     40|	p[0] = u & 0xff;
  210|     40|	p[1] = (u >> 8) & 0xff;
  211|     40|	p[2] = (u >> 16) & 0xff;
  212|     40|}
archive_read_support_format_7zip.c:archive_be32enc:
  177|     20|{
  178|     20|	unsigned char *p = (unsigned char *)pp;
  179|       |
  180|     20|	p[0] = (u >> 24) & 0xff;
  181|     20|	p[1] = (u >> 16) & 0xff;
  182|     20|	p[2] = (u >> 8) & 0xff;
  183|     20|	p[3] = u & 0xff;
  184|     20|}

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

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

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

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

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

archive_read.c:archive_ckd_mul_size:
  187|  7.07k|{
  188|  7.07k|#if USE_STDCKDINT
  189|  7.07k|	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|  7.07k|}
archive_read_support_filter_lz4.c:archive_ckd_add_size:
  119|    488|{
  120|    488|#if USE_STDCKDINT
  121|    488|	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|    488|}
archive_read_support_filter_zstd.c:archive_ckd_add_size:
  119|    552|{
  120|    552|#if USE_STDCKDINT
  121|    552|	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|    552|}
archive_read_support_format_ar.c:archive_ckd_mul_u64:
  205|  17.8k|{
  206|  17.8k|#if USE_STDCKDINT
  207|  17.8k|	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|  17.8k|}
archive_read_support_format_ar.c:archive_ckd_add_u64:
  137|  17.8k|{
  138|  17.8k|#if USE_STDCKDINT
  139|  17.8k|	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|  17.8k|}
archive_read_support_format_mtree.c:archive_ckd_mul_i64:
  160|   144k|{
  161|   144k|#if USE_STDCKDINT
  162|   144k|	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|   144k|}
archive_read_support_format_mtree.c:archive_ckd_sub_i64:
  228|  84.8k|{
  229|  84.8k|#if USE_STDCKDINT
  230|  84.8k|	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|  84.8k|}
archive_read_support_format_mtree.c:archive_ckd_add_i64:
   94|  58.9k|{
   95|  58.9k|#if USE_STDCKDINT
   96|  58.9k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  58.9k|}
archive_read_support_format_rar.c:archive_ckd_mul_size:
  187|  21.3k|{
  188|  21.3k|#if USE_STDCKDINT
  189|  21.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|  21.3k|}
archive_read_support_format_rar5.c:archive_ckd_mul_u64:
  205|   319k|{
  206|   319k|#if USE_STDCKDINT
  207|   319k|	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|   319k|}
archive_read_support_format_rar5.c:archive_ckd_add_u64:
  137|   319k|{
  138|   319k|#if USE_STDCKDINT
  139|   319k|	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|   319k|}
archive_read_support_format_raw.c:archive_ckd_add_i64:
   94|  23.4k|{
   95|  23.4k|#if USE_STDCKDINT
   96|  23.4k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  23.4k|}
archive_read_support_format_tar.c:archive_ckd_mul_i64:
  160|  15.5M|{
  161|  15.5M|#if USE_STDCKDINT
  162|  15.5M|	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|  15.5M|}
archive_read_support_format_tar.c:archive_ckd_add_i64:
   94|  15.5M|{
   95|  15.5M|#if USE_STDCKDINT
   96|  15.5M|	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|  15.5M|}
archive_read_support_format_warc.c:archive_ckd_mul_i64:
  160|  30.2k|{
  161|  30.2k|#if USE_STDCKDINT
  162|  30.2k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  30.2k|}
archive_read_support_format_warc.c:archive_ckd_add_i64:
   94|  30.2k|{
   95|  30.2k|#if USE_STDCKDINT
   96|  30.2k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  30.2k|}
archive_read_support_format_xar.c:archive_ckd_mul_size:
  187|     15|{
  188|     15|#if USE_STDCKDINT
  189|     15|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|     15|}
archive_read_support_format_xar.c:archive_ckd_mul_u64:
  205|   116k|{
  206|   116k|#if USE_STDCKDINT
  207|   116k|	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|   116k|}
archive_read_support_format_xar.c:archive_ckd_add_u64:
  137|   116k|{
  138|   116k|#if USE_STDCKDINT
  139|   116k|	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|   116k|}
archive_read_support_format_7zip.c:archive_ckd_add_i64:
   94|  27.2k|{
   95|  27.2k|#if USE_STDCKDINT
   96|  27.2k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  27.2k|}
archive_read_support_format_7zip.c:archive_ckd_add_size:
  119|  8.15k|{
  120|  8.15k|#if USE_STDCKDINT
  121|  8.15k|	return ckd_add(result, a, b);
  122|       |#elif USE_BUILTIN
  123|       |	return __builtin_add_overflow(a, b, result);
  124|       |#elif USE_INTSAFE
  125|       |	return SizeTAdd(a, b, result);
  126|       |#else
  127|       |	if (a > SIZE_MAX - b)
  128|       |		return 1;
  129|       |	*result = a + b;
  130|       |	return 0;
  131|       |#endif
  132|  8.15k|}
archive_read_support_format_7zip.c:archive_ckd_mul_i64:
  160|  9.00k|{
  161|  9.00k|#if USE_STDCKDINT
  162|  9.00k|	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|  9.00k|}

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

pack_native:
  107|  1.27k|{
  108|  1.27k|	dev_t dev = 0;
  109|       |
  110|  1.27k|	if (n == 2) {
  ------------------
  |  Branch (110:6): [True: 963, False: 308]
  ------------------
  111|    963|		dev = apd_makedev(numbers[0], numbers[1]);
  ------------------
  |  |   95|    963|#define apd_makedev(maj, min) makedev((maj), (min))
  ------------------
  112|    963|		if ((unsigned long)major(dev) != numbers[0])
  ------------------
  |  Branch (112:7): [True: 267, False: 696]
  ------------------
  113|    267|			*error = iMajorError;
  114|    696|		else if ((unsigned long)minor(dev) != numbers[1])
  ------------------
  |  Branch (114:12): [True: 345, False: 351]
  ------------------
  115|    345|			*error = iMinorError;
  116|    963|	} else
  117|    308|		*error = tooManyFields;
  118|  1.27k|	return (dev);
  119|  1.27k|}
pack_find:
  321|  12.5k|{
  322|  12.5k|	const struct format	*format;
  323|       |
  324|  12.5k|	format = bsearch(name, formats,
  325|  12.5k|	    sizeof(formats)/sizeof(formats[0]),
  326|  12.5k|	    sizeof(formats[0]), compare_format);
  327|  12.5k|	if (format == 0)
  ------------------
  |  Branch (327:6): [True: 1.07k, False: 11.4k]
  ------------------
  328|  1.07k|		return (NULL);
  329|  11.4k|	return (format->pack);
  330|  12.5k|}
archive_pack_dev.c:pack_8_8:
  168|  1.10k|{
  169|  1.10k|	dev_t dev = 0;
  170|       |
  171|  1.10k|	if (n == 2) {
  ------------------
  |  Branch (171:6): [True: 792, False: 311]
  ------------------
  172|    792|		dev = makedev_8_8(numbers[0], numbers[1]);
  ------------------
  |  |  163|    792|#define	makedev_8_8(x,y)	((dev_t)((((x) << 8) & 0x0000ff00) | \
  |  |  164|    792|					 (((y) << 0) & 0x000000ff)))
  ------------------
  173|    792|		if ((unsigned long)major_8_8(dev) != numbers[0])
  ------------------
  |  |  161|    792|#define	major_8_8(x)		((int32_t)(((x) & 0x0000ff00) >> 8))
  ------------------
  |  Branch (173:7): [True: 325, False: 467]
  ------------------
  174|    325|			*error = iMajorError;
  175|    792|		if ((unsigned long)minor_8_8(dev) != numbers[1])
  ------------------
  |  |  162|    792|#define	minor_8_8(x)		((int32_t)(((x) & 0x000000ff) >> 0))
  ------------------
  |  Branch (175:7): [True: 257, False: 535]
  ------------------
  176|    257|			*error = iMinorError;
  177|    792|	} else
  178|    311|		*error = tooManyFields;
  179|  1.10k|	return (dev);
  180|  1.10k|}
archive_pack_dev.c:pack_bsdos:
  258|  2.49k|{
  259|  2.49k|	dev_t dev = 0;
  260|       |
  261|  2.49k|	if (n == 2) {
  ------------------
  |  Branch (261:6): [True: 1.10k, False: 1.39k]
  ------------------
  262|  1.10k|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  185|  1.10k|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  186|  1.10k|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  263|  1.10k|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  183|  1.10k|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (263:7): [True: 558, False: 543]
  ------------------
  264|    558|			*error = iMajorError;
  265|  1.10k|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  184|  1.10k|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (265:7): [True: 523, False: 578]
  ------------------
  266|    523|			*error = iMinorError;
  267|  1.39k|	} else if (n == 3) {
  ------------------
  |  Branch (267:13): [True: 1.39k, False: 0]
  ------------------
  268|  1.39k|		dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]);
  ------------------
  |  |  252|  1.39k|#define	makedev_12_12_8(x,y,z)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  253|  1.39k|					 (((y) <<  8) & 0x000fff00) | \
  |  |  254|  1.39k|					 (((z) <<  0) & 0x000000ff)))
  ------------------
  269|  1.39k|		if ((unsigned long)major_12_12_8(dev) != numbers[0])
  ------------------
  |  |  249|  1.39k|#define	major_12_12_8(x)	((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (269:7): [True: 893, False: 498]
  ------------------
  270|    893|			*error = iMajorError;
  271|  1.39k|		if ((unsigned long)unit_12_12_8(dev) != numbers[1])
  ------------------
  |  |  250|  1.39k|#define	unit_12_12_8(x)		((int32_t)(((x) & 0x000fff00) >>  8))
  ------------------
  |  Branch (271:7): [True: 735, False: 656]
  ------------------
  272|    735|			*error = "invalid unit number";
  273|  1.39k|		if ((unsigned long)subunit_12_12_8(dev) != numbers[2])
  ------------------
  |  |  251|  1.39k|#define	subunit_12_12_8(x)	((int32_t)(((x) & 0x000000ff) >>  0))
  ------------------
  |  Branch (273:7): [True: 412, False: 979]
  ------------------
  274|    412|			*error = "invalid subunit number";
  275|  1.39k|	} else
  276|      0|		*error = tooManyFields;
  277|  2.49k|	return (dev);
  278|  2.49k|}
archive_pack_dev.c:pack_8_24:
  234|  1.35k|{
  235|  1.35k|	dev_t dev = 0;
  236|       |
  237|  1.35k|	if (n == 2) {
  ------------------
  |  Branch (237:6): [True: 912, False: 446]
  ------------------
  238|    912|		dev = makedev_8_24(numbers[0], numbers[1]);
  ------------------
  |  |  229|    912|#define	makedev_8_24(x,y)	((dev_t)((((x) << 24) & 0xff000000) | \
  |  |  230|    912|					 (((y) <<  0) & 0x00ffffff)))
  ------------------
  239|    912|		if ((unsigned long)major_8_24(dev) != numbers[0])
  ------------------
  |  |  227|    912|#define	major_8_24(x)		((int32_t)(((x) & 0xff000000) >> 24))
  ------------------
  |  Branch (239:7): [True: 253, False: 659]
  ------------------
  240|    253|			*error = iMajorError;
  241|    912|		if ((unsigned long)minor_8_24(dev) != numbers[1])
  ------------------
  |  |  228|    912|#define	minor_8_24(x)		((int32_t)(((x) & 0x00ffffff) >>  0))
  ------------------
  |  Branch (241:7): [True: 291, False: 621]
  ------------------
  242|    291|			*error = iMinorError;
  243|    912|	} else
  244|    446|		*error = tooManyFields;
  245|  1.35k|	return (dev);
  246|  1.35k|}
archive_pack_dev.c:pack_netbsd:
  124|  1.16k|{
  125|  1.16k|	dev_t dev = 0;
  126|       |
  127|  1.16k|	if (n == 2) {
  ------------------
  |  Branch (127:6): [True: 870, False: 299]
  ------------------
  128|    870|		dev = makedev_netbsd(numbers[0], numbers[1]);
  ------------------
  |  |   45|    870|#define	makedev_netbsd(x,y)	((dev_t)((((x) <<  8) & 0x000fff00) | \
  |  |   46|    870|					 (((y) << 12) & 0xfff00000) | \
  |  |   47|    870|					 (((y) <<  0) & 0x000000ff)))
  ------------------
  129|    870|		if ((unsigned long)major_netbsd(dev) != numbers[0])
  ------------------
  |  |   42|    870|#define	major_netbsd(x)		((int32_t)((((x) & 0x000fff00) >>  8)))
  ------------------
  |  Branch (129:7): [True: 240, False: 630]
  ------------------
  130|    240|			*error = iMajorError;
  131|    630|		else if ((unsigned long)minor_netbsd(dev) != numbers[1])
  ------------------
  |  |   43|    630|#define	minor_netbsd(x)		((int32_t)((((x) & 0xfff00000) >> 12) | \
  |  |   44|    630|					   (((x) & 0x000000ff) >>  0)))
  ------------------
  |  Branch (131:12): [True: 420, False: 210]
  ------------------
  132|    420|			*error = iMinorError;
  133|    870|	} else
  134|    299|		*error = tooManyFields;
  135|  1.16k|	return (dev);
  136|  1.16k|}
archive_pack_dev.c:pack_12_20:
  190|  1.01k|{
  191|  1.01k|	dev_t dev = 0;
  192|       |
  193|  1.01k|	if (n == 2) {
  ------------------
  |  Branch (193:6): [True: 772, False: 247]
  ------------------
  194|    772|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  185|    772|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  186|    772|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  195|    772|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  183|    772|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (195:7): [True: 228, False: 544]
  ------------------
  196|    228|			*error = iMajorError;
  197|    772|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  184|    772|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (197:7): [True: 302, False: 470]
  ------------------
  198|    302|			*error = iMinorError;
  199|    772|	} else
  200|    247|		*error = tooManyFields;
  201|  1.01k|	return (dev);
  202|  1.01k|}
archive_pack_dev.c:pack_14_18:
  212|  1.00k|{
  213|  1.00k|	dev_t dev = 0;
  214|       |
  215|  1.00k|	if (n == 2) {
  ------------------
  |  Branch (215:6): [True: 800, False: 204]
  ------------------
  216|    800|		dev = makedev_14_18(numbers[0], numbers[1]);
  ------------------
  |  |  207|    800|#define	makedev_14_18(x,y)	((dev_t)((((x) << 18) & 0xfffc0000) | \
  |  |  208|    800|					 (((y) <<  0) & 0x0003ffff)))
  ------------------
  217|    800|		if ((unsigned long)major_14_18(dev) != numbers[0])
  ------------------
  |  |  205|    800|#define	major_14_18(x)		((int32_t)(((x) & 0xfffc0000) >> 18))
  ------------------
  |  Branch (217:7): [True: 264, False: 536]
  ------------------
  218|    264|			*error = iMajorError;
  219|    800|		if ((unsigned long)minor_14_18(dev) != numbers[1])
  ------------------
  |  |  206|    800|#define	minor_14_18(x)		((int32_t)(((x) & 0x0003ffff) >>  0))
  ------------------
  |  Branch (219:7): [True: 251, False: 549]
  ------------------
  220|    251|			*error = iMinorError;
  221|    800|	} else
  222|    204|		*error = tooManyFields;
  223|  1.00k|	return (dev);
  224|  1.00k|}
archive_pack_dev.c:compare_format:
  308|  40.3k|{
  309|  40.3k|	const char		*name;
  310|  40.3k|	const struct format	*format;
  311|       |
  312|  40.3k|	name = key;
  313|  40.3k|	format = element;
  314|       |
  315|  40.3k|	return (strcmp(name, format->name));
  316|  40.3k|}

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

archive_ppmd8.c:Ppmd8_Construct:
   65|  14.8k|{
   66|  14.8k|  unsigned i, k, m;
   67|       |
   68|  14.8k|  p->Base = 0;
   69|       |
   70|   578k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   578k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   578k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   578k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   578k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   578k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   578k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   578k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   578k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 563k, False: 14.8k]
  ------------------
   71|   563k|  {
   72|   563k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 385k, False: 177k]
  ------------------
   73|  1.89M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.33M, False: 563k]
  ------------------
   74|   563k|    p->Indx2Units[i] = (Byte)k;
   75|   563k|  }
   76|       |
   77|  14.8k|  p->NS2BSIndx[0] = (0 << 1);
   78|  14.8k|  p->NS2BSIndx[1] = (1 << 1);
   79|  14.8k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  14.8k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  88.9k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 74.1k, False: 14.8k]
  ------------------
   83|  74.1k|    p->NS2Indx[i] = (Byte)i;
   84|  3.79M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 3.78M, False: 14.8k]
  ------------------
   85|  3.78M|  {
   86|  3.78M|    p->NS2Indx[i] = (Byte)m;
   87|  3.78M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 326k, False: 3.45M]
  ------------------
   88|   326k|      k = (++m) - 4;
   89|  3.78M|  }
   90|  14.8k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  13.0k|{
  101|  13.0k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 13.0k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  13.0k|  {
  103|  13.0k|    Ppmd8_Free(p);
  104|  13.0k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  13.0k|        4 - (size & 3);
  109|  13.0k|      #endif
  110|  13.0k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 13.0k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  13.0k|    p->Size = size;
  113|  13.0k|  }
  114|  13.0k|  return True;
  ------------------
  |  |   55|  13.0k|#define True 1
  ------------------
  115|  13.0k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  26.1k|{
   94|  26.1k|  free(p->Base);
   95|  26.1k|  p->Size = 0;
   96|  26.1k|  p->Base = 0;
   97|  26.1k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  13.0k|{
  412|  13.0k|  p->MaxOrder = maxOrder;
  413|  13.0k|  p->RestoreMethod = restoreMethod;
  414|  13.0k|  RestartModel(p);
  415|  13.0k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  13.0k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  13.0k|  p->DummySee.Summ = 0; /* unused */
  417|  13.0k|  p->DummySee.Count = 64; /* unused */
  418|  13.0k|}
archive_ppmd8.c:RestartModel:
  354|  13.1k|{
  355|  13.1k|  unsigned i, k, m, r;
  356|       |
  357|  13.1k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  13.1k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  13.1k|  RESET_TEXT(0);
  ------------------
  |  |  349|  13.1k|#define RESET_TEXT(offs) do {						\
  |  |  350|  13.1k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  13.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 13.1k]
  |  |  ------------------
  ------------------
  360|  13.1k|  p->HiUnit = p->Text + p->Size;
  361|  13.1k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  13.1k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  13.1k|#define UNIT_SIZE 12
  ------------------
  362|  13.1k|  p->GlueCount = 0;
  363|       |
  364|  13.1k|  p->OrderFall = p->MaxOrder;
  365|  13.1k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 8.51k, False: 4.59k]
  ------------------
  366|  13.1k|  p->PrevSuccess = 0;
  367|       |
  368|  13.1k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  13.1k|#define UNIT_SIZE 12
  ------------------
  369|  13.1k|  p->MinContext->Suffix = 0;
  370|  13.1k|  p->MinContext->NumStats = 255;
  371|  13.1k|  p->MinContext->Flags = 0;
  372|  13.1k|  p->MinContext->SummFreq = 256 + 1;
  373|  13.1k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  13.1k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  13.1k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  13.1k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  13.1k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  13.1k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  3.37M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 3.35M, False: 13.1k]
  ------------------
  377|  3.35M|  {
  378|  3.35M|    CPpmd_State *s = &p->FoundState[i];
  379|  3.35M|    s->Symbol = (Byte)i;
  380|  3.35M|    s->Freq = 1;
  381|  3.35M|    SetSuccessor(s, 0);
  382|  3.35M|  }
  383|       |
  384|   341k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 327k, False: 13.1k]
  ------------------
  385|   327k|  {
  386|  3.14M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 2.81M, False: 327k]
  ------------------
  387|  2.81M|      i++;
  388|  2.95M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 2.62M, False: 327k]
  ------------------
  389|  2.62M|    {
  390|  2.62M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.62M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.62M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.62M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  2.62M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  23.6M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 20.9M, False: 2.62M]
  ------------------
  393|  20.9M|        dest[r] = val;
  394|  2.62M|    }
  395|   327k|  }
  396|       |
  397|   327k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 314k, False: 13.1k]
  ------------------
  398|   314k|  {
  399|  3.65M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 3.34M, False: 314k]
  ------------------
  400|  3.34M|      i++;
  401|  10.3M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 10.0M, False: 314k]
  ------------------
  402|  10.0M|    {
  403|  10.0M|      CPpmd_See *s = &p->See[m][k];
  404|  10.0M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  10.0M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  10.0M|      s->Count = 7;
  406|  10.0M|    }
  407|   314k|  }
  408|  13.1k|}
archive_ppmd8.c:SetSuccessor:
  344|   263M|{
  345|   263M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  346|   263M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  347|   263M|}
archive_ppmd8.c:Ppmd8_RangeDec_Init:
 1131|  13.0k|{
 1132|  13.0k|  unsigned i;
 1133|  13.0k|  p->Low = 0;
 1134|  13.0k|  p->Range = 0xFFFFFFFF;
 1135|  13.0k|  p->Code = 0;
 1136|  65.3k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 52.2k, False: 13.0k]
  ------------------
 1137|  52.2k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  13.0k|  return (p->Code < 0xFFFFFFFF);
 1139|  13.0k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|  69.2M|{
 1166|  69.2M|  size_t charMask[256 / sizeof(size_t)];
 1167|  69.2M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 13.5M, False: 55.7M]
  ------------------
 1168|  13.5M|  {
 1169|  13.5M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  13.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  13.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1170|  13.5M|    unsigned i;
 1171|  13.5M|    UInt32 count, hiCnt;
 1172|  13.5M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1172:9): [True: 5.06M, False: 8.50M]
  ------------------
 1173|  5.06M|    {
 1174|  5.06M|      Byte symbol;
 1175|  5.06M|      RangeDec_Decode(p, 0, s->Freq);
 1176|  5.06M|      p->FoundState = s;
 1177|  5.06M|      symbol = s->Symbol;
 1178|  5.06M|      Ppmd8_Update1_0(p);
 1179|  5.06M|      return symbol;
 1180|  5.06M|    }
 1181|  8.50M|    p->PrevSuccess = 0;
 1182|  8.50M|    i = p->MinContext->NumStats;
 1183|  8.50M|    do
 1184|  82.1M|    {
 1185|  82.1M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 4.92M, False: 77.1M]
  ------------------
 1186|  4.92M|      {
 1187|  4.92M|        Byte symbol;
 1188|  4.92M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  4.92M|        p->FoundState = s;
 1190|  4.92M|        symbol = s->Symbol;
 1191|  4.92M|        Ppmd8_Update1(p);
 1192|  4.92M|        return symbol;
 1193|  4.92M|      }
 1194|  82.1M|    }
 1195|  77.1M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 73.5M, False: 3.58M]
  ------------------
 1196|  3.58M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 5.34k, False: 3.57M]
  ------------------
 1197|  5.34k|      return -2;
 1198|  3.57M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1199|  3.57M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  3.57M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  3.57M|	unsigned j;							\
  |  |  153|  17.8M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 14.3M, False: 3.57M]
  |  |  ------------------
  |  |  154|  14.3M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  14.3M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  14.3M|	}								\
  |  |  157|  3.57M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 3.57M]
  |  |  ------------------
  ------------------
 1200|  3.57M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1162|  3.57M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1201|  3.57M|    i = p->MinContext->NumStats;
 1202|  10.6M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  | 1162|  10.6M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1202:44): [True: 7.06M, False: 3.57M]
  ------------------
 1203|  3.57M|  }
 1204|  55.7M|  else
 1205|  55.7M|  {
 1206|  55.7M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|  55.7M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|  55.7M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|  55.7M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|  55.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  55.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  55.7M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|  55.7M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 49.7M, False: 5.97M]
  ------------------
 1208|  49.7M|    {
 1209|  49.7M|      Byte symbol;
 1210|  49.7M|      RangeDec_Decode(p, 0, *prob);
 1211|  49.7M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  49.7M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  49.7M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  49.7M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  49.7M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|  49.7M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|  49.7M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|  49.7M|      Ppmd8_UpdateBin(p);
 1214|  49.7M|      return symbol;
 1215|  49.7M|    }
 1216|  5.97M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1217|  5.97M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  5.97M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  5.97M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  5.97M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  5.97M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1219|  5.97M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  5.97M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  5.97M|	unsigned j;							\
  |  |  153|  29.8M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 23.8M, False: 5.97M]
  |  |  ------------------
  |  |  154|  23.8M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  23.8M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  23.8M|	}								\
  |  |  157|  5.97M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 5.97M]
  |  |  ------------------
  ------------------
 1220|  5.97M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1162|  5.97M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1221|  5.97M|    p->PrevSuccess = 0;
 1222|  5.97M|  }
 1223|  9.54M|  for (;;)
 1224|  13.4M|  {
 1225|  13.4M|    CPpmd_State *ps[256], *s;
 1226|  13.4M|    UInt32 freqSum, count, hiCnt;
 1227|  13.4M|    CPpmd_See *see;
 1228|  13.4M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1229|  13.4M|    do
 1230|  37.0M|    {
 1231|  37.0M|      p->OrderFall++;
 1232|  37.0M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1232:11): [True: 1.39k, False: 37.0M]
  ------------------
 1233|  1.39k|        return -1;
 1234|  37.0M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   97|  37.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   96|  37.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1235|  37.0M|    }
 1236|  37.0M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1236:12): [True: 23.5M, False: 13.4M]
  ------------------
 1237|  13.4M|    hiCnt = 0;
 1238|  13.4M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  13.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  13.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1239|  13.4M|    i = 0;
 1240|  13.4M|    num = p->MinContext->NumStats - numMasked;
 1241|  13.4M|    do
 1242|   627M|    {
 1243|   627M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1162|   627M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1244|   627M|      hiCnt += (s->Freq & k);
 1245|   627M|      ps[i] = s++;
 1246|   627M|      i -= k;
 1247|   627M|    }
 1248|   627M|    while (i != num);
  ------------------
  |  Branch (1248:12): [True: 613M, False: 13.4M]
  ------------------
 1249|       |    
 1250|  13.4M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1251|  13.4M|    freqSum += hiCnt;
 1252|  13.4M|    count = RangeDec_GetThreshold(p, freqSum);
 1253|       |    
 1254|  13.4M|    if (count < hiCnt)
  ------------------
  |  Branch (1254:9): [True: 9.54M, False: 3.94M]
  ------------------
 1255|  9.54M|    {
 1256|  9.54M|      Byte symbol;
 1257|  9.54M|      CPpmd_State **pps = ps;
 1258|   187M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1258:23): [True: 177M, False: 9.54M]
  ------------------
 1259|  9.54M|      s = *pps;
 1260|  9.54M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1261|  9.54M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  9.54M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  9.54M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  19.0M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 5.83M, False: 3.71M]
  |  |  |  Branch (113:39): [True: 185k, False: 5.64M]
  |  |  ------------------
  |  |  114|   185k|		(p)->Summ <<= 1;					\
  |  |  115|   185k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|   185k|    	}								\
  |  |  117|  9.54M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 9.54M]
  |  |  ------------------
  ------------------
 1262|  9.54M|      p->FoundState = s;
 1263|  9.54M|      symbol = s->Symbol;
 1264|  9.54M|      Ppmd8_Update2(p);
 1265|  9.54M|      return symbol;
 1266|  9.54M|    }
 1267|  3.94M|    if (count >= freqSum)
  ------------------
  |  Branch (1267:9): [True: 5.76k, False: 3.93M]
  ------------------
 1268|  5.76k|      return -2;
 1269|  3.93M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1270|  3.93M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1271|  12.0M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1162|  12.0M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1271:46): [True: 8.12M, False: 3.93M]
  ------------------
 1272|  3.93M|  }
 1273|  9.54M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1142|  27.0M|{
 1143|  27.0M|  return p->Code / (p->Range /= total);
 1144|  27.0M|}
archive_ppmd8.c:RangeDec_Decode:
 1147|  82.7M|{
 1148|  82.7M|  start *= p->Range;
 1149|  82.7M|  p->Low += start;
 1150|  82.7M|  p->Code -= start;
 1151|  82.7M|  p->Range *= size;
 1152|       |
 1153|  92.8M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   185M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 10.0M, False: 82.7M]
  ------------------
 1154|  82.7M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   165M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  14.1k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 14.1k, False: 82.7M]
  |  Branch (1154:27): [True: 14.1k, False: 0]
  ------------------
 1155|  10.0M|  {
 1156|  10.0M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1157|  10.0M|    p->Range <<= 8;
 1158|  10.0M|    p->Low <<= 8;
 1159|  10.0M|  }
 1160|  82.7M|}
archive_ppmd8.c:Ppmd8_Update1_0:
 1097|  5.06M|{
 1098|  5.06M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1099|  5.06M|  p->RunLength += p->PrevSuccess;
 1100|  5.06M|  p->MinContext->SummFreq += 4;
 1101|  5.06M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  5.06M|#define MAX_FREQ 124
  ------------------
  |  Branch (1101:7): [True: 41.7k, False: 5.02M]
  ------------------
 1102|  41.7k|    Rescale(p);
 1103|  5.06M|  NextContext(p);
 1104|  5.06M|}
archive_ppmd8.c:Rescale:
  975|  54.2k|{
  976|  54.2k|  unsigned i, adder, sumFreq, escFreq;
  977|  54.2k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|  54.2k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  54.2k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  54.2k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  54.2k|  CPpmd_State *s = p->FoundState;
  979|  54.2k|  {
  980|  54.2k|    CPpmd_State tmp = *s;
  981|   194k|    for (; s != stats; s--)
  ------------------
  |  Branch (981:12): [True: 140k, False: 54.2k]
  ------------------
  982|   140k|      s[0] = s[-1];
  983|  54.2k|    *s = tmp;
  984|  54.2k|  }
  985|  54.2k|  escFreq = p->MinContext->SummFreq - s->Freq;
  986|  54.2k|  s->Freq += 4;
  987|  54.2k|  adder = (p->OrderFall != 0
  988|       |      #ifdef PPMD8_FREEZE_SUPPORT
  989|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  990|       |      #endif
  991|  54.2k|      );
  992|  54.2k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  54.2k|  sumFreq = s->Freq;
  994|       |  
  995|  54.2k|  i = p->MinContext->NumStats;
  996|  54.2k|  do
  997|  2.23M|  {
  998|  2.23M|    escFreq -= (++s)->Freq;
  999|  2.23M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
 1000|  2.23M|    sumFreq += s->Freq;
 1001|  2.23M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1001:9): [True: 651k, False: 1.57M]
  ------------------
 1002|   651k|    {
 1003|   651k|      CPpmd_State *s1 = s;
 1004|   651k|      CPpmd_State tmp = *s1;
 1005|   651k|      do
 1006|  32.4M|        s1[0] = s1[-1];
 1007|  32.4M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1007:14): [True: 32.4M, False: 0]
  |  Branch (1007:31): [True: 31.7M, False: 651k]
  ------------------
 1008|   651k|      *s1 = tmp;
 1009|   651k|    }
 1010|  2.23M|  }
 1011|  2.23M|  while (--i);
  ------------------
  |  Branch (1011:10): [True: 2.17M, False: 54.2k]
  ------------------
 1012|       |  
 1013|  54.2k|  if (s->Freq == 0)
  ------------------
  |  Branch (1013:7): [True: 11.7k, False: 42.5k]
  ------------------
 1014|  11.7k|  {
 1015|  11.7k|    unsigned numStats = p->MinContext->NumStats;
 1016|  11.7k|    unsigned n0, n1;
 1017|  15.3k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1017:24): [True: 3.61k, False: 11.7k]
  ------------------
 1018|  11.7k|    escFreq += i;
 1019|  11.7k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1020|  11.7k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1020:9): [True: 4.33k, False: 7.37k]
  ------------------
 1021|  4.33k|    {
 1022|  4.33k|      CPpmd_State tmp = *stats;
 1023|  4.33k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  4.33k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  4.33k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 4.13k, False: 202]
  ------------------
 1025|  4.13k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  4.13k|#define MAX_FREQ 124
  ------------------
 1026|  4.33k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  4.33k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  4.33k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  4.33k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  4.33k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.33k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  4.33k|      return;
 1030|  4.33k|    }
 1031|  7.37k|    n0 = (numStats + 2) >> 1;
 1032|  7.37k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1033|  7.37k|    if (n0 != n1)
  ------------------
  |  Branch (1033:9): [True: 5.84k, False: 1.53k]
  ------------------
 1034|  5.84k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  5.84k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  5.84k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1035|  7.37k|    p->MinContext->Flags &= ~0x08;
 1036|  7.37k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  7.37k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  7.37k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  7.37k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1037|  7.37k|    i = p->MinContext->NumStats;
 1038|  31.8k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1038:73): [True: 24.4k, False: 7.37k]
  ------------------
 1039|  7.37k|  }
 1040|  49.9k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1041|  49.9k|  p->MinContext->Flags |= 0x4;
 1042|  49.9k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|  49.9k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  49.9k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  49.9k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  49.9k|}
archive_ppmd8.c:InsertNode:
  118|  65.8M|{
  119|  65.8M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|  65.8M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|  65.8M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|  65.8M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|  65.8M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|  65.8M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|  65.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|  65.8M|  p->Stamps[indx]++;
  124|  65.8M|}
archive_ppmd8.c:ShrinkUnits:
  255|  2.59M|{
  256|  2.59M|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  2.59M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  257|  2.59M|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  2.59M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  258|  2.59M|  if (i0 == i1)
  ------------------
  |  Branch (258:7): [True: 421k, False: 2.16M]
  ------------------
  259|   421k|    return oldPtr;
  260|  2.16M|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (260:7): [True: 2.16M, False: 3.93k]
  ------------------
  261|  2.16M|  {
  262|  2.16M|    void *ptr = RemoveNode(p, i1);
  263|  2.16M|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  245|  2.16M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  2.16M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  2.16M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  2.16M|	UInt32 n = num;							\
  |  |  249|  3.26M|	do {								\
  |  |  250|  3.26M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  3.26M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 1.10M, False: 2.16M]
  |  |  ------------------
  |  |  252|  2.16M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 2.16M]
  |  |  ------------------
  ------------------
  264|  2.16M|    InsertNode(p, oldPtr, i0);
  265|  2.16M|    return ptr;
  266|  2.16M|  }
  267|  3.93k|  SplitBlock(p, oldPtr, i0, i1);
  268|  3.93k|  return oldPtr;
  269|  2.16M|}
archive_ppmd8.c:RemoveNode:
  127|  31.8M|{
  128|  31.8M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  31.8M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  31.8M|  p->FreeList[indx] = node->Next;
  130|  31.8M|  p->Stamps[indx]--;
  131|  31.8M|  return node;
  132|  31.8M|}
archive_ppmd8.c:SplitBlock:
  135|  3.88M|{
  136|  3.88M|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  3.88M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  3.88M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|  3.88M|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|  3.88M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  3.88M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|  3.88M|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  3.88M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 283k, False: 3.60M]
  ------------------
  139|   283k|  {
  140|   283k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|   283k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|   283k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|   283k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   283k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|   283k|  }
  143|  3.88M|  InsertNode(p, ptr, i);
  144|  3.88M|}
archive_ppmd8.c:NextContext:
 1070|  59.7M|{
 1071|  59.7M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|  59.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  59.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  59.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|  59.7M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 29.3M, False: 30.4M]
  |  Branch (1072:28): [True: 22.8M, False: 6.46M]
  ------------------
 1073|  22.8M|    p->MinContext = p->MaxContext = c;
 1074|  36.8M|  else
 1075|  36.8M|  {
 1076|  36.8M|    UpdateModel(p);
 1077|  36.8M|    p->MinContext = p->MaxContext;
 1078|  36.8M|  }
 1079|  59.7M|}
archive_ppmd8.c:UpdateModel:
  806|  46.4M|{
  807|  46.4M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  46.4M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  46.4M|  CTX_PTR c;
  809|  46.4M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  46.4M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  46.4M|  CPpmd_State *s = NULL;
  812|       |  
  813|  46.4M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  46.4M|#define MAX_FREQ 124
  ------------------
  |  Branch (813:7): [True: 43.2M, False: 3.13M]
  |  Branch (813:45): [True: 41.5M, False: 1.71M]
  ------------------
  814|  41.5M|  {
  815|  41.5M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  41.5M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  41.5M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  41.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  41.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|       |    
  817|  41.5M|    if (c->NumStats == 0)
  ------------------
  |  Branch (817:9): [True: 24.4M, False: 17.0M]
  ------------------
  818|  24.4M|    {
  819|  24.4M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  24.4M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  24.4M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  820|  24.4M|      if (s->Freq < 32)
  ------------------
  |  Branch (820:11): [True: 24.4M, False: 1.70k]
  ------------------
  821|  24.4M|        s->Freq++;
  822|  24.4M|    }
  823|  17.0M|    else
  824|  17.0M|    {
  825|  17.0M|      s = STATS(c);
  ------------------
  |  |   30|  17.0M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  17.0M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  17.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|  17.0M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (826:11): [True: 10.6M, False: 6.47M]
  ------------------
  827|  10.6M|      {
  828|   159M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (828:28): [True: 149M, False: 10.6M]
  ------------------
  829|  10.6M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (829:13): [True: 4.52M, False: 6.08M]
  ------------------
  830|  4.52M|        {
  831|  4.52M|          SwapStates(&s[0], &s[-1]);
  832|  4.52M|          s--;
  833|  4.52M|        }
  834|  10.6M|      }
  835|  17.0M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  17.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (835:11): [True: 16.9M, False: 153k]
  ------------------
  836|  16.9M|      {
  837|  16.9M|        s->Freq += 2;
  838|  16.9M|        c->SummFreq += 2;
  839|  16.9M|      }
  840|  17.0M|    }
  841|  41.5M|  }
  842|       |  
  843|  46.4M|  c = p->MaxContext;
  844|  46.4M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (844:7): [True: 6.46M, False: 39.9M]
  |  Branch (844:28): [True: 6.36M, False: 95.9k]
  ------------------
  845|  6.36M|  {
  846|  6.36M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  6.36M|#define True 1
  ------------------
  847|  6.36M|    if (cs == 0)
  ------------------
  |  Branch (847:9): [True: 376, False: 6.36M]
  ------------------
  848|    376|    {
  849|    376|      SetSuccessor(p->FoundState, 0);
  850|    376|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    376|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  851|    376|    }
  852|  6.36M|    else
  853|  6.36M|    {
  854|  6.36M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  6.36M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  6.36M|      p->MaxContext = cs;
  856|  6.36M|    }
  857|  6.36M|    return;
  858|  6.36M|  }
  859|       |  
  860|  40.0M|  *p->Text++ = p->FoundState->Symbol;
  861|  40.0M|  successor = REF(p->Text);
  ------------------
  |  |   24|  40.0M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  862|  40.0M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (862:7): [True: 21, False: 40.0M]
  ------------------
  863|     21|  {
  864|     21|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  554|     21|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  865|     21|    return;
  866|     21|  }
  867|       |  
  868|  40.0M|  if (!fSuccessor)
  ------------------
  |  Branch (868:7): [True: 1.97M, False: 38.0M]
  ------------------
  869|  1.97M|  {
  870|  1.97M|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  871|  1.97M|    if (cs == NULL)
  ------------------
  |  Branch (871:9): [True: 65, False: 1.97M]
  ------------------
  872|     65|    {
  873|     65|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|     65|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  874|     65|      return;
  875|     65|    }
  876|  1.97M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  1.97M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  877|  1.97M|  }
  878|  38.0M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |   96|  38.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (878:12): [True: 13.7M, False: 24.3M]
  ------------------
  879|  13.7M|  {
  880|  13.7M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  13.7M|#define False 0
  ------------------
  881|  13.7M|    if (cs == NULL)
  ------------------
  |  Branch (881:9): [True: 182, False: 13.7M]
  ------------------
  882|    182|    {
  883|    182|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|    182|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  884|    182|      return;
  885|    182|    }
  886|  13.7M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  13.7M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  887|  13.7M|  }
  888|       |  
  889|  40.0M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (889:7): [True: 1.36M, False: 38.6M]
  ------------------
  890|  1.36M|  {
  891|  1.36M|    successor = fSuccessor;
  892|  1.36M|    p->Text -= (p->MaxContext != p->MinContext);
  893|  1.36M|  }
  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|  40.0M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  904|  40.0M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  905|       |  
  906|  77.0M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  37.0M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  37.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  37.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  37.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (906:10): [True: 37.0M, False: 40.0M]
  ------------------
  907|  37.0M|  {
  908|  37.0M|    unsigned ns1;
  909|  37.0M|    UInt32 cf, sf;
  910|  37.0M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (910:9): [True: 14.1M, False: 22.8M]
  ------------------
  911|  14.1M|    {
  912|  14.1M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (912:11): [True: 9.51M, False: 4.62M]
  ------------------
  913|  9.51M|      {
  914|       |        /* Expand for one UNIT */
  915|  9.51M|        unsigned oldNU = (ns1 + 1) >> 1;
  916|  9.51M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  9.51M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  917|  9.51M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  9.51M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (917:13): [True: 9.23M, False: 280k]
  ------------------
  918|  9.23M|        {
  919|  9.23M|          void *ptr = AllocUnits(p, i + 1);
  920|  9.23M|          void *oldPtr;
  921|  9.23M|          if (!ptr)
  ------------------
  |  Branch (921:15): [True: 281, False: 9.23M]
  ------------------
  922|    281|          {
  923|    281|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    281|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  924|    281|            return;
  925|    281|          }
  926|  9.23M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  9.23M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  9.23M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  9.23M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  9.23M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  245|  9.23M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  9.23M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  9.23M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  9.23M|	UInt32 n = num;							\
  |  |  249|  13.8M|	do {								\
  |  |  250|  13.8M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  13.8M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 4.58M, False: 9.23M]
  |  |  ------------------
  |  |  252|  9.23M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 9.23M]
  |  |  ------------------
  ------------------
  928|  9.23M|          InsertNode(p, oldPtr, i);
  929|  9.23M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  9.23M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  9.23M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  930|  9.23M|        }
  931|  9.51M|      }
  932|  14.1M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  933|  14.1M|    }
  934|  22.8M|    else
  935|  22.8M|    {
  936|  22.8M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  937|  22.8M|      if (!s2)
  ------------------
  |  Branch (937:11): [True: 352, False: 22.8M]
  ------------------
  938|    352|      {
  939|    352|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    352|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  940|    352|        return;
  941|    352|      }
  942|  22.8M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  22.8M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  22.8M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  943|  22.8M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  22.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  944|  22.8M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  22.8M|#define MAX_FREQ 124
  ------------------
  |  Branch (944:11): [True: 22.8M, False: 11.9k]
  ------------------
  945|  22.8M|        s2->Freq <<= 1;
  946|  11.9k|      else
  947|  11.9k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  11.9k|#define MAX_FREQ 124
  ------------------
  948|  22.8M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  949|  22.8M|    }
  950|  37.0M|    cf = 2 * fFreq * (c->SummFreq + 6);
  951|  37.0M|    sf = (UInt32)s0 + c->SummFreq;
  952|  37.0M|    if (cf < 6 * sf)
  ------------------
  |  Branch (952:9): [True: 19.1M, False: 17.8M]
  ------------------
  953|  19.1M|    {
  954|  19.1M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  955|  19.1M|      c->SummFreq += 4;
  956|  19.1M|    }
  957|  17.8M|    else
  958|  17.8M|    {
  959|  17.8M|      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
  960|  17.8M|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  961|  17.8M|    }
  962|  37.0M|    {
  963|  37.0M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  37.0M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  37.0M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  37.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  37.0M|      SetSuccessor(s2, successor);
  965|  37.0M|      s2->Symbol = fSymbol;
  966|  37.0M|      s2->Freq = (Byte)cf;
  967|  37.0M|      c->Flags |= flag;
  968|  37.0M|      c->NumStats = (Byte)(ns1 + 1);
  969|  37.0M|    }
  970|  37.0M|  }
  971|  40.0M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  40.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  40.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  40.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  40.0M|}
archive_ppmd8.c:SwapStates:
  444|  29.5M|{
  445|  29.5M|  CPpmd_State tmp = *t1;
  446|  29.5M|  *t1 = *t2;
  447|  29.5M|  *t2 = tmp;
  448|  29.5M|}
archive_ppmd8.c:CreateSuccessors:
  619|  20.1M|{
  620|  20.1M|  CPpmd_State upState;
  621|  20.1M|  Byte flags;
  622|  20.1M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  20.1M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  623|       |  /* fixed over Shkarin's code. Maybe it could work without + 1 too. */
  624|  20.1M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  625|  20.1M|  unsigned numPs = 0;
  626|       |  
  627|  20.1M|  if (!skip)
  ------------------
  |  Branch (627:7): [True: 13.7M, False: 6.36M]
  ------------------
  628|  13.7M|    ps[numPs++] = p->FoundState;
  629|       |  
  630|  95.1M|  while (c->Suffix)
  ------------------
  |  Branch (630:10): [True: 94.7M, False: 406k]
  ------------------
  631|  94.7M|  {
  632|  94.7M|    CPpmd_Void_Ref successor;
  633|  94.7M|    CPpmd_State *s;
  634|  94.7M|    c = SUFFIX(c);
  ------------------
  |  |   32|  94.7M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  94.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  94.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  94.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|  94.7M|    if (s1)
  ------------------
  |  Branch (635:9): [True: 19.9M, False: 74.8M]
  ------------------
  636|  19.9M|    {
  637|  19.9M|      s = s1;
  638|  19.9M|      s1 = NULL;
  639|  19.9M|    }
  640|  74.8M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (640:14): [True: 19.6M, False: 55.1M]
  ------------------
  641|  19.6M|    {
  642|   120M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  19.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  19.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  19.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (642:26): [True: 100M, False: 19.6M]
  ------------------
  643|  19.6M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  19.6M|#define MAX_FREQ 124
  ------------------
  |  Branch (643:11): [True: 19.6M, False: 34.8k]
  ------------------
  644|  19.6M|      {
  645|  19.6M|        s->Freq++;
  646|  19.6M|        c->SummFreq++;
  647|  19.6M|      }
  648|  19.6M|    }
  649|  55.1M|    else
  650|  55.1M|    {
  651|  55.1M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  55.1M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  55.1M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  652|  55.1M|      s->Freq = (Byte)(s->Freq + (!SUFFIX(c)->NumStats & (s->Freq < 24)));
  ------------------
  |  |   32|  55.1M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  55.1M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  55.1M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  55.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  653|  55.1M|    }
  654|  94.7M|    successor = SUCCESSOR(s);
  ------------------
  |  |  341|  94.7M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  655|  94.7M|    if (successor != upBranch)
  ------------------
  |  Branch (655:9): [True: 19.7M, False: 75.0M]
  ------------------
  656|  19.7M|    {
  657|  19.7M|      c = CTX(successor);
  ------------------
  |  |   29|  19.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  19.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  19.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|  19.7M|      if (numPs == 0)
  ------------------
  |  Branch (658:11): [True: 455k, False: 19.2M]
  ------------------
  659|   455k|        return c;
  660|  19.2M|      break;
  661|  19.7M|    }
  662|  75.0M|    ps[numPs++] = s;
  663|  75.0M|  }
  664|       |  
  665|  19.6M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |   96|  19.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  666|  19.6M|  SetSuccessor(&upState, upBranch + 1);
  667|  19.6M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  668|       |
  669|  19.6M|  if (c->NumStats == 0)
  ------------------
  |  Branch (669:7): [True: 9.97M, False: 9.71M]
  ------------------
  670|  9.97M|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   31|  9.97M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  9.97M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  671|  9.71M|  else
  672|  9.71M|  {
  673|  9.71M|    UInt32 cf, s0;
  674|  9.71M|    CPpmd_State *s;
  675|  63.2M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  9.71M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  9.71M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  9.71M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:24): [True: 53.5M, False: 9.71M]
  ------------------
  676|  9.71M|    cf = s->Freq - 1;
  677|  9.71M|    s0 = c->SummFreq - c->NumStats - cf;
  678|  9.71M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (678:32): [True: 6.27M, False: 3.43M]
  ------------------
  679|  9.71M|  }
  680|       |
  681|   108M|  while (numPs != 0)
  ------------------
  |  Branch (681:10): [True: 88.8M, False: 19.6M]
  ------------------
  682|  88.8M|  {
  683|       |    /* Create Child */
  684|  88.8M|    CTX_PTR c1; /* = AllocContext(p); */
  685|  88.8M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (685:9): [True: 67.4M, False: 21.3M]
  ------------------
  686|  67.4M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  67.4M|#define UNIT_SIZE 12
  ------------------
  687|  21.3M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (687:14): [True: 12.9M, False: 8.46M]
  ------------------
  688|  12.9M|      c1 = (CTX_PTR)RemoveNode(p, 0);
  689|  8.46M|    else
  690|  8.46M|    {
  691|  8.46M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  692|  8.46M|      if (!c1)
  ------------------
  |  Branch (692:11): [True: 623, False: 8.46M]
  ------------------
  693|    623|        return NULL;
  694|  8.46M|    }
  695|  88.8M|    c1->NumStats = 0;
  696|  88.8M|    c1->Flags = flags;
  697|  88.8M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|  88.8M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  88.8M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  698|  88.8M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|  88.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  699|  88.8M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|  88.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  700|  88.8M|    c = c1;
  701|  88.8M|  }
  702|       |
  703|  19.6M|  return c;
  704|  19.6M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  10.9M|{
  206|  10.9M|  unsigned i;
  207|  10.9M|  void *retVal;
  208|  10.9M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 1.82k, False: 10.9M]
  ------------------
  209|  1.82k|  {
  210|  1.82k|    GlueFreeBlocks(p);
  211|  1.82k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 867, False: 958]
  ------------------
  212|    867|      return RemoveNode(p, indx);
  213|  1.82k|  }
  214|  10.9M|  i = indx;
  215|  10.9M|  do
  216|   276M|  {
  217|   276M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   276M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   276M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   276M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   276M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   276M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   276M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   276M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   276M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 7.10M, False: 269M]
  ------------------
  218|  7.10M|    {
  219|  7.10M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  7.10M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  7.10M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  7.10M|      p->GlueCount--;
  221|  7.10M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 7.10M, False: 1.25k]
  ------------------
  222|  7.10M|    }
  223|   276M|  }
  224|   269M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 265M, False: 3.88M]
  ------------------
  225|  3.88M|  retVal = RemoveNode(p, i);
  226|  3.88M|  SplitBlock(p, retVal, i, indx);
  227|  3.88M|  return retVal;
  228|  10.9M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|  1.82k|{
  148|  1.82k|  CPpmd8_Node_Ref head = 0;
  149|  1.82k|  CPpmd8_Node_Ref *prev = &head;
  150|  1.82k|  unsigned i;
  151|       |
  152|  1.82k|  p->GlueCount = 1 << 13;
  153|  1.82k|  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|  1.82k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 123, False: 1.70k]
  ------------------
  158|    123|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|  71.1k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  71.1k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  71.1k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  71.1k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  71.1k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  71.1k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  71.1k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  71.1k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  71.1k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 69.3k, False: 1.82k]
  ------------------
  162|  69.3k|  {
  163|  69.3k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|  69.3k|    p->FreeList[i] = 0;
  165|  16.9M|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 16.8M, False: 69.3k]
  ------------------
  166|  16.8M|    {
  167|  16.8M|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  16.8M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  16.8M|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 10.2M, False: 6.56M]
  ------------------
  169|  10.2M|      {
  170|  10.2M|        CPpmd8_Node *node2;
  171|  10.2M|        *prev = next;
  172|  10.2M|        prev = &(node->Next);
  173|  20.0M|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  20.0M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 9.72M, False: 10.2M]
  ------------------
  174|  9.72M|        {
  175|  9.72M|          node->NU += node2->NU;
  176|  9.72M|          node2->NU = 0;
  177|  9.72M|        }
  178|  10.2M|      }
  179|  16.8M|      next = node->Next;
  180|  16.8M|    }
  181|  69.3k|  }
  182|  1.82k|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  10.2M|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 10.2M, False: 1.82k]
  ------------------
  186|  10.2M|  {
  187|  10.2M|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  10.2M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  10.2M|    unsigned nu;
  189|  10.2M|    head = node->Next;
  190|  10.2M|    nu = node->NU;
  191|  10.2M|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 3.15M, False: 7.13M]
  ------------------
  192|  3.15M|      continue;
  193|  7.13M|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 189, False: 7.13M]
  ------------------
  194|    189|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|    189|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|    189|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|    189|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|    189|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|    189|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    189|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    189|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    189|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  7.13M|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  7.13M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 442k, False: 6.69M]
  ------------------
  196|   442k|    {
  197|   442k|      unsigned k = I2U(--i);
  ------------------
  |  |   19|   442k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|   442k|      InsertNode(p, node + k, nu - k - 1);
  199|   442k|    }
  200|  7.13M|    InsertNode(p, node, i);
  201|  7.13M|  }
  202|  1.82k|}
archive_ppmd8.c:RestoreModel:
  562|  1.27k|{
  563|  1.27k|  CTX_PTR c;
  564|  1.27k|  CPpmd_State *s;
  565|  1.27k|  RESET_TEXT(0);
  ------------------
  |  |  349|  1.27k|#define RESET_TEXT(offs) do {						\
  |  |  350|  1.27k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  1.27k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 1.27k]
  |  |  ------------------
  ------------------
  566|  3.83k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|  2.55k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  2.55k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  2.55k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.55k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:27): [True: 2.55k, False: 1.27k]
  ------------------
  567|  2.55k|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (567:9): [True: 1.70k, False: 852]
  ------------------
  568|  1.70k|    {
  569|  1.70k|      s = STATS(c);
  ------------------
  |  |   30|  1.70k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  1.70k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.70k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  1.70k|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  571|  1.70k|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|  1.70k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.70k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  572|  1.70k|      SpecialFreeUnit(p, s);
  573|  1.70k|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  1.70k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.70k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  1.70k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  1.70k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|  1.70k|    }
  575|    852|    else
  576|    852|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  577|       | 
  578|  5.61k|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  4.34k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  4.34k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  4.34k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.34k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:10): [True: 4.34k, False: 1.27k]
  ------------------
  579|  4.34k|    if (!c->NumStats)
  ------------------
  |  Branch (579:9): [True: 2.60k, False: 1.73k]
  ------------------
  580|  2.60k|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.60k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.60k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.60k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.60k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  2.60k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.60k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  581|  1.73k|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (581:14): [True: 91, False: 1.64k]
  ------------------
  582|     91|      Refresh(p, c, (c->NumStats + 2) >> 1, 1);
  583|       |
  584|       |  #ifdef PPMD8_FREEZE_SUPPORT
  585|       |  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  586|       |  {
  587|       |    p->MaxContext = fSuccessor;
  588|       |    p->GlueCount += !(p->Stamps[1] & 1);
  589|       |  }
  590|       |  else if (p->RestoreMethod == PPMD8_RESTORE_METHOD_FREEZE)
  591|       |  {
  592|       |    while (p->MaxContext->Suffix)
  593|       |      p->MaxContext = SUFFIX(p->MaxContext);
  594|       |    RemoveBinContexts(p, p->MaxContext, 0);
  595|       |    p->RestoreMethod++;
  596|       |    p->GlueCount = 0;
  597|       |    p->OrderFall = p->MaxOrder;
  598|       |  }
  599|       |  else
  600|       |  #endif
  601|  1.27k|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (601:7): [True: 58, False: 1.21k]
  |  Branch (601:59): [True: 0, False: 1.21k]
  ------------------
  602|     58|    RestartModel(p);
  603|  1.21k|  else
  604|  1.21k|  {
  605|  16.5k|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (605:12): [True: 15.3k, False: 1.21k]
  ------------------
  606|  15.3k|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|  15.3k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  15.3k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  15.3k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  15.3k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.21k|    do
  608|  1.21k|    {
  609|  1.21k|      CutOff(p, p->MaxContext, 0);
  610|  1.21k|      ExpandTextArea(p);
  611|  1.21k|    }
  612|  1.21k|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (612:12): [True: 0, False: 1.21k]
  ------------------
  613|  1.21k|    p->GlueCount = 0;
  614|  1.21k|    p->OrderFall = p->MaxOrder;
  615|  1.21k|  }
  616|  1.27k|}
archive_ppmd8.c:SpecialFreeUnit:
  277|  31.2M|{
  278|  31.2M|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (278:7): [True: 31.1M, False: 1.55k]
  ------------------
  279|  31.1M|    InsertNode(p, ptr, 0);
  280|  1.55k|  else
  281|  1.55k|  {
  282|       |    #ifdef PPMD8_FREEZE_SUPPORT
  283|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  284|       |    #endif
  285|  1.55k|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|  1.55k|#define UNIT_SIZE 12
  ------------------
  286|  1.55k|  }
  287|  31.2M|}
archive_ppmd8.c:Refresh:
  421|  2.58M|{
  422|  2.58M|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  423|  2.58M|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|  2.58M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  2.58M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.58M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  2.58M|  ctx->Stats = REF(s);
  ------------------
  |  |   24|  2.58M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  425|       |  #ifdef PPMD8_FREEZE_SUPPORT
  426|       |  /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */
  427|       |  scale |= (ctx->SummFreq >= ((UInt32)1 << 15));
  428|       |  #endif
  429|  2.58M|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  430|  2.58M|  escFreq = ctx->SummFreq - s->Freq;
  431|  2.58M|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  432|  2.58M|  do
  433|  5.56M|  {
  434|  5.56M|    escFreq -= (++s)->Freq;
  435|  5.56M|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  436|  5.56M|    flags |= 0x08 * (s->Symbol >= 0x40);
  437|  5.56M|  }
  438|  5.56M|  while (--i);
  ------------------
  |  Branch (438:10): [True: 2.98M, False: 2.58M]
  ------------------
  439|  2.58M|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  440|  2.58M|  ctx->Flags = (Byte)flags;
  441|  2.58M|}
archive_ppmd8.c:GetUsedMemory:
  543|  2.43k|{
  544|  2.43k|  UInt32 v = 0;
  545|  2.43k|  unsigned i;
  546|  95.0k|  for (i = 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 (546:15): [True: 92.6k, False: 2.43k]
  ------------------
  547|  92.6k|    v += p->Stamps[i] * I2U(i);
  ------------------
  |  |   19|  92.6k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  548|  2.43k|  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
  ------------------
  |  |   17|  2.43k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  2.43k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  549|  2.43k|}
archive_ppmd8.c:CutOff:
  451|  79.0M|{
  452|  79.0M|  int i;
  453|  79.0M|  unsigned tmp;
  454|  79.0M|  CPpmd_State *s;
  455|       |  
  456|  79.0M|  if (!ctx->NumStats)
  ------------------
  |  Branch (456:7): [True: 61.4M, False: 17.6M]
  ------------------
  457|  61.4M|  {
  458|  61.4M|    s = ONE_STATE(ctx);
  ------------------
  |  |   31|  61.4M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  61.4M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  459|  61.4M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
  ------------------
  |  |   96|  61.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (459:9): [True: 59.0M, False: 2.41M]
  ------------------
  460|  59.0M|    {
  461|  59.0M|      if (order < p->MaxOrder)
  ------------------
  |  Branch (461:11): [True: 54.7M, False: 4.24M]
  ------------------
  462|  54.7M|        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  54.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  54.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  54.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  4.24M|      else
  464|  4.24M|        SetSuccessor(s, 0);
  465|  59.0M|      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
  ------------------
  |  |  341|   118M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 28.4M, False: 30.6M]
  |  |  ------------------
  ------------------
  |  Branch (465:27): [True: 6.16M, False: 24.4M]
  ------------------
  466|  34.5M|        return REF(ctx);
  ------------------
  |  |   24|  34.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  467|  59.0M|    }
  468|  26.8M|    SpecialFreeUnit(p, ctx);
  469|  26.8M|    return 0;
  470|  61.4M|  }
  471|       |
  472|  17.6M|  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
  ------------------
  |  |   27|  17.6M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  17.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  473|       |
  474|  64.1M|  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  17.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  17.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  17.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  64.1M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  64.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  64.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:46): [True: 46.4M, False: 17.6M]
  ------------------
  475|  46.4M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
  ------------------
  |  |   96|  46.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (475:9): [True: 21.7M, False: 24.7M]
  ------------------
  476|  21.7M|    {
  477|  21.7M|      CPpmd_State *s2 = STATS(ctx) + (i--);
  ------------------
  |  |   30|  21.7M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  21.7M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  21.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  21.7M|      SetSuccessor(s, 0);
  479|  21.7M|      SwapStates(s, s2);
  480|  21.7M|    }
  481|  24.7M|    else if (order < p->MaxOrder)
  ------------------
  |  Branch (481:14): [True: 24.3M, False: 436k]
  ------------------
  482|  24.3M|      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  24.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  24.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  24.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   436k|    else
  484|   436k|      SetSuccessor(s, 0);
  485|       |    
  486|  17.6M|  if (i != ctx->NumStats && order)
  ------------------
  |  Branch (486:7): [True: 13.7M, False: 3.84M]
  |  Branch (486:29): [True: 13.7M, False: 1.21k]
  ------------------
  487|  13.7M|  {
  488|  13.7M|    ctx->NumStats = (Byte)i;
  489|  13.7M|    s = STATS(ctx);
  ------------------
  |  |   30|  13.7M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  13.7M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  13.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  13.7M|    if (i < 0)
  ------------------
  |  Branch (490:9): [True: 4.33M, False: 9.45M]
  ------------------
  491|  4.33M|    {
  492|  4.33M|      FreeUnits(p, s, tmp);
  493|  4.33M|      SpecialFreeUnit(p, ctx);
  494|  4.33M|      return 0;
  495|  4.33M|    }
  496|  9.45M|    if (i == 0)
  ------------------
  |  Branch (496:9): [True: 6.87M, False: 2.58M]
  ------------------
  497|  6.87M|    {
  498|  6.87M|      ctx->Flags = (Byte)((ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  499|  6.87M|      *ONE_STATE(ctx) = *s;
  ------------------
  |  |   31|  6.87M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  6.87M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  500|  6.87M|      FreeUnits(p, s, tmp);
  501|       |      /* 9.31: the code was fixed. It's was not BUG, if Freq <= MAX_FREQ = 124 */
  502|  6.87M|      ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  6.87M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  6.87M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  6.87M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  6.87M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  503|  6.87M|    }
  504|  2.58M|    else
  505|  2.58M|      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
  506|  9.45M|  }
  507|  13.3M|  return REF(ctx);
  ------------------
  |  |   24|  13.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  508|  17.6M|}
archive_ppmd8.c:MoveUnitsUp:
  290|  17.6M|{
  291|  17.6M|  unsigned indx = U2I(nu);
  ------------------
  |  |   18|  17.6M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  292|  17.6M|  void *ptr;
  293|  17.6M|  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
  ------------------
  |  |   24|   306k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  |  Branch (293:7): [True: 17.3M, False: 306k]
  |  Branch (293:53): [True: 2.81k, False: 303k]
  ------------------
  294|  17.3M|    return oldPtr;
  295|   303k|  ptr = RemoveNode(p, indx);
  296|   303k|  MyMem12Cpy(ptr, oldPtr, nu);
  ------------------
  |  |  245|   303k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|   303k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|   303k|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|   303k|	UInt32 n = num;							\
  |  |  249|   425k|	do {								\
  |  |  250|   425k|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|   425k|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 121k, False: 303k]
  |  |  ------------------
  |  |  252|   303k|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 303k]
  |  |  ------------------
  ------------------
  297|   303k|  if ((Byte*)oldPtr != p->UnitsStart)
  ------------------
  |  Branch (297:7): [True: 303k, False: 250]
  ------------------
  298|   303k|    InsertNode(p, oldPtr, indx);
  299|    250|  else
  300|    250|    p->UnitsStart += U2B(I2U(indx));
  ------------------
  |  |   17|    250|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|    250|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  301|   303k|  return ptr;
  302|  17.6M|}
archive_ppmd8.c:FreeUnits:
  272|  11.2M|{
  273|  11.2M|  InsertNode(p, ptr, U2I(nu));
  ------------------
  |  |   18|  11.2M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  274|  11.2M|}
archive_ppmd8.c:ExpandTextArea:
  305|  1.21k|{
  306|  1.21k|  UInt32 count[PPMD_NUM_INDEXES];
  307|  1.21k|  unsigned i;
  308|  1.21k|  memset(count, 0, sizeof(count));
  309|  1.21k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (309:7): [True: 0, False: 1.21k]
  ------------------
  310|      0|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  311|       |  
  312|  1.21k|  {
  313|  1.21k|    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
  314|  28.0k|    for (; node->Stamp == EMPTY_NODE; node += node->NU)
  ------------------
  |  |   62|  28.0k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (314:12): [True: 26.8k, False: 1.21k]
  ------------------
  315|  26.8k|    {
  316|  26.8k|      node->Stamp = 0;
  317|  26.8k|      count[U2I(node->NU)]++;
  ------------------
  |  |   18|  26.8k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  318|  26.8k|    }
  319|  1.21k|    p->UnitsStart = (Byte *)node;
  320|  1.21k|  }
  321|       |  
  322|  47.5k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  47.5k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  47.5k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  47.5k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  47.5k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  47.5k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  47.5k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  47.5k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  47.5k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:15): [True: 46.3k, False: 1.21k]
  ------------------
  323|  46.3k|  {
  324|  46.3k|    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
  325|  31.7M|    while (count[i] != 0)
  ------------------
  |  Branch (325:12): [True: 31.7M, False: 46.3k]
  ------------------
  326|  31.7M|    {
  327|  31.7M|      CPpmd8_Node *node = NODE(*next);
  ------------------
  |  |   59|  31.7M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  328|  31.7M|      while (node->Stamp == 0)
  ------------------
  |  Branch (328:14): [True: 26.8k, False: 31.7M]
  ------------------
  329|  26.8k|      {
  330|  26.8k|        *next = node->Next;
  331|  26.8k|        node = NODE(*next);
  ------------------
  |  |   59|  26.8k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  332|  26.8k|        p->Stamps[i]--;
  333|  26.8k|        if (--count[i] == 0)
  ------------------
  |  Branch (333:13): [True: 1.60k, False: 25.2k]
  ------------------
  334|  1.60k|          break;
  335|  26.8k|      }
  336|  31.7M|      next = &node->Next;
  337|  31.7M|    }
  338|  46.3k|  }
  339|  1.21k|}
archive_ppmd8.c:ReduceOrder:
  707|  1.97M|{
  708|  1.97M|  CPpmd_State *s = NULL;
  709|  1.97M|  CTX_PTR c1 = c;
  710|  1.97M|  CPpmd_Void_Ref upBranch = REF(p->Text);
  ------------------
  |  |   24|  1.97M|  #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|  1.97M|  SetSuccessor(p->FoundState, upBranch);
  720|  1.97M|  p->OrderFall++;
  721|       |
  722|  1.97M|  for (;;)
  723|  2.99M|  {
  724|  2.99M|    if (s1)
  ------------------
  |  Branch (724:9): [True: 1.43M, False: 1.56M]
  ------------------
  725|  1.43M|    {
  726|  1.43M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.43M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.43M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.43M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.43M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  727|  1.43M|      s = s1;
  728|  1.43M|      s1 = NULL;
  729|  1.43M|    }
  730|  1.56M|    else
  731|  1.56M|    {
  732|  1.56M|      if (!c->Suffix)
  ------------------
  |  Branch (732:11): [True: 542k, False: 1.01M]
  ------------------
  733|   542k|      {
  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|   542k|        return c;
  743|   542k|      }
  744|  1.01M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.01M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.01M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.01M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.01M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  1.01M|      if (c->NumStats)
  ------------------
  |  Branch (745:11): [True: 491k, False: 528k]
  ------------------
  746|   491k|      {
  747|   491k|        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
  ------------------
  |  |   30|   491k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|   491k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   491k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (747:13): [True: 296k, False: 194k]
  ------------------
  748|   894k|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (748:30): [True: 597k, False: 296k]
  ------------------
  749|   491k|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|   491k|#define MAX_FREQ 124
  ------------------
  |  Branch (749:13): [True: 489k, False: 1.17k]
  ------------------
  750|   489k|        {
  751|   489k|          s->Freq += 2;
  752|   489k|          c->SummFreq += 2;
  753|   489k|        }
  754|   491k|      }
  755|   528k|      else
  756|   528k|      {
  757|   528k|        s = ONE_STATE(c);
  ------------------
  |  |   31|   528k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   528k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  758|   528k|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  759|   528k|      }
  760|  1.01M|    }
  761|  2.45M|    if (SUCCESSOR(s))
  ------------------
  |  |  341|  2.45M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 1.43M, False: 1.01M]
  |  |  ------------------
  ------------------
  762|  1.43M|      break;
  763|       |    #ifdef PPMD8_FREEZE_SUPPORT
  764|       |    ps[numPs++] = s;
  765|       |    #endif
  766|  1.01M|    SetSuccessor(s, upBranch);
  767|  1.01M|    p->OrderFall++;
  768|  1.01M|  }
  769|       |  
  770|       |  #ifdef PPMD8_FREEZE_SUPPORT
  771|       |  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  772|       |  {
  773|       |    c = CTX(SUCCESSOR(s));
  774|       |    do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
  775|       |    RESET_TEXT(1);
  776|       |    p->OrderFall = 1;
  777|       |    return c;
  778|       |  }
  779|       |  else
  780|       |  #endif
  781|  1.43M|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  341|  1.43M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (781:7): [True: 22.4k, False: 1.41M]
  ------------------
  782|  22.4k|  {
  783|  22.4k|    CTX_PTR successor;
  784|  22.4k|    CPpmd_State *s2 = p->FoundState;
  785|  22.4k|    p->FoundState = s;
  786|       |
  787|  22.4k|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|  22.4k|#define False 0
  ------------------
  788|  22.4k|    if (successor == NULL)
  ------------------
  |  Branch (788:9): [True: 65, False: 22.4k]
  ------------------
  789|     65|      SetSuccessor(s, 0);
  790|  22.4k|    else
  791|  22.4k|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|  22.4k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  792|  22.4k|    p->FoundState = s2;
  793|  22.4k|  }
  794|       |  
  795|  1.43M|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (795:7): [True: 17.7k, False: 1.41M]
  |  Branch (795:28): [True: 17.7k, False: 0]
  ------------------
  796|  17.7k|  {
  797|  17.7k|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  341|  17.7k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  798|  17.7k|    p->Text--;
  799|  17.7k|  }
  800|  1.43M|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  341|  1.43M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (800:7): [True: 65, False: 1.43M]
  ------------------
  801|     65|    return NULL;
  802|  1.43M|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|  1.43M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  1.43M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.43M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  1.43M|}
archive_ppmd8.c:AllocUnits:
  231|  32.1M|{
  232|  32.1M|  UInt32 numBytes;
  233|  32.1M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 12.5M, False: 19.5M]
  ------------------
  234|  12.5M|    return RemoveNode(p, indx);
  235|  19.5M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  19.5M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  19.5M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  19.5M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 17.0M, False: 2.52M]
  ------------------
  237|  17.0M|  {
  238|  17.0M|    void *retVal = p->LoUnit;
  239|  17.0M|    p->LoUnit += numBytes;
  240|  17.0M|    return retVal;
  241|  17.0M|  }
  242|  2.52M|  return AllocUnitsRare(p, indx);
  243|  19.5M|}
archive_ppmd8.c:Ppmd8_Update1:
 1082|  4.92M|{
 1083|  4.92M|  CPpmd_State *s = p->FoundState;
 1084|  4.92M|  s->Freq += 4;
 1085|  4.92M|  p->MinContext->SummFreq += 4;
 1086|  4.92M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1086:7): [True: 3.29M, False: 1.62M]
  ------------------
 1087|  3.29M|  {
 1088|  3.29M|    SwapStates(&s[0], &s[-1]);
 1089|  3.29M|    p->FoundState = --s;
 1090|  3.29M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  3.29M|#define MAX_FREQ 124
  ------------------
  |  Branch (1090:9): [True: 635, False: 3.29M]
  ------------------
 1091|    635|      Rescale(p);
 1092|  3.29M|  }
 1093|  4.92M|  NextContext(p);
 1094|  4.92M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|  49.7M|{
 1108|  49.7M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|  49.7M|  p->PrevSuccess = 1;
 1110|  49.7M|  p->RunLength++;
 1111|  49.7M|  NextContext(p);
 1112|  49.7M|}
archive_ppmd8.c:Ppmd8_MakeEscFreq:
 1046|  13.4M|{
 1047|  13.4M|  CPpmd_See *see;
 1048|  13.4M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1048:7): [True: 11.3M, False: 2.12M]
  ------------------
 1049|  11.3M|  {
 1050|  11.3M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1051|  11.3M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1052|  11.3M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1053|  11.3M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  11.3M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  11.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  11.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  11.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  11.3M|        p->MinContext->Flags;
 1055|  11.3M|    {
 1056|  11.3M|      unsigned r = (see->Summ >> see->Shift);
 1057|  11.3M|      see->Summ = (UInt16)(see->Summ - r);
 1058|  11.3M|      *escFreq = r + (r == 0);
 1059|  11.3M|    }
 1060|  11.3M|  }
 1061|  2.12M|  else
 1062|  2.12M|  {
 1063|  2.12M|    see = &p->DummySee;
 1064|  2.12M|    *escFreq = 1;
 1065|  2.12M|  }
 1066|  13.4M|  return see;
 1067|  13.4M|}
archive_ppmd8.c:Ppmd8_Update2:
 1115|  9.54M|{
 1116|  9.54M|  p->MinContext->SummFreq += 4;
 1117|  9.54M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  9.54M|#define MAX_FREQ 124
  ------------------
  |  Branch (1117:7): [True: 11.9k, False: 9.52M]
  ------------------
 1118|  11.9k|    Rescale(p);
 1119|  9.54M|  p->RunLength = p->InitRL;
 1120|  9.54M|  UpdateModel(p);
 1121|  9.54M|  p->MinContext = p->MaxContext;
 1122|  9.54M|}

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

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

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

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

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

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

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

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

archive_read_support_filter_grzip:
   62|  22.2k|{
   63|  22.2k|	struct archive_read *a = (struct archive_read *)_a;
   64|       |
   65|  22.2k|	if (__archive_read_register_bidder(a, NULL, "grzip",
  ------------------
  |  Branch (65:6): [True: 0, False: 22.2k]
  ------------------
   66|  22.2k|				&grzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  22.2k|#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|  22.2k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  22.2k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   71|  22.2k|	    "Using external grzip program for grzip decompression");
   72|  22.2k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  22.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   73|  22.2k|}
archive_read_support_filter_grzip.c:grzip_bidder_bid:
   81|  25.6k|{
   82|  25.6k|	const unsigned char *p;
   83|       |
   84|  25.6k|	(void)b; /* UNUSED */
   85|       |
   86|  25.6k|	p = __archive_read_filter_ahead(f, sizeof(grzip_magic), NULL);
   87|  25.6k|	if (p == NULL)
  ------------------
  |  Branch (87:6): [True: 1.78k, False: 23.8k]
  ------------------
   88|  1.78k|		return (0);
   89|       |
   90|  23.8k|	if (memcmp(p, grzip_magic, sizeof(grzip_magic)))
  ------------------
  |  Branch (90:6): [True: 23.8k, False: 1]
  ------------------
   91|  23.8k|		return (0);
   92|       |
   93|      1|	return (sizeof(grzip_magic) * 8);
   94|  23.8k|}
archive_read_support_filter_grzip.c:grzip_bidder_init:
   98|      1|{
   99|      1|	int r;
  100|       |
  101|      1|	r = __archive_read_program(f, "grzip -d");
  102|       |	/* Note: We set the format here even if __archive_read_program()
  103|       |	 * above fails.  We do, after all, know what the format is
  104|       |	 * even if we weren't able to read it. */
  105|      1|	f->code = ARCHIVE_FILTER_GRZIP;
  ------------------
  |  |  321|      1|#define	ARCHIVE_FILTER_GRZIP	12
  ------------------
  106|      1|	f->name = "grzip";
  107|      1|	return (r);
  108|      1|}

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

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

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

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

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

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

archive_read_support_filter_uu:
   92|  22.2k|{
   93|  22.2k|	struct archive_read *a = (struct archive_read *)_a;
   94|       |
   95|       |	return __archive_read_register_bidder(a, NULL, "uu",
   96|  22.2k|			&uudecode_bidder_vtable);
   97|  22.2k|}
archive_read_support_filter_uu.c:uudecode_bidder_bid:
  263|  25.6k|{
  264|  25.6k|	const unsigned char *p;
  265|  25.6k|	ssize_t avail, ravail;
  266|  25.6k|	ssize_t len, nl;
  267|  25.6k|	int l;
  268|  25.6k|	int firstline;
  269|  25.6k|	size_t nbytes_read;
  270|       |
  271|  25.6k|	(void)b; /* UNUSED */
  272|       |
  273|  25.6k|	p = __archive_read_filter_ahead(f, 1, &avail);
  274|  25.6k|	if (p == NULL)
  ------------------
  |  Branch (274:6): [True: 662, False: 24.9k]
  ------------------
  275|    662|		return (0);
  276|       |
  277|  24.9k|	firstline = 20;
  278|  24.9k|	ravail = avail;
  279|  24.9k|	nbytes_read = avail;
  280|  1.22M|	for (;;) {
  281|  1.22M|		len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  282|  1.22M|		if (len < 0 || nl == 0)
  ------------------
  |  Branch (282:7): [True: 22.9k, False: 1.20M]
  |  Branch (282:18): [True: 1.65k, False: 1.19M]
  ------------------
  283|  24.5k|			return (0); /* No match found. */
  284|  1.19M|		if (len - nl >= 11 && memcmp(p, "begin ", 6) == 0)
  ------------------
  |  Branch (284:7): [True: 9.26k, False: 1.18M]
  |  Branch (284:25): [True: 2.40k, False: 6.86k]
  ------------------
  285|  2.40k|			l = 6;
  286|  1.19M|		else if (len -nl >= 18 && memcmp(p, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (286:12): [True: 4.07k, False: 1.19M]
  |  Branch (286:29): [True: 645, False: 3.43k]
  ------------------
  287|    645|			l = 13;
  288|  1.19M|		else
  289|  1.19M|			l = 0;
  290|       |
  291|  1.19M|		if (l > 0 && (p[l] < '0' || p[l] > '7' ||
  ------------------
  |  Branch (291:7): [True: 3.04k, False: 1.19M]
  |  Branch (291:17): [True: 266, False: 2.78k]
  |  Branch (291:31): [True: 356, False: 2.42k]
  ------------------
  292|  2.42k|		    p[l+1] < '0' || p[l+1] > '7' ||
  ------------------
  |  Branch (292:7): [True: 393, False: 2.03k]
  |  Branch (292:23): [True: 502, False: 1.52k]
  ------------------
  293|  1.52k|		    p[l+2] < '0' || p[l+2] > '7' || p[l+3] != ' '))
  ------------------
  |  Branch (293:7): [True: 380, False: 1.14k]
  |  Branch (293:23): [True: 513, False: 636]
  |  Branch (293:39): [True: 328, False: 308]
  ------------------
  294|  2.73k|			l = 0;
  295|       |
  296|  1.19M|		p += len;
  297|  1.19M|		avail -= len;
  298|  1.19M|		if (l)
  ------------------
  |  Branch (298:7): [True: 308, False: 1.19M]
  ------------------
  299|    308|			break;
  300|  1.19M|		firstline = 0;
  301|       |
  302|       |		/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  303|  1.19M|		if (nbytes_read >= UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|  1.19M|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (303:7): [True: 53, False: 1.19M]
  ------------------
  304|     53|			return (0);
  305|  1.19M|	}
  306|    308|	if (!avail)
  ------------------
  |  Branch (306:6): [True: 1, False: 307]
  ------------------
  307|      1|		return (0);
  308|    307|	len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  309|    307|	if (len < 0 || nl == 0)
  ------------------
  |  Branch (309:6): [True: 1, False: 306]
  |  Branch (309:17): [True: 1, False: 305]
  ------------------
  310|      2|		return (0);/* There are non-ascii characters. */
  311|    305|	avail -= len;
  312|       |
  313|    305|	if (l == 6) {
  ------------------
  |  Branch (313:6): [True: 150, False: 155]
  ------------------
  314|       |		/* "begin " */
  315|    150|		if (!uuchar[*p])
  ------------------
  |  Branch (315:7): [True: 1, False: 149]
  ------------------
  316|      1|			return (0);
  317|       |		/* Get a length of decoded bytes. */
  318|    149|		l = UUDECODE(*p++); len--;
  ------------------
  |  |  258|    149|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  319|    149|		if (l > 45)
  ------------------
  |  Branch (319:7): [True: 1, False: 148]
  ------------------
  320|       |			/* Normally, maximum length is 45(character 'M'). */
  321|      1|			return (0);
  322|    148|		if (l > len - nl)
  ------------------
  |  Branch (322:7): [True: 3, False: 145]
  ------------------
  323|      3|			return (0); /* Line too short. */
  324|    421|		while (l) {
  ------------------
  |  Branch (324:10): [True: 279, False: 142]
  ------------------
  325|    279|			if (!uuchar[*p++])
  ------------------
  |  Branch (325:8): [True: 3, False: 276]
  ------------------
  326|      3|				return (0);
  327|    276|			--len;
  328|    276|			--l;
  329|    276|		}
  330|    142|		if (len-nl == 1 &&
  ------------------
  |  Branch (330:7): [True: 20, False: 122]
  ------------------
  331|     20|		    (uuchar[*p] ||		 /* Check sum. */
  ------------------
  |  Branch (331:8): [True: 16, False: 4]
  ------------------
  332|     19|		     (*p >= 'a' && *p <= 'z'))) {/* Padding data(MINIX). */
  ------------------
  |  Branch (332:9): [True: 4, False: 0]
  |  Branch (332:22): [True: 3, False: 1]
  ------------------
  333|     19|			++p;
  334|     19|			--len;
  335|     19|		}
  336|    142|		p += nl;
  337|    142|		if (avail && uuchar[*p])
  ------------------
  |  Branch (337:7): [True: 137, False: 5]
  |  Branch (337:16): [True: 135, False: 2]
  ------------------
  338|    135|			return (firstline+30);
  339|    155|	} else if (l == 13) {
  ------------------
  |  Branch (339:13): [True: 155, False: 0]
  ------------------
  340|       |		/* "begin-base64 " */
  341|    758|		while (len-nl > 0) {
  ------------------
  |  Branch (341:10): [True: 607, False: 151]
  ------------------
  342|    607|			if (!base64[*p++])
  ------------------
  |  Branch (342:8): [True: 4, False: 603]
  ------------------
  343|      4|				return (0);
  344|    603|			--len;
  345|    603|		}
  346|    151|		p += nl;
  347|       |
  348|    151|		if (avail >= 5 && memcmp(p, "====\n", 5) == 0)
  ------------------
  |  Branch (348:7): [True: 95, False: 56]
  |  Branch (348:21): [True: 11, False: 84]
  ------------------
  349|     11|			return (firstline+40);
  350|    140|		if (avail >= 6 && memcmp(p, "====\r\n", 6) == 0)
  ------------------
  |  Branch (350:7): [True: 82, False: 58]
  |  Branch (350:21): [True: 2, False: 80]
  ------------------
  351|      2|			return (firstline+40);
  352|    138|		if (avail > 0 && base64[*p])
  ------------------
  |  Branch (352:7): [True: 137, False: 1]
  |  Branch (352:20): [True: 136, False: 1]
  ------------------
  353|    136|			return (firstline+30);
  354|    138|	}
  355|       |
  356|      9|	return (0);
  357|    305|}
archive_read_support_filter_uu.c:bid_get_line:
  213|  1.22M|{
  214|  1.22M|	ssize_t len;
  215|  1.22M|	int quit;
  216|       |	
  217|  1.22M|	quit = 0;
  218|  1.22M|	if (*avail == 0) {
  ------------------
  |  Branch (218:6): [True: 973, False: 1.22M]
  ------------------
  219|    973|		*nl = 0;
  220|    973|		len = 0;
  221|    973|	} else
  222|  1.22M|		len = get_line(*b, *avail, nl);
  223|       |
  224|       |	/*
  225|       |	 * Read more bytes while it does not reach the end of line.
  226|       |	 */
  227|  1.22M|	while (*nl == 0 && len == *avail && !quit &&
  ------------------
  |  Branch (227:9): [True: 24.7k, False: 1.19M]
  |  Branch (227:21): [True: 1.82k, False: 22.9k]
  |  Branch (227:38): [True: 1.81k, False: 6]
  ------------------
  228|  1.81k|	    *nbytes_read < UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  1.81k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (228:6): [True: 1.79k, False: 26]
  ------------------
  229|  1.79k|		ssize_t diff = *ravail - *avail;
  230|  1.79k|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  231|  1.79k|		ssize_t tested;
  232|       |
  233|       |		/* Increase reading bytes if it is not enough for at least
  234|       |		 * two new lines. */
  235|  1.79k|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (235:7): [True: 155, False: 1.63k]
  ------------------
  236|    155|			nbytes_req <<= 1;
  237|       |
  238|  1.79k|		*b = __archive_read_filter_ahead(f, nbytes_req, avail);
  239|  1.79k|		if (*b == NULL) {
  ------------------
  |  Branch (239:7): [True: 1.65k, False: 139]
  ------------------
  240|  1.65k|			if (*ravail >= *avail)
  ------------------
  |  Branch (240:8): [True: 1.61k, False: 33]
  ------------------
  241|  1.61k|				return (0);
  242|       |			/* Reading bytes reaches the end of a stream. */
  243|     33|			*b = __archive_read_filter_ahead(f, *avail, avail);
  244|     33|			quit = 1;
  245|     33|		}
  246|    172|		*nbytes_read = *avail;
  247|    172|		*ravail = *avail;
  248|    172|		*b += diff;
  249|    172|		*avail -= diff;
  250|    172|		tested = len;/* Skip some bytes we already determined. */
  251|    172|		len = get_line(*b + tested, *avail - tested, nl);
  252|    172|		if (len >= 0)
  ------------------
  |  Branch (252:7): [True: 158, False: 14]
  ------------------
  253|    158|			len += tested;
  254|    172|	}
  255|  1.22M|	return (len);
  256|  1.22M|}
archive_read_support_filter_uu.c:get_line:
  177|  1.57M|{
  178|  1.57M|	ssize_t len;
  179|       |
  180|  1.57M|	len = 0;
  181|  16.9M|	while (len < avail) {
  ------------------
  |  Branch (181:9): [True: 16.9M, False: 4.04k]
  ------------------
  182|  16.9M|		switch (ascii[*b]) {
  ------------------
  |  Branch (182:11): [True: 16.9M, False: 0]
  ------------------
  183|  22.9k|		case 0:	/* Non-ascii character or control character. */
  ------------------
  |  Branch (183:3): [True: 22.9k, False: 16.9M]
  ------------------
  184|  22.9k|			if (nlsize != NULL)
  ------------------
  |  Branch (184:8): [True: 22.9k, False: 0]
  ------------------
  185|  22.9k|				*nlsize = 0;
  186|  22.9k|			return (-1);
  187|  1.01M|		case '\r':
  ------------------
  |  Branch (187:3): [True: 1.01M, False: 15.9M]
  ------------------
  188|  1.01M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (188:8): [True: 1.01M, False: 383]
  |  Branch (188:25): [True: 2.35k, False: 1.00M]
  ------------------
  189|  2.35k|				if (nlsize != NULL)
  ------------------
  |  Branch (189:9): [True: 2.35k, False: 0]
  ------------------
  190|  2.35k|					*nlsize = 2;
  191|  2.35k|				return (len+2);
  192|  2.35k|			}
  193|       |			/* FALL THROUGH */
  194|  1.54M|		case '\n':
  ------------------
  |  Branch (194:3): [True: 536k, False: 16.4M]
  ------------------
  195|  1.54M|			if (nlsize != NULL)
  ------------------
  |  Branch (195:8): [True: 1.54M, False: 0]
  ------------------
  196|  1.54M|				*nlsize = 1;
  197|  1.54M|			return (len+1);
  198|  15.4M|		case 1:
  ------------------
  |  Branch (198:3): [True: 15.4M, False: 1.57M]
  ------------------
  199|  15.4M|			b++;
  200|  15.4M|			len++;
  201|  15.4M|			break;
  202|  16.9M|		}
  203|  16.9M|	}
  204|  4.04k|	if (nlsize != NULL)
  ------------------
  |  Branch (204:6): [True: 4.04k, False: 0]
  ------------------
  205|  4.04k|		*nlsize = 0;
  206|  4.04k|	return (avail);
  207|  1.57M|}
archive_read_support_filter_uu.c:uudecode_bidder_init:
  368|    284|{
  369|    284|	struct uu   *uu;
  370|    284|	void *out_buff;
  371|    284|	void *in_buff;
  372|       |
  373|    284|	f->code = ARCHIVE_FILTER_UU;
  ------------------
  |  |  316|    284|#define	ARCHIVE_FILTER_UU	7
  ------------------
  374|    284|	f->name = "uu";
  375|       |
  376|    284|	uu = calloc(1, sizeof(*uu));
  377|    284|	out_buff = malloc(OUT_BUFF_SIZE);
  ------------------
  |  |   53|    284|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  378|    284|	in_buff = malloc(IN_BUFF_SIZE);
  ------------------
  |  |   49|    284|#define IN_BUFF_SIZE	(1024)
  ------------------
  379|    284|	if (uu == NULL || out_buff == NULL || in_buff == NULL) {
  ------------------
  |  Branch (379:6): [True: 0, False: 284]
  |  Branch (379:20): [True: 0, False: 284]
  |  Branch (379:40): [True: 0, False: 284]
  ------------------
  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|    284|	f->data = uu;
  389|    284|	uu->in_buff = in_buff;
  390|    284|	uu->in_cnt = 0;
  391|    284|	uu->in_allocated = IN_BUFF_SIZE;
  ------------------
  |  |   49|    284|#define IN_BUFF_SIZE	(1024)
  ------------------
  392|    284|	uu->out_buff = out_buff;
  393|    284|	uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|    284|#define ST_FIND_HEAD	0
  ------------------
  394|    284|	uu->mode_set = 0;
  395|    284|	uu->name = NULL;
  396|    284|	f->vtable = &uudecode_reader_vtable;
  397|       |
  398|    284|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    284|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  399|    284|}
archive_read_support_filter_uu.c:uudecode_filter_read:
  456|  2.46k|{
  457|  2.46k|	struct uu *uu = f->data;
  458|  2.46k|	const unsigned char *b, *d;
  459|  2.46k|	unsigned char *out;
  460|  2.46k|	ssize_t avail_in, ravail;
  461|  2.46k|	ssize_t used;
  462|  2.46k|	ssize_t total;
  463|  2.46k|	ssize_t len, llen, nl, namelen;
  464|       |
  465|  3.69k|read_more:
  466|  3.69k|	d = __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  467|  3.69k|	if (d == NULL && avail_in < 0)
  ------------------
  |  Branch (467:6): [True: 140, False: 3.55k]
  |  Branch (467:19): [True: 40, False: 100]
  ------------------
  468|     40|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     40|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|       |	/* Quiet a code analyzer; make sure avail_in must be zero
  470|       |	 * when d is NULL. */
  471|  3.65k|	if (d == NULL)
  ------------------
  |  Branch (471:6): [True: 100, False: 3.55k]
  ------------------
  472|    100|		avail_in = 0;
  473|  3.65k|	used = 0;
  474|  3.65k|	total = 0;
  475|  3.65k|	out = uu->out_buff;
  476|  3.65k|	if (avail_in > 2 * UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|  3.65k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (476:6): [True: 12, False: 3.64k]
  ------------------
  477|     12|		avail_in = 2 * UUENCODE_BID_MAX_READ;
  ------------------
  |  |   44|     12|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  478|  3.65k|	ravail = avail_in;
  479|  3.65k|	if (uu->state == ST_IGNORE) {
  ------------------
  |  |   59|  3.65k|#define ST_IGNORE	4
  ------------------
  |  Branch (479:6): [True: 9, False: 3.64k]
  ------------------
  480|      9|		used = avail_in;
  481|      9|		goto finish;
  482|      9|	}
  483|  3.64k|	if (uu->in_cnt) {
  ------------------
  |  Branch (483:6): [True: 2.95k, False: 691]
  ------------------
  484|  2.95k|		if (uu->in_cnt > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  2.95k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (484:7): [True: 0, False: 2.95k]
  ------------------
  485|      0|			archive_set_error(&f->archive->archive,
  486|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  487|      0|			    "Invalid format data");
  488|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  489|      0|		}
  490|       |		/*
  491|       |		 * If there is remaining data which is saved by
  492|       |		 * a previous call, use it first.
  493|       |		 */
  494|  2.95k|		if (ensure_in_buff_size(f, uu,
  ------------------
  |  Branch (494:7): [True: 0, False: 2.95k]
  ------------------
  495|  2.95k|		    avail_in + uu->in_cnt) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.95k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  496|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|  2.95k|		if (avail_in > 0)
  ------------------
  |  Branch (497:7): [True: 2.89k, False: 61]
  ------------------
  498|  2.89k|			memcpy(uu->in_buff + uu->in_cnt,
  499|  2.89k|			    d, avail_in);
  500|  2.95k|		d = uu->in_buff;
  501|  2.95k|		avail_in += uu->in_cnt;
  502|  2.95k|		uu->in_cnt = 0;
  503|  2.95k|	}
  504|   351k|	for (;used < avail_in; d += llen, used += llen) {
  ------------------
  |  Branch (504:8): [True: 351k, False: 445]
  ------------------
  505|   351k|		ssize_t l, body;
  506|       |
  507|   351k|		b = d;
  508|   351k|		len = get_line(b, avail_in - used, &nl);
  509|   351k|		if (len < 0) {
  ------------------
  |  Branch (509:7): [True: 50, False: 351k]
  ------------------
  510|       |			/* Non-ascii character is found. */
  511|     50|			if (uu->state == ST_FIND_HEAD &&
  ------------------
  |  |   55|    100|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (511:8): [True: 19, False: 31]
  ------------------
  512|     19|			    (uu->total > 0 || total > 0)) {
  ------------------
  |  Branch (512:9): [True: 6, False: 13]
  |  Branch (512:26): [True: 9, False: 4]
  ------------------
  513|     15|				uu->state = ST_IGNORE;
  ------------------
  |  |   59|     15|#define ST_IGNORE	4
  ------------------
  514|     15|				used = avail_in;
  515|     15|				goto finish;
  516|     15|			}
  517|     35|			archive_set_error(&f->archive->archive,
  518|     35|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     35|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  519|     35|			    "Insufficient compressed data");
  520|     35|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     35|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  521|     50|		}
  522|   351k|		if (len > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|   351k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (522:7): [True: 1, False: 351k]
  ------------------
  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|   351k|		llen = len;
  529|   351k|		if ((nl == 0) && (uu->state != ST_UUEND)) {
  ------------------
  |  |   57|  3.19k|#define ST_UUEND	2
  ------------------
  |  Branch (529:7): [True: 3.19k, False: 348k]
  |  Branch (529:20): [True: 3.04k, False: 152]
  ------------------
  530|  3.04k|			if (total == 0 && ravail <= 0) {
  ------------------
  |  Branch (530:8): [True: 1.28k, False: 1.75k]
  |  Branch (530:22): [True: 61, False: 1.22k]
  ------------------
  531|       |				/* There is nothing more to read, fail */
  532|     61|				archive_set_error(&f->archive->archive,
  533|     61|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     61|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  534|     61|				    "Missing format data");
  535|     61|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     61|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  536|     61|			}
  537|       |			/*
  538|       |			 * Save remaining data which does not contain
  539|       |			 * NL('\n','\r').
  540|       |			 */
  541|  2.98k|			if (ensure_in_buff_size(f, uu, len)
  ------------------
  |  Branch (541:8): [True: 0, False: 2.98k]
  ------------------
  542|  2.98k|			    != ARCHIVE_OK)
  ------------------
  |  |  233|  2.98k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  543|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  544|  2.98k|			if (uu->in_buff != b)
  ------------------
  |  Branch (544:8): [True: 2.05k, False: 925]
  ------------------
  545|  2.05k|				memmove(uu->in_buff, b, len);
  546|  2.98k|			uu->in_cnt = len;
  547|  2.98k|			if (total == 0) {
  ------------------
  |  Branch (547:8): [True: 1.22k, False: 1.75k]
  ------------------
  548|       |				/* Do not return 0; it means end-of-file.
  549|       |				 * We should try to read more bytes. */
  550|  1.22k|				__archive_read_filter_consume(
  551|  1.22k|				    f->upstream, ravail);
  552|  1.22k|				goto read_more;
  553|  1.22k|			}
  554|  1.75k|			used += len;
  555|  1.75k|			break;
  556|  2.98k|		}
  557|   348k|		switch (uu->state) {
  558|      0|		default:
  ------------------
  |  Branch (558:3): [True: 0, False: 348k]
  ------------------
  559|  10.7k|		case ST_FIND_HEAD:
  ------------------
  |  |   55|  10.7k|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (559:3): [True: 10.7k, False: 337k]
  ------------------
  560|       |			/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  561|  10.7k|			if (total + len >= UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  10.7k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (561:8): [True: 0, False: 10.7k]
  ------------------
  562|      0|				archive_set_error(&f->archive->archive,
  563|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  564|      0|				    "Invalid format data");
  565|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  566|      0|			}
  567|  10.7k|			if (len - nl >= 11 && memcmp(b, "begin ", 6) == 0)
  ------------------
  |  Branch (567:8): [True: 4.46k, False: 6.24k]
  |  Branch (567:26): [True: 3.03k, False: 1.43k]
  ------------------
  568|  3.03k|				l = 6;
  569|  7.67k|			else if (len - nl >= 18 &&
  ------------------
  |  Branch (569:13): [True: 1.33k, False: 6.33k]
  ------------------
  570|  1.33k|			    memcmp(b, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (570:8): [True: 841, False: 497]
  ------------------
  571|    841|				l = 13;
  572|  6.83k|			else
  573|  6.83k|				l = 0;
  574|  10.7k|			if (l != 0 && b[l] >= '0' && b[l] <= '7' &&
  ------------------
  |  Branch (574:8): [True: 3.87k, False: 6.83k]
  |  Branch (574:18): [True: 3.78k, False: 90]
  |  Branch (574:33): [True: 3.41k, False: 371]
  ------------------
  575|  3.41k|			    b[l+1] >= '0' && b[l+1] <= '7' &&
  ------------------
  |  Branch (575:8): [True: 3.12k, False: 292]
  |  Branch (575:25): [True: 2.26k, False: 857]
  ------------------
  576|  2.26k|			    b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') {
  ------------------
  |  Branch (576:8): [True: 2.09k, False: 177]
  |  Branch (576:25): [True: 1.39k, False: 698]
  |  Branch (576:42): [True: 929, False: 464]
  ------------------
  577|    929|				if (l == 6)
  ------------------
  |  Branch (577:9): [True: 216, False: 713]
  ------------------
  578|    216|					uu->state = ST_READ_UU;
  ------------------
  |  |   56|    216|#define ST_READ_UU	1
  ------------------
  579|    713|				else
  580|    713|					uu->state = ST_READ_BASE64;
  ------------------
  |  |   58|    713|#define ST_READ_BASE64	3
  ------------------
  581|    929|				uu->mode = (mode_t)(
  582|    929|				    ((int)(b[l] - '0') * 64) +
  583|    929|				    ((int)(b[l+1] - '0') * 8) +
  584|    929|				     (int)(b[l+2] - '0'));
  585|    929|				uu->mode_set = 1;
  586|    929|				namelen = len - nl - 4 - l;
  587|    929|				if (namelen > 1) {
  ------------------
  |  Branch (587:9): [True: 532, False: 397]
  ------------------
  588|    532|					if (uu->name != NULL)
  ------------------
  |  Branch (588:10): [True: 436, False: 96]
  ------------------
  589|    436|						free(uu->name);
  590|    532|					uu->name = malloc(namelen + 1);
  591|    532|					if (uu->name == NULL) {
  ------------------
  |  Branch (591:10): [True: 0, False: 532]
  ------------------
  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|    532|					strncpy(uu->name,
  599|    532|					    (const char *)(b + l + 4),
  600|    532|					    namelen);
  601|    532|					uu->name[namelen] = '\0';
  602|    532|				}
  603|    929|			}
  604|  10.7k|			break;
  605|  10.7k|		case ST_READ_UU:
  ------------------
  |  |   56|    632|#define ST_READ_UU	1
  ------------------
  |  Branch (605:3): [True: 632, False: 347k]
  ------------------
  606|    632|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|    632|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (606:8): [True: 3, False: 629]
  ------------------
  607|      3|				goto finish;
  608|    629|			body = len - nl;
  609|    629|			if (!uuchar[*b] || body <= 0) {
  ------------------
  |  Branch (609:8): [True: 4, False: 625]
  |  Branch (609:23): [True: 0, False: 625]
  ------------------
  610|      4|				archive_set_error(&f->archive->archive,
  611|      4|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  612|      4|				    "Insufficient compressed data");
  613|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  614|      4|			}
  615|       |			/* Get length of undecoded bytes of current line. */
  616|    625|			l = UUDECODE(*b++);
  ------------------
  |  |  258|    625|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  617|    625|			body--;
  618|    625|			if (l > body) {
  ------------------
  |  Branch (618:8): [True: 1, False: 624]
  ------------------
  619|      1|				archive_set_error(&f->archive->archive,
  620|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  621|      1|				    "Insufficient compressed data");
  622|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  623|      1|			}
  624|    624|			if (l == 0) {
  ------------------
  |  Branch (624:8): [True: 160, False: 464]
  ------------------
  625|    160|				uu->state = ST_UUEND;
  ------------------
  |  |   57|    160|#define ST_UUEND	2
  ------------------
  626|    160|				break;
  627|    160|			}
  628|  1.29k|			while (l > 0) {
  ------------------
  |  Branch (628:11): [True: 840, False: 453]
  ------------------
  629|    840|				int n = 0;
  630|       |
  631|    840|				if (!uuchar[b[0]] || !uuchar[b[1]])
  ------------------
  |  Branch (631:9): [True: 2, False: 838]
  |  Branch (631:26): [True: 3, False: 835]
  ------------------
  632|      5|					break;
  633|    835|				n = UUDECODE(*b++) << 18;
  ------------------
  |  |  258|    835|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  634|    835|				n |= UUDECODE(*b++) << 12;
  ------------------
  |  |  258|    835|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  635|    835|				*out++ = n >> 16; total++;
  636|    835|				--l;
  637|       |
  638|    835|				if (l > 0) {
  ------------------
  |  Branch (638:9): [True: 712, False: 123]
  ------------------
  639|    712|					if (!uuchar[b[0]])
  ------------------
  |  Branch (639:10): [True: 2, False: 710]
  ------------------
  640|      2|						break;
  641|    710|					n |= UUDECODE(*b++) << 6;
  ------------------
  |  |  258|    710|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  642|    710|					*out++ = (n >> 8) & 0xFF; total++;
  643|    710|					--l;
  644|    710|				}
  645|    833|				if (l > 0) {
  ------------------
  |  Branch (645:9): [True: 408, False: 425]
  ------------------
  646|    408|					if (!uuchar[b[0]])
  ------------------
  |  Branch (646:10): [True: 4, False: 404]
  ------------------
  647|      4|						break;
  648|    404|					n |= UUDECODE(*b++);
  ------------------
  |  |  258|    404|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  649|    404|					*out++ = n & 0xFF; total++;
  650|    404|					--l;
  651|    404|				}
  652|    833|			}
  653|    464|			if (l) {
  ------------------
  |  Branch (653:8): [True: 11, False: 453]
  ------------------
  654|     11|				archive_set_error(&f->archive->archive,
  655|     11|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  656|     11|				    "Insufficient compressed data");
  657|     11|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  658|     11|			}
  659|    453|			break;
  660|    453|		case ST_UUEND:
  ------------------
  |  |   57|    155|#define ST_UUEND	2
  ------------------
  |  Branch (660:3): [True: 155, False: 348k]
  ------------------
  661|    155|			if (len - nl == 3 && memcmp(b, "end ", 3) == 0)
  ------------------
  |  Branch (661:8): [True: 90, False: 65]
  |  Branch (661:25): [True: 88, False: 2]
  ------------------
  662|     88|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     88|#define ST_FIND_HEAD	0
  ------------------
  663|     67|			else {
  664|     67|				archive_set_error(&f->archive->archive,
  665|     67|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     67|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  666|     67|				    "Insufficient compressed data");
  667|     67|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     67|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  668|     67|			}
  669|     88|			break;
  670|   336k|		case ST_READ_BASE64:
  ------------------
  |  |   58|   336k|#define ST_READ_BASE64	3
  ------------------
  |  Branch (670:3): [True: 336k, False: 11.4k]
  ------------------
  671|   336k|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|   336k|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (671:8): [True: 3, False: 336k]
  ------------------
  672|      3|				goto finish;
  673|   336k|			l = len - nl;
  674|   336k|			if (l >= 3 && b[0] == '=' && b[1] == '=' &&
  ------------------
  |  Branch (674:8): [True: 252k, False: 84.0k]
  |  Branch (674:18): [True: 227k, False: 25.5k]
  |  Branch (674:33): [True: 66.0k, False: 161k]
  ------------------
  675|  66.0k|			    b[2] == '=') {
  ------------------
  |  Branch (675:8): [True: 605, False: 65.4k]
  ------------------
  676|    605|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|    605|#define ST_FIND_HEAD	0
  ------------------
  677|    605|				break;
  678|    605|			}
  679|   365k|			while (l > 0) {
  ------------------
  |  Branch (679:11): [True: 350k, False: 15.0k]
  ------------------
  680|   350k|				int n = 0;
  681|       |
  682|   350k|				if (!base64[b[0]] || !base64[b[1]])
  ------------------
  |  Branch (682:9): [True: 3, False: 350k]
  |  Branch (682:26): [True: 93.6k, False: 256k]
  ------------------
  683|  93.6k|					break;
  684|   256k|				n = base64num[*b++] << 18;
  685|   256k|				n |= base64num[*b++] << 12;
  686|   256k|				*out++ = n >> 16; total++;
  687|   256k|				l -= 2;
  688|       |
  689|   256k|				if (l > 0) {
  ------------------
  |  Branch (689:9): [True: 245k, False: 11.1k]
  ------------------
  690|   245k|					if (*b == '=')
  ------------------
  |  Branch (690:10): [True: 124k, False: 120k]
  ------------------
  691|   124k|						break;
  692|   120k|					if (!base64[*b])
  ------------------
  |  Branch (692:10): [True: 4, False: 120k]
  ------------------
  693|      4|						break;
  694|   120k|					n |= base64num[*b++] << 6;
  695|   120k|					*out++ = (n >> 8) & 0xFF; total++;
  696|   120k|					--l;
  697|   120k|				}
  698|   131k|				if (l > 0) {
  ------------------
  |  Branch (698:9): [True: 120k, False: 11.5k]
  ------------------
  699|   120k|					if (*b == '=')
  ------------------
  |  Branch (699:10): [True: 102k, False: 17.5k]
  ------------------
  700|   102k|						break;
  701|  17.5k|					if (!base64[*b])
  ------------------
  |  Branch (701:10): [True: 6, False: 17.5k]
  ------------------
  702|      6|						break;
  703|  17.5k|					n |= base64num[*b++];
  704|  17.5k|					*out++ = n & 0xFF; total++;
  705|  17.5k|					--l;
  706|  17.5k|				}
  707|   131k|			}
  708|   336k|			if (l && *b != '=') {
  ------------------
  |  Branch (708:8): [True: 321k, False: 15.0k]
  |  Branch (708:13): [True: 15, False: 321k]
  ------------------
  709|     15|				archive_set_error(&f->archive->archive,
  710|     15|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     15|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  711|     15|				    "Insufficient compressed data");
  712|     15|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     15|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  713|     15|			}
  714|   336k|			break;
  715|   348k|		}
  716|   348k|	}
  717|  2.23k|finish:
  718|  2.23k|	if (ravail < avail_in)
  ------------------
  |  Branch (718:6): [True: 1.95k, False: 278]
  ------------------
  719|  1.95k|		used -= avail_in - ravail;
  720|  2.23k|	__archive_read_filter_consume(f->upstream, used);
  721|       |
  722|  2.23k|	*buff = uu->out_buff;
  723|  2.23k|	uu->total += total;
  724|  2.23k|	return (total);
  725|  3.64k|}
archive_read_support_filter_uu.c:ensure_in_buff_size:
  404|  5.93k|{
  405|       |
  406|  5.93k|	if (size > uu->in_allocated) {
  ------------------
  |  Branch (406:6): [True: 37, False: 5.89k]
  ------------------
  407|     37|		unsigned char *ptr;
  408|     37|		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|     37|		newsize = uu->in_allocated;
  415|    906|		do {
  416|    906|			if (newsize < IN_BUFF_SIZE*32)
  ------------------
  |  |   49|    906|#define IN_BUFF_SIZE	(1024)
  ------------------
  |  Branch (416:8): [True: 132, False: 774]
  ------------------
  417|    132|				newsize <<= 1;
  418|    774|			else
  419|    774|				newsize += IN_BUFF_SIZE;
  ------------------
  |  |   49|    774|#define IN_BUFF_SIZE	(1024)
  ------------------
  420|    906|		} while (size > newsize);
  ------------------
  |  Branch (420:12): [True: 869, False: 37]
  ------------------
  421|       |		/* Allocate the new buffer. */
  422|     37|		ptr = malloc(newsize);
  423|     37|		if (ptr == NULL) {
  ------------------
  |  Branch (423:7): [True: 0, False: 37]
  ------------------
  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|     37|		if (uu->in_cnt)
  ------------------
  |  Branch (430:7): [True: 13, False: 24]
  ------------------
  431|     13|			memmove(ptr, uu->in_buff, uu->in_cnt);
  432|       |		/* Replace in_buff with the new buffer. */
  433|     37|		free(uu->in_buff);
  434|     37|		uu->in_buff = ptr;
  435|     37|		uu->in_allocated = newsize;
  436|     37|	}
  437|  5.93k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.93k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  438|  5.93k|}
archive_read_support_filter_uu.c:uudecode_filter_close:
  729|    284|{
  730|    284|	struct uu *uu = f->data;
  731|       |
  732|    284|	free(uu->in_buff);
  733|    284|	free(uu->out_buff);
  734|    284|	free(uu->name);
  735|    284|	free(uu);
  736|       |
  737|    284|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    284|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  738|    284|}
archive_read_support_filter_uu.c:uudecode_read_header:
  442|     49|{
  443|     49|	struct uu *uu = f->data;
  444|       |
  445|     49|	if (uu->mode_set != 0)
  ------------------
  |  Branch (445:6): [True: 49, False: 0]
  ------------------
  446|     49|		archive_entry_set_mode(entry, S_IFREG | uu->mode);
  447|       |
  448|     49|	if (uu->name != NULL)
  ------------------
  |  Branch (448:6): [True: 22, False: 27]
  ------------------
  449|     22|		archive_entry_set_pathname(entry, uu->name);
  450|       |
  451|     49|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     49|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  452|     49|}

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

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

archive_read_support_format_7zip:
  471|  22.2k|{
  472|  22.2k|	struct archive_read *a = (struct archive_read *)_a;
  473|  22.2k|	struct _7zip *zip;
  474|  22.2k|	int r;
  475|       |
  476|  22.2k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  22.2k|	do { \
  |  |  178|  22.2k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  22.2k|			(allowed_states), (function_name)); \
  |  |  180|  22.2k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  22.2k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 22.2k]
  |  |  ------------------
  |  |  181|  22.2k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  22.2k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
  477|  22.2k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_7zip");
  478|       |
  479|  22.2k|	zip = calloc(1, sizeof(*zip));
  480|  22.2k|	if (zip == NULL) {
  ------------------
  |  Branch (480:6): [True: 0, False: 22.2k]
  ------------------
  481|      0|		archive_set_error(&a->archive, ENOMEM,
  482|      0|		    "Can't allocate 7zip data");
  483|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  484|      0|	}
  485|       |
  486|       |	/*
  487|       |	 * Until enough data has been read, we cannot tell about
  488|       |	 * any encrypted entries yet.
  489|       |	 */
  490|  22.2k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  22.2k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  491|       |
  492|       |
  493|  22.2k|	r = __archive_read_register_format(a,
  494|  22.2k|	    zip,
  495|  22.2k|	    "7zip",
  496|  22.2k|	    archive_read_format_7zip_bid,
  497|  22.2k|	    NULL,
  498|  22.2k|	    archive_read_format_7zip_read_header,
  499|  22.2k|	    archive_read_format_7zip_read_data,
  500|  22.2k|	    archive_read_format_7zip_read_data_skip,
  501|  22.2k|	    NULL,
  502|  22.2k|	    archive_read_format_7zip_cleanup,
  503|  22.2k|	    archive_read_support_format_7zip_capabilities,
  504|  22.2k|	    archive_read_format_7zip_has_encrypted_entries);
  505|       |
  506|  22.2k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (506:6): [True: 0, False: 22.2k]
  ------------------
  507|      0|		free(zip);
  508|  22.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  509|  22.2k|}
archive_read_support_format_7zip.c:archive_read_support_format_7zip_capabilities:
  513|  3.71k|{
  514|  3.71k|	(void)a; /* UNUSED */
  515|  3.71k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|  3.71k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  516|  3.71k|			ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  3.71k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  517|  3.71k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_has_encrypted_entries:
  521|  1.85k|{
  522|  1.85k|	if (a && a->format) {
  ------------------
  |  Branch (522:6): [True: 1.85k, False: 0]
  |  Branch (522:11): [True: 1.85k, False: 0]
  ------------------
  523|  1.85k|		struct _7zip *zip = a->format->data;
  524|  1.85k|		if (zip) {
  ------------------
  |  Branch (524:7): [True: 1.85k, False: 0]
  ------------------
  525|  1.85k|			return zip->has_encrypted_entries;
  526|  1.85k|		}
  527|  1.85k|	}
  528|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  529|  1.85k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_bid:
  600|  21.6k|{
  601|  21.6k|	int64_t data_offset;
  602|       |
  603|       |	/* If someone has already bid more than 32, then avoid
  604|       |	   trashing the look-ahead buffers with a seek. */
  605|  21.6k|	if (best_bid > 32)
  ------------------
  |  Branch (605:6): [True: 4.94k, False: 16.7k]
  ------------------
  606|  4.94k|		return (-1);
  607|       |
  608|  16.7k|	if (get_data_offset(a, &data_offset, 0) < 0)
  ------------------
  |  Branch (608:6): [True: 14.8k, False: 1.86k]
  ------------------
  609|  14.8k|		return (0);
  610|       |
  611|  1.86k|	return (48);
  612|  16.7k|}
archive_read_support_format_7zip.c:get_data_offset:
  533|  18.5k|{
  534|  18.5k|	const unsigned char *p;
  535|  18.5k|	int64_t offset, sfx_offset;
  536|  18.5k|	int r, window;
  537|       |
  538|  18.5k|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL) {
  ------------------
  |  Branch (538:6): [True: 400, False: 18.1k]
  ------------------
  539|    400|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    400|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  540|    400|		    "Truncated 7-Zip file body");
  541|    400|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    400|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  542|    400|	}
  543|       |
  544|       |	/* If first six bytes are the 7-Zip signature,
  545|       |	 * return the offset right now. */
  546|  18.1k|	if (memcmp(p, _7ZIP_SIGNATURE, 6) == 0) {
  ------------------
  |  |   67|  18.1k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (546:6): [True: 3.67k, False: 14.4k]
  ------------------
  547|  3.67k|		*data_offset = 0;
  548|  3.67k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  549|  3.67k|	}
  550|       |
  551|       |	/*
  552|       |	 * It may be a 7-Zip SFX archive file. If first two bytes are
  553|       |	 * 'M' and 'Z' (PE, Windows) or first four bytes are
  554|       |	 * "\x7F\x45LF" (ELF, Posix-like systems), seek the 7-Zip
  555|       |	 * signature. While get_pe_sfx_offset can be performed without
  556|       |	 * performing a seek, get_elf_sfx_offset requires one,
  557|       |	 * thus a performance difference between the two is expected. 
  558|       |	 */
  559|  14.4k|	if ((p[0] == 'M' && p[1] == 'Z'))
  ------------------
  |  Branch (559:7): [True: 1.40k, False: 13.0k]
  |  Branch (559:22): [True: 687, False: 713]
  ------------------
  560|    687|		r = get_pe_sfx_offset(a, &sfx_offset);
  561|  13.8k|	else if (memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (561:11): [True: 171, False: 13.6k]
  ------------------
  562|    171|		r = get_elf_sfx_offset(a, &sfx_offset, compat);
  563|  13.6k|	else
  564|  13.6k|		r = ARCHIVE_FATAL;
  ------------------
  |  |  239|  13.6k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  565|  14.4k|	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |  235|  28.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |   71|    214|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (565:6): [True: 14.2k, False: 214]
  |  Branch (565:26): [True: 30, False: 184]
  ------------------
  566|  14.3k|		goto fail;
  567|       |
  568|    184|	offset = sfx_offset;
  569|    184|	window = 4096;
  570|  1.63k|	while (offset + window <= (sfx_offset + SFX_MAX_OFFSET)) {
  ------------------
  |  |   70|  1.63k|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  ------------------
  |  |  |  |   69|  1.63k|#define SFX_MAX_ADDR	0x60000
  |  |  ------------------
  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  ------------------
  |  |  |  |   68|  1.63k|#define SFX_MIN_ADDR	0x27000
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 1.62k, False: 9]
  ------------------
  571|  1.62k|		ssize_t bytes_avail;
  572|  1.62k|		const unsigned char *buff = __archive_read_ahead(a,
  573|  1.62k|				offset + window, &bytes_avail);
  574|  1.62k|		if (buff == NULL) {
  ------------------
  |  Branch (574:7): [True: 1.09k, False: 526]
  ------------------
  575|       |			/* Remaining bytes are less than window. */
  576|  1.09k|			window >>= 1;
  577|  1.09k|			if (window < 0x40)
  ------------------
  |  Branch (577:8): [True: 138, False: 961]
  ------------------
  578|    138|				goto fail;
  579|    961|			continue;
  580|  1.09k|		}
  581|    526|		p = buff + offset;
  582|   574k|		while (buff + bytes_avail - p >= 32) {
  ------------------
  |  Branch (582:10): [True: 574k, False: 489]
  ------------------
  583|   574k|			size_t step = check_7zip_header_in_sfx(p);
  584|   574k|			if (step == 0) {
  ------------------
  |  Branch (584:8): [True: 37, False: 574k]
  ------------------
  585|     37|				*data_offset = p - buff;
  586|     37|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     37|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  587|     37|			}
  588|   574k|			p += step;
  589|   574k|		}
  590|    489|		offset = p - buff;
  591|    489|	}
  592|  14.4k|fail:
  593|  14.4k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  14.4k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  594|  14.4k|	    "Couldn't find out 7-Zip header");
  595|  14.4k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  14.4k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  596|    184|}
archive_read_support_format_7zip.c:get_pe_sfx_offset:
  641|    687|{
  642|    687|	const char *h;
  643|    687|	int64_t max_offset, offset;
  644|    687|	ssize_t bytes;
  645|    687|	uint16_t opt_hdr_sz, sec_cnt;
  646|       |
  647|       |	/*
  648|       |	 * If encounter any weirdness, revert to old brute-force style search
  649|       |	 */
  650|    687|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   68|    687|#define SFX_MIN_ADDR	0x27000
  ------------------
  651|       |
  652|    687|	for (;;) {
  653|       |		/*
  654|       |		 * Read Dos header to find e_lfanew
  655|       |		 */
  656|    687|		h = __archive_read_ahead(a, PE_DOS_HDR_LEN, &bytes);
  ------------------
  |  |   76|    687|#define PE_DOS_HDR_LEN			0x40
  ------------------
  657|    687|		if (h == NULL) {
  ------------------
  |  Branch (657:7): [True: 66, False: 621]
  ------------------
  658|     66|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     66|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  659|     66|		}
  660|    621|		if (h[0] != 'M' || h[1] != 'Z') {
  ------------------
  |  Branch (660:7): [True: 0, False: 621]
  |  Branch (660:22): [True: 0, False: 621]
  ------------------
  661|      0|			break;
  662|      0|		}
  663|    621|		offset = archive_le32dec(h + PE_DOS_HDR_ELFANEW_OFFSET);
  ------------------
  |  |   77|    621|#define PE_DOS_HDR_ELFANEW_OFFSET	0x3c
  ------------------
  664|    621|		if (offset > SFX_MAX_SEEK) {
  ------------------
  |  |   71|    621|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (664:7): [True: 367, False: 254]
  ------------------
  665|    367|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    367|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  666|    367|		}
  667|       |
  668|       |		/*
  669|       |		 * Read COFF header to find opt header size and sec cnt
  670|       |		 */
  671|    254|		if (bytes < offset + PE_COFF_HDR_LEN) {
  ------------------
  |  |   78|    254|#define PE_COFF_HDR_LEN			0x18
  ------------------
  |  Branch (671:7): [True: 68, False: 186]
  ------------------
  672|     68|			h = __archive_read_ahead(a, offset + PE_COFF_HDR_LEN,
  ------------------
  |  |   78|     68|#define PE_COFF_HDR_LEN			0x18
  ------------------
  673|     68|			    &bytes);
  674|     68|			if (h == NULL) {
  ------------------
  |  Branch (674:8): [True: 55, False: 13]
  ------------------
  675|     55|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     55|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  676|     55|			}
  677|     13|			if (h[offset] != 'P' || h[offset + 1] != 'E') {
  ------------------
  |  Branch (677:8): [True: 7, False: 6]
  |  Branch (677:28): [True: 1, False: 5]
  ------------------
  678|      8|				break;
  679|      8|			}
  680|     13|		}
  681|    191|		sec_cnt = archive_le16dec(
  682|    191|		    h + offset + PE_COFF_HDR_SEC_CNT_OFFSET);
  ------------------
  |  |   79|    191|#define PE_COFF_HDR_SEC_CNT_OFFSET	0x6
  ------------------
  683|    191|		opt_hdr_sz = archive_le16dec(
  684|    191|		    h + offset + PE_COFF_HDR_OPT_SZ_OFFSET);
  ------------------
  |  |   80|    191|#define PE_COFF_HDR_OPT_SZ_OFFSET	0x14
  ------------------
  685|       |
  686|       |		/*
  687|       |		 * Skip optional header
  688|       |		 */
  689|    191|		if (opt_hdr_sz != 0) {
  ------------------
  |  Branch (689:7): [True: 140, False: 51]
  ------------------
  690|    140|			offset += PE_COFF_HDR_LEN + opt_hdr_sz;
  ------------------
  |  |   78|    140|#define PE_COFF_HDR_LEN			0x18
  ------------------
  691|    140|		} else {
  692|     51|			break;
  693|     51|		}
  694|       |
  695|    140|		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   81|    140|#define PE_SEC_HDR_LEN 			0x28
  ------------------
              		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   71|    140|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (695:7): [True: 0, False: 140]
  ------------------
  696|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  697|      0|		}
  698|       |
  699|       |		/*
  700|       |		 * Traverse sec table to find max raw offset (i.e., overlay)
  701|       |		 */
  702|    140|		if (bytes < offset + sec_cnt * PE_SEC_HDR_LEN) {
  ------------------
  |  |   81|    140|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  |  Branch (702:7): [True: 39, False: 101]
  ------------------
  703|     39|			h = __archive_read_ahead(a,
  704|     39|			    offset + sec_cnt * PE_SEC_HDR_LEN, NULL);
  ------------------
  |  |   81|     39|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  705|     39|			if (h == NULL) {
  ------------------
  |  Branch (705:8): [True: 32, False: 7]
  ------------------
  706|     32|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     32|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  707|     32|			}
  708|     39|		}
  709|    108|		max_offset = offset;
  710|  62.5k|		while (sec_cnt > 0) {
  ------------------
  |  Branch (710:10): [True: 62.4k, False: 108]
  ------------------
  711|  62.4k|			int64_t sec_end;
  712|       |
  713|  62.4k|			sec_end = (int64_t)archive_le32dec(
  714|  62.4k|				      h + offset + PE_SEC_HDR_RAW_SZ_OFFSET) +
  ------------------
  |  |   83|  62.4k|#define PE_SEC_HDR_RAW_SZ_OFFSET	0x10
  ------------------
  715|  62.4k|			    archive_le32dec(
  716|  62.4k|				h + offset + PE_SEC_HDR_RAW_ADDR_OFFSET);
  ------------------
  |  |   82|  62.4k|#define PE_SEC_HDR_RAW_ADDR_OFFSET	0x14
  ------------------
  717|  62.4k|			if (sec_end > max_offset) {
  ------------------
  |  Branch (717:8): [True: 10.3k, False: 52.1k]
  ------------------
  718|  10.3k|				max_offset = sec_end;
  719|  10.3k|			}
  720|  62.4k|			offset += PE_SEC_HDR_LEN;
  ------------------
  |  |   81|  62.4k|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  721|  62.4k|			sec_cnt--;
  722|  62.4k|		}
  723|    108|		*sfx_offset = max_offset;
  724|    108|		break;
  725|    140|	}
  726|       |
  727|    167|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    167|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  728|    687|}
archive_read_support_format_7zip.c:get_elf_sfx_offset:
  732|    171|{
  733|    171|	int64_t r;
  734|    171|	const char *h;
  735|    171|	char big_endian, format_64;
  736|    171|	size_t request;
  737|    171|	uint64_t e_shoff, strtab_offset, strtab_size;
  738|    171|	uint16_t e_shentsize, e_shnum, e_shstrndx;
  739|    171|	uint16_t (*dec16)(const void *);
  740|    171|	uint32_t (*dec32)(const void *);
  741|    171|	uint64_t (*dec64)(const void *);
  742|       |
  743|       |	/*
  744|       |	 * If encounter any weirdness, revert to old brute-force style search
  745|       |	 */
  746|    171|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   68|    171|#define SFX_MIN_ADDR	0x27000
  ------------------
  747|       |
  748|    171|	for (;;) {
  749|       |		/*
  750|       |		 * Read Elf header to find bitness & endianness
  751|       |		 */
  752|    171|		h = __archive_read_ahead(a, ELF_HDR_MIN_LEN, NULL);
  ------------------
  |  |   88|    171|#define ELF_HDR_MIN_LEN 0x40 /* sizeof(Elf64_Ehdr) */
  ------------------
  753|    171|		if (h == NULL) {
  ------------------
  |  Branch (753:7): [True: 6, False: 165]
  ------------------
  754|      6|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  755|      6|		}
  756|    165|		if (memcmp(h, "\x7F\x45LF", 4) != 0) {
  ------------------
  |  Branch (756:7): [True: 0, False: 165]
  ------------------
  757|      0|			break;
  758|      0|		}
  759|    165|		format_64 = h[ELF_HDR_EI_CLASS_OFFSET] == 0x2;
  ------------------
  |  |   89|    165|#define ELF_HDR_EI_CLASS_OFFSET 0x04
  ------------------
  760|    165|		big_endian = h[ELF_HDR_EI_DATA_OFFSET] == 0x2;
  ------------------
  |  |   90|    165|#define ELF_HDR_EI_DATA_OFFSET 0x05
  ------------------
  761|    165|		if (big_endian) {
  ------------------
  |  Branch (761:7): [True: 64, False: 101]
  ------------------
  762|     64|			dec16 = &archive_be16dec;
  763|     64|			dec32 = &archive_be32dec;
  764|     64|			dec64 = &archive_be64dec;
  765|    101|		} else {
  766|    101|			dec16 = &archive_le16dec;
  767|    101|			dec32 = &archive_le32dec;
  768|    101|			dec64 = &archive_le64dec;
  769|    101|		}
  770|       |
  771|       |		/*
  772|       |		 * Read section header table info
  773|       |		 */
  774|    165|		if (format_64) {
  ------------------
  |  Branch (774:7): [True: 94, False: 71]
  ------------------
  775|     94|			e_shoff = (*dec64)(h + 0x28);
  776|     94|			e_shentsize = (*dec16)(h + 0x3A);
  777|     94|			e_shnum = (*dec16)(h + 0x3C);
  778|     94|			e_shstrndx = (*dec16)(h + 0x3E);
  779|     94|			if (e_shnum <= e_shstrndx || e_shentsize < 0x28)
  ------------------
  |  Branch (779:8): [True: 6, False: 88]
  |  Branch (779:33): [True: 1, False: 87]
  ------------------
  780|      7|				break;
  781|       |
  782|     94|		} else {
  783|     71|			e_shoff = (*dec32)(h + 0x20);
  784|     71|			e_shentsize = (*dec16)(h + 0x2E);
  785|     71|			e_shnum = (*dec16)(h + 0x30);
  786|     71|			e_shstrndx = (*dec16)(h + 0x32);
  787|     71|			if (e_shnum <= e_shstrndx || e_shentsize < 0x18)
  ------------------
  |  Branch (787:8): [True: 11, False: 60]
  |  Branch (787:33): [True: 1, False: 59]
  ------------------
  788|     12|				break;
  789|     71|		}
  790|       |
  791|    146|		if ((int64_t)e_shoff < 0) {
  ------------------
  |  Branch (791:7): [True: 28, False: 118]
  ------------------
  792|     28|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     28|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  793|     28|		}
  794|       |
  795|       |		/*
  796|       |		 * Reading the section table to find strtab section
  797|       |		 */
  798|    118|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (798:7): [True: 33, False: 85]
  ------------------
  799|     33|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|     33|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  800|     33|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     33|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  801|     33|		}
  802|     85|		if (format_64) {
  ------------------
  |  Branch (802:7): [True: 47, False: 38]
  ------------------
  803|     47|			request = (size_t)e_shnum * e_shentsize + 0x28;
  804|     47|		} else {
  805|     38|			request = (size_t)e_shnum * e_shentsize + 0x18;
  806|     38|		}
  807|     85|		if (request > SFX_MAX_SEEK) {
  ------------------
  |  |   71|     85|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (807:7): [True: 9, False: 76]
  ------------------
  808|      9|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  809|      9|		}
  810|     76|		h = __archive_read_ahead(a, request, NULL);
  811|     76|		if (h == NULL) {
  ------------------
  |  Branch (811:7): [True: 8, False: 68]
  ------------------
  812|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  813|      8|		}
  814|     68|		if (format_64) {
  ------------------
  |  Branch (814:7): [True: 45, False: 23]
  ------------------
  815|     45|			strtab_offset = (*dec64)(
  816|     45|			    h + e_shstrndx * e_shentsize + 0x18);
  817|     45|			strtab_size = (*dec64)(
  818|     45|			    h + e_shstrndx * e_shentsize + 0x20);
  819|     45|		} else {
  820|     23|			strtab_offset = (*dec32)(
  821|     23|			    h + e_shstrndx * e_shentsize + 0x10);
  822|     23|			strtab_size = (*dec32)(
  823|     23|			    h + e_shstrndx * e_shentsize + 0x14);
  824|     23|		}
  825|     68|		if ((int64_t)strtab_offset < 0 || strtab_size < 6 ||
  ------------------
  |  Branch (825:7): [True: 11, False: 57]
  |  Branch (825:37): [True: 1, False: 56]
  ------------------
  826|     56|		    strtab_size > SFX_MAX_SEEK)
  ------------------
  |  |   71|     56|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (826:7): [True: 24, False: 32]
  ------------------
  827|     36|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  828|       |
  829|       |		/*
  830|       |		 * Read the STRTAB section to find the .data offset
  831|       |		 */
  832|     32|		if (seek_compat(a, strtab_offset, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (832:7): [True: 1, False: 31]
  ------------------
  833|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  834|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  835|      1|		}
  836|     31|		h = __archive_read_ahead(a, strtab_size, NULL);
  837|     31|		if (h == NULL) {
  ------------------
  |  Branch (837:7): [True: 2, False: 29]
  ------------------
  838|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  839|      2|		}
  840|     29|		size_t data_sym_offset = strtab_size;
  841|  20.1k|		for (size_t offset = 0; offset + 6 <= strtab_size; offset++) {
  ------------------
  |  Branch (841:27): [True: 20.1k, False: 7]
  ------------------
  842|  20.1k|			if (memcmp(h + offset, ".data\00", 6) == 0) {
  ------------------
  |  Branch (842:8): [True: 22, False: 20.1k]
  ------------------
  843|     22|				data_sym_offset = offset;
  844|     22|				break;
  845|     22|			}
  846|  20.1k|		}
  847|     29|		if (data_sym_offset == strtab_size) {
  ------------------
  |  Branch (847:7): [True: 7, False: 22]
  ------------------
  848|      7|			break;
  849|      7|		}
  850|       |
  851|       |		/*
  852|       |		 * Find the section with the .data name
  853|       |		 */
  854|     22|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (854:7): [True: 0, False: 22]
  ------------------
  855|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  856|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  857|      0|		}
  858|     22|		h = __archive_read_ahead(a, (size_t)e_shnum * e_shentsize, NULL);
  859|     22|		if (h == NULL) {
  ------------------
  |  Branch (859:7): [True: 0, False: 22]
  ------------------
  860|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  861|      0|		}
  862|     22|		size_t sec_tbl_offset = 0;
  863|    681|		while (e_shnum > 0) {
  ------------------
  |  Branch (863:10): [True: 668, False: 13]
  ------------------
  864|    668|			uint32_t name_offset;
  865|       |
  866|    668|			name_offset = (*dec32)(h + sec_tbl_offset);
  867|    668|			if (name_offset == data_sym_offset) {
  ------------------
  |  Branch (867:8): [True: 9, False: 659]
  ------------------
  868|      9|				int64_t sel_offset;
  869|       |
  870|      9|				if (format_64) {
  ------------------
  |  Branch (870:9): [True: 6, False: 3]
  ------------------
  871|      6|					sel_offset = (*dec64)(
  872|      6|					    h + sec_tbl_offset + 0x18);
  873|      6|				} else {
  874|      3|					sel_offset = (*dec32)(
  875|      3|					    h + sec_tbl_offset + 0x10);
  876|      3|				}
  877|      9|				if (sel_offset >= 0)
  ------------------
  |  Branch (877:9): [True: 7, False: 2]
  ------------------
  878|      7|					*sfx_offset = sel_offset;
  879|      9|				break;
  880|      9|			}
  881|    659|			sec_tbl_offset += e_shentsize;
  882|    659|			e_shnum--;
  883|    659|		}
  884|     22|		break;
  885|     22|	}
  886|       |
  887|     48|	r = seek_compat(a, 0, SEEK_SET, compat);
  888|     48|	if (r < 0)
  ------------------
  |  Branch (888:6): [True: 1, False: 47]
  ------------------
  889|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  890|     48|	return (int)r;
  891|    171|}
archive_read_support_format_7zip.c:seek_compat:
 4628|    813|{
 4629|    813|	int64_t ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|    813|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4630|       |
 4631|    813|	if (a->filter->can_seek)
  ------------------
  |  Branch (4631:6): [True: 806, False: 7]
  ------------------
 4632|    806|		ret = __archive_read_seek(a, offset, whence);
 4633|      7|	else if (compat) {
  ------------------
  |  Branch (4633:11): [True: 4, False: 3]
  ------------------
 4634|      4|		switch (whence) {
 4635|      0|		case SEEK_CUR:
  ------------------
  |  Branch (4635:3): [True: 0, False: 4]
  ------------------
 4636|      0|			ret = __archive_read_consume(a, offset);
 4637|      0|			break;
 4638|      4|		case SEEK_SET:
  ------------------
  |  Branch (4638:3): [True: 4, False: 0]
  ------------------
 4639|      4|			if (a->filter->position > offset)
  ------------------
  |  Branch (4639:8): [True: 1, False: 3]
  ------------------
 4640|      1|				break;
 4641|      3|			ret = __archive_read_consume(a,
 4642|      3|			    offset - a->filter->position);
 4643|      3|			break;
 4644|      0|		default:
  ------------------
  |  Branch (4644:3): [True: 0, False: 4]
  ------------------
 4645|      0|			break;
 4646|      4|		}
 4647|      4|	}
 4648|       |
 4649|    813|	return (ret);
 4650|    813|}
archive_read_support_format_7zip.c:check_7zip_header_in_sfx:
  616|   574k|{
  617|   574k|	switch (p[5]) {
  618|  5.46k|	case 0x1C:
  ------------------
  |  Branch (618:2): [True: 5.46k, False: 568k]
  ------------------
  619|  5.46k|		if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0)
  ------------------
  |  |   67|  5.46k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (619:7): [True: 2.38k, False: 3.07k]
  ------------------
  620|  2.38k|			return (6);
  621|       |		/*
  622|       |		 * Test the CRC because its extraction code has 7-Zip
  623|       |		 * Magic Code, so we should do this in order not to
  624|       |		 * make a mis-detection.
  625|       |		 */
  626|  3.07k|		if (crc32(0, p + 12, 20) != archive_le32dec(p + 8))
  ------------------
  |  Branch (626:7): [True: 3.04k, False: 37]
  ------------------
  627|  3.04k|			return (6);
  628|       |		/* Hit the header! */
  629|     37|		return (0);
  630|  3.46k|	case 0x37: return (5);
  ------------------
  |  Branch (630:2): [True: 3.46k, False: 570k]
  ------------------
  631|  2.46k|	case 0x7A: return (4);
  ------------------
  |  Branch (631:2): [True: 2.46k, False: 571k]
  ------------------
  632|    458|	case 0xBC: return (3);
  ------------------
  |  Branch (632:2): [True: 458, False: 573k]
  ------------------
  633|  1.47k|	case 0xAF: return (2);
  ------------------
  |  Branch (633:2): [True: 1.47k, False: 572k]
  ------------------
  634|  3.04k|	case 0x27: return (1);
  ------------------
  |  Branch (634:2): [True: 3.04k, False: 571k]
  ------------------
  635|   557k|	default: return (6);
  ------------------
  |  Branch (635:2): [True: 557k, False: 16.3k]
  ------------------
  636|   574k|	}
  637|   574k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_header:
  896|  7.47k|{
  897|  7.47k|	struct _7zip *zip = a->format->data;
  898|  7.47k|	struct _7zip_entry *zip_entry;
  899|  7.47k|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|  7.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  900|  7.47k|	struct _7z_folder *folder = 0;
  901|       |
  902|       |	/*
  903|       |	 * It should be sufficient to call archive_read_next_header() for
  904|       |	 * a reader to determine if an entry is encrypted or not. If the
  905|       |	 * encryption of an entry is only detectable when calling
  906|       |	 * archive_read_data(), so be it. We'll do the same check there
  907|       |	 * as well.
  908|       |	 */
  909|  7.47k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  7.47k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (909:6): [True: 1.85k, False: 5.62k]
  ------------------
  910|  1.85k|		zip->has_encrypted_entries = 0;
  911|  1.85k|	}
  912|       |
  913|  7.47k|	a->archive.archive_format = ARCHIVE_FORMAT_7ZIP;
  ------------------
  |  |  385|  7.47k|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  914|  7.47k|	a->archive.archive_format_name = "7-Zip";
  915|       |
  916|  7.47k|	if (zip->entries == NULL) {
  ------------------
  |  Branch (916:6): [True: 1.85k, False: 5.62k]
  ------------------
  917|  1.85k|		struct _7z_header_info header;
  918|       |
  919|  1.85k|		memset(&header, 0, sizeof(header));
  920|  1.85k|		r = slurp_central_directory(a, zip, &header);
  921|  1.85k|		free_Header(&header);
  922|  1.85k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (922:7): [True: 1.64k, False: 210]
  ------------------
  923|  1.64k|			return (r);
  924|    210|		zip->entries_remaining = zip->numFiles;
  925|    210|		zip->entry = zip->entries;
  926|  5.62k|	} else {
  927|  5.62k|		++zip->entry;
  928|  5.62k|	}
  929|  5.83k|	zip_entry = zip->entry;
  930|       |
  931|  5.83k|	if (zip->entries_remaining == 0 || zip_entry == NULL)
  ------------------
  |  Branch (931:6): [True: 156, False: 5.67k]
  |  Branch (931:37): [True: 0, False: 5.67k]
  ------------------
  932|    156|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    156|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  933|  5.67k|	--zip->entries_remaining;
  934|       |
  935|  5.67k|	zip->entry_offset = 0;
  936|  5.67k|	zip->end_of_entry = 0;
  937|  5.67k|	zip->entry_crc32 = 0;
  938|       |
  939|       |	/* Setup a string conversion for a filename. */
  940|  5.67k|	if (zip->sconv == NULL) {
  ------------------
  |  Branch (940:6): [True: 201, False: 5.47k]
  ------------------
  941|    201|		zip->sconv = archive_string_conversion_from_charset(
  942|    201|		    &a->archive, "UTF-16LE", 1);
  943|    201|		if (zip->sconv == NULL)
  ------------------
  |  Branch (943:7): [True: 0, False: 201]
  ------------------
  944|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  945|    201|	}
  946|       |
  947|       |	/* Figure out if the entry is encrypted by looking at the folder
  948|       |	   that is associated to the current 7zip entry. If the folder
  949|       |	   has a coder with a _7Z_CRYPTO codec then the folder is encrypted.
  950|       |	   Hence the entry must also be encrypted. */
  951|  5.67k|	if (zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (951:6): [True: 162, False: 5.51k]
  ------------------
  952|    162|		size_t fidx = 0;
  953|       |
  954|    162|		folder = &(zip->si.ci.folders[zip_entry->folderIndex]);
  955|    457|		for (fidx = 0; fidx < folder->numCoders; fidx++) {
  ------------------
  |  Branch (955:18): [True: 295, False: 162]
  ------------------
  956|    295|			switch(folder->coders[fidx].codec) {
  ------------------
  |  Branch (956:11): [True: 0, False: 295]
  ------------------
  957|      0|				case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (957:5): [True: 0, False: 295]
  ------------------
  958|      0|				case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (958:5): [True: 0, False: 295]
  ------------------
  959|      0|				case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (959:5): [True: 0, False: 295]
  ------------------
  960|      0|					archive_entry_set_is_data_encrypted(entry, 1);
  961|      0|					zip->has_encrypted_entries = 1;
  962|      0|					break;
  963|      0|				}
  964|    295|			}
  965|    295|		}
  966|    162|	}
  967|       |
  968|  5.67k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  5.67k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (968:6): [True: 615, False: 5.06k]
  ------------------
  969|  5.67k|	    (const char *)zip_entry->utf16name,
  970|  5.67k|	    zip_entry->name_len, zip->sconv) != 0) {
  971|    615|		if (errno == ENOMEM) {
  ------------------
  |  Branch (971:7): [True: 0, False: 615]
  ------------------
  972|      0|			archive_set_error(&a->archive, ENOMEM,
  973|      0|			    "Can't allocate memory for Pathname");
  974|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  975|      0|		}
  976|    615|		archive_set_error(&a->archive,
  977|    615|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    615|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  978|    615|		    "Pathname cannot be converted "
  979|    615|		    "from %s to current locale",
  980|    615|		    archive_string_conversion_charset_name(zip->sconv));
  981|    615|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    615|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  982|    615|	}
  983|       |
  984|       |	/* Populate some additional entry fields: */
  985|  5.67k|	archive_entry_set_mode(entry, zip_entry->mode);
  986|  5.67k|	if (zip_entry->flg & MTIME_IS_SET)
  ------------------
  |  |  245|  5.67k|#define MTIME_IS_SET	(1<<0)
  ------------------
  |  Branch (986:6): [True: 235, False: 5.44k]
  ------------------
  987|    235|		archive_entry_set_mtime(entry, zip_entry->mtime,
  988|    235|			zip_entry->mtime_ns);
  989|  5.67k|	if (zip_entry->flg & CTIME_IS_SET)
  ------------------
  |  |  247|  5.67k|#define CTIME_IS_SET	(1<<2)
  ------------------
  |  Branch (989:6): [True: 77, False: 5.60k]
  ------------------
  990|     77|		archive_entry_set_ctime(entry, zip_entry->ctime,
  991|     77|		    zip_entry->ctime_ns);
  992|  5.67k|	if (zip_entry->flg & ATIME_IS_SET)
  ------------------
  |  |  246|  5.67k|#define ATIME_IS_SET	(1<<1)
  ------------------
  |  Branch (992:6): [True: 72, False: 5.60k]
  ------------------
  993|     72|		archive_entry_set_atime(entry, zip_entry->atime,
  994|     72|		    zip_entry->atime_ns);
  995|  5.67k|	if (zip_entry->ssIndex != (size_t)-1) {
  ------------------
  |  Branch (995:6): [True: 162, False: 5.51k]
  ------------------
  996|    162|		zip->entry_bytes_remaining =
  997|    162|		    zip->si.ss.unpackSizes[zip_entry->ssIndex];
  998|    162|		archive_entry_set_size(entry, zip->entry_bytes_remaining);
  999|  5.51k|	} else {
 1000|  5.51k|		zip->entry_bytes_remaining = 0;
 1001|  5.51k|		archive_entry_set_size(entry, 0);
 1002|  5.51k|	}
 1003|       |
 1004|       |	// These attributes are supported by the windows implementation of archive_write_disk.
 1005|  5.67k|	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  150|  5.67k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  154|  5.67k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  158|  5.67k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
 1006|       |
 1007|  5.67k|	if (zip_entry->attr & supported_attrs) {
  ------------------
  |  Branch (1007:6): [True: 1.07k, False: 4.60k]
  ------------------
 1008|  1.07k|		char buf[sizeof(",rdonly,hidden,system")];
 1009|  1.07k|		const char *fflags[3] = { "", "", "" };
 1010|  1.07k|		const char **flag = fflags;
 1011|       |
 1012|  1.07k|		if (zip_entry->attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  150|  1.07k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (1012:7): [True: 632, False: 445]
  ------------------
 1013|    632|			*flag++ = ",rdonly";
 1014|  1.07k|		if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN)
  ------------------
  |  |  154|  1.07k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
  |  Branch (1014:7): [True: 656, False: 421]
  ------------------
 1015|    656|			*flag++ = ",hidden";
 1016|  1.07k|		if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM)
  ------------------
  |  |  158|  1.07k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  |  Branch (1016:7): [True: 571, False: 506]
  ------------------
 1017|    571|			*flag++ = ",system";
 1018|       |
 1019|  1.07k|		snprintf(buf, sizeof(buf), "%s%s%s", fflags[0], fflags[1], fflags[2]);
 1020|  1.07k|		archive_entry_copy_fflags_text(entry, buf + 1);
 1021|  1.07k|	}
 1022|       |
 1023|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1024|  5.67k|	if (zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1024:6): [True: 5.51k, False: 160]
  ------------------
 1025|  5.51k|		zip->end_of_entry = 1;
 1026|       |
 1027|  5.67k|	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  5.67k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  5.67k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1027:6): [True: 88, False: 5.58k]
  ------------------
 1028|     88|		unsigned char *symname = NULL;
 1029|     88|		size_t symsize = 0;
 1030|       |
 1031|     88|		if (zip->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (1031:7): [True: 2, False: 86]
  ------------------
 1032|      2|			archive_set_error(&a->archive, ENOMEM,
 1033|      2|			    "Rejecting malformed 7zip archive: "
 1034|      2|			    "symlink contents exceed 1 megabyte");
 1035|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1036|      2|		}
 1037|       |
 1038|       |		/*
 1039|       |		 * Symbolic-name is recorded as its contents. We have to
 1040|       |		 * read the contents at this time.
 1041|       |		 */
 1042|     88|		while (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (1042:10): [True: 3, False: 85]
  ------------------
 1043|      3|			const void *buff;
 1044|      3|			unsigned char *mem;
 1045|      3|			size_t size;
 1046|      3|			int64_t offset;
 1047|       |
 1048|      3|			r = archive_read_format_7zip_read_data(a, &buff,
 1049|      3|				&size, &offset);
 1050|      3|			if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1050:8): [True: 1, False: 2]
  ------------------
 1051|      1|				free(symname);
 1052|      1|				return (r);
 1053|      1|			}
 1054|      2|			mem = realloc(symname, symsize + size + 1);
 1055|      2|			if (mem == NULL) {
  ------------------
  |  Branch (1055:8): [True: 0, False: 2]
  ------------------
 1056|      0|				free(symname);
 1057|      0|				archive_set_error(&a->archive, ENOMEM,
 1058|      0|				    "Can't allocate memory for Symname");
 1059|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1060|      0|			}
 1061|      2|			symname = mem;
 1062|      2|			memcpy(symname+symsize, buff, size);
 1063|      2|			symsize += size;
 1064|      2|		}
 1065|     85|		if (symsize == 0) {
  ------------------
  |  Branch (1065:7): [True: 84, False: 1]
  ------------------
 1066|       |			/* If there is no symname, handle it as a regular
 1067|       |			 * file. */
 1068|     84|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|     84|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1069|     84|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|     84|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1070|     84|			archive_entry_set_mode(entry, zip_entry->mode);
 1071|     84|		} else {
 1072|      1|			struct archive_string_conv* utf8_conv;
 1073|       |
 1074|      1|			symname[symsize] = '\0';
 1075|       |
 1076|       |			/* Symbolic links are embedded as UTF-8 strings */
 1077|      1|			utf8_conv = archive_string_conversion_from_charset(&a->archive,
 1078|      1|			    "UTF-8", 1);
 1079|      1|			if (utf8_conv == NULL) {
  ------------------
  |  Branch (1079:8): [True: 0, False: 1]
  ------------------
 1080|      0|				free(symname);
 1081|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1082|      0|			}
 1083|       |
 1084|      1|			archive_entry_copy_symlink_l(entry, (const char*)symname, symsize,
  ------------------
  |  |   83|      1|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1085|      1|			    utf8_conv);
 1086|      1|		}
 1087|     85|		free(symname);
 1088|     85|		archive_entry_set_size(entry, 0);
 1089|     85|	}
 1090|       |
 1091|  5.67k|	return (ret);
 1092|  5.67k|}
archive_read_support_format_7zip.c:slurp_central_directory:
 3277|  1.85k|{
 3278|  1.85k|	const unsigned char *p;
 3279|  1.85k|	int64_t next_header_offset;
 3280|  1.85k|	int64_t next_header_size;
 3281|  1.85k|	uint32_t next_header_crc;
 3282|  1.85k|	ssize_t bytes_avail;
 3283|  1.85k|	int64_t data_offset;
 3284|  1.85k|	int check_header_crc, r;
 3285|       |
 3286|  1.85k|	if (get_data_offset(a, &data_offset, 1) < 0)
  ------------------
  |  Branch (3286:6): [True: 2, False: 1.85k]
  ------------------
 3287|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3288|  1.85k|	if (__archive_read_consume(a, data_offset) < 0) {
  ------------------
  |  Branch (3288:6): [True: 0, False: 1.85k]
  ------------------
 3289|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3290|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3291|      0|	}
 3292|  1.85k|	if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL) {
  ------------------
  |  Branch (3292:6): [True: 1, False: 1.85k]
  ------------------
 3293|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3294|      1|		    "Truncated 7-Zip file header");
 3295|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3296|      1|	}
 3297|       |
 3298|  1.85k|	if (archive_ckd_add_i64(&zip->seek_base, data_offset, 32)) {
  ------------------
  |  Branch (3298:6): [True: 0, False: 1.85k]
  ------------------
 3299|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3300|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3301|      0|	}
 3302|       |
 3303|  1.85k|	if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0) {
  ------------------
  |  |   67|  1.85k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (3303:6): [True: 0, False: 1.85k]
  ------------------
 3304|      0|		archive_set_error(&a->archive, -1, "Not 7-Zip archive file");
 3305|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3306|      0|	}
 3307|       |
 3308|       |	/* CRC check. */
 3309|  1.85k|	if (crc32(0, p + 12, 20)
  ------------------
  |  Branch (3309:6): [True: 1.79k, False: 63]
  ------------------
 3310|  1.85k|	    != archive_le32dec(p + 8)) {
 3311|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3312|       |		archive_set_error(&a->archive, -1, "Header CRC error");
 3313|       |		return (ARCHIVE_FATAL);
 3314|       |#endif
 3315|  1.79k|	}
 3316|       |
 3317|  1.85k|	next_header_offset = archive_le64dec(p + 12);
 3318|  1.85k|	if (next_header_offset < 0) {
  ------------------
  |  Branch (3318:6): [True: 29, False: 1.82k]
  ------------------
 3319|     29|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3320|     29|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3321|     29|	}
 3322|  1.82k|	next_header_size = archive_le64dec(p + 20);
 3323|  1.82k|	if (next_header_size < 0) {
  ------------------
  |  Branch (3323:6): [True: 34, False: 1.79k]
  ------------------
 3324|     34|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3325|     34|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     34|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3326|     34|	}
 3327|  1.79k|	next_header_crc = archive_le32dec(p + 28);
 3328|       |
 3329|  1.79k|	if (next_header_size == 0)
  ------------------
  |  Branch (3329:6): [True: 2, False: 1.78k]
  ------------------
 3330|       |		/* There is no entry in the archive file. */
 3331|      2|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3332|       |
 3333|  1.78k|	__archive_read_consume(a, 32);
 3334|  1.78k|	if (next_header_offset != 0) {
  ------------------
  |  Branch (3334:6): [True: 1.45k, False: 329]
  ------------------
 3335|  1.45k|		if (bytes_avail >= next_header_offset)
  ------------------
  |  Branch (3335:7): [True: 1.34k, False: 118]
  ------------------
 3336|  1.34k|			__archive_read_consume(a, next_header_offset);
 3337|    118|		else {
 3338|    118|			int64_t target;
 3339|       |
 3340|    118|			if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3340:8): [True: 2, False: 116]
  ------------------
 3341|    118|			    zip->seek_base, next_header_offset) ||
 3342|    118|			    seek_compat(a, target, SEEK_SET, 1) < 0) {
  ------------------
  |  Branch (3342:8): [True: 116, False: 0]
  ------------------
 3343|    118|				archive_set_error(&a->archive,
 3344|    118|				    ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|    118|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3345|    118|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    118|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3346|    118|			}
 3347|    118|		}
 3348|  1.45k|	}
 3349|  1.67k|	zip->stream_offset = next_header_offset;
 3350|  1.67k|	zip->header_offset = next_header_offset;
 3351|  1.67k|	zip->header_bytes_remaining = next_header_size;
 3352|  1.67k|	zip->header_crc32 = 0;
 3353|  1.67k|	zip->header_is_encoded = 0;
 3354|  1.67k|	zip->header_is_being_read = 1;
 3355|  1.67k|	zip->has_encrypted_entries = 0;
 3356|  1.67k|	check_header_crc = 1;
 3357|       |
 3358|  1.67k|	if ((p = header_bytes(a, 1)) == NULL) {
  ------------------
  |  Branch (3358:6): [True: 27, False: 1.64k]
  ------------------
 3359|     27|		archive_set_error(&a->archive,
 3360|     27|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     27|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3361|     27|		    "Truncated 7-Zip file body");
 3362|     27|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     27|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3363|     27|	}
 3364|       |	/* Parse ArchiveProperties. */
 3365|  1.64k|	switch (p[0]) {
 3366|    458|	case kEncodedHeader:
  ------------------
  |  |  144|    458|#define kEncodedHeader		0x17
  ------------------
  |  Branch (3366:2): [True: 458, False: 1.18k]
  ------------------
 3367|       |		/*
 3368|       |		 * The archive has an encoded header and we have to decode it
 3369|       |		 * in order to parse the header correctly.
 3370|       |		 */
 3371|    458|		r = decode_encoded_header_info(a, &(zip->si));
 3372|       |
 3373|       |		/* Check the EncodedHeader CRC.*/
 3374|    458|		if (r == 0 && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3374:7): [True: 391, False: 67]
  |  Branch (3374:17): [True: 346, False: 45]
  ------------------
 3375|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3376|       |			archive_set_error(&a->archive, -1,
 3377|       |			    "Damaged 7-Zip archive");
 3378|       |			r = -1;
 3379|       |#endif
 3380|    346|		}
 3381|    458|		if (r == 0) {
  ------------------
  |  Branch (3381:7): [True: 391, False: 67]
  ------------------
 3382|    391|			if (zip->si.ci.folders[0].digest_defined)
  ------------------
  |  Branch (3382:8): [True: 99, False: 292]
  ------------------
 3383|     99|				next_header_crc = zip->si.ci.folders[0].digest;
 3384|    292|			else
 3385|    292|				check_header_crc = 0;
 3386|    391|			if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3386:8): [True: 391, False: 0]
  ------------------
 3387|    391|				read_consume(a);
 3388|    391|			r = setup_decode_folder(a, zip->si.ci.folders, 1);
 3389|    391|			if (r == 0) {
  ------------------
  |  Branch (3389:8): [True: 361, False: 30]
  ------------------
 3390|    361|				zip->header_bytes_remaining =
 3391|    361|					zip->folder_outbytes_remaining;
 3392|    361|				r = seek_pack(a);
 3393|    361|			}
 3394|    391|		}
 3395|       |		/* Clean up StreamsInfo. */
 3396|    458|		free_StreamsInfo(&(zip->si));
 3397|    458|		memset(&(zip->si), 0, sizeof(zip->si));
 3398|    458|		if (r < 0)
  ------------------
  |  Branch (3398:7): [True: 100, False: 358]
  ------------------
 3399|    100|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    100|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3400|    358|		zip->header_is_encoded = 1;
 3401|    358|		zip->header_crc32 = 0;
 3402|       |		/* FALL THROUGH */
 3403|  1.51k|	case kHeader:
  ------------------
  |  |  123|  1.51k|#define kHeader			0x01
  ------------------
  |  Branch (3403:2): [True: 1.15k, False: 490]
  ------------------
 3404|       |		/*
 3405|       |		 * Parse the header.
 3406|       |		 */
 3407|  1.51k|		errno = 0;
 3408|  1.51k|		r = read_Header(a, header, zip->header_is_encoded);
 3409|  1.51k|		if (r < 0) {
  ------------------
  |  Branch (3409:7): [True: 1.26k, False: 246]
  ------------------
 3410|  1.26k|			if (errno == ENOMEM)
  ------------------
  |  Branch (3410:8): [True: 6, False: 1.25k]
  ------------------
 3411|      6|				archive_set_error(&a->archive, -1,
 3412|      6|				    "Couldn't allocate memory");
 3413|  1.25k|			else
 3414|  1.25k|				archive_set_error(&a->archive, -1,
 3415|  1.25k|				    "Damaged 7-Zip archive");
 3416|  1.26k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.26k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3417|  1.26k|		}
 3418|       |
 3419|       |		/*
 3420|       |		 *  Must be kEnd.
 3421|       |		 */
 3422|    246|		if ((p = header_bytes(a, 1)) == NULL ||*p != kEnd) {
  ------------------
  |  |  122|    238|#define kEnd			0x00
  ------------------
  |  Branch (3422:7): [True: 8, False: 238]
  |  Branch (3422:42): [True: 28, False: 210]
  ------------------
 3423|     36|			archive_set_error(&a->archive, -1,
 3424|     36|			    "Malformed 7-Zip archive");
 3425|     36|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3426|     36|		}
 3427|       |
 3428|       |		/* Check the Header CRC.*/
 3429|    210|		if (check_header_crc && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3429:7): [True: 206, False: 4]
  |  Branch (3429:27): [True: 159, False: 47]
  ------------------
 3430|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3431|       |			archive_set_error(&a->archive, -1,
 3432|       |			    "Malformed 7-Zip archive");
 3433|       |			return (ARCHIVE_FATAL);
 3434|       |#endif
 3435|    159|		}
 3436|    210|		break;
 3437|     32|	default:
  ------------------
  |  Branch (3437:2): [True: 32, False: 1.61k]
  ------------------
 3438|     32|		archive_set_error(&a->archive, -1,
 3439|     32|		    "Unexpected Property ID = %X", p[0]);
 3440|     32|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     32|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3441|  1.64k|	}
 3442|       |
 3443|       |	/* Clean up variables be used for decoding the archive header */
 3444|    210|	zip->pack_stream_remaining = 0;
 3445|    210|	zip->pack_stream_index = 0;
 3446|    210|	zip->folder_outbytes_remaining = 0;
 3447|    210|	zip->uncompressed_buffer_bytes_remaining = 0;
 3448|    210|	zip->pack_stream_bytes_unconsumed = 0;
 3449|    210|	zip->header_is_being_read = 0;
 3450|       |
 3451|    210|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    210|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3452|  1.64k|}
archive_read_support_format_7zip.c:header_bytes:
 3243|  1.19M|{
 3244|  1.19M|	struct _7zip *zip = a->format->data;
 3245|  1.19M|	const unsigned char *p;
 3246|       |
 3247|  1.19M|	if ((uint64_t)zip->header_bytes_remaining < rbytes)
  ------------------
  |  Branch (3247:6): [True: 40, False: 1.19M]
  ------------------
 3248|     40|		return (NULL);
 3249|  1.19M|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3249:6): [True: 1.19M, False: 8.11k]
  ------------------
 3250|  1.19M|		read_consume(a);
 3251|       |
 3252|  1.19M|	if (zip->header_is_encoded == 0) {
  ------------------
  |  Branch (3252:6): [True: 1.19M, False: 4.56k]
  ------------------
 3253|  1.19M|		p = __archive_read_ahead(a, rbytes, NULL);
 3254|  1.19M|		if (p == NULL)
  ------------------
  |  Branch (3254:7): [True: 443, False: 1.19M]
  ------------------
 3255|    443|			return (NULL);
 3256|  1.19M|		zip->header_bytes_remaining -= rbytes;
 3257|  1.19M|		zip->pack_stream_bytes_unconsumed = rbytes;
 3258|  1.19M|	} else {
 3259|  4.56k|		const void *buff;
 3260|  4.56k|		ssize_t bytes;
 3261|       |
 3262|  4.56k|		bytes = read_stream(a, &buff, rbytes, rbytes);
 3263|  4.56k|		if (bytes <= 0)
  ------------------
  |  Branch (3263:7): [True: 213, False: 4.35k]
  ------------------
 3264|    213|			return (NULL);
 3265|  4.35k|		zip->header_bytes_remaining -= bytes;
 3266|  4.35k|		p = buff;
 3267|  4.35k|	}
 3268|       |
 3269|       |	/* Update checksum */
 3270|  1.19M|	zip->header_crc32 = crc32(zip->header_crc32, p, (unsigned)rbytes);
 3271|  1.19M|	return (p);
 3272|  1.19M|}
archive_read_support_format_7zip.c:read_stream:
 3709|  4.73k|{
 3710|  4.73k|	struct _7zip *zip = a->format->data;
 3711|  4.73k|	int64_t skip_bytes = 0;
 3712|  4.73k|	ssize_t r;
 3713|       |
 3714|  4.73k|	if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3714:6): [True: 480, False: 4.25k]
  ------------------
 3715|    480|		if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3715:7): [True: 354, False: 126]
  ------------------
 3716|    354|			r = extract_pack_stream(a, 0);
 3717|    354|			if (r < 0)
  ------------------
  |  Branch (3717:8): [True: 207, False: 147]
  ------------------
 3718|    207|				return (r);
 3719|    147|			return (get_uncompressed_data(a, buff, size, minimum));
 3720|    354|		} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3720:14): [True: 16, False: 110]
  ------------------
 3721|       |			/* Extract a remaining pack stream. */
 3722|     16|			r = extract_pack_stream(a, 0);
 3723|     16|			if (r < 0)
  ------------------
  |  Branch (3723:8): [True: 2, False: 14]
  ------------------
 3724|      2|				return (r);
 3725|     14|			return (get_uncompressed_data(a, buff, size, minimum));
 3726|     16|		}
 3727|    480|	} else
 3728|  4.25k|		return (get_uncompressed_data(a, buff, size, minimum));
 3729|       |
 3730|       |	/*
 3731|       |	 * Current pack stream has been consumed.
 3732|       |	 */
 3733|    110|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3733:6): [True: 110, False: 0]
  ------------------
 3734|    110|		if (zip->header_is_being_read) {
  ------------------
  |  Branch (3734:7): [True: 1, False: 109]
  ------------------
 3735|       |			/* Invalid sequence. This might happen when
 3736|       |			 * reading a malformed archive. */
 3737|      1|			archive_set_error(&(a->archive),
 3738|      1|			    ARCHIVE_ERRNO_MISC, "Malformed 7-Zip archive");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3739|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3740|      1|		}
 3741|       |
 3742|       |		/*
 3743|       |		 * All current folder's pack streams have been
 3744|       |		 * consumed. Switch to next folder.
 3745|       |		 */
 3746|    109|		if (zip->folder_index == 0 &&
  ------------------
  |  Branch (3746:7): [True: 106, False: 3]
  ------------------
 3747|    106|		    (zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
  ------------------
  |  Branch (3747:8): [True: 0, False: 106]
  ------------------
 3748|    106|		     || zip->folder_index != zip->entry->folderIndex)) {
  ------------------
  |  Branch (3748:11): [True: 0, False: 106]
  ------------------
 3749|      0|			zip->folder_index = zip->entry->folderIndex;
 3750|      0|			skip_bytes =
 3751|      0|			    zip->si.ci.folders[zip->folder_index].skipped_bytes;
 3752|      0|		}
 3753|       |
 3754|    109|		if (zip->folder_index >= zip->si.ci.numFolders) {
  ------------------
  |  Branch (3754:7): [True: 0, False: 109]
  ------------------
 3755|       |			/*
 3756|       |			 * We have consumed all folders and its pack streams.
 3757|       |			 */
 3758|      0|			*buff = NULL;
 3759|      0|			return (0);
 3760|      0|		}
 3761|    109|		r = setup_decode_folder(a,
 3762|    109|			&(zip->si.ci.folders[zip->folder_index]), 0);
 3763|    109|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    109|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3763:7): [True: 8, False: 101]
  ------------------
 3764|      8|			return (r);
 3765|       |
 3766|    101|		zip->folder_index++;
 3767|    101|	}
 3768|       |
 3769|       |	/*
 3770|       |	 * Switch to next pack stream.
 3771|       |	 */
 3772|    101|	r = seek_pack(a);
 3773|    101|	if (r < 0)
  ------------------
  |  Branch (3773:6): [True: 3, False: 98]
  ------------------
 3774|      3|		return (r);
 3775|       |
 3776|       |	/* Extract a new pack stream. */
 3777|     98|	r = extract_pack_stream(a, 0);
 3778|     98|	if (r < 0)
  ------------------
  |  Branch (3778:6): [True: 24, False: 74]
  ------------------
 3779|     24|		return (r);
 3780|       |
 3781|       |	/*
 3782|       |	 * Skip the bytes we already have skipped in skip_stream().
 3783|       |	 */
 3784|     74|	while (1) {
  ------------------
  |  Branch (3784:9): [True: 74, Folded]
  ------------------
 3785|     74|		size_t request;
 3786|     74|		ssize_t skipped;
 3787|       |
 3788|     74|		if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3788:7): [True: 6, False: 68]
  ------------------
 3789|      6|			if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3789:8): [True: 0, False: 6]
  ------------------
 3790|      0|				r = extract_pack_stream(a, 0);
 3791|      0|				if (r < 0)
  ------------------
  |  Branch (3791:9): [True: 0, False: 0]
  ------------------
 3792|      0|					return (r);
 3793|      6|			} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3793:15): [True: 6, False: 0]
  ------------------
 3794|       |				/* Extract a remaining pack stream. */
 3795|      6|				r = extract_pack_stream(a, 0);
 3796|      6|				if (r < 0)
  ------------------
  |  Branch (3796:9): [True: 0, False: 6]
  ------------------
 3797|      0|					return (r);
 3798|      6|			} else {
 3799|      0|				archive_set_error(&a->archive,
 3800|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3801|      0|				    "Truncated 7-Zip file body");
 3802|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3803|      0|			}
 3804|      6|		}
 3805|       |
 3806|     74|		if (!skip_bytes)
  ------------------
  |  Branch (3806:7): [True: 74, False: 0]
  ------------------
 3807|     74|			break;
 3808|       |
 3809|      0|		if (skip_bytes > MAX_READ)
  ------------------
  |  |  396|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
  |  Branch (3809:7): [True: 0, False: 0]
  ------------------
 3810|      0|			request = MAX_READ;
  ------------------
  |  |  396|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
 3811|      0|		else
 3812|      0|			request = (size_t)skip_bytes;
 3813|       |
 3814|      0|		skipped = get_uncompressed_data(a, buff, request, 0);
 3815|      0|		if (skipped < 0)
  ------------------
  |  Branch (3815:7): [True: 0, False: 0]
  ------------------
 3816|      0|			return (skipped);
 3817|      0|		skip_bytes -= skipped;
 3818|      0|		if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3818:7): [True: 0, False: 0]
  ------------------
 3819|      0|			read_consume(a);
 3820|      0|	}
 3821|       |
 3822|     74|	return (get_uncompressed_data(a, buff, size, minimum));
 3823|     74|}
archive_read_support_format_7zip.c:extract_pack_stream:
 3520|    542|{
 3521|    542|	struct _7zip *zip = a->format->data;
 3522|    542|	ssize_t bytes_avail;
 3523|    542|	int r;
 3524|       |
 3525|    542|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   95|  1.08k|#define _7Z_COPY	0
  ------------------
  |  Branch (3525:6): [True: 166, False: 376]
  |  Branch (3525:32): [True: 86, False: 80]
  ------------------
 3526|     86|		if (minimum == 0)
  ------------------
  |  Branch (3526:7): [True: 86, False: 0]
  ------------------
 3527|     86|			minimum = 1;
 3528|     86|		if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL
  ------------------
  |  Branch (3528:7): [True: 0, False: 86]
  ------------------
 3529|     86|		    || bytes_avail <= 0) {
  ------------------
  |  Branch (3529:10): [True: 0, False: 86]
  ------------------
 3530|      0|			archive_set_error(&a->archive,
 3531|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3532|      0|			    "Truncated 7-Zip file body");
 3533|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3534|      0|		}
 3535|     86|		if (bytes_avail > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3535:7): [True: 86, False: 0]
  ------------------
 3536|     86|			bytes_avail = (ssize_t)zip->pack_stream_inbytes_remaining;
 3537|     86|		zip->pack_stream_inbytes_remaining -= bytes_avail;
 3538|     86|		if (bytes_avail > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3538:7): [True: 16, False: 70]
  ------------------
 3539|     16|			bytes_avail = (ssize_t)zip->folder_outbytes_remaining;
 3540|     86|		zip->folder_outbytes_remaining -= bytes_avail;
 3541|     86|		zip->uncompressed_buffer_bytes_remaining = bytes_avail;
 3542|     86|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     86|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3543|     86|	}
 3544|       |
 3545|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3546|    456|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3546:6): [True: 354, False: 102]
  ------------------
 3547|    354|		size_t new_size = UBUFF_SIZE;
  ------------------
  |  |  293|    354|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3548|       |
 3549|    354|		if (new_size < minimum)
  ------------------
  |  Branch (3549:7): [True: 0, False: 354]
  ------------------
 3550|      0|		    new_size = align_size(minimum);
 3551|    354|		zip->uncompressed_buffer = malloc(new_size);
 3552|    354|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3552:7): [True: 0, False: 354]
  ------------------
 3553|      0|			archive_set_error(&a->archive, ENOMEM,
 3554|      0|			    "No memory for 7-Zip decompression");
 3555|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3556|      0|		}
 3557|    354|		zip->uncompressed_buffer_size = new_size;
 3558|    354|		zip->uncompressed_buffer_bytes_remaining = 0;
 3559|    354|	} else if (zip->uncompressed_buffer_size < minimum ||
  ------------------
  |  Branch (3559:13): [True: 0, False: 102]
  ------------------
 3560|    102|	    zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3560:6): [True: 0, False: 102]
  ------------------
 3561|       |		/*
 3562|       |		 * Make sure the uncompressed buffer can have bytes
 3563|       |		 * at least `minimum' bytes.
 3564|       |		 * NOTE: This case happen when reading the header.
 3565|       |		 */
 3566|      0|		size_t used;
 3567|      0|		if (zip->uncompressed_buffer_pointer != 0)
  ------------------
  |  Branch (3567:7): [True: 0, False: 0]
  ------------------
 3568|      0|			used = zip->uncompressed_buffer_pointer -
 3569|      0|				zip->uncompressed_buffer;
 3570|      0|		else
 3571|      0|			used = 0;
 3572|      0|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3572:7): [True: 0, False: 0]
  ------------------
 3573|       |			/*
 3574|       |			 * Expand the uncompressed buffer up to
 3575|       |			 * the minimum size.
 3576|       |			 */
 3577|      0|			void *p;
 3578|      0|			size_t new_size = align_size(minimum);
 3579|       |
 3580|      0|			p = realloc(zip->uncompressed_buffer, new_size);
 3581|      0|			if (p == NULL) {
  ------------------
  |  Branch (3581:8): [True: 0, False: 0]
  ------------------
 3582|      0|				archive_set_error(&a->archive, ENOMEM,
 3583|      0|				    "No memory for 7-Zip decompression");
 3584|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3585|      0|			}
 3586|      0|			zip->uncompressed_buffer = (unsigned char *)p;
 3587|      0|			zip->uncompressed_buffer_size = new_size;
 3588|      0|		}
 3589|       |		/*
 3590|       |		 * Move unconsumed bytes to the head.
 3591|       |		 */
 3592|      0|		if (used) {
  ------------------
  |  Branch (3592:7): [True: 0, False: 0]
  ------------------
 3593|      0|			memmove(zip->uncompressed_buffer,
 3594|      0|				zip->uncompressed_buffer + used,
 3595|      0|				zip->uncompressed_buffer_bytes_remaining);
 3596|      0|		}
 3597|      0|	} else
 3598|    102|		zip->uncompressed_buffer_bytes_remaining = 0;
 3599|    456|	zip->uncompressed_buffer_pointer = NULL;
 3600|    682|	for (;;) {
 3601|    682|		size_t bytes_in, bytes_out;
 3602|    682|		const void *buff_in;
 3603|    682|		unsigned char *buff_out;
 3604|    682|		int end_of_data;
 3605|       |
 3606|       |		/*
 3607|       |		 * Note: '1' here is a performance optimization.
 3608|       |		 * Recall that the decompression layer returns a count of
 3609|       |		 * available bytes; asking for more than that forces the
 3610|       |		 * decompressor to combine reads by copying data.
 3611|       |		 */
 3612|    682|		buff_in = __archive_read_ahead(a, 1, &bytes_avail);
 3613|    682|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (3613:7): [True: 0, False: 682]
  ------------------
 3614|      0|			archive_set_error(&a->archive,
 3615|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3616|      0|			    "Truncated 7-Zip file body");
 3617|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3618|      0|		}
 3619|       |
 3620|    682|		buff_out = zip->uncompressed_buffer
 3621|    682|			+ zip->uncompressed_buffer_bytes_remaining;
 3622|    682|		bytes_out = zip->uncompressed_buffer_size
 3623|    682|			- zip->uncompressed_buffer_bytes_remaining;
 3624|    682|		bytes_in = bytes_avail;
 3625|    682|		if (bytes_in > (uint64_t)zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3625:7): [True: 682, False: 0]
  ------------------
 3626|    682|			bytes_in = (size_t)zip->pack_stream_inbytes_remaining;
 3627|       |		/* Drive decompression. */
 3628|    682|		r = decompress(a, zip, buff_out, &bytes_out,
 3629|    682|			buff_in, &bytes_in);
 3630|    682|		switch (r) {
 3631|    440|		case ARCHIVE_OK:
  ------------------
  |  |  233|    440|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3631:3): [True: 440, False: 242]
  ------------------
 3632|    440|			end_of_data = 0;
 3633|    440|			break;
 3634|     47|		case ARCHIVE_EOF:
  ------------------
  |  |  232|     47|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3634:3): [True: 47, False: 635]
  ------------------
 3635|     47|			end_of_data = 1;
 3636|     47|			break;
 3637|    195|		default:
  ------------------
  |  Branch (3637:3): [True: 195, False: 487]
  ------------------
 3638|    195|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    195|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3639|    682|		}
 3640|    487|		zip->pack_stream_inbytes_remaining -= bytes_in;
 3641|    487|		if (bytes_out > (uint64_t)zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3641:7): [True: 153, False: 334]
  ------------------
 3642|    153|			bytes_out = (size_t)zip->folder_outbytes_remaining;
 3643|    487|		zip->folder_outbytes_remaining -= bytes_out;
 3644|    487|		zip->uncompressed_buffer_bytes_remaining += bytes_out;
 3645|    487|		zip->pack_stream_bytes_unconsumed = bytes_in;
 3646|       |
 3647|       |		/*
 3648|       |		 * Continue decompression until uncompressed_buffer is full.
 3649|       |		 */
 3650|    487|		if (zip->uncompressed_buffer_bytes_remaining ==
  ------------------
  |  Branch (3650:7): [True: 3, False: 484]
  ------------------
 3651|    487|		    zip->uncompressed_buffer_size)
 3652|      3|			break;
 3653|    484|		if (zip->codec2 == _7Z_X86 && zip->odd_bcj_size &&
  ------------------
  |  |  107|    968|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (3653:7): [True: 59, False: 425]
  |  Branch (3653:33): [True: 39, False: 20]
  ------------------
 3654|     39|		    zip->uncompressed_buffer_bytes_remaining + 5 >
  ------------------
  |  Branch (3654:7): [True: 0, False: 39]
  ------------------
 3655|     39|		    zip->uncompressed_buffer_size)
 3656|      0|			break;
 3657|    484|		if (zip->pack_stream_inbytes_remaining == 0 &&
  ------------------
  |  Branch (3657:7): [True: 471, False: 13]
  ------------------
 3658|    471|		    zip->folder_outbytes_remaining == 0)
  ------------------
  |  Branch (3658:7): [True: 218, False: 253]
  ------------------
 3659|    218|			break;
 3660|    266|		if (end_of_data || (bytes_in == 0 && bytes_out == 0)) {
  ------------------
  |  Branch (3660:7): [True: 35, False: 231]
  |  Branch (3660:23): [True: 5, False: 226]
  |  Branch (3660:40): [True: 5, False: 0]
  ------------------
 3661|     40|			archive_set_error(&(a->archive),
 3662|     40|			    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|     40|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3663|     40|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     40|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3664|     40|		}
 3665|    226|		read_consume(a);
 3666|    226|	}
 3667|    221|	if (zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3667:6): [True: 0, False: 221]
  ------------------
 3668|      0|		archive_set_error(&(a->archive),
 3669|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3670|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3671|      0|	}
 3672|    221|	zip->uncompressed_buffer_pointer = zip->uncompressed_buffer;
 3673|    221|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    221|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3674|    221|}
archive_read_support_format_7zip.c:decompress:
 1668|    682|{
 1669|    682|	const uint8_t *t_next_in;
 1670|    682|	uint8_t *t_next_out;
 1671|    682|	size_t o_avail_in, o_avail_out;
 1672|    682|	size_t t_avail_in, t_avail_out;
 1673|    682|	uint8_t *bcj2_next_out;
 1674|    682|	size_t bcj2_avail_out;
 1675|    682|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    682|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1676|       |
 1677|    682|	t_avail_in = o_avail_in = *used;
 1678|    682|	t_avail_out = o_avail_out = *outbytes;
 1679|    682|	t_next_in = b;
 1680|    682|	t_next_out = buff;
 1681|       |
 1682|    682|	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |   97|  1.36k|#define _7Z_LZMA2	0x21
  ------------------
              	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |  107|    639|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1682:6): [True: 639, False: 43]
  |  Branch (1682:33): [True: 59, False: 580]
  ------------------
 1683|     59|		int i;
 1684|       |
 1685|       |		/* Do not copy out the BCJ remaining bytes when the output
 1686|       |		 * buffer size is less than five bytes. */
 1687|     59|		if (o_avail_in != 0 && t_avail_out < 5 && zip->odd_bcj_size) {
  ------------------
  |  Branch (1687:7): [True: 41, False: 18]
  |  Branch (1687:26): [True: 0, False: 41]
  |  Branch (1687:45): [True: 0, False: 0]
  ------------------
 1688|      0|			*used = 0;
 1689|      0|			*outbytes = 0;
 1690|      0|			return (ret);
 1691|      0|		}
 1692|    123|		for (i = 0; zip->odd_bcj_size > 0 && t_avail_out; i++) {
  ------------------
  |  Branch (1692:15): [True: 64, False: 59]
  |  Branch (1692:40): [True: 64, False: 0]
  ------------------
 1693|     64|			*t_next_out++ = zip->odd_bcj[i];
 1694|     64|			t_avail_out--;
 1695|     64|			zip->odd_bcj_size--;
 1696|     64|		}
 1697|     59|		if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1697:7): [True: 18, False: 41]
  |  Branch (1697:26): [True: 0, False: 41]
  ------------------
 1698|     18|			*used = o_avail_in - t_avail_in;
 1699|     18|			*outbytes = o_avail_out - t_avail_out;
 1700|     18|			if (o_avail_in == 0)
  ------------------
  |  Branch (1700:8): [True: 18, False: 0]
  ------------------
 1701|     18|				ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     18|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1702|     18|			return (ret);
 1703|     18|		}
 1704|     59|	}
 1705|       |
 1706|    664|	bcj2_next_out = t_next_out;
 1707|    664|	bcj2_avail_out = t_avail_out;
 1708|    664|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  108|    664|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1708:6): [True: 23, False: 641]
  ------------------
 1709|       |		/*
 1710|       |		 * Decode a remaining decompressed main stream for BCJ2.
 1711|       |		 */
 1712|     23|		if (zip->tmp_stream_bytes_remaining) {
  ------------------
  |  Branch (1712:7): [True: 0, False: 23]
  ------------------
 1713|      0|			ssize_t bytes;
 1714|      0|			size_t remaining = zip->tmp_stream_bytes_remaining;
 1715|      0|			bytes = Bcj2_Decode(zip, t_next_out, t_avail_out);
 1716|      0|			if (bytes < 0) {
  ------------------
  |  Branch (1716:8): [True: 0, False: 0]
  ------------------
 1717|      0|				archive_set_error(&(a->archive),
 1718|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1719|      0|				    "BCJ2 conversion failed");
 1720|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1721|      0|			}
 1722|      0|			zip->main_stream_bytes_remaining -=
 1723|      0|			    remaining - zip->tmp_stream_bytes_remaining;
 1724|      0|			t_avail_out -= bytes;
 1725|      0|			if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1725:8): [True: 0, False: 0]
  |  Branch (1725:27): [True: 0, False: 0]
  ------------------
 1726|      0|				*used = 0;
 1727|      0|				*outbytes = o_avail_out - t_avail_out;
 1728|      0|				if (o_avail_in == 0 &&
  ------------------
  |  Branch (1728:9): [True: 0, False: 0]
  ------------------
 1729|      0|				    zip->tmp_stream_bytes_remaining)
  ------------------
  |  Branch (1729:9): [True: 0, False: 0]
  ------------------
 1730|      0|					ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1731|      0|				return (ret);
 1732|      0|			}
 1733|      0|			t_next_out += bytes;
 1734|      0|			bcj2_next_out = t_next_out;
 1735|      0|			bcj2_avail_out = t_avail_out;
 1736|      0|		}
 1737|     23|		t_next_out = zip->tmp_stream_buff;
 1738|     23|		t_avail_out = zip->tmp_stream_buff_size;
 1739|     23|	}
 1740|       |
 1741|    664|	switch (zip->codec) {
 1742|     94|	case _7Z_COPY:
  ------------------
  |  |   95|     94|#define _7Z_COPY	0
  ------------------
  |  Branch (1742:2): [True: 94, False: 570]
  ------------------
 1743|     94|	{
 1744|     94|		size_t bytes = (t_avail_in > t_avail_out) ?
  ------------------
  |  Branch (1744:18): [True: 0, False: 94]
  ------------------
 1745|     94|		    t_avail_out : t_avail_in;
 1746|       |
 1747|     94|		memcpy(t_next_out, t_next_in, bytes);
 1748|     94|		t_avail_in -= bytes;
 1749|     94|		t_avail_out -= bytes;
 1750|     94|		if (o_avail_in == 0)
  ------------------
  |  Branch (1750:7): [True: 15, False: 79]
  ------------------
 1751|     15|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     15|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1752|     94|		break;
 1753|      0|	}
 1754|      0|#ifdef HAVE_LZMA_H
 1755|    177|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   96|    134|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   97|    177|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1755:2): [True: 134, False: 530]
  |  Branch (1755:17): [True: 43, False: 621]
  ------------------
 1756|    177|		zip->lzstream.next_in = t_next_in;
 1757|    177|		zip->lzstream.avail_in = t_avail_in;
 1758|    177|		zip->lzstream.next_out = t_next_out;
 1759|    177|		zip->lzstream.avail_out = t_avail_out;
 1760|       |
 1761|    177|		r = lzma_code(&(zip->lzstream), LZMA_RUN);
 1762|    177|		switch (r) {
 1763|     23|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1763:3): [True: 23, False: 154]
  ------------------
 1764|     23|			lzma_end(&(zip->lzstream));
 1765|     23|			zip->lzstream_valid = 0;
 1766|     23|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     23|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1767|     23|			break;
 1768|    150|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1768:3): [True: 150, False: 27]
  ------------------
 1769|    150|			break;
 1770|      4|		default:
  ------------------
  |  Branch (1770:3): [True: 4, False: 173]
  ------------------
 1771|      4|			archive_set_error(&(a->archive),
 1772|      4|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1773|      4|				"Decompression failed (%d)",
 1774|      4|			    r);
 1775|      4|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1776|    177|		}
 1777|    173|		t_avail_in = zip->lzstream.avail_in;
 1778|    173|		t_avail_out = zip->lzstream.avail_out;
 1779|    173|		break;
 1780|      0|#endif
 1781|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1782|      0|	case _7Z_BZ2:
  ------------------
  |  |   99|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1782:2): [True: 0, False: 664]
  ------------------
 1783|      0|		if (t_avail_in > UINT_MAX)
  ------------------
  |  Branch (1783:7): [True: 0, False: 0]
  ------------------
 1784|      0|			t_avail_in = UINT_MAX;
 1785|      0|		if (t_avail_out > UINT_MAX)
  ------------------
  |  Branch (1785:7): [True: 0, False: 0]
  ------------------
 1786|      0|			t_avail_out = UINT_MAX;
 1787|      0|		zip->bzstream.next_in = (char *)(uintptr_t)t_next_in;
 1788|      0|		zip->bzstream.avail_in = (unsigned int)t_avail_in;
 1789|      0|		zip->bzstream.next_out = (char *)(uintptr_t)t_next_out;
 1790|      0|		zip->bzstream.avail_out = (unsigned int)t_avail_out;
 1791|      0|		r = BZ2_bzDecompress(&(zip->bzstream));
 1792|      0|		switch (r) {
 1793|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1793:3): [True: 0, False: 0]
  ------------------
 1794|      0|			switch (BZ2_bzDecompressEnd(&(zip->bzstream))) {
 1795|      0|			case BZ_OK:
  ------------------
  |  Branch (1795:4): [True: 0, False: 0]
  ------------------
 1796|      0|				break;
 1797|      0|			default:
  ------------------
  |  Branch (1797:4): [True: 0, False: 0]
  ------------------
 1798|      0|				archive_set_error(&(a->archive),
 1799|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1800|      0|				    "Failed to clean up decompressor");
 1801|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1802|      0|			}
 1803|      0|			zip->bzstream_valid = 0;
 1804|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1805|      0|			break;
 1806|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1806:3): [True: 0, False: 0]
  ------------------
 1807|      0|			break;
 1808|      0|		default:
  ------------------
  |  Branch (1808:3): [True: 0, False: 0]
  ------------------
 1809|      0|			archive_set_error(&(a->archive),
 1810|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1811|      0|			    "bzip decompression failed");
 1812|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1813|      0|		}
 1814|      0|		t_avail_in = zip->bzstream.avail_in;
 1815|      0|		t_avail_out = zip->bzstream.avail_out;
 1816|      0|		break;
 1817|      0|#endif
 1818|      0|#ifdef HAVE_ZLIB_H
 1819|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   98|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1819:2): [True: 0, False: 664]
  ------------------
 1820|      0|		if (t_avail_in > UINT_MAX)
  ------------------
  |  Branch (1820:7): [True: 0, False: 0]
  ------------------
 1821|      0|			t_avail_in = UINT_MAX;
 1822|      0|		if (t_avail_out > UINT_MAX)
  ------------------
  |  Branch (1822:7): [True: 0, False: 0]
  ------------------
 1823|      0|			t_avail_out = UINT_MAX;
 1824|      0|		zip->stream.next_in = (Bytef *)(uintptr_t)t_next_in;
 1825|      0|		zip->stream.avail_in = (uInt)t_avail_in;
 1826|      0|		zip->stream.next_out = t_next_out;
 1827|      0|		zip->stream.avail_out = (uInt)t_avail_out;
 1828|      0|		r = inflate(&(zip->stream), 0);
 1829|      0|		switch (r) {
 1830|      0|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1830:3): [True: 0, False: 0]
  ------------------
 1831|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1832|      0|			break;
 1833|      0|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1833:3): [True: 0, False: 0]
  ------------------
 1834|      0|			break;
 1835|      0|		default:
  ------------------
  |  Branch (1835:3): [True: 0, False: 0]
  ------------------
 1836|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1837|      0|			    "File decompression failed (%d)", r);
 1838|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1839|      0|		}
 1840|      0|		t_avail_in = zip->stream.avail_in;
 1841|      0|		t_avail_out = zip->stream.avail_out;
 1842|      0|		break;
 1843|      0|#endif
 1844|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1845|       |	case _7Z_ZSTD:
 1846|       |	{
 1847|       |		/* src, size, pos */
 1848|       |		ZSTD_inBuffer input = { t_next_in, t_avail_in, 0 };
 1849|       |		/* dst, size, pos */
 1850|       |		ZSTD_outBuffer output = { t_next_out, t_avail_out, 0 };
 1851|       |
 1852|       |		size_t const zret = ZSTD_decompressStream(zip->zstd_dstream,
 1853|       |		    &output, &input);
 1854|       |		if (ZSTD_isError(zret)) {
 1855|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1856|       |			    "Zstd decompression failed: %s",
 1857|       |			    ZSTD_getErrorName(zret));
 1858|       |			return ARCHIVE_FAILED;
 1859|       |		}
 1860|       |		t_avail_in -= input.pos;
 1861|       |		t_avail_out -= output.pos;
 1862|       |		break;
 1863|       |	}
 1864|       |#endif
 1865|    393|	case _7Z_PPMD:
  ------------------
  |  |  100|    393|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1865:2): [True: 393, False: 271]
  ------------------
 1866|    393|	{
 1867|    393|		int64_t flush_bytes;
 1868|       |
 1869|    393|		if (!zip->ppmd7_valid || zip->ppmd7_stat < 0 ||
  ------------------
  |  Branch (1869:7): [True: 0, False: 393]
  |  Branch (1869:28): [True: 0, False: 393]
  ------------------
 1870|    393|		    t_avail_out <= 0) {
  ------------------
  |  Branch (1870:7): [True: 0, False: 393]
  ------------------
 1871|      0|			archive_set_error(&(a->archive),
 1872|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1873|      0|			    "Decompression internal error");
 1874|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1875|      0|		}
 1876|    393|		zip->ppstream.next_in = t_next_in;
 1877|    393|		zip->ppstream.avail_in = t_avail_in;
 1878|    393|		zip->ppstream.stream_in = 0;
 1879|    393|		zip->ppstream.next_out = t_next_out;
 1880|    393|		zip->ppstream.avail_out = t_avail_out;
 1881|    393|		if (zip->ppmd7_stat == 0) {
  ------------------
  |  Branch (1881:7): [True: 204, False: 189]
  ------------------
 1882|    204|			zip->bytein.a = a;
 1883|    204|			zip->bytein.Read = &ppmd_read;
 1884|    204|			zip->range_dec.Stream = &zip->bytein;
 1885|    204|			r = __archive_ppmd7_functions.Ppmd7z_RangeDec_Init(
 1886|    204|				&(zip->range_dec));
 1887|    204|			if (r == 0) {
  ------------------
  |  Branch (1887:8): [True: 1, False: 203]
  ------------------
 1888|      1|				zip->ppmd7_stat = -1;
 1889|      1|				archive_set_error(&a->archive,
 1890|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1891|      1|				    "Failed to initialize PPMd range decoder");
 1892|      1|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1893|      1|			}
 1894|    203|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1894:8): [True: 0, False: 203]
  ------------------
 1895|      0|				zip->ppmd7_stat = -1;
 1896|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1897|      0|			}
 1898|    203|			zip->ppmd7_stat = 1;
 1899|    203|		}
 1900|       |
 1901|    392|		if (t_avail_in == 0)
  ------------------
  |  Branch (1901:7): [True: 180, False: 212]
  ------------------
 1902|       |			/* XXX Flush out remaining decoded data XXX */
 1903|    180|			flush_bytes = zip->folder_outbytes_remaining;
 1904|    212|		else
 1905|    212|			flush_bytes = 0;
 1906|       |
 1907|  2.24M|		do {
 1908|  2.24M|			int sym;
 1909|       |
 1910|  2.24M|			sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
 1911|  2.24M|				&(zip->ppmd7_context), &(zip->range_dec.p));
 1912|  2.24M|			if (sym < 0) {
  ------------------
  |  Branch (1912:8): [True: 38, False: 2.24M]
  ------------------
 1913|     38|				zip->ppmd7_stat = -1;
 1914|     38|				archive_set_error(&a->archive,
 1915|     38|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     38|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1916|     38|				    "Failed to decode PPMd");
 1917|     38|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     38|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1918|     38|			}
 1919|  2.24M|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1919:8): [True: 139, False: 2.24M]
  ------------------
 1920|    139|				zip->ppmd7_stat = -1;
 1921|    139|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    139|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1922|    139|			}
 1923|  2.24M|			*zip->ppstream.next_out++ = (unsigned char)sym;
 1924|  2.24M|			zip->ppstream.avail_out--;
 1925|  2.24M|			if (flush_bytes > 0)
  ------------------
  |  Branch (1925:8): [True: 560k, False: 1.68M]
  ------------------
 1926|   560k|				flush_bytes--;
 1927|  2.24M|		} while (zip->ppstream.avail_out &&
  ------------------
  |  Branch (1927:12): [True: 2.24M, False: 13]
  ------------------
 1928|  2.24M|			(zip->ppstream.avail_in || flush_bytes));
  ------------------
  |  Branch (1928:5): [True: 1.68M, False: 560k]
  |  Branch (1928:31): [True: 560k, False: 202]
  ------------------
 1929|       |
 1930|    215|		t_avail_in = zip->ppstream.avail_in;
 1931|    215|		t_avail_out = zip->ppstream.avail_out;
 1932|    215|		break;
 1933|    392|	}
 1934|      0|	default:
  ------------------
  |  Branch (1934:2): [True: 0, False: 664]
  ------------------
 1935|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1936|      0|		    "Decompression internal error");
 1937|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1938|    664|	}
 1939|    482|	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  233|    964|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  232|     38|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1939:6): [True: 38, False: 444]
  |  Branch (1939:27): [True: 0, False: 38]
  ------------------
 1940|      0|		return (ret);
 1941|       |
 1942|    482|	*used = o_avail_in - t_avail_in;
 1943|    482|	*outbytes = o_avail_out - t_avail_out;
 1944|       |
 1945|       |	/*
 1946|       |	 * Decode BCJ.
 1947|       |	 */
 1948|    482|	if (zip->codec != _7Z_LZMA2) {
  ------------------
  |  |   97|    482|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1948:6): [True: 440, False: 42]
  ------------------
 1949|    440|		if (zip->codec2 == _7Z_X86) {
  ------------------
  |  |  107|    440|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1949:7): [True: 41, False: 399]
  ------------------
 1950|     41|			size_t l = x86_Convert(zip, buff, *outbytes);
 1951|       |
 1952|     41|			zip->odd_bcj_size = *outbytes - l;
 1953|     41|			if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
  ------------------
  |  Branch (1953:8): [True: 40, False: 1]
  |  Branch (1953:33): [True: 40, False: 0]
  ------------------
 1954|     40|			    o_avail_in && ret != ARCHIVE_EOF) {
  ------------------
  |  |  232|     40|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1954:8): [True: 40, False: 0]
  |  Branch (1954:22): [True: 39, False: 1]
  ------------------
 1955|     39|				memcpy(zip->odd_bcj,
 1956|     39|				    ((unsigned char *)buff) + l,
 1957|     39|				    zip->odd_bcj_size);
 1958|     39|				*outbytes = l;
 1959|     39|			} else
 1960|      2|				zip->odd_bcj_size = 0;
 1961|    399|		} else if (zip->codec2 == _7Z_ARM) {
  ------------------
  |  |  111|    399|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1961:14): [True: 13, False: 386]
  ------------------
 1962|     13|			*outbytes = arm_Convert(zip, buff, *outbytes);
 1963|    386|		} else if (zip->codec2 == _7Z_ARM64) {
  ------------------
  |  |  113|    386|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1963:14): [True: 31, False: 355]
  ------------------
 1964|     31|			*outbytes = arm64_Convert(zip, buff, *outbytes);
 1965|    355|		} else if (zip->codec2 == _7Z_SPARC) {
  ------------------
  |  |  115|    355|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1965:14): [True: 16, False: 339]
  ------------------
 1966|     16|			*outbytes = sparc_Convert(zip, buff, *outbytes);
 1967|    339|		} else if (zip->codec2 == _7Z_POWERPC) {
  ------------------
  |  |  109|    339|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1967:14): [True: 18, False: 321]
  ------------------
 1968|     18|			*outbytes = powerpc_Convert(zip, buff, *outbytes);
 1969|     18|		}
 1970|    440|	}
 1971|       |
 1972|       |	/*
 1973|       |	 * Decode BCJ2 with a decompressed main stream.
 1974|       |	 */
 1975|    482|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  108|    482|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1975:6): [True: 23, False: 459]
  ------------------
 1976|     23|		ssize_t bytes;
 1977|       |
 1978|     23|		zip->tmp_stream_bytes_avail =
 1979|     23|		    zip->tmp_stream_buff_size - t_avail_out;
 1980|     23|		if (zip->tmp_stream_bytes_avail >
  ------------------
  |  Branch (1980:7): [True: 4, False: 19]
  ------------------
 1981|     23|		      (uint64_t)zip->main_stream_bytes_remaining)
 1982|      4|			zip->tmp_stream_bytes_avail =
 1983|      4|			    zip->main_stream_bytes_remaining;
 1984|     23|		zip->tmp_stream_bytes_remaining = zip->tmp_stream_bytes_avail;
 1985|     23|		bytes = Bcj2_Decode(zip, bcj2_next_out, bcj2_avail_out);
 1986|     23|		if (bytes < 0) {
  ------------------
  |  Branch (1986:7): [True: 13, False: 10]
  ------------------
 1987|     13|			archive_set_error(&(a->archive),
 1988|     13|			    ARCHIVE_ERRNO_MISC, "BCJ2 conversion failed");
  ------------------
  |  |  204|     13|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1989|     13|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     13|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1990|     13|		}
 1991|     10|		zip->main_stream_bytes_remaining -=
 1992|     10|		    zip->tmp_stream_bytes_avail
 1993|     10|		      - zip->tmp_stream_bytes_remaining;
 1994|     10|		bcj2_avail_out -= bytes;
 1995|     10|		*outbytes = o_avail_out - bcj2_avail_out;
 1996|     10|	}
 1997|       |
 1998|    469|	return (ret);
 1999|    482|}
archive_read_support_format_7zip.c:Bcj2_Decode:
 4488|     23|{
 4489|     23|	size_t inPos = 0, outPos = 0;
 4490|     23|	const uint8_t *buf0, *buf1, *buf2, *buf3;
 4491|     23|	size_t size0, size1, size2, size3;
 4492|     23|	const uint8_t *buffer, *bufferLim;
 4493|     23|	size_t i, j;
 4494|       |
 4495|     23|	size0 = zip->tmp_stream_bytes_remaining;
 4496|     23|	buf0 = zip->tmp_stream_buff + zip->tmp_stream_bytes_avail - size0;
 4497|     23|	size1 = zip->sub_stream_bytes_remaining[0];
 4498|     23|	buf1 = zip->sub_stream_buff[0] + zip->sub_stream_size[0] - size1;
 4499|     23|	size2 = zip->sub_stream_bytes_remaining[1];
 4500|     23|	buf2 = zip->sub_stream_buff[1] + zip->sub_stream_size[1] - size2;
 4501|     23|	size3 = zip->sub_stream_bytes_remaining[2];
 4502|     23|	buf3 = zip->sub_stream_buff[2] + zip->sub_stream_size[2] - size3;
 4503|       |
 4504|     23|	buffer = buf3;
 4505|     23|	bufferLim = buffer + size3;
 4506|       |
 4507|     23|	if (zip->bcj_state == 0) {
  ------------------
  |  Branch (4507:6): [True: 21, False: 2]
  ------------------
 4508|       |		/*
 4509|       |		 * Initialize.
 4510|       |		 */
 4511|     21|		zip->bcj2_prevByte = 0;
 4512|     21|		for (i = 0;
 4513|  5.43k|		    i < sizeof(zip->bcj2_p) / sizeof(zip->bcj2_p[0]); i++)
  ------------------
  |  Branch (4513:7): [True: 5.41k, False: 21]
  ------------------
 4514|  5.41k|			zip->bcj2_p[i] = kBitModelTotal >> 1;
  ------------------
  |  | 4463|  5.41k|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  ------------------
  |  |  |  | 4462|  5.41k|#define kNumBitModelTotalBits 11
  |  |  ------------------
  ------------------
 4515|     21|		RC_INIT2;
  ------------------
  |  | 4468|     21|#define RC_INIT2 do {							\
  |  | 4469|     21|	zip->bcj2_code = 0;						\
  |  | 4470|     21|	zip->bcj2_range = 0xFFFFFFFF;					\
  |  | 4471|     21|	{								\
  |  | 4472|     21|		int ii;							\
  |  | 4473|    126|		for (ii = 0; ii < 5; ii++) {				\
  |  |  ------------------
  |  |  |  Branch (4473:16): [True: 105, False: 21]
  |  |  ------------------
  |  | 4474|    105|			RC_TEST;					\
  |  |  ------------------
  |  |  |  | 4467|    105|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4454|      0|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4467:23): [True: 0, False: 105]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4475|    105|			zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; \
  |  |  ------------------
  |  |  |  | 4466|    105|#define RC_READ_BYTE (*buffer++)
  |  |  ------------------
  |  | 4476|    105|		}							\
  |  | 4477|     21|	}								\
  |  | 4478|     21|} while (0)
  |  |  ------------------
  |  |  |  Branch (4478:10): [Folded, False: 21]
  |  |  ------------------
  ------------------
 4516|     21|		zip->bcj_state = 1;
 4517|     21|	}
 4518|       |
 4519|       |	/*
 4520|       |	 * Gather the odd bytes of a previous call.
 4521|       |	 */
 4522|     23|	for (i = 0; zip->odd_bcj_size > 0 && outPos < outSize; i++) {
  ------------------
  |  Branch (4522:14): [True: 0, False: 23]
  |  Branch (4522:39): [True: 0, False: 0]
  ------------------
 4523|      0|		outBuf[outPos++] = zip->odd_bcj[i];
 4524|      0|		zip->odd_bcj_size--;
 4525|      0|	}
 4526|       |
 4527|     23|	if (outSize == 0) {
  ------------------
  |  Branch (4527:6): [True: 0, False: 23]
  ------------------
 4528|      0|		zip->bcj2_outPos += outPos;
 4529|      0|		return (outPos);
 4530|      0|	}
 4531|       |
 4532|    100|	for (;;) {
 4533|    100|		uint8_t b;
 4534|    100|		CProb *prob;
  ------------------
  |  |  375|    100|#define CProb uint16_t
  ------------------
 4535|    100|		uint32_t bound;
 4536|    100|		uint32_t ttt;
 4537|       |
 4538|    100|		size_t limit = size0 - inPos;
 4539|    100|		if (outSize - outPos < limit)
  ------------------
  |  Branch (4539:7): [True: 0, False: 100]
  ------------------
 4540|      0|			limit = outSize - outPos;
 4541|       |
 4542|    100|		if (zip->bcj_state == 1) {
  ------------------
  |  Branch (4542:7): [True: 100, False: 0]
  ------------------
 4543|    683|			while (limit != 0) {
  ------------------
  |  Branch (4543:11): [True: 673, False: 10]
  ------------------
 4544|    673|				uint8_t bb = buf0[inPos];
 4545|    673|				outBuf[outPos++] = bb;
 4546|    673|				if (IsJ(zip->bcj2_prevByte, bb)) {
  ------------------
  |  | 4457|    673|#define IsJ(b0, b1) ((b1 & 0xFE) == 0xE8 || IsJcc(b0, b1))
  |  |  ------------------
  |  |  |  | 4456|    615|#define IsJcc(b0, b1) ((b0) == 0x0F && ((b1) & 0xF0) == 0x80)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4456:24): [True: 128, False: 487]
  |  |  |  |  |  Branch (4456:40): [True: 32, False: 96]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (4457:22): [True: 58, False: 615]
  |  |  ------------------
  ------------------
 4547|     90|					zip->bcj_state = 2;
 4548|     90|					break;
 4549|     90|				}
 4550|    583|				inPos++;
 4551|    583|				zip->bcj2_prevByte = bb;
 4552|    583|				limit--;
 4553|    583|			}
 4554|    100|		}
 4555|       |
 4556|    100|		if (limit == 0 || outPos == outSize)
  ------------------
  |  Branch (4556:7): [True: 10, False: 90]
  |  Branch (4556:21): [True: 0, False: 90]
  ------------------
 4557|     10|			break;
 4558|     90|		zip->bcj_state = 1;
 4559|       |
 4560|     90|		b = buf0[inPos++];
 4561|       |
 4562|     90|		if (b == 0xE8)
  ------------------
  |  Branch (4562:7): [True: 27, False: 63]
  ------------------
 4563|     27|			prob = zip->bcj2_p + zip->bcj2_prevByte;
 4564|     63|		else if (b == 0xE9)
  ------------------
  |  Branch (4564:12): [True: 31, False: 32]
  ------------------
 4565|     31|			prob = zip->bcj2_p + 256;
 4566|     32|		else
 4567|     32|			prob = zip->bcj2_p + 257;
 4568|       |
 4569|     90|		IF_BIT_0(prob) {
  ------------------
  |  | 4482|     90|#define IF_BIT_0(p) ttt = *(p); bound = (zip->bcj2_range >> kNumBitModelTotalBits) * ttt; if (zip->bcj2_code < bound)
  |  |  ------------------
  |  |  |  | 4462|     90|#define kNumBitModelTotalBits 11
  |  |  ------------------
  |  |  |  Branch (4482:95): [True: 80, False: 10]
  |  |  ------------------
  ------------------
 4570|     80|			UPDATE_0(prob)
  ------------------
  |  | 4483|     80|#define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4463|     80|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  |  |  ------------------
  |  |  |  |  |  | 4462|     80|#define kNumBitModelTotalBits 11
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4464|     80|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4480|     80|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4460|     80|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4459|     80|#define kNumTopBits 24
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4467|      3|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4454|      3|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (4467:23): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4466|      0|#define RC_READ_BYTE (*buffer++)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4480:23): [True: 3, False: 77]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4571|     77|			zip->bcj2_prevByte = b;
 4572|     77|		} else {
 4573|     10|			uint32_t dest;
 4574|     10|			const uint8_t *v;
 4575|     10|			uint8_t out[4];
 4576|       |
 4577|     10|			UPDATE_1(prob)
  ------------------
  |  | 4484|     10|#define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4464|     10|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4480|     10|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4460|     10|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4459|     10|#define kNumTopBits 24
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4467|      1|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4454|      1|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (4467:23): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4466|      0|#define RC_READ_BYTE (*buffer++)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4480:23): [True: 1, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4578|      9|			if (b == 0xE8) {
  ------------------
  |  Branch (4578:8): [True: 3, False: 6]
  ------------------
 4579|      3|				v = buf1;
 4580|      3|				if (size1 < 4)
  ------------------
  |  Branch (4580:9): [True: 3, False: 0]
  ------------------
 4581|      3|					return SZ_ERROR_DATA;
  ------------------
  |  | 4454|      3|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  ------------------
  |  |  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  ------------------
  ------------------
 4582|      0|				buf1 += 4;
 4583|      0|				size1 -= 4;
 4584|      6|			} else {
 4585|      6|				v = buf2;
 4586|      6|				if (size2 < 4)
  ------------------
  |  Branch (4586:9): [True: 6, False: 0]
  ------------------
 4587|      6|					return SZ_ERROR_DATA;
  ------------------
  |  | 4454|      6|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  ------------------
  |  |  |  |  237|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  ------------------
  ------------------
 4588|      0|				buf2 += 4;
 4589|      0|				size2 -= 4;
 4590|      0|			}
 4591|      0|			dest = archive_be32dec(v) -
 4592|      0|			    (zip->bcj2_outPos + outPos + 4);
 4593|      0|			archive_le32enc(out, dest);
 4594|      0|			zip->bcj2_prevByte = out[3];
 4595|       |
 4596|      0|			for (i = 0; i < 4 && outPos < outSize; i++)
  ------------------
  |  Branch (4596:16): [True: 0, False: 0]
  |  Branch (4596:25): [True: 0, False: 0]
  ------------------
 4597|      0|				outBuf[outPos++] = out[i];
 4598|      0|			if (i < 4) {
  ------------------
  |  Branch (4598:8): [True: 0, False: 0]
  ------------------
 4599|       |				/*
 4600|       |				 * Save odd bytes which we could not add into
 4601|       |				 * the output buffer because of out of space.
 4602|       |				 */
 4603|      0|				zip->odd_bcj_size = 4 - i;
 4604|      0|				for (; i < 4; i++) {
  ------------------
  |  Branch (4604:12): [True: 0, False: 0]
  ------------------
 4605|      0|					j = i - 4 + (unsigned)zip->odd_bcj_size;
 4606|      0|					zip->odd_bcj[j] = out[i];
 4607|      0|				}
 4608|      0|				break;
 4609|      0|			}
 4610|      0|		}
 4611|     90|	}
 4612|     10|	zip->tmp_stream_bytes_remaining -= inPos;
 4613|     10|	zip->sub_stream_bytes_remaining[0] = size1;
 4614|     10|	zip->sub_stream_bytes_remaining[1] = size2;
 4615|     10|	zip->sub_stream_bytes_remaining[2] = bufferLim - buffer;
 4616|     10|	zip->bcj2_outPos += outPos;
 4617|       |
 4618|     10|	return ((ssize_t)outPos);
 4619|     23|}
archive_read_support_format_7zip.c:ppmd_read:
 1294|   216k|{
 1295|   216k|	struct archive_read *a = ((IByteIn*)p)->a;
 1296|   216k|	struct _7zip *zip = a->format->data;
 1297|   216k|	Byte b;
 1298|       |
 1299|   216k|	if (zip->ppstream.avail_in == 0) {
  ------------------
  |  Branch (1299:6): [True: 196k, False: 19.5k]
  ------------------
 1300|       |		/*
 1301|       |		 * Ppmd7_DecodeSymbol might require reading multiple bytes
 1302|       |		 * and we are on boundary;
 1303|       |		 * last resort to read using __archive_read_ahead.
 1304|       |		 */
 1305|   196k|		const uint8_t *data = __archive_read_ahead(a,
 1306|   196k|		    zip->ppstream.stream_in + 1, NULL);
 1307|   196k|		if (data == NULL) {
  ------------------
  |  Branch (1307:7): [True: 149, False: 196k]
  ------------------
 1308|    149|			archive_set_error(&a->archive,
 1309|    149|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    149|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1310|    149|			    "Truncated 7z file data");
 1311|    149|			zip->ppstream.overconsumed = 1;
 1312|    149|			return (0);
 1313|    149|		}
 1314|   196k|		b = data[zip->ppstream.stream_in];
 1315|   196k|	} else {
 1316|  19.5k|		b = *zip->ppstream.next_in++;
 1317|  19.5k|		zip->ppstream.avail_in--;
 1318|  19.5k|	}
 1319|   215k|	zip->ppstream.stream_in++;
 1320|   215k|	return (b);
 1321|   216k|}
archive_read_support_format_7zip.c:x86_Convert:
 4164|     41|{
 4165|     41|	static const uint8_t kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
 4166|     41|	static const uint8_t kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
 4167|     41|	size_t bufferPos, prevPosT;
 4168|     41|	uint32_t ip, prevMask;
 4169|       |
 4170|     41|	if (size < 5)
  ------------------
  |  Branch (4170:6): [True: 1, False: 40]
  ------------------
 4171|      1|		return 0;
 4172|       |
 4173|     40|	bufferPos = 0;
 4174|     40|	prevPosT = zip->bcj_prevPosT;
 4175|     40|	prevMask = zip->bcj_prevMask;
 4176|     40|	ip = zip->bcj_ip;
 4177|       |
 4178|  1.50k|	for (;;) {
 4179|  1.50k|		uint8_t *p = data + bufferPos;
 4180|  1.50k|		uint8_t *limit = data + size - 4;
 4181|       |
 4182|  10.1k|		for (; p < limit; p++)
  ------------------
  |  Branch (4182:10): [True: 10.1k, False: 40]
  ------------------
 4183|  10.1k|			if ((*p & 0xFE) == 0xE8)
  ------------------
  |  Branch (4183:8): [True: 1.46k, False: 8.63k]
  ------------------
 4184|  1.46k|				break;
 4185|  1.50k|		bufferPos = (size_t)(p - data);
 4186|  1.50k|		if (p >= limit)
  ------------------
  |  Branch (4186:7): [True: 40, False: 1.46k]
  ------------------
 4187|     40|			break;
 4188|  1.46k|		prevPosT = bufferPos - prevPosT;
 4189|  1.46k|		if (prevPosT == 0 || prevPosT > 3)
  ------------------
  |  Branch (4189:7): [True: 0, False: 1.46k]
  |  Branch (4189:24): [True: 540, False: 926]
  ------------------
 4190|    540|			prevMask = 0;
 4191|    926|		else {
 4192|    926|			prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7;
 4193|    926|			if (prevMask != 0) {
  ------------------
  |  Branch (4193:8): [True: 889, False: 37]
  ------------------
 4194|    889|				unsigned char b =
 4195|    889|					p[4 - kMaskToBitNumber[prevMask]];
 4196|    889|				if (!kMaskToAllowedStatus[prevMask] ||
  ------------------
  |  Branch (4196:9): [True: 408, False: 481]
  ------------------
 4197|    481|				    Test86MSByte(b)) {
  ------------------
  |  | 4151|    481|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4151:26): [True: 17, False: 464]
  |  |  |  Branch (4151:38): [True: 20, False: 444]
  |  |  ------------------
  ------------------
 4198|    445|					prevPosT = bufferPos;
 4199|    445|					prevMask = ((prevMask << 1) & 0x7) | 1;
 4200|    445|					bufferPos++;
 4201|    445|					continue;
 4202|    445|				}
 4203|    889|			}
 4204|    926|		}
 4205|  1.02k|		prevPosT = bufferPos;
 4206|       |
 4207|  1.02k|		if (Test86MSByte(p[4])) {
  ------------------
  |  | 4151|  1.02k|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4151:26): [True: 114, False: 907]
  |  |  |  Branch (4151:38): [True: 97, False: 810]
  |  |  ------------------
  ------------------
 4208|    211|			uint32_t src = archive_le32dec(p + 1);
 4209|    211|			uint32_t dest;
 4210|    229|			for (;;) {
 4211|    229|				uint8_t b;
 4212|    229|				int b_index;
 4213|       |
 4214|    229|				dest = src - (ip + (uint32_t)bufferPos);
 4215|    229|				if (prevMask == 0)
  ------------------
  |  Branch (4215:9): [True: 125, False: 104]
  ------------------
 4216|    125|					break;
 4217|    104|				b_index = kMaskToBitNumber[prevMask] * 8;
 4218|    104|				b = (uint8_t)(dest >> (24 - b_index));
 4219|    104|				if (!Test86MSByte(b))
  ------------------
  |  | 4151|    104|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4151:26): [True: 17, False: 87]
  |  |  |  Branch (4151:38): [True: 1, False: 86]
  |  |  ------------------
  ------------------
 4220|     86|					break;
 4221|     18|				src = dest ^ ((1 << (32 - b_index)) - 1);
 4222|     18|			}
 4223|    211|			p[4] = (uint8_t)(~(((dest >> 24) & 1) - 1));
 4224|    211|			p[3] = (uint8_t)(dest >> 16);
 4225|    211|			p[2] = (uint8_t)(dest >> 8);
 4226|    211|			p[1] = (uint8_t)dest;
 4227|    211|			bufferPos += 5;
 4228|    810|		} else {
 4229|    810|			prevMask = ((prevMask << 1) & 0x7) | 1;
 4230|    810|			bufferPos++;
 4231|    810|		}
 4232|  1.02k|	}
 4233|     40|	zip->bcj_prevPosT = prevPosT;
 4234|     40|	zip->bcj_prevMask = prevMask;
 4235|     40|	zip->bcj_ip += (uint32_t)bufferPos;
 4236|     40|	return (bufferPos);
 4237|     41|}
archive_read_support_format_7zip.c:arm_Convert:
 4247|     13|{
 4248|       |	// This function was adapted from
 4249|       |	// static size_t bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4250|       |	// in https://git.tukaani.org/xz-embedded.git
 4251|       |
 4252|       |	/*
 4253|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4254|       |	 *
 4255|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4256|       |	 *          Igor Pavlov <https://7-zip.org/>
 4257|       |	 *
 4258|       |	 * This file has been put into the public domain.
 4259|       |	 * You can do whatever you want with this file.
 4260|       |	 */
 4261|       |
 4262|     13|	size_t i;
 4263|     13|	uint32_t addr;
 4264|       |
 4265|    118|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4265:14): [True: 105, False: 13]
  ------------------
 4266|    105|		if (buf[i + 3] == 0xEB) {
  ------------------
  |  Branch (4266:7): [True: 40, False: 65]
  ------------------
 4267|       |			// Calculate the transformed addr.
 4268|     40|			addr = archive_le24dec(buf + i);
 4269|     40|			addr <<= 2;
 4270|     40|			addr -= zip->bcj_ip + (uint32_t)i;
 4271|     40|			addr >>= 2;
 4272|       |
 4273|       |			// Store the transformed addr in buf.
 4274|     40|			archive_le24enc(buf + i, addr);
 4275|     40|		}
 4276|    105|	}
 4277|       |
 4278|     13|	zip->bcj_ip += (uint32_t)i;
 4279|       |
 4280|     13|	return i;
 4281|     13|}
archive_read_support_format_7zip.c:arm64_Convert:
 4285|     31|{
 4286|       |	// This function was adapted from
 4287|       |	// static size_t bcj_arm64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4288|       |	// in https://git.tukaani.org/xz-embedded.git
 4289|       |
 4290|       |	/*
 4291|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4292|       |	 *
 4293|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4294|       |	 *          Igor Pavlov <https://7-zip.org/>
 4295|       |	 *
 4296|       |	 * This file has been put into the public domain.
 4297|       |	 * You can do whatever you want with this file.
 4298|       |	 */
 4299|       |
 4300|     31|	size_t i;
 4301|     31|	uint32_t instr;
 4302|     31|	uint32_t addr;
 4303|       |
 4304|    489|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4304:14): [True: 458, False: 31]
  ------------------
 4305|    458|		instr = archive_le32dec(buf + i);
 4306|       |
 4307|    458|		if ((instr >> 26) == 0x25) {
  ------------------
  |  Branch (4307:7): [True: 86, False: 372]
  ------------------
 4308|       |			/* BL instruction */
 4309|     86|			addr = instr - ((zip->bcj_ip + (uint32_t)i) >> 2);
 4310|     86|			instr = 0x94000000 | (addr & 0x03FFFFFF);
 4311|       |
 4312|     86|			archive_le32enc(buf + i, instr);
 4313|    372|		} else if ((instr & 0x9F000000) == 0x90000000) {
  ------------------
  |  Branch (4313:14): [True: 87, False: 285]
  ------------------
 4314|       |			/* ADRP instruction */
 4315|     87|			addr = ((instr >> 29) & 3) | ((instr >> 3) & 0x1FFFFC);
 4316|       |
 4317|       |			/* Only convert values in the range +/-512 MiB. */
 4318|     87|			if ((addr + 0x020000) & 0x1C0000)
  ------------------
  |  Branch (4318:8): [True: 46, False: 41]
  ------------------
 4319|     46|				continue;
 4320|       |
 4321|     41|			addr -= (zip->bcj_ip + (uint32_t)i) >> 12;
 4322|       |
 4323|     41|			instr &= 0x9000001F;
 4324|     41|			instr |= (addr & 3) << 29;
 4325|     41|			instr |= (addr & 0x03FFFC) << 3;
 4326|     41|			instr |= (0U - (addr & 0x020000)) & 0xE00000;
 4327|       |
 4328|     41|			archive_le32enc(buf + i, instr);
 4329|     41|		}
 4330|    458|	}
 4331|       |
 4332|     31|	zip->bcj_ip += (uint32_t)i;
 4333|       |
 4334|     31|	return i;
 4335|     31|}
archive_read_support_format_7zip.c:sparc_Convert:
 4339|     16|{
 4340|       |	// This function was adapted from
 4341|       |	// static size_t bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4342|       |	// in https://git.tukaani.org/xz-embedded.git
 4343|       |
 4344|       |	/*
 4345|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4346|       |	 *
 4347|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4348|       |	 *          Igor Pavlov <https://7-zip.org/>
 4349|       |	 *
 4350|       |	 * Copyright (C) The XZ Embedded authors and contributors
 4351|       |	 *
 4352|       |	 * Permission to use, copy, modify, and/or distribute this
 4353|       |	 * software for any purpose with or without fee is hereby granted.
 4354|       |	 *
 4355|       |	 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 4356|       |	 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 4357|       |	 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 4358|       |	 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 4359|       |	 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 4360|       |	 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 4361|       |	 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 4362|       |	 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 4363|       |	 */
 4364|       |
 4365|     16|	size_t i;
 4366|     16|	uint32_t instr;
 4367|       |
 4368|     16|	size &= ~(size_t)3;
 4369|       |
 4370|    176|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4370:14): [True: 160, False: 16]
  ------------------
 4371|    160|		instr = archive_be32dec(buf + i);
 4372|       |
 4373|    160|		if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {
  ------------------
  |  Branch (4373:7): [True: 10, False: 150]
  |  Branch (4373:33): [True: 10, False: 140]
  ------------------
 4374|     20|			instr <<= 2;
 4375|     20|			instr -= zip->bcj_ip + (uint32_t)i;
 4376|     20|			instr >>= 2;
 4377|     20|			instr = ((uint32_t)0x40000000 - (instr & 0x400000))
 4378|     20|			        | 0x40000000 | (instr & 0x3FFFFF);
 4379|       |
 4380|     20|			archive_be32enc(buf + i, instr);
 4381|     20|		}
 4382|    160|	}
 4383|       |
 4384|     16|	zip->bcj_ip += (uint32_t)i;
 4385|       |
 4386|     16|	return i;
 4387|     16|}
archive_read_support_format_7zip.c:powerpc_Convert:
 4391|     18|{
 4392|       |	// This function was adapted from
 4393|       |	// static size_t powerpc_code(void *simple, uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size)
 4394|       |	// in https://git.tukaani.org/xz.git
 4395|       |
 4396|       |	/*
 4397|       |	 * Filter for PowerPC (big endian) binaries
 4398|       |	 *
 4399|       |	 * Authors: Igor Pavlov
 4400|       |	 *          Lasse Collin
 4401|       |	 *
 4402|       |	 * Copyright (C) The XZ Utils authors and contributors
 4403|       |	 *
 4404|       |	 * Permission to use, copy, modify, and/or distribute this
 4405|       |	 * software for any purpose with or without fee is hereby granted.
 4406|       |	 *
 4407|       |	 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 4408|       |	 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 4409|       |	 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 4410|       |	 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 4411|       |	 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 4412|       |	 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 4413|       |	 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 4414|       |	 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 4415|       |	 */
 4416|       |
 4417|     18|	size &= ~(size_t)3;
 4418|       |
 4419|     18|	size_t i;
 4420|    207|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4420:14): [True: 189, False: 18]
  ------------------
 4421|       |		// PowerPC branch 6(48) 24(Offset) 1(Abs) 1(Link)
 4422|    189|		if ((buf[i] >> 2) == 0x12
  ------------------
  |  Branch (4422:7): [True: 56, False: 133]
  ------------------
 4423|     56|			&& ((buf[i + 3] & 3) == 1)) {
  ------------------
  |  Branch (4423:7): [True: 37, False: 19]
  ------------------
 4424|       |
 4425|     37|			const uint32_t src
 4426|     37|				= (((uint32_t)(buf[i + 0]) & 3) << 24)
 4427|     37|				| ((uint32_t)(buf[i + 1]) << 16)
 4428|     37|				| ((uint32_t)(buf[i + 2]) << 8)
 4429|     37|				| ((uint32_t)(buf[i + 3]) & ~UINT32_C(3));
 4430|       |
 4431|     37|			uint32_t dest = src - (zip->bcj_ip + (uint32_t)(i));
 4432|       |
 4433|     37|			buf[i + 0] = 0x48 | ((dest >> 24) &  0x03);
 4434|     37|			buf[i + 1] = (dest >> 16);
 4435|     37|			buf[i + 2] = (dest >> 8);
 4436|     37|			buf[i + 3] &= 0x03;
 4437|     37|			buf[i + 3] |= dest;
 4438|     37|		}
 4439|    189|	}
 4440|       |
 4441|     18|	zip->bcj_ip += (uint32_t)i;
 4442|       |
 4443|     18|	return i;
 4444|     18|}
archive_read_support_format_7zip.c:get_uncompressed_data:
 3457|  4.55k|{
 3458|  4.55k|	struct _7zip *zip = a->format->data;
 3459|  4.55k|	ssize_t bytes_avail;
 3460|       |
 3461|  4.55k|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   95|  9.10k|#define _7Z_COPY	0
  ------------------
  |  Branch (3461:6): [True: 327, False: 4.22k]
  |  Branch (3461:32): [True: 139, False: 188]
  ------------------
 3462|       |		/* Copy mode. */
 3463|       |
 3464|    139|		*buff = __archive_read_ahead(a, minimum, &bytes_avail);
 3465|    139|		if (*buff == NULL) {
  ------------------
  |  Branch (3465:7): [True: 1, False: 138]
  ------------------
 3466|      1|			archive_set_error(&a->archive,
 3467|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3468|      1|			    "Truncated 7-Zip file data");
 3469|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3470|      1|		}
 3471|    138|		if ((size_t)bytes_avail >
  ------------------
  |  Branch (3471:7): [True: 138, False: 0]
  ------------------
 3472|    138|		    zip->uncompressed_buffer_bytes_remaining)
 3473|    138|			bytes_avail = (ssize_t)
 3474|    138|			    zip->uncompressed_buffer_bytes_remaining;
 3475|    138|		if ((size_t)bytes_avail > size)
  ------------------
  |  Branch (3475:7): [True: 67, False: 71]
  ------------------
 3476|     67|			bytes_avail = (ssize_t)size;
 3477|       |
 3478|    138|		zip->pack_stream_bytes_unconsumed = bytes_avail;
 3479|  4.41k|	} else if (zip->uncompressed_buffer_pointer == NULL) {
  ------------------
  |  Branch (3479:13): [True: 0, False: 4.41k]
  ------------------
 3480|       |		/* Decompression has failed. */
 3481|      0|		archive_set_error(&(a->archive),
 3482|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3483|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3484|  4.41k|	} else {
 3485|       |		/* Packed mode. */
 3486|  4.41k|		if (minimum > zip->uncompressed_buffer_bytes_remaining) {
  ------------------
  |  Branch (3486:7): [True: 0, False: 4.41k]
  ------------------
 3487|       |			/*
 3488|       |			 * If remaining uncompressed data size is less than
 3489|       |			 * the minimum size, fill the buffer up to the
 3490|       |			 * minimum size.
 3491|       |			 */
 3492|      0|			if (extract_pack_stream(a, minimum) < 0)
  ------------------
  |  Branch (3492:8): [True: 0, False: 0]
  ------------------
 3493|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3494|      0|		}
 3495|  4.41k|		if (size > zip->uncompressed_buffer_bytes_remaining)
  ------------------
  |  Branch (3495:7): [True: 0, False: 4.41k]
  ------------------
 3496|      0|			bytes_avail = (ssize_t)
 3497|      0|			    zip->uncompressed_buffer_bytes_remaining;
 3498|  4.41k|		else
 3499|  4.41k|			bytes_avail = (ssize_t)size;
 3500|  4.41k|		*buff = zip->uncompressed_buffer_pointer;
 3501|  4.41k|		zip->uncompressed_buffer_pointer += bytes_avail;
 3502|  4.41k|	}
 3503|  4.55k|	zip->uncompressed_buffer_bytes_remaining -= bytes_avail;
 3504|  4.55k|	return (bytes_avail);
 3505|  4.55k|}
archive_read_support_format_7zip.c:decode_encoded_header_info:
 3208|    458|{
 3209|    458|	struct _7zip *zip = a->format->data;
 3210|    458|	int64_t pi_end;
 3211|       |
 3212|    458|	errno = 0;
 3213|    458|	if (read_StreamsInfo(a, si) < 0) {
  ------------------
  |  Branch (3213:6): [True: 63, False: 395]
  ------------------
 3214|     63|		if (errno == ENOMEM)
  ------------------
  |  Branch (3214:7): [True: 0, False: 63]
  ------------------
 3215|      0|			archive_set_error(&a->archive, -1,
 3216|      0|			    "Couldn't allocate memory");
 3217|     63|		else
 3218|     63|			archive_set_error(&a->archive, -1,
 3219|     63|			    "Malformed 7-Zip archive");
 3220|     63|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     63|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3221|     63|	}
 3222|       |
 3223|    395|	if (si->pi.numPackStreams == 0 || si->ci.numFolders == 0) {
  ------------------
  |  Branch (3223:6): [True: 1, False: 394]
  |  Branch (3223:36): [True: 3, False: 391]
  ------------------
 3224|      4|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3225|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3226|      4|	}
 3227|       |
 3228|    391|	if (archive_ckd_add_i64(&pi_end, si->pi.pos, si->pi.sizes[0])) {
  ------------------
  |  Branch (3228:6): [True: 0, False: 391]
  ------------------
 3229|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3230|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3231|      0|	}
 3232|       |
 3233|    391|	if (zip->header_offset < pi_end) {
  ------------------
  |  Branch (3233:6): [True: 0, False: 391]
  ------------------
 3234|      0|		archive_set_error(&a->archive, -1, "Malformed Header offset");
 3235|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3236|      0|	}
 3237|       |
 3238|    391|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    391|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3239|    391|}
archive_read_support_format_7zip.c:read_StreamsInfo:
 2683|  1.24k|{
 2684|  1.24k|	struct _7zip *zip = a->format->data;
 2685|  1.24k|	const unsigned char *p;
 2686|  1.24k|	size_t i;
 2687|       |
 2688|  1.24k|	memset(si, 0, sizeof(*si));
 2689|       |
 2690|  1.24k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2690:6): [True: 2, False: 1.24k]
  ------------------
 2691|      2|		return (-1);
 2692|  1.24k|	if (*p == kPackInfo) {
  ------------------
  |  |  128|  1.24k|#define kPackInfo		0x06
  ------------------
  |  Branch (2692:6): [True: 1.14k, False: 97]
  ------------------
 2693|  1.14k|		int64_t packPos;
 2694|       |
 2695|  1.14k|		if (read_PackInfo(a, &(si->pi)) < 0)
  ------------------
  |  Branch (2695:7): [True: 118, False: 1.02k]
  ------------------
 2696|    118|			return (-1);
 2697|       |
 2698|  1.02k|		if (si->pi.positions == NULL || si->pi.sizes == NULL)
  ------------------
  |  Branch (2698:7): [True: 5, False: 1.02k]
  |  Branch (2698:35): [True: 0, False: 1.02k]
  ------------------
 2699|      5|			return (-1);
 2700|       |		/*
 2701|       |		 * Calculate packed stream positions.
 2702|       |		 */
 2703|  1.02k|		packPos = si->pi.pos;
 2704|  2.40k|		for (i = 0; i < si->pi.numPackStreams; i++) {
  ------------------
  |  Branch (2704:15): [True: 1.40k, False: 994]
  ------------------
 2705|  1.40k|			si->pi.positions[i] = packPos;
 2706|  1.40k|			if (archive_ckd_add_i64(&packPos,
  ------------------
  |  Branch (2706:8): [True: 0, False: 1.40k]
  ------------------
 2707|  1.40k|			    packPos, si->pi.sizes[i]))
 2708|      0|				return (-1);
 2709|  1.40k|			if (packPos > zip->header_offset)
  ------------------
  |  Branch (2709:8): [True: 28, False: 1.38k]
  ------------------
 2710|     28|				return (-1);
 2711|  1.40k|		}
 2712|    994|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2712:7): [True: 2, False: 992]
  ------------------
 2713|      2|			return (-1);
 2714|    994|	}
 2715|  1.08k|	if (*p == kUnPackInfo) {
  ------------------
  |  |  129|  1.08k|#define kUnPackInfo		0x07
  ------------------
  |  Branch (2715:6): [True: 1.07k, False: 18]
  ------------------
 2716|  1.07k|		size_t packIndex;
 2717|  1.07k|		struct _7z_folder *f;
 2718|       |
 2719|  1.07k|		if (read_CodersInfo(a, &(si->ci)) < 0)
  ------------------
  |  Branch (2719:7): [True: 421, False: 650]
  ------------------
 2720|    421|			return (-1);
 2721|       |
 2722|       |		/*
 2723|       |		 * Calculate packed stream indexes.
 2724|       |		 */
 2725|    650|		packIndex = 0;
 2726|    650|		f = si->ci.folders;
 2727|  1.30k|		for (i = 0; i < si->ci.numFolders; i++) {
  ------------------
  |  Branch (2727:15): [True: 655, False: 647]
  ------------------
 2728|    655|			f[i].packIndex = packIndex;
 2729|    655|			if (archive_ckd_add_size(&packIndex,
  ------------------
  |  Branch (2729:8): [True: 0, False: 655]
  ------------------
 2730|    655|			    packIndex, f[i].numPackedStreams) ||
 2731|    655|			    packIndex > si->pi.numPackStreams)
  ------------------
  |  Branch (2731:8): [True: 3, False: 652]
  ------------------
 2732|      3|				return (-1);
 2733|    655|		}
 2734|    647|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2734:7): [True: 3, False: 644]
  ------------------
 2735|      3|			return (-1);
 2736|    647|	}
 2737|       |
 2738|    662|	if (*p == kSubStreamsInfo) {
  ------------------
  |  |  130|    662|#define kSubStreamsInfo		0x08
  ------------------
  |  Branch (2738:6): [True: 262, False: 400]
  ------------------
 2739|    262|		if (read_SubStreamsInfo(a, &(si->ss),
  ------------------
  |  Branch (2739:7): [True: 64, False: 198]
  ------------------
 2740|    262|		    si->ci.folders, si->ci.numFolders) < 0)
 2741|     64|			return (-1);
 2742|    198|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2742:7): [True: 1, False: 197]
  ------------------
 2743|      1|			return (-1);
 2744|    198|	}
 2745|       |
 2746|       |	/*
 2747|       |	 *  Must be kEnd.
 2748|       |	 */
 2749|    597|	if (*p != kEnd)
  ------------------
  |  |  122|    597|#define kEnd			0x00
  ------------------
  |  Branch (2749:6): [True: 4, False: 593]
  ------------------
 2750|      4|		return (-1);
 2751|    593|	return (0);
 2752|    597|}
archive_read_support_format_7zip.c:read_PackInfo:
 2166|  1.14k|{
 2167|  1.14k|	const unsigned char *p;
 2168|  1.14k|	size_t i;
 2169|       |
 2170|  1.14k|	memset(pi, 0, sizeof(*pi));
 2171|       |
 2172|       |	/*
 2173|       |	 * Read PackPos.
 2174|       |	 */
 2175|  1.14k|	if (parse_7zip_int64(a, &(pi->pos)) < 0)
  ------------------
  |  Branch (2175:6): [True: 7, False: 1.13k]
  ------------------
 2176|      7|		return (-1);
 2177|       |
 2178|       |	/*
 2179|       |	 * Read NumPackStreams.
 2180|       |	 */
 2181|  1.13k|	if (parse_7zip_size(a, &(pi->numPackStreams)) < 0)
  ------------------
  |  Branch (2181:6): [True: 32, False: 1.10k]
  ------------------
 2182|     32|		return (-1);
 2183|  1.10k|	if (pi->numPackStreams == 0)
  ------------------
  |  Branch (2183:6): [True: 1, False: 1.10k]
  ------------------
 2184|      1|		return (-1);
 2185|       |
 2186|       |	/*
 2187|       |	 * Read PackSizes[num]
 2188|       |	 */
 2189|  1.10k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2189:6): [True: 4, False: 1.10k]
  ------------------
 2190|      4|		return (-1);
 2191|  1.10k|	if (*p == kEnd)
  ------------------
  |  |  122|  1.10k|#define kEnd			0x00
  ------------------
  |  Branch (2191:6): [True: 5, False: 1.09k]
  ------------------
 2192|       |		/* PackSizes[num] are not present. */
 2193|      5|		return (0);
 2194|  1.09k|	if (*p != kSize)
  ------------------
  |  |  131|  1.09k|#define kSize			0x09
  ------------------
  |  Branch (2194:6): [True: 7, False: 1.08k]
  ------------------
 2195|      7|		return (-1);
 2196|  1.08k|	pi->sizes = calloc(pi->numPackStreams, sizeof(int64_t));
 2197|  1.08k|	pi->positions = calloc(pi->numPackStreams, sizeof(int64_t));
 2198|  1.08k|	if (pi->sizes == NULL || pi->positions == NULL)
  ------------------
  |  Branch (2198:6): [True: 0, False: 1.08k]
  |  Branch (2198:27): [True: 0, False: 1.08k]
  ------------------
 2199|      0|		return (-1);
 2200|       |
 2201|  12.6k|	for (i = 0; i < pi->numPackStreams; i++) {
  ------------------
  |  Branch (2201:14): [True: 11.5k, False: 1.05k]
  ------------------
 2202|  11.5k|		if (parse_7zip_int64(a, &(pi->sizes[i])) < 0)
  ------------------
  |  Branch (2202:7): [True: 37, False: 11.5k]
  ------------------
 2203|     37|			return (-1);
 2204|  11.5k|	}
 2205|       |
 2206|       |	/*
 2207|       |	 * Read PackStreamDigests[num]
 2208|       |	 */
 2209|  1.05k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2209:6): [True: 2, False: 1.05k]
  ------------------
 2210|      2|		return (-1);
 2211|  1.05k|	if (*p == kEnd) {
  ------------------
  |  |  122|  1.05k|#define kEnd			0x00
  ------------------
  |  Branch (2211:6): [True: 1.01k, False: 32]
  ------------------
 2212|       |		/* PackStreamDigests[num] are not present. */
 2213|  1.01k|		pi->digest.defineds =
 2214|  1.01k|		    calloc(pi->numPackStreams, sizeof(*pi->digest.defineds));
 2215|  1.01k|		pi->digest.digests =
 2216|  1.01k|		    calloc(pi->numPackStreams, sizeof(*pi->digest.digests));
 2217|  1.01k|		if (pi->digest.defineds == NULL || pi->digest.digests == NULL)
  ------------------
  |  Branch (2217:7): [True: 0, False: 1.01k]
  |  Branch (2217:38): [True: 0, False: 1.01k]
  ------------------
 2218|      0|			return (-1);
 2219|  1.01k|		return (0);
 2220|  1.01k|	}
 2221|       |
 2222|     32|	if (*p != kCRC)
  ------------------
  |  |  132|     32|#define kCRC			0x0A
  ------------------
  |  Branch (2222:6): [True: 6, False: 26]
  ------------------
 2223|      6|		return (-1);
 2224|       |
 2225|     26|	if (read_Digests(a, &(pi->digest), pi->numPackStreams) < 0)
  ------------------
  |  Branch (2225:6): [True: 17, False: 9]
  ------------------
 2226|     17|		return (-1);
 2227|       |
 2228|       |	/*
 2229|       |	 *  Must be marked by kEnd.
 2230|       |	 */
 2231|      9|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2231:6): [True: 1, False: 8]
  ------------------
 2232|      1|		return (-1);
 2233|      8|	if (*p != kEnd)
  ------------------
  |  |  122|      8|#define kEnd			0x00
  ------------------
  |  Branch (2233:6): [True: 4, False: 4]
  ------------------
 2234|      4|		return (-1);
 2235|      4|	return (0);
 2236|      8|}
archive_read_support_format_7zip.c:parse_7zip_int64:
 2062|  1.11M|{
 2063|  1.11M|	uint64_t v;
 2064|  1.11M|	const unsigned char *p;
 2065|  1.11M|	unsigned char avail, mask;
 2066|  1.11M|	int i;
 2067|       |
 2068|  1.11M|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2068:6): [True: 80, False: 1.11M]
  ------------------
 2069|     80|		return (-1);
 2070|  1.11M|	avail = *p;
 2071|  1.11M|	mask = 0x80;
 2072|  1.11M|	v = 0;
 2073|  1.14M|	for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (2073:14): [True: 1.14M, False: 1.90k]
  ------------------
 2074|  1.14M|		if (avail & mask) {
  ------------------
  |  Branch (2074:7): [True: 35.7k, False: 1.11M]
  ------------------
 2075|  35.7k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2075:8): [True: 72, False: 35.6k]
  ------------------
 2076|     72|				return (-1);
 2077|  35.6k|			v |= ((uint64_t)*p) << (8 * i);
 2078|  35.6k|			mask >>= 1;
 2079|  35.6k|			continue;
 2080|  35.7k|		}
 2081|  1.11M|		v += ((uint64_t)(avail & (mask - 1))) << (8 * i);
 2082|  1.11M|		break;
 2083|  1.14M|	}
 2084|  1.11M|	if (v > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2084:6): [True: 196, False: 1.11M]
  ------------------
 2085|    196|		return (-1);
 2086|  1.11M|	*val = (int64_t)v;
 2087|  1.11M|	return (0);
 2088|  1.11M|}
archive_read_support_format_7zip.c:parse_7zip_size:
 2050|  1.07M|{
 2051|  1.07M|	int64_t v;
 2052|       |
 2053|  1.07M|	if (parse_7zip_int64(a, &v) < 0 || v > UMAX_ENTRY)
  ------------------
  |  |  393|  1.07M|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  205|  1.07M|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2053:6): [True: 236, False: 1.07M]
  |  Branch (2053:37): [True: 144, False: 1.07M]
  ------------------
 2054|    380|		return (-1);
 2055|       |
 2056|  1.07M|	*val = (size_t)v;
 2057|  1.07M|	return (0);
 2058|  1.07M|}
archive_read_support_format_7zip.c:read_Digests:
 2119|    317|{
 2120|    317|	const unsigned char *p;
 2121|    317|	size_t i;
 2122|       |
 2123|    317|	if (num == 0)
  ------------------
  |  Branch (2123:6): [True: 3, False: 314]
  ------------------
 2124|      3|		return (-1);
 2125|    314|	memset(d, 0, sizeof(*d));
 2126|       |
 2127|    314|	d->defineds = malloc(num);
 2128|    314|	if (d->defineds == NULL)
  ------------------
  |  Branch (2128:6): [True: 0, False: 314]
  ------------------
 2129|      0|		return (-1);
 2130|       |	/*
 2131|       |	 * Read Bools.
 2132|       |	 */
 2133|    314|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2133:6): [True: 2, False: 312]
  ------------------
 2134|      2|		return (-1);
 2135|    312|	if (*p == 0) {
  ------------------
  |  Branch (2135:6): [True: 27, False: 285]
  ------------------
 2136|     27|		if (read_Bools(a, d->defineds, num) < 0)
  ------------------
  |  Branch (2136:7): [True: 3, False: 24]
  ------------------
 2137|      3|			return (-1);
 2138|     27|	} else
 2139|       |		/* All are defined */
 2140|    285|		memset(d->defineds, 1, num);
 2141|       |
 2142|    309|	d->digests = calloc(num, sizeof(*d->digests));
 2143|    309|	if (d->digests == NULL)
  ------------------
  |  Branch (2143:6): [True: 0, False: 309]
  ------------------
 2144|      0|		return (-1);
 2145|  1.48k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2145:14): [True: 1.19k, False: 293]
  ------------------
 2146|  1.19k|		if (d->defineds[i]) {
  ------------------
  |  Branch (2146:7): [True: 751, False: 442]
  ------------------
 2147|    751|			if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (2147:8): [True: 16, False: 735]
  ------------------
 2148|     16|				return (-1);
 2149|    735|			d->digests[i] = archive_le32dec(p);
 2150|    735|		}
 2151|  1.19k|	}
 2152|       |
 2153|    293|	return (0);
 2154|    309|}
archive_read_support_format_7zip.c:read_Bools:
 2092|    969|{
 2093|    969|	const unsigned char *p;
 2094|    969|	size_t i;
 2095|    969|	unsigned mask = 0, avail = 0;
 2096|       |
 2097|  33.5k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2097:14): [True: 32.6k, False: 954]
  ------------------
 2098|  32.6k|		if (mask == 0) {
  ------------------
  |  Branch (2098:7): [True: 4.45k, False: 28.1k]
  ------------------
 2099|  4.45k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2099:8): [True: 15, False: 4.43k]
  ------------------
 2100|     15|				return (-1);
 2101|  4.43k|			avail = *p;
 2102|  4.43k|			mask = 0x80;
 2103|  4.43k|		}
 2104|  32.5k|		data[i] = (avail & mask) ? 1 : 0;
  ------------------
  |  Branch (2104:13): [True: 18.1k, False: 14.4k]
  ------------------
 2105|  32.5k|		mask >>= 1;
 2106|  32.5k|	}
 2107|    954|	return (0);
 2108|    969|}
archive_read_support_format_7zip.c:read_CodersInfo:
 2401|  1.07k|{
 2402|  1.07k|	struct _7zip *zip = a->format->data;
 2403|  1.07k|	const unsigned char *p;
 2404|  1.07k|	struct _7z_digests digest;
 2405|  1.07k|	size_t dataStreamIndex, i;
 2406|       |
 2407|  1.07k|	memset(ci, 0, sizeof(*ci));
 2408|  1.07k|	memset(&digest, 0, sizeof(digest));
 2409|       |
 2410|  1.07k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2410:6): [True: 1, False: 1.07k]
  ------------------
 2411|      1|		goto failed;
 2412|  1.07k|	if (*p != kFolder)
  ------------------
  |  |  133|  1.07k|#define kFolder			0x0B
  ------------------
  |  Branch (2412:6): [True: 5, False: 1.06k]
  ------------------
 2413|      5|		goto failed;
 2414|       |
 2415|       |	/*
 2416|       |	 * Read NumFolders.
 2417|       |	 */
 2418|  1.06k|	if (parse_7zip_size(a, &(ci->numFolders)) < 0)
  ------------------
  |  Branch (2418:6): [True: 20, False: 1.04k]
  ------------------
 2419|     20|		goto failed;
 2420|       |	/*
 2421|       |	 * Each folder is encoded by at least one byte in the coders
 2422|       |	 * list that follows, so a folder count larger than the bytes
 2423|       |	 * left in the header cannot be honored and is rejected here
 2424|       |	 * before it is used to size the folders allocation.
 2425|       |	 */
 2426|  1.04k|	if (ci->numFolders > (uint64_t)zip->header_bytes_remaining)
  ------------------
  |  Branch (2426:6): [True: 1, False: 1.04k]
  ------------------
 2427|      1|		goto failed;
 2428|       |
 2429|       |	/*
 2430|       |	 * Read External.
 2431|       |	 */
 2432|  1.04k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2432:6): [True: 1, False: 1.04k]
  ------------------
 2433|      1|		goto failed;
 2434|  1.04k|	switch (*p) {
 2435|  1.02k|	case 0:
  ------------------
  |  Branch (2435:2): [True: 1.02k, False: 18]
  ------------------
 2436|  1.02k|		ci->folders =
 2437|  1.02k|			calloc(ci->numFolders, sizeof(*ci->folders));
 2438|  1.02k|		if (ci->folders == NULL)
  ------------------
  |  Branch (2438:7): [True: 0, False: 1.02k]
  ------------------
 2439|      0|			return (-1);
 2440|  2.93k|		for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2440:15): [True: 2.23k, False: 694]
  ------------------
 2441|  2.23k|			if (read_Folder(a, &(ci->folders[i])) < 0)
  ------------------
  |  Branch (2441:8): [True: 331, False: 1.90k]
  ------------------
 2442|    331|				goto failed;
 2443|  2.23k|		}
 2444|    694|		break;
 2445|    694|	case 1:
  ------------------
  |  Branch (2445:2): [True: 14, False: 1.02k]
  ------------------
 2446|     14|		if (parse_7zip_size(a, &dataStreamIndex) < 0)
  ------------------
  |  Branch (2446:7): [True: 6, False: 8]
  ------------------
 2447|      6|			return (-1);
 2448|      8|		if (ci->numFolders > 0) {
  ------------------
  |  Branch (2448:7): [True: 2, False: 6]
  ------------------
 2449|      2|			archive_set_error(&a->archive, -1,
 2450|      2|			    "Malformed 7-Zip archive");
 2451|      2|			goto failed;
 2452|      2|		}
 2453|      6|		break;
 2454|      6|	default:
  ------------------
  |  Branch (2454:2): [True: 4, False: 1.03k]
  ------------------
 2455|      4|		archive_set_error(&a->archive, -1,
 2456|      4|		    "Malformed 7-Zip archive");
 2457|      4|		goto failed;
 2458|  1.04k|	}
 2459|       |
 2460|    700|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2460:6): [True: 1, False: 699]
  ------------------
 2461|      1|		goto failed;
 2462|    699|	if (*p != kCodersUnPackSize)
  ------------------
  |  |  134|    699|#define kCodersUnPackSize	0x0C
  ------------------
  |  Branch (2462:6): [True: 15, False: 684]
  ------------------
 2463|     15|		goto failed;
 2464|       |
 2465|  1.41k|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2465:14): [True: 760, False: 657]
  ------------------
 2466|    760|		struct _7z_folder *folder = &(ci->folders[i]);
 2467|    760|		size_t j;
 2468|       |
 2469|    760|		folder->unPackSize =
 2470|    760|		    calloc(folder->numOutStreams, sizeof(*folder->unPackSize));
 2471|    760|		if (folder->unPackSize == NULL)
  ------------------
  |  Branch (2471:7): [True: 0, False: 760]
  ------------------
 2472|      0|			goto failed;
 2473|  2.25k|		for (j = 0; j < folder->numOutStreams; j++) {
  ------------------
  |  Branch (2473:15): [True: 1.52k, False: 733]
  ------------------
 2474|  1.52k|			if (parse_7zip_int64(a, &(folder->unPackSize[j])) < 0)
  ------------------
  |  Branch (2474:8): [True: 27, False: 1.49k]
  ------------------
 2475|     27|				goto failed;
 2476|  1.52k|		}
 2477|    760|	}
 2478|       |
 2479|       |	/*
 2480|       |	 * Read CRCs.
 2481|       |	 */
 2482|    657|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2482:6): [True: 1, False: 656]
  ------------------
 2483|      1|		goto failed;
 2484|    656|	if (*p == kEnd)
  ------------------
  |  |  122|    656|#define kEnd			0x00
  ------------------
  |  Branch (2484:6): [True: 541, False: 115]
  ------------------
 2485|    541|		return (0);
 2486|    115|	if (*p != kCRC)
  ------------------
  |  |  132|    115|#define kCRC			0x0A
  ------------------
  |  Branch (2486:6): [True: 2, False: 113]
  ------------------
 2487|      2|		goto failed;
 2488|    113|	if (read_Digests(a, &digest, ci->numFolders) < 0)
  ------------------
  |  Branch (2488:6): [True: 2, False: 111]
  ------------------
 2489|      2|		goto failed;
 2490|    239|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2490:14): [True: 128, False: 111]
  ------------------
 2491|    128|		ci->folders[i].digest_defined = digest.defineds[i];
 2492|    128|		ci->folders[i].digest = digest.digests[i];
 2493|    128|	}
 2494|       |
 2495|       |	/*
 2496|       |	 *  Must be kEnd.
 2497|       |	 */
 2498|    111|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2498:6): [True: 1, False: 110]
  ------------------
 2499|      1|		goto failed;
 2500|    110|	if (*p != kEnd)
  ------------------
  |  |  122|    110|#define kEnd			0x00
  ------------------
  |  Branch (2500:6): [True: 1, False: 109]
  ------------------
 2501|      1|		goto failed;
 2502|    109|	free_Digest(&digest);
 2503|    109|	return (0);
 2504|    415|failed:
 2505|    415|	free_Digest(&digest);
 2506|    415|	return (-1);
 2507|    110|}
archive_read_support_format_7zip.c:read_Folder:
 2255|  2.23k|{
 2256|  2.23k|	struct _7zip *zip = a->format->data;
 2257|  2.23k|	const unsigned char *p;
 2258|  2.23k|	size_t numInStreamsTotal = 0;
 2259|  2.23k|	size_t numOutStreamsTotal = 0;
 2260|  2.23k|	size_t i;
 2261|       |
 2262|  2.23k|	memset(f, 0, sizeof(*f));
 2263|       |
 2264|       |	/*
 2265|       |	 * Read NumCoders.
 2266|       |	 */
 2267|  2.23k|	if (parse_7zip_size(a, &(f->numCoders)) < 0)
  ------------------
  |  Branch (2267:6): [True: 21, False: 2.21k]
  ------------------
 2268|     21|		return (-1);
 2269|  2.21k|	if (f->numCoders > 4)
  ------------------
  |  Branch (2269:6): [True: 13, False: 2.20k]
  ------------------
 2270|       |		/* Too many coders. */
 2271|     13|		return (-1);
 2272|       |
 2273|  2.20k|	f->coders = calloc(f->numCoders, sizeof(*f->coders));
 2274|  2.20k|	if (f->coders == NULL)
  ------------------
  |  Branch (2274:6): [True: 0, False: 2.20k]
  ------------------
 2275|      0|		return (-1);
 2276|  5.79k|	for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2276:14): [True: 3.69k, False: 2.09k]
  ------------------
 2277|  3.69k|		size_t codec_size;
 2278|  3.69k|		int simple, attr;
 2279|       |
 2280|  3.69k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2280:7): [True: 3, False: 3.69k]
  ------------------
 2281|      3|			return (-1);
 2282|       |		/*
 2283|       |		 * 0:3 CodecIdSize
 2284|       |		 * 4:  0 - IsSimple
 2285|       |		 *     1 - Is not Simple
 2286|       |		 * 5:  0 - No Attributes
 2287|       |		 *     1 - There are Attributes;
 2288|       |		 * 7:  Must be zero.
 2289|       |		 */
 2290|  3.69k|		codec_size = *p & 0xf;
 2291|  3.69k|		simple = (*p & 0x10) ? 0 : 1;
  ------------------
  |  Branch (2291:12): [True: 442, False: 3.25k]
  ------------------
 2292|  3.69k|		attr = *p & 0x20;
 2293|  3.69k|		if (*p & 0x80)
  ------------------
  |  Branch (2293:7): [True: 3, False: 3.68k]
  ------------------
 2294|      3|			return (-1);/* Not supported. */
 2295|       |
 2296|       |		/*
 2297|       |		 * Read Decompression Method IDs.
 2298|       |		 */
 2299|  3.68k|		if ((p = header_bytes(a, codec_size)) == NULL)
  ------------------
  |  Branch (2299:7): [True: 11, False: 3.67k]
  ------------------
 2300|     11|			return (-1);
 2301|       |
 2302|  3.67k|		if (decode_codec_id(p, codec_size, &f->coders[i].codec) < 0)
  ------------------
  |  Branch (2302:7): [True: 14, False: 3.66k]
  ------------------
 2303|     14|			return (-1);
 2304|       |
 2305|  3.66k|		if (simple) {
  ------------------
  |  Branch (2305:7): [True: 3.23k, False: 427]
  ------------------
 2306|  3.23k|			f->coders[i].numInStreams = 1;
 2307|  3.23k|			f->coders[i].numOutStreams = 1;
 2308|  3.23k|		} else {
 2309|    427|			if (parse_7zip_size(
  ------------------
  |  Branch (2309:8): [True: 16, False: 411]
  ------------------
 2310|    427|			    a, &(f->coders[i].numInStreams)) < 0)
 2311|     16|				return (-1);
 2312|    411|			if (parse_7zip_size(
  ------------------
  |  Branch (2312:8): [True: 25, False: 386]
  ------------------
 2313|    411|			    a, &(f->coders[i].numOutStreams)) < 0)
 2314|     25|				return (-1);
 2315|    411|		}
 2316|       |
 2317|  3.62k|		if (attr) {
  ------------------
  |  Branch (2317:7): [True: 825, False: 2.79k]
  ------------------
 2318|    825|			if (parse_7zip_size(
  ------------------
  |  Branch (2318:8): [True: 27, False: 798]
  ------------------
 2319|    825|			    a, &(f->coders[i].propertiesSize)) < 0)
 2320|     27|				return (-1);
 2321|    798|			if ((p = header_bytes(
  ------------------
  |  Branch (2321:8): [True: 8, False: 790]
  ------------------
 2322|    798|			    a, f->coders[i].propertiesSize)) == NULL)
 2323|      8|				return (-1);
 2324|    790|			f->coders[i].properties =
 2325|    790|			    malloc(f->coders[i].propertiesSize);
 2326|    790|			if (f->coders[i].properties == NULL)
  ------------------
  |  Branch (2326:8): [True: 0, False: 790]
  ------------------
 2327|      0|				return (-1);
 2328|    790|			memcpy(f->coders[i].properties, p,
 2329|    790|			    f->coders[i].propertiesSize);
 2330|    790|		}
 2331|       |
 2332|  3.58k|		if (archive_ckd_add_size(&numInStreamsTotal,
  ------------------
  |  Branch (2332:7): [True: 0, False: 3.58k]
  ------------------
 2333|  3.58k|		    numInStreamsTotal, f->coders[i].numInStreams) ||
 2334|  3.58k|		    archive_ckd_add_size(&numOutStreamsTotal,
  ------------------
  |  Branch (2334:7): [True: 0, False: 3.58k]
  ------------------
 2335|  3.58k|		    numOutStreamsTotal, f->coders[i].numOutStreams))
 2336|      0|			return (-1);
 2337|  3.58k|	}
 2338|       |
 2339|  2.09k|	if (numOutStreamsTotal == 0 ||
  ------------------
  |  Branch (2339:6): [True: 10, False: 2.08k]
  ------------------
 2340|  2.08k|	    numInStreamsTotal < numOutStreamsTotal-1)
  ------------------
  |  Branch (2340:6): [True: 5, False: 2.08k]
  ------------------
 2341|     15|		return (-1);
 2342|       |
 2343|  2.08k|	f->numBindPairs = numOutStreamsTotal - 1;
 2344|  2.08k|	if ((uint64_t)zip->header_bytes_remaining < f->numBindPairs)
  ------------------
  |  Branch (2344:6): [True: 4, False: 2.07k]
  ------------------
 2345|      4|			return (-1);
 2346|  2.07k|	if (f->numBindPairs > 0) {
  ------------------
  |  Branch (2346:6): [True: 929, False: 1.14k]
  ------------------
 2347|    929|		f->bindPairs =
 2348|    929|			calloc(f->numBindPairs, sizeof(*f->bindPairs));
 2349|    929|		if (f->bindPairs == NULL)
  ------------------
  |  Branch (2349:7): [True: 0, False: 929]
  ------------------
 2350|      0|			return (-1);
 2351|    929|	} else
 2352|  1.14k|		f->bindPairs = NULL;
 2353|   531k|	for (i = 0; i < f->numBindPairs; i++) {
  ------------------
  |  Branch (2353:14): [True: 529k, False: 1.96k]
  ------------------
 2354|   529k|		if (parse_7zip_size(a, &(f->bindPairs[i].inIndex)) < 0)
  ------------------
  |  Branch (2354:7): [True: 69, False: 529k]
  ------------------
 2355|     69|			return (-1);
 2356|   529k|		if (parse_7zip_size(a, &(f->bindPairs[i].outIndex)) < 0)
  ------------------
  |  Branch (2356:7): [True: 39, False: 529k]
  ------------------
 2357|     39|			return (-1);
 2358|   529k|	}
 2359|       |
 2360|  1.96k|	f->numPackedStreams = numInStreamsTotal - f->numBindPairs;
 2361|       |	/* packedStreams are not needed; parse/verify nonetheless */
 2362|  1.96k|	if (f->numPackedStreams == 1) {
  ------------------
  |  Branch (2362:6): [True: 1.77k, False: 190]
  ------------------
 2363|  1.86k|		for (i = 0; i < numInStreamsTotal; i++) {
  ------------------
  |  Branch (2363:15): [True: 1.86k, False: 0]
  ------------------
 2364|  1.86k|			size_t j;
 2365|  4.52k|			for (j = 0; j < f->numBindPairs; j++) {
  ------------------
  |  Branch (2365:16): [True: 2.74k, False: 1.77k]
  ------------------
 2366|  2.74k|				if (f->bindPairs[j].inIndex == i)
  ------------------
  |  Branch (2366:9): [True: 85, False: 2.66k]
  ------------------
 2367|     85|					break;
 2368|  2.74k|			}
 2369|  1.86k|			if (j == f->numBindPairs)
  ------------------
  |  Branch (2369:8): [True: 1.77k, False: 85]
  ------------------
 2370|  1.77k|				break;
 2371|  1.86k|		}
 2372|  1.77k|		if (i == numInStreamsTotal)
  ------------------
  |  Branch (2372:7): [True: 0, False: 1.77k]
  ------------------
 2373|      0|			return (-1);
 2374|  1.77k|	} else {
 2375|  11.8k|		for (i = 0; i < f->numPackedStreams; i++) {
  ------------------
  |  Branch (2375:15): [True: 11.7k, False: 127]
  ------------------
 2376|  11.7k|			size_t packedStream;
 2377|  11.7k|			if (parse_7zip_size(a, &packedStream) < 0)
  ------------------
  |  Branch (2377:8): [True: 63, False: 11.6k]
  ------------------
 2378|     63|				return (-1);
 2379|  11.7k|		}
 2380|    190|	}
 2381|  1.90k|	f->numInStreams = numInStreamsTotal;
 2382|  1.90k|	f->numOutStreams = numOutStreamsTotal;
 2383|       |
 2384|  1.90k|	return (0);
 2385|  1.96k|}
archive_read_support_format_7zip.c:decode_codec_id:
 1280|  3.67k|{
 1281|  3.67k|	size_t i;
 1282|       |
 1283|  3.67k|	*id = 0;
 1284|  12.6k|	for (i = 0; i < id_size; i++) {
  ------------------
  |  Branch (1284:14): [True: 9.00k, False: 3.66k]
  ------------------
 1285|  9.00k|		if (archive_ckd_mul_i64(id, *id, 256) ||
  ------------------
  |  Branch (1285:7): [True: 14, False: 8.99k]
  ------------------
 1286|  8.99k|		    archive_ckd_add_i64(id, *id, codecId[i]))
  ------------------
  |  Branch (1286:7): [True: 0, False: 8.99k]
  ------------------
 1287|     14|			return (-1);
 1288|  9.00k|	}
 1289|  3.66k|	return (0);
 1290|  3.67k|}
archive_read_support_format_7zip.c:free_Digest:
 2112|  23.4k|{
 2113|  23.4k|	free(d->defineds);
 2114|  23.4k|	free(d->digests);
 2115|  23.4k|}
archive_read_support_format_7zip.c:read_SubStreamsInfo:
 2538|    262|{
 2539|    262|	const unsigned char *p;
 2540|    262|	int64_t *usizes;
 2541|    262|	size_t numDigests;
 2542|    262|	size_t unpack_streams;
 2543|    262|	size_t i;
 2544|    262|	int type;
 2545|       |
 2546|    262|	memset(ss, 0, sizeof(*ss));
 2547|       |
 2548|    520|	for (i = 0; i < numFolders; i++)
  ------------------
  |  Branch (2548:14): [True: 258, False: 262]
  ------------------
 2549|    258|		f[i].numUnpackStreams = 1;
 2550|       |
 2551|    262|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2551:6): [True: 1, False: 261]
  ------------------
 2552|      1|		return (-1);
 2553|    261|	type = *p;
 2554|       |
 2555|    261|	if (type == kNumUnPackStream) {
  ------------------
  |  |  135|    261|#define kNumUnPackStream	0x0D
  ------------------
  |  Branch (2555:6): [True: 126, False: 135]
  ------------------
 2556|    126|		unpack_streams = 0;
 2557|    242|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2557:15): [True: 123, False: 119]
  ------------------
 2558|    123|			if (parse_7zip_size(a, &(f[i].numUnpackStreams)) < 0)
  ------------------
  |  Branch (2558:8): [True: 7, False: 116]
  ------------------
 2559|      7|				return (-1);
 2560|    116|			if (archive_ckd_add_size(&unpack_streams,
  ------------------
  |  Branch (2560:8): [True: 0, False: 116]
  ------------------
 2561|    116|			    unpack_streams, f[i].numUnpackStreams))
 2562|      0|				return (-1);
 2563|    116|		}
 2564|    119|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2564:7): [True: 2, False: 117]
  ------------------
 2565|      2|			return (-1);
 2566|    117|		type = *p;
 2567|    117|	} else
 2568|    135|		unpack_streams = numFolders;
 2569|       |
 2570|    252|	if (unpack_streams > UMAX_ENTRY)
  ------------------
  |  |  393|    252|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  205|    252|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2570:6): [True: 0, False: 252]
  ------------------
 2571|      0|		return (-1);
 2572|       |
 2573|    252|	if (type != kSize) {
  ------------------
  |  |  131|    252|#define kSize			0x09
  ------------------
  |  Branch (2573:6): [True: 143, False: 109]
  ------------------
 2574|    278|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2574:15): [True: 143, False: 135]
  ------------------
 2575|    143|			if (f[i].numUnpackStreams > 1)
  ------------------
  |  Branch (2575:8): [True: 8, False: 135]
  ------------------
 2576|      8|				return (-1);
 2577|    143|		}
 2578|    143|	}
 2579|       |
 2580|    244|	ss->unpack_streams = unpack_streams;
 2581|    244|	if (unpack_streams) {
  ------------------
  |  Branch (2581:6): [True: 230, False: 14]
  ------------------
 2582|    230|		ss->unpackSizes = calloc(unpack_streams,
 2583|    230|		    sizeof(*ss->unpackSizes));
 2584|    230|		ss->digestsDefined = calloc(unpack_streams,
 2585|    230|		    sizeof(*ss->digestsDefined));
 2586|    230|		ss->digests = calloc(unpack_streams,
 2587|    230|		    sizeof(*ss->digests));
 2588|    230|		if (ss->unpackSizes == NULL || ss->digestsDefined == NULL ||
  ------------------
  |  Branch (2588:7): [True: 0, False: 230]
  |  Branch (2588:34): [True: 0, False: 230]
  ------------------
 2589|    230|		    ss->digests == NULL)
  ------------------
  |  Branch (2589:7): [True: 0, False: 230]
  ------------------
 2590|      0|			return (-1);
 2591|    230|	}
 2592|       |
 2593|    244|	usizes = ss->unpackSizes;
 2594|    462|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2594:14): [True: 241, False: 221]
  ------------------
 2595|    241|		int64_t size, sum;
 2596|    241|		size_t pack;
 2597|       |
 2598|    241|		if (f[i].numUnpackStreams == 0)
  ------------------
  |  Branch (2598:7): [True: 8, False: 233]
  ------------------
 2599|      8|			continue;
 2600|       |
 2601|    233|		sum = 0;
 2602|    233|		if (type == kSize) {
  ------------------
  |  |  131|    233|#define kSize			0x09
  ------------------
  |  Branch (2602:7): [True: 102, False: 131]
  ------------------
 2603|  14.0k|			for (pack = 1; pack < f[i].numUnpackStreams; pack++) {
  ------------------
  |  Branch (2603:19): [True: 14.0k, False: 84]
  ------------------
 2604|  14.0k|				if (parse_7zip_int64(a, usizes) < 0)
  ------------------
  |  Branch (2604:9): [True: 16, False: 13.9k]
  ------------------
 2605|     16|					return (-1);
 2606|  13.9k|				if (archive_ckd_add_i64(&sum, sum, *usizes++))
  ------------------
  |  Branch (2606:9): [True: 2, False: 13.9k]
  ------------------
 2607|      2|					return (-1);
 2608|  13.9k|			}
 2609|    102|		}
 2610|    215|		size = folder_uncompressed_size(&f[i]);
 2611|    215|		if (size < sum)
  ------------------
  |  Branch (2611:7): [True: 5, False: 210]
  ------------------
 2612|      5|			return (-1);
 2613|    210|		*usizes++ = size - sum;
 2614|    210|	}
 2615|       |
 2616|    221|	if (type == kSize) {
  ------------------
  |  |  131|    221|#define kSize			0x09
  ------------------
  |  Branch (2616:6): [True: 86, False: 135]
  ------------------
 2617|     86|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2617:7): [True: 5, False: 81]
  ------------------
 2618|      5|			return (-1);
 2619|     81|		type = *p;
 2620|     81|	}
 2621|       |
 2622|    216|	numDigests = 0;
 2623|    429|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2623:14): [True: 213, False: 216]
  ------------------
 2624|    213|		if (f[i].numUnpackStreams != 1 || !f[i].digest_defined)
  ------------------
  |  Branch (2624:7): [True: 78, False: 135]
  |  Branch (2624:37): [True: 134, False: 1]
  ------------------
 2625|    212|			if (archive_ckd_add_size(&numDigests,
  ------------------
  |  Branch (2625:8): [True: 0, False: 212]
  ------------------
 2626|    212|			    numDigests, f[i].numUnpackStreams)) {
 2627|      0|				errno = ENOMEM;
 2628|      0|				return (-1);
 2629|      0|			}
 2630|    213|	}
 2631|       |
 2632|    216|	if (type == kCRC) {
  ------------------
  |  |  132|    216|#define kCRC			0x0A
  ------------------
  |  Branch (2632:6): [True: 178, False: 38]
  ------------------
 2633|    178|		struct _7z_digests tmpDigests;
 2634|    178|		unsigned char *digestsDefined = ss->digestsDefined;
 2635|    178|		uint32_t *digests = ss->digests;
 2636|    178|		size_t di = 0;
 2637|       |
 2638|    178|		memset(&tmpDigests, 0, sizeof(tmpDigests));
 2639|    178|		if (read_Digests(a, &(tmpDigests), numDigests) < 0) {
  ------------------
  |  Branch (2639:7): [True: 5, False: 173]
  ------------------
 2640|      5|			free_Digest(&tmpDigests);
 2641|      5|			return (-1);
 2642|      5|		}
 2643|    349|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2643:15): [True: 176, False: 173]
  ------------------
 2644|    176|			if (f[i].numUnpackStreams == 1 && f[i].digest_defined) {
  ------------------
  |  Branch (2644:8): [True: 116, False: 60]
  |  Branch (2644:38): [True: 0, False: 116]
  ------------------
 2645|      0|				*digestsDefined++ = 1;
 2646|      0|				*digests++ = f[i].digest;
 2647|    176|			} else {
 2648|    176|				size_t j;
 2649|       |
 2650|    459|				for (j = 0; j < f[i].numUnpackStreams;
  ------------------
  |  Branch (2650:17): [True: 283, False: 176]
  ------------------
 2651|    283|				    j++, di++) {
 2652|    283|					*digestsDefined++ =
 2653|    283|					    tmpDigests.defineds[di];
 2654|    283|					*digests++ =
 2655|    283|					    tmpDigests.digests[di];
 2656|    283|				}
 2657|    176|			}
 2658|    176|		}
 2659|    173|		free_Digest(&tmpDigests);
 2660|    173|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2660:7): [True: 2, False: 171]
  ------------------
 2661|      2|			return (-1);
 2662|    171|		type = *p;
 2663|    171|	}
 2664|       |
 2665|       |	/*
 2666|       |	 *  Must be kEnd.
 2667|       |	 */
 2668|    209|	if (type != kEnd)
  ------------------
  |  |  122|    209|#define kEnd			0x00
  ------------------
  |  Branch (2668:6): [True: 11, False: 198]
  ------------------
 2669|     11|		return (-1);
 2670|    198|	return (0);
 2671|    209|}
archive_read_support_format_7zip.c:folder_uncompressed_size:
 2511|    735|{
 2512|    735|	size_t n = f->numOutStreams;
 2513|    735|	size_t pairs = f->numBindPairs;
 2514|       |
 2515|    824|	while (n-- > 0) {
  ------------------
  |  Branch (2515:9): [True: 824, False: 0]
  ------------------
 2516|    824|		size_t i;
 2517|  2.83k|		for (i = 0; i < pairs; i++) {
  ------------------
  |  Branch (2517:15): [True: 2.10k, False: 735]
  ------------------
 2518|  2.10k|			if (f->bindPairs[i].outIndex == n)
  ------------------
  |  Branch (2518:8): [True: 89, False: 2.01k]
  ------------------
 2519|     89|				break;
 2520|  2.10k|		}
 2521|    824|		if (i >= pairs)
  ------------------
  |  Branch (2521:7): [True: 735, False: 89]
  ------------------
 2522|    735|			return (f->unPackSize[n]);
 2523|    824|	}
 2524|      0|	return (0);
 2525|    735|}
archive_read_support_format_7zip.c:read_consume:
 1211|  1.19M|{
 1212|  1.19M|	struct _7zip *zip = a->format->data;
 1213|       |
 1214|  1.19M|	if (zip->pack_stream_bytes_unconsumed) {
  ------------------
  |  Branch (1214:6): [True: 1.19M, False: 0]
  ------------------
 1215|  1.19M|		int64_t r;
 1216|       |
 1217|  1.19M|		if ((r = __archive_read_consume(a,
  ------------------
  |  Branch (1217:7): [True: 0, False: 1.19M]
  ------------------
 1218|  1.19M|		    zip->pack_stream_bytes_unconsumed)) < 0)
 1219|      0|			return ((int)r);
 1220|       |
 1221|  1.19M|		zip->stream_offset += zip->pack_stream_bytes_unconsumed;
 1222|  1.19M|		zip->pack_stream_bytes_unconsumed = 0;
 1223|  1.19M|	}
 1224|       |
 1225|  1.19M|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.19M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1226|  1.19M|}
archive_read_support_format_7zip.c:setup_decode_folder:
 3828|    500|{
 3829|    500|	struct _7zip *zip = a->format->data;
 3830|    500|	const struct _7z_coder *coder1, *coder2;
 3831|    500|	const char *cname = (header)?"archive header":"file content";
  ------------------
  |  Branch (3831:22): [True: 391, False: 109]
  ------------------
 3832|    500|	size_t i;
 3833|    500|	int r, found_bcj2 = 0;
 3834|       |
 3835|       |	/*
 3836|       |	 * Release the memory which the previous folder used for BCJ2.
 3837|       |	 */
 3838|  2.00k|	for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3838:14): [True: 1.50k, False: 500]
  ------------------
 3839|  1.50k|		free(zip->sub_stream_buff[i]);
 3840|  1.50k|		zip->sub_stream_buff[i] = NULL;
 3841|  1.50k|	}
 3842|       |
 3843|       |	/*
 3844|       |	 * Check coder types before modifying any stream-reader state, so that
 3845|       |	 * an early return leaves zip unchanged (avoids partially-initialized
 3846|       |	 * state that callers would have to reason about).
 3847|       |	 */
 3848|  1.18k|	for (i = 0; i < folder->numCoders; i++) {
  ------------------
  |  Branch (3848:14): [True: 684, False: 500]
  ------------------
 3849|    684|		switch(folder->coders[i].codec) {
  ------------------
  |  Branch (3849:10): [True: 24, False: 660]
  ------------------
 3850|      0|			case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (3850:4): [True: 0, False: 684]
  ------------------
 3851|      0|			case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (3851:4): [True: 0, False: 684]
  ------------------
 3852|      0|			case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (3852:4): [True: 0, False: 684]
  ------------------
 3853|       |				/* For entry that is associated with this folder, mark
 3854|       |				   it as encrypted (data+metadata). */
 3855|      0|				zip->has_encrypted_entries = 1;
 3856|      0|				if (a->entry) {
  ------------------
  |  Branch (3856:9): [True: 0, False: 0]
  ------------------
 3857|      0|					archive_entry_set_is_data_encrypted(a->entry, 1);
 3858|      0|					archive_entry_set_is_metadata_encrypted(a->entry, 1);
 3859|      0|				}
 3860|      0|				archive_set_error(&(a->archive),
 3861|      0|					ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3862|      0|					"The %s is encrypted, "
 3863|      0|					"but currently not supported", cname);
 3864|      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 (3864:13): [True: 0, False: 0]
  ------------------
 3865|      0|			}
 3866|     24|			case _7Z_X86_BCJ2: {
  ------------------
  |  |  108|     24|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3866:4): [True: 24, False: 660]
  ------------------
 3867|     24|				found_bcj2++;
 3868|     24|				break;
 3869|      0|			}
 3870|    684|		}
 3871|    684|	}
 3872|       |	/* Now that we've checked for encryption, if there were still no
 3873|       |	 * encrypted entries found we can say for sure that there are none.
 3874|       |	 */
 3875|    500|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|    500|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (3875:6): [True: 0, False: 500]
  ------------------
 3876|      0|		zip->has_encrypted_entries = 0;
 3877|      0|	}
 3878|       |
 3879|    500|	if ((folder->numCoders > 2 && !found_bcj2) || found_bcj2 > 1) {
  ------------------
  |  Branch (3879:7): [True: 24, False: 476]
  |  Branch (3879:32): [True: 1, False: 23]
  |  Branch (3879:48): [True: 0, False: 499]
  ------------------
 3880|      1|		archive_set_error(&(a->archive),
 3881|      1|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3882|      1|		    "The %s is encoded with many filters, "
 3883|      1|		    "but currently not supported", cname);
 3884|      1|		return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  239|      1|#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 (3884:11): [True: 1, False: 0]
  ------------------
 3885|      1|	}
 3886|       |
 3887|       |	/*
 3888|       |	 * Initialize a stream reader.
 3889|       |	 */
 3890|    499|	zip->pack_stream_remaining = folder->numPackedStreams;
 3891|    499|	zip->pack_stream_index = folder->packIndex;
 3892|    499|	zip->folder_outbytes_remaining = folder_uncompressed_size(folder);
 3893|    499|	zip->uncompressed_buffer_bytes_remaining = 0;
 3894|    499|	coder1 = &(folder->coders[0]);
 3895|    499|	if (folder->numCoders == 2)
  ------------------
  |  Branch (3895:6): [True: 113, False: 386]
  ------------------
 3896|    113|		coder2 = &(folder->coders[1]);
 3897|    386|	else
 3898|    386|		coder2 = NULL;
 3899|       |
 3900|    499|	if (found_bcj2) {
  ------------------
  |  Branch (3900:6): [True: 24, False: 475]
  ------------------
 3901|       |		/*
 3902|       |		 * Preparation to decode BCJ2.
 3903|       |		 * Decoding BCJ2 requires four sources. Those are at least,
 3904|       |		 * as far as I know, two types of the storage form.
 3905|       |		 */
 3906|     24|		const struct _7z_coder *fc = folder->coders;
 3907|     24|		static const struct _7z_coder coder_copy = {0, 1, 1, 0, NULL};
 3908|     24|		const struct _7z_coder *scoder[3] =
 3909|     24|			{&coder_copy, &coder_copy, &coder_copy};
 3910|     24|		const void *buff;
 3911|     24|		ssize_t bytes;
 3912|     24|		unsigned char *b[3] = {NULL, NULL, NULL};
 3913|     24|		int64_t sunpack[3] ={-1, -1, -1};
 3914|     24|		int64_t remaining;
 3915|     24|		size_t s[3] = {0, 0, 0};
 3916|     24|		int idx[3] = {0, 1, 2};
 3917|       |
 3918|     24|		if (folder->numCoders == 4 && fc[3].codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  108|     47|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3918:7): [True: 23, False: 1]
  |  Branch (3918:33): [True: 23, False: 0]
  ------------------
 3919|     23|		    folder->numInStreams == 7 && folder->numOutStreams == 4 &&
  ------------------
  |  Branch (3919:7): [True: 23, False: 0]
  |  Branch (3919:36): [True: 23, False: 0]
  ------------------
 3920|     23|		    zip->pack_stream_remaining == 4) {
  ------------------
  |  Branch (3920:7): [True: 23, False: 0]
  ------------------
 3921|       |			/* Source type 1 made by 7zr or 7z with -m options. */
 3922|     23|			if (folder->bindPairs[0].inIndex == 5) {
  ------------------
  |  Branch (3922:8): [True: 23, False: 0]
  ------------------
 3923|       |				/* The form made by 7zr */
 3924|     23|				idx[0] = 1; idx[1] = 2; idx[2] = 0;
 3925|     23|				scoder[1] = &(fc[1]);
 3926|     23|				scoder[2] = &(fc[0]);
 3927|     23|				sunpack[1] = folder->unPackSize[1];
 3928|     23|				sunpack[2] = folder->unPackSize[0];
 3929|     23|				coder1 = &(fc[2]);
 3930|     23|			} else {
 3931|       |				/*
 3932|       |				 * NOTE: Some patterns do not work.
 3933|       |				 * work:
 3934|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=COPY
 3935|       |				 *       -m3=(any)
 3936|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=(any)
 3937|       |				 *       -m3=COPY
 3938|       |				 *  7z a -m0=BCJ2 -m1=(any) -m2=COPY
 3939|       |				 *       -m3=COPY
 3940|       |				 * not work:
 3941|       |				 *  other patterns.
 3942|       |				 *
 3943|       |				 * We have to handle this like `pipe' or
 3944|       |				 * our libarchive7s filter frame work,
 3945|       |				 * decoding the BCJ2 main stream sequentially,
 3946|       |				 * m3 -> m2 -> m1 -> BCJ2.
 3947|       |				 *
 3948|       |				 */
 3949|      0|				if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3949:9): [True: 0, False: 0]
  ------------------
 3950|      0|				    fc[1].codec == _7Z_COPY)
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3950:9): [True: 0, False: 0]
  ------------------
 3951|      0|					coder1 = &(folder->coders[2]);
 3952|      0|				else if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3952:14): [True: 0, False: 0]
  ------------------
 3953|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3953:9): [True: 0, False: 0]
  ------------------
 3954|      0|					coder1 = &(folder->coders[1]);
 3955|      0|				else if (fc[1].codec == _7Z_COPY &&
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3955:14): [True: 0, False: 0]
  ------------------
 3956|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   95|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3956:9): [True: 0, False: 0]
  ------------------
 3957|      0|					coder1 = &(folder->coders[0]);
 3958|      0|				else {
 3959|      0|					archive_set_error(&(a->archive),
 3960|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3961|      0|					    "Unsupported form of "
 3962|      0|					    "BCJ2 streams");
 3963|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3964|      0|				}
 3965|      0|			}
 3966|     23|			coder2 = &(fc[3]);
 3967|     23|			remaining = folder->unPackSize[2];
 3968|     23|		} else if (coder2 != NULL && coder2->codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  108|      2|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3968:14): [True: 1, False: 0]
  |  Branch (3968:32): [True: 1, False: 0]
  ------------------
 3969|      1|		    zip->pack_stream_remaining == 4 &&
  ------------------
  |  Branch (3969:7): [True: 0, False: 1]
  ------------------
 3970|      0|		    folder->numInStreams == 5 && folder->numOutStreams == 2) {
  ------------------
  |  Branch (3970:7): [True: 0, False: 0]
  |  Branch (3970:36): [True: 0, False: 0]
  ------------------
 3971|       |			/* Source type 0 made by 7z */
 3972|      0|			remaining = folder->unPackSize[0];
 3973|      1|		} else {
 3974|       |			/* We got an unexpected form. */
 3975|      1|			archive_set_error(&(a->archive),
 3976|      1|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3977|      1|			    "Unsupported form of BCJ2 streams");
 3978|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3979|      1|		}
 3980|     23|		zip->main_stream_bytes_remaining = remaining;
 3981|       |
 3982|       |
 3983|       |		/* Skip the main stream at this time. */
 3984|     23|		if ((r = seek_pack(a)) < 0)
  ------------------
  |  Branch (3984:7): [True: 0, False: 23]
  ------------------
 3985|      0|			return (r);
 3986|     23|		zip->pack_stream_bytes_unconsumed =
 3987|     23|		    zip->pack_stream_inbytes_remaining;
 3988|     23|		if ((r = read_consume(a)) < 0)
  ------------------
  |  Branch (3988:7): [True: 0, False: 23]
  ------------------
 3989|      0|			return (r);
 3990|       |
 3991|       |		/* Read following three sub streams. */
 3992|     89|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3992:15): [True: 68, False: 21]
  ------------------
 3993|     68|			const struct _7z_coder *coder = scoder[i];
 3994|       |
 3995|     68|			if ((r = seek_pack(a)) < 0) {
  ------------------
  |  Branch (3995:8): [True: 0, False: 68]
  ------------------
 3996|      0|				free(b[0]); free(b[1]); free(b[2]);
 3997|      0|				return (r);
 3998|      0|			}
 3999|       |
 4000|     68|			if (sunpack[i] == -1)
  ------------------
  |  Branch (4000:8): [True: 23, False: 45]
  ------------------
 4001|     23|				zip->folder_outbytes_remaining =
 4002|     23|				    zip->pack_stream_inbytes_remaining;
 4003|     45|			else
 4004|     45|				zip->folder_outbytes_remaining = sunpack[i];
 4005|       |
 4006|     68|			r = init_decompression(a, zip, coder, NULL);
 4007|     68|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|     68|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4007:8): [True: 0, False: 68]
  ------------------
 4008|      0|				free(b[0]); free(b[1]); free(b[2]);
 4009|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4010|      0|			}
 4011|       |
 4012|       |			/* Allocate memory for the decoded data of a sub
 4013|       |			 * stream. */
 4014|     68|			if ((uint64_t)zip->folder_outbytes_remaining > SIZE_MAX) {
  ------------------
  |  Branch (4014:8): [True: 0, False: 68]
  ------------------
 4015|      0|				free(b[0]); free(b[1]); free(b[2]);
 4016|      0|				archive_set_error(&a->archive,
 4017|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4018|      0|				    "7-Zip sub-stream size exceeds "
 4019|      0|				    "platform maximum");
 4020|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4021|      0|			}
 4022|     68|			b[i] = malloc((size_t)zip->folder_outbytes_remaining);
 4023|     68|			if (b[i] == NULL) {
  ------------------
  |  Branch (4023:8): [True: 0, False: 68]
  ------------------
 4024|      0|				free(b[0]); free(b[1]); free(b[2]);
 4025|      0|				archive_set_error(&a->archive, ENOMEM,
 4026|      0|				    "No memory for 7-Zip decompression");
 4027|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4028|      0|			}
 4029|       |
 4030|       |			/* Extract a sub stream. */
 4031|    134|			while (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (4031:11): [True: 68, False: 66]
  ------------------
 4032|     68|				r = (int)extract_pack_stream(a, 0);
 4033|     68|				if (r < 0) {
  ------------------
  |  Branch (4033:9): [True: 2, False: 66]
  ------------------
 4034|      2|					free(b[0]); free(b[1]); free(b[2]);
 4035|      2|					return (r);
 4036|      2|				}
 4037|     66|				bytes = get_uncompressed_data(a, &buff,
 4038|     66|				    zip->uncompressed_buffer_bytes_remaining,
 4039|     66|				    0);
 4040|     66|				if (bytes < 0) {
  ------------------
  |  Branch (4040:9): [True: 0, False: 66]
  ------------------
 4041|      0|					free(b[0]); free(b[1]); free(b[2]);
 4042|      0|					return ((int)bytes);
 4043|      0|				}
 4044|     66|				memcpy(b[i]+s[i], buff, bytes);
 4045|     66|				s[i] += bytes;
 4046|     66|				if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4046:9): [True: 66, False: 0]
  ------------------
 4047|     66|					read_consume(a);
 4048|     66|			}
 4049|     68|		}
 4050|       |
 4051|       |		/* Set the sub streams to the right place. */
 4052|     84|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4052:15): [True: 63, False: 21]
  ------------------
 4053|     63|			zip->sub_stream_buff[i] = b[idx[i]];
 4054|     63|			zip->sub_stream_size[i] = s[idx[i]];
 4055|     63|			zip->sub_stream_bytes_remaining[i] = s[idx[i]];
 4056|     63|		}
 4057|       |
 4058|       |		/* Allocate memory used for decoded main stream bytes. */
 4059|     21|		if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4059:7): [True: 21, False: 0]
  ------------------
 4060|     21|			zip->tmp_stream_buff_size = 32 * 1024;
 4061|     21|			zip->tmp_stream_buff =
 4062|     21|			    malloc(zip->tmp_stream_buff_size);
 4063|     21|			if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4063:8): [True: 0, False: 21]
  ------------------
 4064|      0|				archive_set_error(&a->archive, ENOMEM,
 4065|      0|				    "No memory for 7-Zip decompression");
 4066|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4067|      0|			}
 4068|     21|		}
 4069|     21|		zip->tmp_stream_bytes_avail = 0;
 4070|     21|		zip->tmp_stream_bytes_remaining = 0;
 4071|     21|		zip->odd_bcj_size = 0;
 4072|     21|		zip->bcj2_outPos = 0;
 4073|       |
 4074|       |		/*
 4075|       |		 * Reset a stream reader in order to read the main stream
 4076|       |		 * of BCJ2.
 4077|       |		 */
 4078|     21|		zip->pack_stream_remaining = 1;
 4079|     21|		zip->pack_stream_index = folder->packIndex;
 4080|     21|		zip->folder_outbytes_remaining =
 4081|     21|		    folder_uncompressed_size(folder);
 4082|     21|		zip->uncompressed_buffer_bytes_remaining = 0;
 4083|     21|	}
 4084|       |
 4085|       |	/*
 4086|       |	 * Initialize the decompressor for the new folder's pack streams.
 4087|       |	 */
 4088|    496|	r = init_decompression(a, zip, coder1, coder2);
 4089|    496|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    496|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4089:6): [True: 34, False: 462]
  ------------------
 4090|     34|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     34|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4091|    462|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    462|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4092|    496|}
archive_read_support_format_7zip.c:init_decompression:
 1326|    564|{
 1327|    564|	int r;
 1328|       |
 1329|    564|	zip->codec = coder1->codec;
 1330|    564|	zip->codec2 = -1;
 1331|       |
 1332|    564|	switch (zip->codec) {
 1333|    156|	case _7Z_COPY:
  ------------------
  |  |   95|    156|#define _7Z_COPY	0
  ------------------
  |  Branch (1333:2): [True: 156, False: 408]
  ------------------
 1334|    156|	case _7Z_BZ2:
  ------------------
  |  |   99|    156|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1334:2): [True: 0, False: 564]
  ------------------
 1335|    156|	case _7Z_DEFLATE:
  ------------------
  |  |   98|    156|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1335:2): [True: 0, False: 564]
  ------------------
 1336|    156|	case _7Z_ZSTD:
  ------------------
  |  |  117|    156|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1336:2): [True: 0, False: 564]
  ------------------
 1337|    365|	case _7Z_PPMD:
  ------------------
  |  |  100|    365|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1337:2): [True: 209, False: 355]
  ------------------
 1338|    365|		if (coder2 != NULL) {
  ------------------
  |  Branch (1338:7): [True: 83, False: 282]
  ------------------
 1339|     83|			if (coder2->codec != _7Z_X86 &&
  ------------------
  |  |  107|    166|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1339:8): [True: 67, False: 16]
  ------------------
 1340|     67|			    coder2->codec != _7Z_X86_BCJ2 &&
  ------------------
  |  |  108|    150|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1340:8): [True: 67, False: 0]
  ------------------
 1341|     67|			    coder2->codec != _7Z_ARM &&
  ------------------
  |  |  111|    150|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1341:8): [True: 56, False: 11]
  ------------------
 1342|     56|			    coder2->codec != _7Z_ARM64 &&
  ------------------
  |  |  113|    139|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1342:8): [True: 33, False: 23]
  ------------------
 1343|     33|			    coder2->codec != _7Z_POWERPC &&
  ------------------
  |  |  109|    116|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1343:8): [True: 17, False: 16]
  ------------------
 1344|     17|			    coder2->codec != _7Z_SPARC) {
  ------------------
  |  |  115|     17|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1344:8): [True: 3, False: 14]
  ------------------
 1345|      3|				archive_set_error(&a->archive,
 1346|      3|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1347|      3|				    "Unsupported filter %jx for %jx",
 1348|      3|				    (uintmax_t)coder2->codec,
 1349|      3|				    (uintmax_t)coder1->codec);
 1350|      3|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1351|      3|			}
 1352|     80|			zip->codec2 = coder2->codec;
 1353|     80|			zip->bcj_state = 0;
 1354|     80|			if (coder2->codec == _7Z_X86)
  ------------------
  |  |  107|     80|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1354:8): [True: 16, False: 64]
  ------------------
 1355|     16|				x86_Init(zip);
 1356|     64|			else if (coder2->codec == _7Z_ARM)
  ------------------
  |  |  111|     64|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1356:13): [True: 11, False: 53]
  ------------------
 1357|     11|				arm_Init(zip);
 1358|     80|		}
 1359|    362|		break;
 1360|    362|	default:
  ------------------
  |  Branch (1360:2): [True: 199, False: 365]
  ------------------
 1361|    199|		break;
 1362|    564|	}
 1363|       |
 1364|    561|	switch (zip->codec) {
 1365|    153|	case _7Z_COPY:
  ------------------
  |  |   95|    153|#define _7Z_COPY	0
  ------------------
  |  Branch (1365:2): [True: 153, False: 408]
  ------------------
 1366|    153|		break;
 1367|       |
 1368|    175|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   96|    136|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   97|    175|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1368:2): [True: 136, False: 425]
  |  Branch (1368:17): [True: 39, False: 522]
  ------------------
 1369|    175|#ifdef HAVE_LZMA_H
 1370|    175|#if LZMA_VERSION_MAJOR >= 5
 1371|       |/* Effectively disable the limiter. */
 1372|    175|#define LZMA_MEMLIMIT   UINT64_MAX
 1373|       |#else
 1374|       |/* NOTE: This needs to check memory size which running system has. */
 1375|       |#define LZMA_MEMLIMIT   (1U << 30)
 1376|       |#endif
 1377|    175|	{
 1378|    175|		lzma_options_delta delta_opt;
 1379|    175|		lzma_filter filters[LZMA_FILTERS_MAX], *ff;
 1380|    175|		int fi = 0;
 1381|       |
 1382|    175|		if (zip->lzstream_valid) {
  ------------------
  |  Branch (1382:7): [True: 101, False: 74]
  ------------------
 1383|    101|			lzma_end(&(zip->lzstream));
 1384|    101|			zip->lzstream_valid = 0;
 1385|    101|		}
 1386|       |
 1387|       |		/*
 1388|       |		 * NOTE: liblzma incompletely handle the BCJ+LZMA compressed
 1389|       |		 * data made by 7-Zip because 7-Zip does not add End-Of-
 1390|       |		 * Payload Marker(EOPM) at the end of LZMA compressed data,
 1391|       |		 * and so liblzma cannot know the end of the compressed data
 1392|       |		 * without EOPM. So consequently liblzma will not return last
 1393|       |		 * three or four bytes of uncompressed data because
 1394|       |		 * LZMA_FILTER_X86 filter does not handle input data if its
 1395|       |		 * data size is less than five bytes. If liblzma detect EOPM
 1396|       |		 * or know the uncompressed data size, liblzma will flush out
 1397|       |		 * the remaining that three or four bytes of uncompressed
 1398|       |		 * data. That is why we have to use our converting program
 1399|       |		 * for BCJ+LZMA. If we were able to tell the uncompressed
 1400|       |		 * size to liblzma when using lzma_raw_decoder() liblzma
 1401|       |		 * could correctly deal with BCJ+LZMA. But unfortunately
 1402|       |		 * there is no way to do that.
 1403|       |		 *
 1404|       |		 * Reference: https://web.archive.org/web/20240405171610/https://www.mail-archive.com/xz-devel@tukaani.org/msg00373.html
 1405|       |		 */
 1406|    175|		if (coder2 != NULL) {
  ------------------
  |  Branch (1406:7): [True: 50, False: 125]
  ------------------
 1407|     50|			zip->codec2 = coder2->codec;
 1408|       |
 1409|     50|			filters[fi].options = NULL;
 1410|     50|			switch (zip->codec2) {
 1411|     25|			case _7Z_X86:
  ------------------
  |  |  107|     25|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1411:4): [True: 25, False: 25]
  ------------------
 1412|     25|				if (zip->codec == _7Z_LZMA2) {
  ------------------
  |  |   97|     25|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1412:9): [True: 0, False: 25]
  ------------------
 1413|      0|					filters[fi].id = LZMA_FILTER_X86;
 1414|      0|					fi++;
 1415|      0|				} else
 1416|       |					/* Use our filter. */
 1417|     25|					x86_Init(zip);
 1418|     25|				break;
 1419|     21|			case _7Z_X86_BCJ2:
  ------------------
  |  |  108|     21|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1419:4): [True: 21, False: 29]
  ------------------
 1420|       |				/* Use our filter. */
 1421|     21|				zip->bcj_state = 0;
 1422|     21|				break;
 1423|      0|			case _7Z_DELTA:
  ------------------
  |  |  101|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1423:4): [True: 0, False: 50]
  ------------------
 1424|      0|				if (coder2->propertiesSize != 1) {
  ------------------
  |  Branch (1424:9): [True: 0, False: 0]
  ------------------
 1425|      0|					archive_set_error(&a->archive,
 1426|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1427|      0|					    "Invalid Delta parameter");
 1428|      0|					return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1429|      0|				}
 1430|      0|				filters[fi].id = LZMA_FILTER_DELTA;
 1431|      0|				memset(&delta_opt, 0, sizeof(delta_opt));
 1432|      0|				delta_opt.type = LZMA_DELTA_TYPE_BYTE;
 1433|      0|				delta_opt.dist =
 1434|      0|				    coder2->properties[0] + 1;
 1435|      0|				filters[fi].options = &delta_opt;
 1436|      0|				fi++;
 1437|      0|				break;
 1438|       |			/* Following filters have not been tested yet. */
 1439|      1|			case _7Z_POWERPC:
  ------------------
  |  |  109|      1|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1439:4): [True: 1, False: 49]
  ------------------
 1440|      1|				filters[fi].id = LZMA_FILTER_POWERPC;
 1441|      1|				fi++;
 1442|      1|				break;
 1443|      1|			case _7Z_IA64:
  ------------------
  |  |  110|      1|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1443:4): [True: 1, False: 49]
  ------------------
 1444|      1|				filters[fi].id = LZMA_FILTER_IA64;
 1445|      1|				fi++;
 1446|      1|				break;
 1447|      1|			case _7Z_ARM:
  ------------------
  |  |  111|      1|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1447:4): [True: 1, False: 49]
  ------------------
 1448|      1|				filters[fi].id = LZMA_FILTER_ARM;
 1449|      1|				fi++;
 1450|      1|				break;
 1451|      0|			case _7Z_ARMTHUMB:
  ------------------
  |  |  112|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1451:4): [True: 0, False: 50]
  ------------------
 1452|      0|				filters[fi].id = LZMA_FILTER_ARMTHUMB;
 1453|      0|				fi++;
 1454|      0|				break;
 1455|       |#ifdef LZMA_FILTER_ARM64
 1456|       |			case _7Z_ARM64:
 1457|       |				filters[fi].id = LZMA_FILTER_ARM64;
 1458|       |				fi++;
 1459|       |				break;
 1460|       |#endif
 1461|       |#ifdef LZMA_FILTER_RISCV
 1462|       |			case _7Z_RISCV:
 1463|       |				filters[fi].id = LZMA_FILTER_RISCV;
 1464|       |				fi++;
 1465|       |				break;
 1466|       |#endif
 1467|      0|			case _7Z_SPARC:
  ------------------
  |  |  115|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1467:4): [True: 0, False: 50]
  ------------------
 1468|      0|				filters[fi].id = LZMA_FILTER_SPARC;
 1469|      0|				fi++;
 1470|      0|				break;
 1471|      1|			default:
  ------------------
  |  Branch (1471:4): [True: 1, False: 49]
  ------------------
 1472|      1|				archive_set_error(&a->archive,
 1473|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1474|      1|				    "Unexpected codec ID: %jX",
 1475|      1|				    (uintmax_t)zip->codec2);
 1476|      1|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1477|     50|			}
 1478|     50|		}
 1479|       |
 1480|    174|		if (zip->codec == _7Z_LZMA2)
  ------------------
  |  |   97|    174|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1480:7): [True: 39, False: 135]
  ------------------
 1481|     39|			filters[fi].id = LZMA_FILTER_LZMA2;
 1482|    135|		else
 1483|    135|			filters[fi].id = LZMA_FILTER_LZMA1;
 1484|    174|		filters[fi].options = NULL;
 1485|    174|		ff = &filters[fi];
 1486|    174|		r = lzma_properties_decode(&filters[fi], NULL,
 1487|    174|		    coder1->properties, coder1->propertiesSize);
 1488|    174|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1488:7): [True: 2, False: 172]
  ------------------
 1489|      2|			set_error(a, r);
 1490|      2|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1491|      2|		}
 1492|    172|		fi++;
 1493|       |
 1494|    172|		filters[fi].id = LZMA_VLI_UNKNOWN;
 1495|    172|		filters[fi].options = NULL;
 1496|    172|		r = lzma_raw_decoder(&(zip->lzstream), filters);
 1497|    172|		free(ff->options);
 1498|    172|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1498:7): [True: 0, False: 172]
  ------------------
 1499|      0|			set_error(a, r);
 1500|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1501|      0|		}
 1502|    172|		zip->lzstream_valid = 1;
 1503|    172|		zip->lzstream.total_in = 0;
 1504|    172|		zip->lzstream.total_out = 0;
 1505|    172|		break;
 1506|    172|	}
 1507|       |#else
 1508|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1509|       |		    "LZMA codec is unsupported");
 1510|       |		return (ARCHIVE_FAILED);
 1511|       |#endif
 1512|      0|	case _7Z_BZ2:
  ------------------
  |  |   99|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1512:2): [True: 0, False: 561]
  ------------------
 1513|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1514|      0|		if (zip->bzstream_valid) {
  ------------------
  |  Branch (1514:7): [True: 0, False: 0]
  ------------------
 1515|      0|			BZ2_bzDecompressEnd(&(zip->bzstream));
 1516|      0|			zip->bzstream_valid = 0;
 1517|      0|		}
 1518|      0|		r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 0);
 1519|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1519:7): [True: 0, False: 0]
  ------------------
 1520|      0|			r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 1);
 1521|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1521:7): [True: 0, False: 0]
  ------------------
 1522|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1523|      0|			const char *detail = NULL;
 1524|      0|			switch (r) {
  ------------------
  |  Branch (1524:12): [True: 0, False: 0]
  ------------------
 1525|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1525:4): [True: 0, False: 0]
  ------------------
 1526|      0|				detail = "invalid setup parameter";
 1527|      0|				break;
 1528|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1528:4): [True: 0, False: 0]
  ------------------
 1529|      0|				err = ENOMEM;
 1530|      0|				detail = "out of memory";
 1531|      0|				break;
 1532|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1532:4): [True: 0, False: 0]
  ------------------
 1533|      0|				detail = "mis-compiled library";
 1534|      0|				break;
 1535|      0|			}
 1536|      0|			archive_set_error(&a->archive, err,
 1537|      0|			    "Internal error initializing decompressor: %s",
 1538|      0|			    detail != NULL ? detail : "??");
  ------------------
  |  Branch (1538:8): [True: 0, False: 0]
  ------------------
 1539|      0|			zip->bzstream_valid = 0;
 1540|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1541|      0|		}
 1542|      0|		zip->bzstream_valid = 1;
 1543|      0|		zip->bzstream.total_in_lo32 = 0;
 1544|      0|		zip->bzstream.total_in_hi32 = 0;
 1545|      0|		zip->bzstream.total_out_lo32 = 0;
 1546|      0|		zip->bzstream.total_out_hi32 = 0;
 1547|      0|		break;
 1548|       |#else
 1549|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1550|       |		    "BZ2 codec is unsupported");
 1551|       |		return (ARCHIVE_FAILED);
 1552|       |#endif
 1553|      0|	case _7Z_ZSTD:
  ------------------
  |  |  117|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1553:2): [True: 0, False: 561]
  ------------------
 1554|      0|	{
 1555|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1556|       |		if (zip->zstdstream_valid) {
 1557|       |			ZSTD_freeDStream(zip->zstd_dstream);
 1558|       |			zip->zstdstream_valid = 0;
 1559|       |		}
 1560|       |		zip->zstd_dstream = ZSTD_createDStream();
 1561|       |		zip->zstdstream_valid = 1;
 1562|       |		break;
 1563|       |#else
 1564|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1565|      0|			"ZSTD codec is unsupported");
 1566|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1567|      0|#endif
 1568|      0|	}
 1569|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   98|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1569:2): [True: 0, False: 561]
  ------------------
 1570|      0|#ifdef HAVE_ZLIB_H
 1571|      0|		if (zip->stream_valid)
  ------------------
  |  Branch (1571:7): [True: 0, False: 0]
  ------------------
 1572|      0|			r = inflateReset(&(zip->stream));
 1573|      0|		else
 1574|      0|			r = inflateInit2(&(zip->stream),
 1575|      0|			    -15 /* Don't check for zlib header */);
 1576|      0|		if (r != Z_OK) {
  ------------------
  |  Branch (1576:7): [True: 0, False: 0]
  ------------------
 1577|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1578|      0|			    "Couldn't initialize zlib stream");
 1579|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1580|      0|		}
 1581|      0|		zip->stream_valid = 1;
 1582|      0|		zip->stream.total_in = 0;
 1583|      0|		zip->stream.total_out = 0;
 1584|      0|		break;
 1585|       |#else
 1586|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1587|       |		    "DEFLATE codec is unsupported");
 1588|       |		return (ARCHIVE_FAILED);
 1589|       |#endif
 1590|    209|	case _7Z_PPMD:
  ------------------
  |  |  100|    209|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1590:2): [True: 209, False: 352]
  ------------------
 1591|    209|	{
 1592|    209|		unsigned order;
 1593|    209|		uint32_t msize;
 1594|       |
 1595|    209|		if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1595:7): [True: 0, False: 209]
  ------------------
 1596|      0|			__archive_ppmd7_functions.Ppmd7_Free(
 1597|      0|			    &zip->ppmd7_context);
 1598|      0|			zip->ppmd7_valid = 0;
 1599|      0|		}
 1600|       |
 1601|    209|		if (coder1->propertiesSize < 5) {
  ------------------
  |  Branch (1601:7): [True: 1, False: 208]
  ------------------
 1602|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1603|      1|			    "Malformed PPMd parameter");
 1604|      1|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1605|      1|		}
 1606|    208|		order = coder1->properties[0];
 1607|    208|		msize = archive_le32dec(&(coder1->properties[1]));
 1608|    208|		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   18|    416|#define PPMD7_MIN_ORDER 2
  ------------------
              		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   19|    415|#define PPMD7_MAX_ORDER 64
  ------------------
  |  Branch (1608:7): [True: 1, False: 207]
  |  Branch (1608:34): [True: 1, False: 206]
  ------------------
 1609|    206|		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   21|    414|#define PPMD7_MIN_MEM_SIZE (1 << 11)
  ------------------
              		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   22|    206|#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3)
  ------------------
  |  Branch (1609:7): [True: 0, False: 206]
  |  Branch (1609:37): [True: 1, False: 205]
  ------------------
 1610|      3|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1611|      3|			    "Malformed PPMd parameter");
 1612|      3|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1613|      3|		}
 1614|    205|		__archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context);
 1615|    205|		r = __archive_ppmd7_functions.Ppmd7_Alloc(
 1616|    205|			&zip->ppmd7_context, msize);
 1617|    205|		if (r == 0) {
  ------------------
  |  Branch (1617:7): [True: 0, False: 205]
  ------------------
 1618|      0|			archive_set_error(&a->archive, ENOMEM,
 1619|      0|			    "Coludn't allocate memory for PPMd");
 1620|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1621|      0|		}
 1622|    205|		__archive_ppmd7_functions.Ppmd7_Init(
 1623|    205|			&zip->ppmd7_context, order);
 1624|    205|		__archive_ppmd7_functions.Ppmd7z_RangeDec_CreateVTable(
 1625|    205|			&zip->range_dec);
 1626|    205|		zip->ppmd7_valid = 1;
 1627|    205|		zip->ppmd7_stat = 0;
 1628|    205|		zip->ppstream.overconsumed = 0;
 1629|    205|		break;
 1630|    205|	}
 1631|      0|	case _7Z_X86:
  ------------------
  |  |  107|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1631:2): [True: 0, False: 561]
  ------------------
 1632|      0|	case _7Z_X86_BCJ2:
  ------------------
  |  |  108|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1632:2): [True: 0, False: 561]
  ------------------
 1633|      0|	case _7Z_POWERPC:
  ------------------
  |  |  109|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1633:2): [True: 0, False: 561]
  ------------------
 1634|      0|	case _7Z_IA64:
  ------------------
  |  |  110|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1634:2): [True: 0, False: 561]
  ------------------
 1635|      0|	case _7Z_ARM:
  ------------------
  |  |  111|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1635:2): [True: 0, False: 561]
  ------------------
 1636|      0|	case _7Z_ARMTHUMB:
  ------------------
  |  |  112|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1636:2): [True: 0, False: 561]
  ------------------
 1637|      1|	case _7Z_ARM64:
  ------------------
  |  |  113|      1|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1637:2): [True: 1, False: 560]
  ------------------
 1638|      2|	case _7Z_RISCV:
  ------------------
  |  |  114|      2|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1638:2): [True: 1, False: 560]
  ------------------
 1639|      2|	case _7Z_SPARC:
  ------------------
  |  |  115|      2|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1639:2): [True: 0, False: 561]
  ------------------
 1640|      3|	case _7Z_DELTA:
  ------------------
  |  |  101|      3|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1640:2): [True: 1, False: 560]
  ------------------
 1641|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1642|      3|		    "Unexpected codec ID: %jX", (uintmax_t)zip->codec);
 1643|      3|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1644|      0|	case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (1644:2): [True: 0, False: 561]
  ------------------
 1645|      0|	case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (1645:2): [True: 0, False: 561]
  ------------------
 1646|      0|	case _7Z_CRYPTO_AES_256_SHA_256:
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1646:2): [True: 0, False: 561]
  ------------------
 1647|      0|		if (a->entry) {
  ------------------
  |  Branch (1647:7): [True: 0, False: 0]
  ------------------
 1648|      0|			archive_entry_set_is_metadata_encrypted(a->entry, 1);
 1649|      0|			archive_entry_set_is_data_encrypted(a->entry, 1);
 1650|      0|			zip->has_encrypted_entries = 1;
 1651|      0|		}
 1652|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1653|      0|		    "Crypto codec not supported yet (ID: 0x%jX)",
 1654|      0|		    (uintmax_t)zip->codec);
 1655|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1656|     21|	default:
  ------------------
  |  Branch (1656:2): [True: 21, False: 540]
  ------------------
 1657|     21|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     21|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1658|     21|		    "Unknown codec ID: %jX", (uintmax_t)zip->codec);
 1659|     21|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     21|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1660|    561|	}
 1661|       |
 1662|    530|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    530|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1663|    561|}
archive_read_support_format_7zip.c:x86_Init:
 4155|     41|{
 4156|     41|	zip->bcj_state = 0;
 4157|     41|	zip->bcj_prevPosT = (size_t)0 - 1;
 4158|     41|	zip->bcj_prevMask = 0;
 4159|     41|	zip->bcj_ip = 5;
 4160|     41|}
archive_read_support_format_7zip.c:arm_Init:
 4241|     11|{
 4242|     11|	zip->bcj_ip = 8;
 4243|     11|}
archive_read_support_format_7zip.c:set_error:
 1234|      2|{
 1235|       |
 1236|      2|	switch (ret) {
 1237|      0|	case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1237:2): [True: 0, False: 2]
  ------------------
 1238|      0|	case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1238:2): [True: 0, False: 2]
  ------------------
 1239|      0|		break;
 1240|      0|	case LZMA_MEM_ERROR:
  ------------------
  |  Branch (1240:2): [True: 0, False: 2]
  ------------------
 1241|      0|		archive_set_error(&a->archive, ENOMEM,
 1242|      0|		    "Lzma library error: Cannot allocate memory");
 1243|      0|		break;
 1244|      0|	case LZMA_MEMLIMIT_ERROR:
  ------------------
  |  Branch (1244:2): [True: 0, False: 2]
  ------------------
 1245|      0|		archive_set_error(&a->archive, ENOMEM,
 1246|      0|		    "Lzma library error: Out of memory");
 1247|      0|		break;
 1248|      0|	case LZMA_FORMAT_ERROR:
  ------------------
  |  Branch (1248:2): [True: 0, False: 2]
  ------------------
 1249|      0|		archive_set_error(&a->archive,
 1250|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1251|      0|		    "Lzma library error: format not recognized");
 1252|      0|		break;
 1253|      2|	case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (1253:2): [True: 2, False: 0]
  ------------------
 1254|      2|		archive_set_error(&a->archive,
 1255|      2|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1256|      2|		    "Lzma library error: Invalid options");
 1257|      2|		break;
 1258|      0|	case LZMA_DATA_ERROR:
  ------------------
  |  Branch (1258:2): [True: 0, False: 2]
  ------------------
 1259|      0|		archive_set_error(&a->archive,
 1260|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1261|      0|		    "Lzma library error: Corrupted input data");
 1262|      0|		break;
 1263|      0|	case LZMA_BUF_ERROR:
  ------------------
  |  Branch (1263:2): [True: 0, False: 2]
  ------------------
 1264|      0|		archive_set_error(&a->archive,
 1265|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1266|      0|		    "Lzma library error:  No progress is possible");
 1267|      0|		break;
 1268|      0|	default:
  ------------------
  |  Branch (1268:2): [True: 0, False: 2]
  ------------------
 1269|       |		/* Return an error. */
 1270|      0|		archive_set_error(&a->archive,
 1271|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1272|      0|		    "Lzma decompression failed:  Unknown error");
 1273|      0|		break;
 1274|      2|	}
 1275|      2|}
archive_read_support_format_7zip.c:seek_pack:
 3678|    553|{
 3679|    553|	struct _7zip *zip = a->format->data;
 3680|    553|	int64_t pack_offset;
 3681|       |
 3682|    553|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3682:6): [True: 5, False: 548]
  ------------------
 3683|      5|		archive_set_error(&(a->archive),
 3684|      5|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3685|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3686|      5|	}
 3687|    548|	zip->pack_stream_inbytes_remaining =
 3688|    548|	    zip->si.pi.sizes[zip->pack_stream_index];
 3689|    548|	pack_offset = zip->si.pi.positions[zip->pack_stream_index];
 3690|    548|	if (zip->stream_offset != pack_offset) {
  ------------------
  |  Branch (3690:6): [True: 477, False: 71]
  ------------------
 3691|    477|		int64_t target;
 3692|       |
 3693|    477|		if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3693:7): [True: 0, False: 477]
  ------------------
 3694|    477|		    zip->seek_base, pack_offset) ||
 3695|    477|		    0 > seek_compat(a, target, SEEK_SET, 1)) {
  ------------------
  |  Branch (3695:7): [True: 1, False: 476]
  ------------------
 3696|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3697|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3698|      1|		}
 3699|    476|		zip->stream_offset = pack_offset;
 3700|    476|	}
 3701|    547|	zip->pack_stream_index++;
 3702|    547|	zip->pack_stream_remaining--;
 3703|    547|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    547|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3704|    548|}
archive_read_support_format_7zip.c:free_StreamsInfo:
 2675|  22.7k|{
 2676|  22.7k|	free_PackInfo(&(si->pi));
 2677|  22.7k|	free_CodersInfo(&(si->ci));
 2678|  22.7k|	free_SubStreamsInfo(&(si->ss));
 2679|  22.7k|}
archive_read_support_format_7zip.c:free_PackInfo:
 2158|  22.7k|{
 2159|  22.7k|	free(pi->sizes);
 2160|  22.7k|	free(pi->positions);
 2161|  22.7k|	free_Digest(&(pi->digest));
 2162|  22.7k|}
archive_read_support_format_7zip.c:free_CodersInfo:
 2389|  22.7k|{
 2390|  22.7k|	size_t i;
 2391|       |
 2392|  22.7k|	if (ci->folders) {
  ------------------
  |  Branch (2392:6): [True: 1.02k, False: 21.6k]
  ------------------
 2393|   822k|		for (i = 0; i < ci->numFolders; i++)
  ------------------
  |  Branch (2393:15): [True: 821k, False: 1.02k]
  ------------------
 2394|   821k|			free_Folder(&(ci->folders[i]));
 2395|  1.02k|		free(ci->folders);
 2396|  1.02k|	}
 2397|  22.7k|}
archive_read_support_format_7zip.c:free_Folder:
 2240|   821k|{
 2241|   821k|	if (f->coders) {
  ------------------
  |  Branch (2241:6): [True: 2.20k, False: 819k]
  ------------------
 2242|  2.20k|		size_t i;
 2243|       |
 2244|  5.95k|		for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2244:15): [True: 3.74k, False: 2.20k]
  ------------------
 2245|  3.74k|			free(f->coders[i].properties);
 2246|  3.74k|		}
 2247|  2.20k|		free(f->coders);
 2248|  2.20k|	}
 2249|   821k|	free(f->bindPairs);
 2250|   821k|	free(f->unPackSize);
 2251|   821k|}
archive_read_support_format_7zip.c:free_SubStreamsInfo:
 2529|  22.7k|{
 2530|  22.7k|	free(ss->unpackSizes);
 2531|  22.7k|	free(ss->digestsDefined);
 2532|  22.7k|	free(ss->digests);
 2533|  22.7k|}
archive_read_support_format_7zip.c:read_Header:
 2785|  1.51k|{
 2786|  1.51k|	struct _7zip *zip = a->format->data;
 2787|  1.51k|	const unsigned char *p;
 2788|  1.51k|	struct _7z_folder *folders;
 2789|  1.51k|	struct _7z_stream_info *si = &(zip->si);
 2790|  1.51k|	struct _7zip_entry *entries;
 2791|  1.51k|	size_t folderIndex, indexInFolder;
 2792|  1.51k|	size_t i;
 2793|  1.51k|	size_t eindex, empty_streams, sindex;
 2794|  1.51k|	int attr_seen = 0;
 2795|       |
 2796|  1.51k|	if (check_header_id) {
  ------------------
  |  Branch (2796:6): [True: 358, False: 1.15k]
  ------------------
 2797|       |		/*
 2798|       |		 * Read Header.
 2799|       |		 */
 2800|    358|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2800:7): [True: 211, False: 147]
  ------------------
 2801|    211|			return (-1);
 2802|    147|		if (*p != kHeader)
  ------------------
  |  |  123|    147|#define kHeader			0x01
  ------------------
  |  Branch (2802:7): [True: 65, False: 82]
  ------------------
 2803|     65|			return (-1);
 2804|    147|	}
 2805|       |
 2806|       |	/*
 2807|       |	 * Read ArchiveProperties.
 2808|       |	 */
 2809|  1.23k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2809:6): [True: 1, False: 1.23k]
  ------------------
 2810|      1|		return (-1);
 2811|  1.23k|	if (*p == kArchiveProperties) {
  ------------------
  |  |  124|  1.23k|#define kArchiveProperties	0x02
  ------------------
  |  Branch (2811:6): [True: 61, False: 1.17k]
  ------------------
 2812|    611|		for (;;) {
 2813|    611|			int64_t size;
 2814|    611|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2814:8): [True: 5, False: 606]
  ------------------
 2815|      5|				return (-1);
 2816|    606|			if (*p == kEnd)
  ------------------
  |  |  122|    606|#define kEnd			0x00
  ------------------
  |  Branch (2816:8): [True: 21, False: 585]
  ------------------
 2817|     21|				break;
 2818|    585|			if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (2818:8): [True: 7, False: 578]
  ------------------
 2819|      7|				return (-1);
 2820|    578|			if (size < 0 || zip->header_bytes_remaining < size)
  ------------------
  |  Branch (2820:8): [True: 0, False: 578]
  |  Branch (2820:20): [True: 7, False: 571]
  ------------------
 2821|      7|				return (-1);
 2822|       |
 2823|       |			/* Skip the property data to keep header parsing aligned. */
 2824|  1.04k|			while (size > 0) {
  ------------------
  |  Branch (2824:11): [True: 492, False: 550]
  ------------------
 2825|    492|				int64_t skip = size;
 2826|       |
 2827|    492|				if (skip > UBUFF_SIZE)
  ------------------
  |  |  293|    492|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2827:9): [True: 37, False: 455]
  ------------------
 2828|     37|					skip = UBUFF_SIZE;
  ------------------
  |  |  293|     37|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2829|    492|				if (header_bytes(a, (size_t)skip) == NULL)
  ------------------
  |  Branch (2829:9): [True: 21, False: 471]
  ------------------
 2830|     21|					return (-1);
 2831|    471|				size -= skip;
 2832|    471|			}
 2833|    571|		}
 2834|     21|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2834:7): [True: 5, False: 16]
  ------------------
 2835|      5|			return (-1);
 2836|     21|	}
 2837|       |
 2838|       |	/*
 2839|       |	 * Read MainStreamsInfo.
 2840|       |	 */
 2841|  1.18k|	if (*p == kMainStreamsInfo) {
  ------------------
  |  |  126|  1.18k|#define kMainStreamsInfo	0x04
  ------------------
  |  Branch (2841:6): [True: 786, False: 403]
  ------------------
 2842|    786|		if (read_StreamsInfo(a, &(zip->si)) < 0)
  ------------------
  |  Branch (2842:7): [True: 588, False: 198]
  ------------------
 2843|    588|			return (-1);
 2844|    198|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2844:7): [True: 1, False: 197]
  ------------------
 2845|      1|			return (-1);
 2846|    198|	}
 2847|    600|	if (*p == kEnd)
  ------------------
  |  |  122|    600|#define kEnd			0x00
  ------------------
  |  Branch (2847:6): [True: 12, False: 588]
  ------------------
 2848|     12|		return (0);
 2849|       |
 2850|       |	/*
 2851|       |	 * Read FilesInfo.
 2852|       |	 */
 2853|    588|	if (*p != kFilesInfo)
  ------------------
  |  |  127|    588|#define kFilesInfo		0x05
  ------------------
  |  Branch (2853:6): [True: 14, False: 574]
  ------------------
 2854|     14|		return (-1);
 2855|       |
 2856|    574|	if (parse_7zip_size(a, &(zip->numFiles)) < 0)
  ------------------
  |  Branch (2856:6): [True: 20, False: 554]
  ------------------
 2857|     20|		return (-1);
 2858|    554|	if (!files_info_numfiles_is_sane(zip))
  ------------------
  |  Branch (2858:6): [True: 2, False: 552]
  ------------------
 2859|      2|		return (-1);
 2860|       |
 2861|    552|	zip->entries = calloc(zip->numFiles, sizeof(*zip->entries));
 2862|    552|	if (zip->entries == NULL)
  ------------------
  |  Branch (2862:6): [True: 0, False: 552]
  ------------------
 2863|      0|		return (-1);
 2864|    552|	entries = zip->entries;
 2865|       |
 2866|    552|	empty_streams = 0;
 2867|  7.13k|	for (;;) {
 2868|  7.13k|		int type;
 2869|  7.13k|		int64_t size;
 2870|  7.13k|		size_t ll;
 2871|       |
 2872|  7.13k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2872:7): [True: 9, False: 7.12k]
  ------------------
 2873|      9|			return (-1);
 2874|  7.12k|		type = *p;
 2875|  7.12k|		if (type == kEnd)
  ------------------
  |  |  122|  7.12k|#define kEnd			0x00
  ------------------
  |  Branch (2875:7): [True: 272, False: 6.85k]
  ------------------
 2876|    272|			break;
 2877|       |
 2878|  6.85k|		if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (2878:7): [True: 18, False: 6.83k]
  ------------------
 2879|     18|			return (-1);
 2880|  6.83k|		if (zip->header_bytes_remaining < size ||
  ------------------
  |  Branch (2880:7): [True: 15, False: 6.82k]
  ------------------
 2881|  6.82k|		    size > (int64_t)(SIZE_MAX / 4))
  ------------------
  |  Branch (2881:7): [True: 1, False: 6.82k]
  ------------------
 2882|     16|			return (-1);
 2883|  6.82k|		ll = (size_t)size;
 2884|       |
 2885|  6.82k|		switch (type) {
 2886|    262|		case kEmptyStream:
  ------------------
  |  |  136|    262|#define kEmptyStream		0x0E
  ------------------
  |  Branch (2886:3): [True: 262, False: 6.56k]
  ------------------
 2887|    262|			if (h->emptyStreamBools != NULL)
  ------------------
  |  Branch (2887:8): [True: 2, False: 260]
  ------------------
 2888|      2|				return (-1);
 2889|    260|			h->emptyStreamBools = calloc(zip->numFiles,
 2890|    260|			    sizeof(*h->emptyStreamBools));
 2891|    260|			if (h->emptyStreamBools == NULL)
  ------------------
  |  Branch (2891:8): [True: 0, False: 260]
  ------------------
 2892|      0|				return (-1);
 2893|    260|			if (read_Bools(
  ------------------
  |  Branch (2893:8): [True: 4, False: 256]
  ------------------
 2894|    260|			    a, h->emptyStreamBools, zip->numFiles) < 0)
 2895|      4|				return (-1);
 2896|    256|			empty_streams = 0;
 2897|  12.8k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2897:16): [True: 12.5k, False: 256]
  ------------------
 2898|  12.5k|				if (h->emptyStreamBools[i])
  ------------------
  |  Branch (2898:9): [True: 10.9k, False: 1.68k]
  ------------------
 2899|  10.9k|					empty_streams++;
 2900|  12.5k|			}
 2901|    256|			break;
 2902|    357|		case kEmptyFile:
  ------------------
  |  |  137|    357|#define kEmptyFile		0x0F
  ------------------
  |  Branch (2902:3): [True: 357, False: 6.46k]
  ------------------
 2903|    357|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2903:8): [True: 330, False: 27]
  ------------------
 2904|       |				/* Unexcepted sequence. Skip this. */
 2905|    330|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2905:9): [True: 5, False: 325]
  ------------------
 2906|      5|					return (-1);
 2907|    325|				break;
 2908|    330|			}
 2909|     27|			if (h->emptyFileBools != NULL)
  ------------------
  |  Branch (2909:8): [True: 1, False: 26]
  ------------------
 2910|      1|				return (-1);
 2911|     26|			h->emptyFileBools = calloc(empty_streams,
 2912|     26|			    sizeof(*h->emptyFileBools));
 2913|     26|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (2913:8): [True: 0, False: 26]
  ------------------
 2914|      0|				return (-1);
 2915|     26|			if (read_Bools(a, h->emptyFileBools, empty_streams) < 0)
  ------------------
  |  Branch (2915:8): [True: 1, False: 25]
  ------------------
 2916|      1|				return (-1);
 2917|     25|			break;
 2918|  1.00k|		case kAnti:
  ------------------
  |  |  138|  1.00k|#define kAnti			0x10
  ------------------
  |  Branch (2918:3): [True: 1.00k, False: 5.81k]
  ------------------
 2919|  1.00k|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2919:8): [True: 998, False: 10]
  ------------------
 2920|       |				/* Unexcepted sequence. Skip this. */
 2921|    998|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2921:9): [True: 7, False: 991]
  ------------------
 2922|      7|					return (-1);
 2923|    991|				break;
 2924|    998|			}
 2925|     10|			if (h->antiBools != NULL)
  ------------------
  |  Branch (2925:8): [True: 1, False: 9]
  ------------------
 2926|      1|				return (-1);
 2927|      9|			h->antiBools = calloc(empty_streams,
 2928|      9|			    sizeof(*h->antiBools));
 2929|      9|			if (h->antiBools == NULL)
  ------------------
  |  Branch (2929:8): [True: 0, False: 9]
  ------------------
 2930|      0|				return (-1);
 2931|      9|			if (read_Bools(a, h->antiBools, empty_streams) < 0)
  ------------------
  |  Branch (2931:8): [True: 1, False: 8]
  ------------------
 2932|      1|				return (-1);
 2933|      8|			break;
 2934|    463|		case kCTime:
  ------------------
  |  |  140|    463|#define kCTime			0x12
  ------------------
  |  Branch (2934:3): [True: 463, False: 6.36k]
  ------------------
 2935|  1.61k|		case kATime:
  ------------------
  |  |  141|  1.61k|#define kATime			0x13
  ------------------
  |  Branch (2935:3): [True: 1.15k, False: 5.67k]
  ------------------
 2936|  1.94k|		case kMTime:
  ------------------
  |  |  142|  1.94k|#define kMTime			0x14
  ------------------
  |  Branch (2936:3): [True: 327, False: 6.49k]
  ------------------
 2937|  1.94k|			if (read_Times(a, type) < 0)
  ------------------
  |  Branch (2937:8): [True: 86, False: 1.85k]
  ------------------
 2938|     86|				return (-1);
 2939|  1.85k|			break;
 2940|  1.85k|		case kName:
  ------------------
  |  |  139|    141|#define kName			0x11
  ------------------
  |  Branch (2940:3): [True: 141, False: 6.68k]
  ------------------
 2941|    141|		{
 2942|    141|			unsigned char *np;
 2943|    141|			size_t nl, nb;
 2944|       |
 2945|       |			/* Skip one byte. */
 2946|    141|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2946:8): [True: 1, False: 140]
  ------------------
 2947|      1|				return (-1);
 2948|    140|			ll--;
 2949|       |
 2950|    140|			if ((ll & 1) || ll < zip->numFiles * 4)
  ------------------
  |  Branch (2950:8): [True: 3, False: 137]
  |  Branch (2950:20): [True: 1, False: 136]
  ------------------
 2951|      4|				return (-1);
 2952|       |
 2953|    136|			if (zip->entry_names != NULL)
  ------------------
  |  Branch (2953:8): [True: 1, False: 135]
  ------------------
 2954|      1|				return (-1);
 2955|    135|			zip->entry_names = malloc(ll);
 2956|    135|			if (zip->entry_names == NULL)
  ------------------
  |  Branch (2956:8): [True: 2, False: 133]
  ------------------
 2957|      2|				return (-1);
 2958|    133|			np = zip->entry_names;
 2959|    133|			nb = ll;
 2960|       |			/*
 2961|       |			 * Copy whole file names.
 2962|       |			 * NOTE: This loop prevents from expanding
 2963|       |			 * the uncompressed buffer in order not to
 2964|       |			 * use extra memory resource.
 2965|       |			 */
 2966|    264|			while (nb) {
  ------------------
  |  Branch (2966:11): [True: 133, False: 131]
  ------------------
 2967|    133|				size_t b;
 2968|    133|				if (nb > UBUFF_SIZE)
  ------------------
  |  |  293|    133|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2968:9): [True: 1, False: 132]
  ------------------
 2969|      1|					b = UBUFF_SIZE;
  ------------------
  |  |  293|      1|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2970|    132|				else
 2971|    132|					b = nb;
 2972|    133|				if ((p = header_bytes(a, b)) == NULL)
  ------------------
  |  Branch (2972:9): [True: 2, False: 131]
  ------------------
 2973|      2|					return (-1);
 2974|    131|				memcpy(np, p, b);
 2975|    131|				np += b;
 2976|    131|				nb -= b;
 2977|    131|			}
 2978|    131|			np = zip->entry_names;
 2979|    131|			nl = ll;
 2980|       |
 2981|  3.90k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2981:16): [True: 3.78k, False: 124]
  ------------------
 2982|  3.78k|				entries[i].utf16name = np;
 2983|       |#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
 2984|       |				entries[i].wname = (wchar_t *)np;
 2985|       |#endif
 2986|       |
 2987|       |				/* Find a terminator. */
 2988|  32.5k|				while (nl >= 2 && (np[0] || np[1])) {
  ------------------
  |  Branch (2988:12): [True: 32.4k, False: 7]
  |  Branch (2988:24): [True: 27.6k, False: 4.87k]
  |  Branch (2988:33): [True: 1.09k, False: 3.77k]
  ------------------
 2989|  28.7k|					np += 2;
 2990|  28.7k|					nl -= 2;
 2991|  28.7k|				}
 2992|  3.78k|				if (nl < 2)
  ------------------
  |  Branch (2992:9): [True: 7, False: 3.77k]
  ------------------
 2993|      7|					return (-1);/* Terminator not found */
 2994|  3.77k|				entries[i].name_len = np - entries[i].utf16name;
 2995|  3.77k|				np += 2;
 2996|  3.77k|				nl -= 2;
 2997|  3.77k|			}
 2998|    124|			break;
 2999|    131|		}
 3000|    162|		case kAttributes:
  ------------------
  |  |  143|    162|#define kAttributes		0x15
  ------------------
  |  Branch (3000:3): [True: 162, False: 6.66k]
  ------------------
 3001|    162|		{
 3002|    162|			int allAreDefined;
 3003|       |
 3004|    162|			if ((p = header_bytes(a, 2)) == NULL)
  ------------------
  |  Branch (3004:8): [True: 1, False: 161]
  ------------------
 3005|      1|				return (-1);
 3006|    161|			allAreDefined = *p;
 3007|    161|			if (attr_seen)
  ------------------
  |  Branch (3007:8): [True: 1, False: 160]
  ------------------
 3008|      1|				return (-1);
 3009|    160|			attr_seen = 1;
 3010|    160|			if (!allAreDefined) {
  ------------------
  |  Branch (3010:8): [True: 46, False: 114]
  ------------------
 3011|     46|				h->attrBools = calloc(zip->numFiles,
 3012|     46|				    sizeof(*h->attrBools));
 3013|     46|				if (h->attrBools == NULL)
  ------------------
  |  Branch (3013:9): [True: 0, False: 46]
  ------------------
 3014|      0|					return (-1);
 3015|     46|				if (read_Bools(a, h->attrBools,
  ------------------
  |  Branch (3015:9): [True: 1, False: 45]
  ------------------
 3016|     46|				    zip->numFiles) < 0)
 3017|      1|					return (-1);
 3018|     46|			}
 3019|  6.62k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3019:16): [True: 6.47k, False: 144]
  ------------------
 3020|  6.47k|				if (allAreDefined || h->attrBools[i]) {
  ------------------
  |  Branch (3020:9): [True: 2.00k, False: 4.47k]
  |  Branch (3020:26): [True: 1.55k, False: 2.92k]
  ------------------
 3021|  3.55k|					if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (3021:10): [True: 15, False: 3.53k]
  ------------------
 3022|     15|						return (-1);
 3023|  3.53k|					entries[i].attr = archive_le32dec(p);
 3024|  3.53k|				}
 3025|  6.47k|			}
 3026|    144|			break;
 3027|    159|		}
 3028|    773|		case kDummy:
  ------------------
  |  |  145|    773|#define kDummy			0x19
  ------------------
  |  Branch (3028:3): [True: 773, False: 6.05k]
  ------------------
 3029|    773|			if (ll == 0)
  ------------------
  |  Branch (3029:8): [True: 108, False: 665]
  ------------------
 3030|    108|				break;
 3031|    665|			__LA_FALLTHROUGH;
 3032|  2.84k|		default:
  ------------------
  |  Branch (3032:3): [True: 2.17k, False: 4.64k]
  ------------------
 3033|  2.84k|			if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3033:8): [True: 94, False: 2.75k]
  ------------------
 3034|     94|				return (-1);
 3035|  2.75k|			break;
 3036|  6.82k|		}
 3037|  6.82k|	}
 3038|       |
 3039|       |	/*
 3040|       |	 * Set up entry's attributes.
 3041|       |	 */
 3042|    272|	folders = si->ci.folders;
 3043|    272|	eindex = sindex = 0;
 3044|    272|	folderIndex = indexInFolder = 0;
 3045|  7.83k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3045:14): [True: 7.60k, False: 234]
  ------------------
 3046|  7.60k|		if (h->emptyStreamBools == NULL || h->emptyStreamBools[i] == 0)
  ------------------
  |  Branch (3046:7): [True: 111, False: 7.49k]
  |  Branch (3046:38): [True: 154, False: 7.33k]
  ------------------
 3047|    265|			entries[i].flg |= HAS_STREAM;
  ------------------
  |  |  249|    265|#define HAS_STREAM	(1<<4)
  ------------------
 3048|       |		/* The high 16 bits of attributes is a posix file mode. */
 3049|  7.60k|		entries[i].mode = entries[i].attr >> 16;
 3050|       |
 3051|  7.60k|		if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
  ------------------
  |  |  169|  7.60k|#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
  ------------------
  |  Branch (3051:7): [True: 6.67k, False: 926]
  ------------------
 3052|       |			// Only windows permissions specified for this entry. Translate to
 3053|       |			// reasonable corresponding unix permissions.
 3054|       |
 3055|  6.67k|			if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
  ------------------
  |  |  162|  6.67k|#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  ------------------
  |  Branch (3055:8): [True: 396, False: 6.28k]
  ------------------
 3056|    396|				if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  150|    396|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3056:9): [True: 184, False: 212]
  ------------------
 3057|       |					// Read-only directory.
 3058|    184|					entries[i].mode = AE_IFDIR | 0555;
  ------------------
  |  |  221|    184|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3059|    212|				} else {
 3060|       |					// Read-write directory.
 3061|    212|					entries[i].mode = AE_IFDIR | 0755;
  ------------------
  |  |  221|    212|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3062|    212|				}
 3063|  6.28k|			} else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  150|  6.28k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3063:15): [True: 210, False: 6.07k]
  ------------------
 3064|       |				// Readonly file.
 3065|    210|				entries[i].mode = AE_IFREG | 0444;
  ------------------
  |  |  216|    210|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3066|  6.07k|			} else {
 3067|       |				// Assume read-write file.
 3068|  6.07k|				entries[i].mode = AE_IFREG | 0644;
  ------------------
  |  |  216|  6.07k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3069|  6.07k|			}
 3070|  6.67k|		}
 3071|       |
 3072|  7.60k|		if (entries[i].flg & HAS_STREAM) {
  ------------------
  |  |  249|  7.60k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3072:7): [True: 265, False: 7.33k]
  ------------------
 3073|    265|			if (sindex >= si->ss.unpack_streams)
  ------------------
  |  Branch (3073:8): [True: 38, False: 227]
  ------------------
 3074|     38|				return (-1);
 3075|    227|			if (entries[i].mode == 0)
  ------------------
  |  Branch (3075:8): [True: 1, False: 226]
  ------------------
 3076|      1|				entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      1|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3077|    227|			if (si->ss.digestsDefined[sindex])
  ------------------
  |  Branch (3077:8): [True: 176, False: 51]
  ------------------
 3078|    176|				entries[i].flg |= CRC32_IS_SET;
  ------------------
  |  |  248|    176|#define CRC32_IS_SET	(1<<3)
  ------------------
 3079|    227|			entries[i].ssIndex = sindex;
 3080|    227|			sindex++;
 3081|  7.33k|		} else {
 3082|  7.33k|			int dir = 1;
 3083|       |
 3084|  7.33k|			if (h->emptyFileBools != NULL) {
  ------------------
  |  Branch (3084:8): [True: 898, False: 6.44k]
  ------------------
 3085|    898|				dir = !h->emptyFileBools[eindex];
 3086|    898|				eindex++;
 3087|    898|			}
 3088|  7.33k|			if (entries[i].mode == 0) {
  ------------------
  |  Branch (3088:8): [True: 206, False: 7.13k]
  ------------------
 3089|    206|				if (dir)
  ------------------
  |  Branch (3089:9): [True: 144, False: 62]
  ------------------
 3090|    144|					entries[i].mode = AE_IFDIR | 0777;
  ------------------
  |  |  221|    144|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3091|     62|				else
 3092|     62|					entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|     62|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3093|  7.13k|			} else if (dir &&
  ------------------
  |  Branch (3093:15): [True: 6.85k, False: 275]
  ------------------
 3094|  6.85k|			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  6.85k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  6.85k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3094:8): [True: 6.41k, False: 444]
  ------------------
 3095|  6.41k|				entries[i].mode &= ~AE_IFMT;
  ------------------
  |  |  215|  6.41k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 3096|  6.41k|				entries[i].mode |= AE_IFDIR;
  ------------------
  |  |  221|  6.41k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3097|  6.41k|			}
 3098|  7.33k|			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  215|  7.33k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  221|  14.6k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3098:8): [True: 7.02k, False: 311]
  ------------------
 3099|  7.02k|			    entries[i].name_len >= 2 &&
  ------------------
  |  Branch (3099:8): [True: 895, False: 6.13k]
  ------------------
 3100|    895|			    (entries[i].utf16name[entries[i].name_len-2] != '/' ||
  ------------------
  |  Branch (3100:9): [True: 848, False: 47]
  ------------------
 3101|    858|			     entries[i].utf16name[entries[i].name_len-1] != 0)) {
  ------------------
  |  Branch (3101:9): [True: 10, False: 37]
  ------------------
 3102|    858|				entries[i].utf16name[entries[i].name_len] = '/';
 3103|    858|				entries[i].utf16name[entries[i].name_len+1] = 0;
 3104|    858|				entries[i].name_len += 2;
 3105|    858|			}
 3106|  7.33k|			entries[i].ssIndex = -1;
 3107|  7.33k|		}
 3108|  7.56k|		if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  150|  7.56k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3108:7): [True: 777, False: 6.78k]
  ------------------
 3109|    777|			entries[i].mode &= ~0222;/* Read only. */
 3110|       |
 3111|  7.56k|		if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
  ------------------
  |  |  249|  7.56k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3111:7): [True: 7.33k, False: 227]
  |  Branch (3111:45): [True: 7.32k, False: 12]
  ------------------
 3112|       |			/*
 3113|       |			 * The entry is an empty file or a directory file,
 3114|       |			 * those both have no contents.
 3115|       |			 */
 3116|  7.32k|			entries[i].folderIndex = -1;
 3117|  7.32k|			continue;
 3118|  7.32k|		}
 3119|    239|		if (indexInFolder == 0) {
  ------------------
  |  Branch (3119:7): [True: 119, False: 120]
  ------------------
 3120|    119|			for (;;) {
 3121|    119|				if (folderIndex >= si->ci.numFolders)
  ------------------
  |  Branch (3121:9): [True: 0, False: 119]
  ------------------
 3122|      0|					return (-1);
 3123|    119|				if (folders[folderIndex].numUnpackStreams)
  ------------------
  |  Branch (3123:9): [True: 119, False: 0]
  ------------------
 3124|    119|					break;
 3125|      0|				folderIndex++;
 3126|      0|			}
 3127|    119|		}
 3128|    239|		entries[i].folderIndex = folderIndex;
 3129|    239|		if ((entries[i].flg & HAS_STREAM) == 0)
  ------------------
  |  |  249|    239|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3129:7): [True: 12, False: 227]
  ------------------
 3130|     12|			continue;
 3131|    227|		indexInFolder++;
 3132|    227|		if (indexInFolder >= folders[folderIndex].numUnpackStreams) {
  ------------------
  |  Branch (3132:7): [True: 105, False: 122]
  ------------------
 3133|    105|			folderIndex++;
 3134|    105|			indexInFolder = 0;
 3135|    105|		}
 3136|    227|	}
 3137|       |
 3138|    234|	return (0);
 3139|    272|}
archive_read_support_format_7zip.c:files_info_numfiles_is_sane:
 2769|    554|{
 2770|    554|	int64_t empty_stream_map_bytes;
 2771|       |
 2772|    554|	if (zip->numFiles > SIZE_MAX / sizeof(*zip->entries))
  ------------------
  |  Branch (2772:6): [True: 0, False: 554]
  ------------------
 2773|      0|		return (0);
 2774|       |
 2775|    554|	if (zip->numFiles <= zip->si.ss.unpack_streams)
  ------------------
  |  Branch (2775:6): [True: 124, False: 430]
  ------------------
 2776|    124|		return (1);
 2777|       |
 2778|    430|	empty_stream_map_bytes = (zip->numFiles + 7) / 8;
 2779|    430|	return (empty_stream_map_bytes <= zip->header_bytes_remaining);
 2780|    554|}
archive_read_support_format_7zip.c:read_Times:
 3143|  1.94k|{
 3144|  1.94k|	struct _7zip *zip = a->format->data;
 3145|  1.94k|	const unsigned char *p;
 3146|  1.94k|	struct _7zip_entry *entries = zip->entries;
 3147|  1.94k|	unsigned char *timeBools = NULL;
 3148|  1.94k|	int allAreDefined;
 3149|  1.94k|	size_t dataIndex, i;
 3150|       |
 3151|       |	/* Read allAreDefined. */
 3152|  1.94k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3152:6): [True: 2, False: 1.93k]
  ------------------
 3153|      2|		goto failed;
 3154|  1.93k|	allAreDefined = *p;
 3155|       |
 3156|  1.93k|	if (!allAreDefined) {
  ------------------
  |  Branch (3156:6): [True: 601, False: 1.33k]
  ------------------
 3157|    601|		timeBools = calloc(zip->numFiles, sizeof(*timeBools));
 3158|    601|		if (timeBools == NULL)
  ------------------
  |  Branch (3158:7): [True: 0, False: 601]
  ------------------
 3159|      0|			goto failed;
 3160|    601|		if (read_Bools(a, timeBools, zip->numFiles) < 0)
  ------------------
  |  Branch (3160:7): [True: 5, False: 596]
  ------------------
 3161|      5|			goto failed;
 3162|    601|	}
 3163|       |
 3164|       |	/* Read external. */
 3165|  1.93k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3165:6): [True: 8, False: 1.92k]
  ------------------
 3166|      8|		goto failed;
 3167|  1.92k|	if (*p) {
  ------------------
  |  Branch (3167:6): [True: 1.67k, False: 253]
  ------------------
 3168|  1.67k|		if (parse_7zip_size(a, &dataIndex) < 0)
  ------------------
  |  Branch (3168:7): [True: 35, False: 1.63k]
  ------------------
 3169|     35|			goto failed;
 3170|  1.67k|	}
 3171|       |
 3172|  6.27k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3172:14): [True: 4.42k, False: 1.85k]
  ------------------
 3173|  4.42k|		if (!allAreDefined && !timeBools[i])
  ------------------
  |  Branch (3173:7): [True: 3.39k, False: 1.02k]
  |  Branch (3173:25): [True: 2.45k, False: 942]
  ------------------
 3174|  2.45k|			continue;
 3175|  1.97k|		if ((p = header_bytes(a, 8)) == NULL)
  ------------------
  |  Branch (3175:7): [True: 36, False: 1.93k]
  ------------------
 3176|     36|			goto failed;
 3177|  1.93k|		switch (type) {
  ------------------
  |  Branch (3177:11): [True: 1.93k, False: 0]
  ------------------
 3178|    400|		case kCTime:
  ------------------
  |  |  140|    400|#define kCTime			0x12
  ------------------
  |  Branch (3178:3): [True: 400, False: 1.53k]
  ------------------
 3179|    400|			ntfs_to_unix(archive_le64dec(p),
 3180|    400|			    &(entries[i].ctime),
 3181|    400|			    &(entries[i].ctime_ns));
 3182|    400|			entries[i].flg |= CTIME_IS_SET;
  ------------------
  |  |  247|    400|#define CTIME_IS_SET	(1<<2)
  ------------------
 3183|    400|			break;
 3184|    945|		case kATime:
  ------------------
  |  |  141|    945|#define kATime			0x13
  ------------------
  |  Branch (3184:3): [True: 945, False: 990]
  ------------------
 3185|    945|			ntfs_to_unix(archive_le64dec(p),
 3186|    945|			    &(entries[i].atime),
 3187|    945|			    &(entries[i].atime_ns));
 3188|    945|			entries[i].flg |= ATIME_IS_SET;
  ------------------
  |  |  246|    945|#define ATIME_IS_SET	(1<<1)
  ------------------
 3189|    945|			break;
 3190|    590|		case kMTime:
  ------------------
  |  |  142|    590|#define kMTime			0x14
  ------------------
  |  Branch (3190:3): [True: 590, False: 1.34k]
  ------------------
 3191|    590|			ntfs_to_unix(archive_le64dec(p),
 3192|    590|			    &(entries[i].mtime),
 3193|    590|			    &(entries[i].mtime_ns));
 3194|    590|			entries[i].flg |= MTIME_IS_SET;
  ------------------
  |  |  245|    590|#define MTIME_IS_SET	(1<<0)
  ------------------
 3195|    590|			break;
 3196|  1.93k|		}
 3197|  1.93k|	}
 3198|       |
 3199|  1.85k|	free(timeBools);
 3200|  1.85k|	return (0);
 3201|     86|failed:
 3202|     86|	free(timeBools);
 3203|     86|	return (-1);
 3204|  1.89k|}
archive_read_support_format_7zip.c:free_Header:
 2756|  1.85k|{
 2757|  1.85k|	free(h->emptyStreamBools);
 2758|  1.85k|	free(h->emptyFileBools);
 2759|  1.85k|	free(h->antiBools);
 2760|  1.85k|	free(h->attrBools);
 2761|  1.85k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data:
 1097|  5.73k|{
 1098|  5.73k|	struct _7zip *zip = a->format->data;
 1099|  5.73k|	ssize_t bytes;
 1100|  5.73k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  5.73k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1101|       |
 1102|  5.73k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  5.73k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1102:6): [True: 0, False: 5.73k]
  ------------------
 1103|      0|		zip->has_encrypted_entries = 0;
 1104|      0|	}
 1105|       |
 1106|  5.73k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1106:6): [True: 31, False: 5.70k]
  ------------------
 1107|     31|		read_consume(a);
 1108|       |
 1109|  5.73k|	*offset = zip->entry_offset;
 1110|  5.73k|	*size = 0;
 1111|  5.73k|	*buff = NULL;
 1112|       |	/*
 1113|       |	 * If we hit end-of-entry last time, clean up and return
 1114|       |	 * ARCHIVE_EOF this time.
 1115|       |	 */
 1116|  5.73k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1116:6): [True: 5.56k, False: 167]
  ------------------
 1117|  5.56k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  5.56k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1118|       |
 1119|    167|	size_t bytes_to_read = MAX_READ;
  ------------------
  |  |  396|    167|#define MAX_READ	16 * 1024 * 1024
  ------------------
 1120|    167|	if ((int64_t)bytes_to_read > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (1120:6): [True: 162, False: 5]
  ------------------
 1121|    162|		bytes_to_read = (size_t)zip->entry_bytes_remaining;
 1122|    162|	}
 1123|    167|	bytes = read_stream(a, buff, bytes_to_read, 0);
 1124|    167|	if (bytes < 0)
  ------------------
  |  Branch (1124:6): [True: 35, False: 132]
  ------------------
 1125|     35|		return ((int)bytes);
 1126|    132|	if (bytes == 0) {
  ------------------
  |  Branch (1126:6): [True: 17, False: 115]
  ------------------
 1127|     17|		archive_set_error(&a->archive,
 1128|     17|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1129|     17|		    "Truncated 7-Zip file body");
 1130|     17|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1131|     17|	}
 1132|    115|	zip->entry_bytes_remaining -= bytes;
 1133|    115|	if (zip->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1133:6): [True: 106, False: 9]
  ------------------
 1134|    106|		zip->end_of_entry = 1;
 1135|       |
 1136|       |	/* Update checksum */
 1137|    115|	if ((zip->entry->flg & CRC32_IS_SET) && bytes)
  ------------------
  |  |  248|    115|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1137:6): [True: 94, False: 21]
  |  Branch (1137:42): [True: 94, False: 0]
  ------------------
 1138|     94|		zip->entry_crc32 = crc32(zip->entry_crc32, *buff,
 1139|     94|		    (unsigned)bytes);
 1140|       |
 1141|       |	/* If we hit the end, swallow any end-of-data marker. */
 1142|    115|	if (zip->end_of_entry) {
  ------------------
  |  Branch (1142:6): [True: 106, False: 9]
  ------------------
 1143|       |		/* Check computed CRC against file contents. */
 1144|    106|		if ((zip->entry->flg & CRC32_IS_SET) &&
  ------------------
  |  |  248|    106|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1144:7): [True: 89, False: 17]
  ------------------
 1145|     89|			zip->si.ss.digests[zip->entry->ssIndex] !=
  ------------------
  |  Branch (1145:4): [True: 83, False: 6]
  ------------------
 1146|     89|		    zip->entry_crc32) {
 1147|     83|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     83|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1148|     83|			    "7-Zip bad CRC: 0x%lx should be 0x%lx",
 1149|     83|			    zip->entry_crc32,
 1150|     83|			    (unsigned long)zip->si.ss.digests[
 1151|     83|			    		zip->entry->ssIndex]);
 1152|     83|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     83|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1153|     83|		}
 1154|    106|	}
 1155|       |
 1156|    115|	*size = bytes;
 1157|    115|	*offset = zip->entry_offset;
 1158|    115|	zip->entry_offset += bytes;
 1159|       |
 1160|    115|	return (ret);
 1161|    132|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data_skip:
 1165|  5.62k|{
 1166|  5.62k|	struct _7zip *zip = a->format->data;
 1167|  5.62k|	int r;
 1168|       |
 1169|  5.62k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1169:6): [True: 54, False: 5.56k]
  ------------------
 1170|     54|		read_consume(a);
 1171|       |
 1172|       |	/* If we've already read to end of data, we're done. */
 1173|  5.62k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1173:6): [True: 5.62k, False: 0]
  ------------------
 1174|  5.62k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1175|       |
 1176|       |	/*
 1177|       |	 * If the length is at the beginning, we can skip the
 1178|       |	 * compressed data much more quickly.
 1179|       |	 */
 1180|      0|	r = skip_stream(a, zip->entry_bytes_remaining);
 1181|      0|	if (r < 0)
  ------------------
  |  Branch (1181:6): [True: 0, False: 0]
  ------------------
 1182|      0|		return (r);
 1183|      0|	zip->entry_bytes_remaining = 0;
 1184|       |
 1185|       |	/* This entry is finished and done. */
 1186|      0|	zip->end_of_entry = 1;
 1187|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1188|      0|}
archive_read_support_format_7zip.c:archive_read_format_7zip_cleanup:
 1192|  22.2k|{
 1193|  22.2k|	struct _7zip *zip = a->format->data;
 1194|       |
 1195|  22.2k|	free_StreamsInfo(&(zip->si));
 1196|  22.2k|	free(zip->entries);
 1197|  22.2k|	free(zip->entry_names);
 1198|  22.2k|	free_decompression(a, zip);
 1199|  22.2k|	free(zip->uncompressed_buffer);
 1200|  22.2k|	free(zip->sub_stream_buff[0]);
 1201|  22.2k|	free(zip->sub_stream_buff[1]);
 1202|  22.2k|	free(zip->sub_stream_buff[2]);
 1203|  22.2k|	free(zip->tmp_stream_buff);
 1204|  22.2k|	free(zip);
 1205|  22.2k|	a->format->data = NULL;
 1206|  22.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1207|  22.2k|}
archive_read_support_format_7zip.c:free_decompression:
 2003|  22.2k|{
 2004|  22.2k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2005|       |
 2006|       |#if !defined(HAVE_ZLIB_H) &&\
 2007|       |	!(defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR))
 2008|       |	(void)a;/* UNUSED */
 2009|       |#endif
 2010|  22.2k|#ifdef HAVE_LZMA_H
 2011|  22.2k|	if (zip->lzstream_valid)
  ------------------
  |  Branch (2011:6): [True: 48, False: 22.2k]
  ------------------
 2012|     48|		lzma_end(&(zip->lzstream));
 2013|  22.2k|#endif
 2014|  22.2k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 2015|  22.2k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (2015:6): [True: 0, False: 22.2k]
  ------------------
 2016|      0|		if (BZ2_bzDecompressEnd(&(zip->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (2016:7): [True: 0, False: 0]
  ------------------
 2017|      0|			archive_set_error(&a->archive,
 2018|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2019|      0|			    "Failed to clean up bzip2 decompressor");
 2020|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2021|      0|		}
 2022|      0|		zip->bzstream_valid = 0;
 2023|      0|	}
 2024|  22.2k|#endif
 2025|  22.2k|#ifdef HAVE_ZLIB_H
 2026|  22.2k|	if (zip->stream_valid) {
  ------------------
  |  Branch (2026:6): [True: 0, False: 22.2k]
  ------------------
 2027|      0|		if (inflateEnd(&(zip->stream)) != Z_OK) {
  ------------------
  |  Branch (2027:7): [True: 0, False: 0]
  ------------------
 2028|      0|			archive_set_error(&a->archive,
 2029|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2030|      0|			    "Failed to clean up zlib decompressor");
 2031|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2032|      0|		}
 2033|      0|		zip->stream_valid = 0;
 2034|      0|	}
 2035|  22.2k|#endif
 2036|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 2037|       |	if (zip->zstdstream_valid)
 2038|       |		ZSTD_freeDStream(zip->zstd_dstream);
 2039|       |#endif
 2040|  22.2k|	if (zip->ppmd7_valid) {
  ------------------
  |  Branch (2040:6): [True: 205, False: 22.0k]
  ------------------
 2041|    205|		__archive_ppmd7_functions.Ppmd7_Free(
 2042|    205|			&zip->ppmd7_context);
 2043|    205|		zip->ppmd7_valid = 0;
 2044|    205|	}
 2045|  22.2k|	return (r);
 2046|  22.2k|}

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

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

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

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

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

archive_read_support_format_iso9660:
  457|  22.2k|{
  458|  22.2k|	struct archive_read *a = (struct archive_read *)_a;
  459|  22.2k|	struct iso9660 *iso9660;
  460|  22.2k|	int r;
  461|       |
  462|  22.2k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  22.2k|	do { \
  |  |  178|  22.2k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  22.2k|			(allowed_states), (function_name)); \
  |  |  180|  22.2k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  22.2k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 22.2k]
  |  |  ------------------
  |  |  181|  22.2k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  22.2k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
  463|  22.2k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  464|       |
  465|  22.2k|	iso9660 = calloc(1, sizeof(*iso9660));
  466|  22.2k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (466:6): [True: 0, False: 22.2k]
  ------------------
  467|      0|		archive_set_error(&a->archive, ENOMEM,
  468|      0|		    "Can't allocate iso9660 data");
  469|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  470|      0|	}
  471|  22.2k|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  324|  22.2k|#define ISO9660_MAGIC   0x96609660
  ------------------
  472|  22.2k|	iso9660->cache_files.first = NULL;
  473|  22.2k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  474|  22.2k|	iso9660->re_files.first = NULL;
  475|  22.2k|	iso9660->re_files.last = &(iso9660->re_files.first);
  476|       |	/* Enable to support Joliet extensions by default.	*/
  477|  22.2k|	iso9660->opt_support_joliet = 1;
  478|       |	/* Enable to support Rock Ridge extensions by default.	*/
  479|  22.2k|	iso9660->opt_support_rockridge = 1;
  480|       |
  481|  22.2k|	r = __archive_read_register_format(a,
  482|  22.2k|	    iso9660,
  483|  22.2k|	    "iso9660",
  484|  22.2k|	    archive_read_format_iso9660_bid,
  485|  22.2k|	    archive_read_format_iso9660_options,
  486|  22.2k|	    archive_read_format_iso9660_read_header,
  487|  22.2k|	    archive_read_format_iso9660_read_data,
  488|  22.2k|	    archive_read_format_iso9660_read_data_skip,
  489|  22.2k|	    NULL,
  490|  22.2k|	    archive_read_format_iso9660_cleanup,
  491|  22.2k|	    NULL,
  492|  22.2k|	    NULL);
  493|       |
  494|  22.2k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (494:6): [True: 0, False: 22.2k]
  ------------------
  495|      0|		free(iso9660);
  496|      0|		return (r);
  497|      0|	}
  498|  22.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  499|  22.2k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  504|  21.6k|{
  505|  21.6k|	struct iso9660 *iso9660 = a->format->data;
  506|  21.6k|	ssize_t bytes_read;
  507|  21.6k|	const unsigned char *p;
  508|  21.6k|	int seenTerminator;
  509|       |
  510|       |	/* If there's already a better bid than we can ever
  511|       |	   make, don't bother testing. */
  512|  21.6k|	if (best_bid > 48)
  ------------------
  |  Branch (512:6): [True: 5.03k, False: 16.6k]
  ------------------
  513|  5.03k|		return (-1);
  514|       |
  515|       |	/*
  516|       |	 * Skip the first 32k (reserved area) and get the first
  517|       |	 * 8 sectors of the volume descriptor table.  Of course,
  518|       |	 * if the I/O layer gives us more, we'll take it.
  519|       |	 */
  520|  16.6k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  521|  16.6k|	p = __archive_read_ahead(a,
  522|  16.6k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  520|  16.6k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|  16.6k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  16.6k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   82|  16.6k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  523|  16.6k|	    &bytes_read);
  524|  16.6k|	if (p == NULL)
  ------------------
  |  Branch (524:6): [True: 15.7k, False: 829]
  ------------------
  525|  15.7k|	    return (-1);
  526|       |
  527|       |	/* Skip the reserved area. */
  528|    829|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  520|    829|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    829|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    829|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  529|    829|	p += RESERVED_AREA;
  ------------------
  |  |  520|    829|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    829|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    829|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  530|       |
  531|       |	/* Check each volume descriptor. */
  532|    829|	seenTerminator = 0;
  533|  1.16k|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   82|  1.16k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (533:9): [True: 1.16k, False: 0]
  ------------------
  534|  1.16k|	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    333|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    333|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  535|       |		/* Do not handle undefined Volume Descriptor Type. */
  536|  1.16k|		if (p[0] >= 4 && p[0] <= 254)
  ------------------
  |  Branch (536:7): [True: 636, False: 526]
  |  Branch (536:20): [True: 417, False: 219]
  ------------------
  537|    417|			return (0);
  538|       |		/* Standard Identifier must be "CD001" */
  539|    745|		if (memcmp(p + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (539:7): [True: 113, False: 632]
  ------------------
  540|    113|			return (0);
  541|    632|		if (isPVD(iso9660, p))
  ------------------
  |  Branch (541:7): [True: 216, False: 416]
  ------------------
  542|    216|			continue;
  543|    416|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (543:7): [True: 388, False: 28]
  ------------------
  544|    388|			if (isJolietSVD(iso9660, p))
  ------------------
  |  Branch (544:8): [True: 30, False: 358]
  ------------------
  545|     30|				continue;
  546|    388|		}
  547|    386|		if (isBootRecord(p))
  ------------------
  |  Branch (547:7): [True: 7, False: 379]
  ------------------
  548|      7|			continue;
  549|    379|		if (isEVD(p))
  ------------------
  |  Branch (549:7): [True: 0, False: 379]
  ------------------
  550|      0|			continue;
  551|    379|		if (isSVD(p))
  ------------------
  |  Branch (551:7): [True: 80, False: 299]
  ------------------
  552|     80|			continue;
  553|    299|		if (isVolumePartition(iso9660, p))
  ------------------
  |  Branch (553:7): [True: 0, False: 299]
  ------------------
  554|      0|			continue;
  555|    299|		if (isVDSetTerminator(p)) {
  ------------------
  |  Branch (555:7): [True: 196, False: 103]
  ------------------
  556|    196|			seenTerminator = 1;
  557|    196|			break;
  558|    196|		}
  559|    103|		return (0);
  560|    299|	}
  561|       |	/*
  562|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  563|       |	 * Volume Descriptor Set Terminator.
  564|       |	 */
  565|    196|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (565:6): [True: 196, False: 0]
  |  Branch (565:24): [True: 194, False: 2]
  ------------------
  566|    194|		return (48);
  567|       |
  568|       |	/* We didn't find a valid PVD; return a bid of zero. */
  569|      2|	return (0);
  570|    196|}
archive_read_support_format_iso9660.c:isPVD:
  863|    632|{
  864|    632|	const unsigned char *p;
  865|    632|	ssize_t logical_block_size;
  866|    632|	int32_t volume_block;
  867|    632|	int32_t location;
  868|    632|	int i;
  869|       |
  870|       |	/* Type of the Primary Volume Descriptor must be 1. */
  871|    632|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   86|    632|#define PVD_type_offset 0
  ------------------
  |  Branch (871:6): [True: 376, False: 256]
  ------------------
  872|    376|		return (0);
  873|       |
  874|       |	/* PVD version must be 1. */
  875|    256|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   90|    256|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    256|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    256|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    256|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    256|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (875:6): [True: 1, False: 255]
  ------------------
  876|      1|		return (0);
  877|       |
  878|       |	/* Reserved field must be 0. */
  879|    255|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|    255|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    255|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    255|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    255|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    255|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|    255|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|    255|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (879:6): [True: 1, False: 254]
  ------------------
  880|      1|		return (0);
  881|       |
  882|       |	/* Reserved field must be 0. */
  883|    254|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    254|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    254|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    254|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    254|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    254|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    254|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    254|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    254|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    254|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    254|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    254|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    254|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|    254|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|    254|#define PVD_reserved2_size 8
  ------------------
  |  Branch (883:6): [True: 1, False: 253]
  ------------------
  884|      1|		return (0);
  885|       |
  886|       |	/* Volume space size must be encoded according to 7.3.3 */
  887|    253|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |  100|    253|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    253|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    253|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    253|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    253|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    253|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    253|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    253|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    253|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    253|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    253|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    253|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    253|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    253|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    253|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (887:6): [True: 4, False: 249]
  ------------------
  888|      4|		return (0);
  889|      4|	}
  890|    249|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|    249|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    249|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    249|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    249|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    249|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    249|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    249|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    249|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    249|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    249|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    249|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    249|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    249|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    249|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    249|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  891|    249|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    249|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (891:6): [True: 1, False: 248]
  ------------------
  892|      1|		return (0);
  893|       |
  894|       |	/* Reserved field must be 0. */
  895|    248|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    248|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    248|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    248|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    248|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    248|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    248|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    248|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    248|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    248|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    248|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    248|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    248|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    248|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    248|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    248|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    248|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|    248|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|    248|#define PVD_reserved3_size 32
  ------------------
  |  Branch (895:6): [True: 2, False: 246]
  ------------------
  896|      2|		return (0);
  897|       |
  898|       |	/* Volume set size must be encoded according to 7.2.3 */
  899|    246|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  104|    246|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    246|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    246|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    246|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    246|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    246|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    246|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    246|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    246|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    246|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    246|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    246|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    246|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    246|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    246|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    246|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    246|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    246|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  103|    246|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (899:6): [True: 2, False: 244]
  ------------------
  900|      2|		return (0);
  901|      2|	}
  902|       |
  903|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  904|    244|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  106|    244|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    244|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    244|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|    244|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|    244|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|    244|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    244|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    244|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    244|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    244|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    244|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    244|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    244|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    244|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    244|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    244|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    244|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    244|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    244|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    244|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  105|    244|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (904:6): [True: 2, False: 242]
  ------------------
  905|      2|		return (0);
  906|      2|	}
  907|       |
  908|       |	/* Logical block size must be > 0. */
  909|       |	/* I've looked at Ecma 119 and can't find any stronger
  910|       |	 * restriction on this field. */
  911|    242|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  108|    242|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    242|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    242|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    242|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    242|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    242|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    242|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    242|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    242|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    242|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    242|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    242|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    242|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    242|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    242|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    242|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    242|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    242|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    242|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    242|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    242|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    242|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    242|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (911:6): [True: 2, False: 240]
  ------------------
  912|      2|		return (0);
  913|      2|	}
  914|    240|	logical_block_size =
  915|    240|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|    240|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    240|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    240|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    240|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    240|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    240|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    240|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    240|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    240|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    240|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    240|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    240|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    240|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    240|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    240|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    240|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    240|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    240|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    240|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    240|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    240|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    240|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    240|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  916|    240|	if (logical_block_size <= 0)
  ------------------
  |  Branch (916:6): [True: 1, False: 239]
  ------------------
  917|      1|		return (0);
  918|       |
  919|       |	/* Path Table size must be encoded according to 7.3.3 */
  920|    239|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  110|    239|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    239|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    239|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    239|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    239|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    239|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    239|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    239|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    239|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    239|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    239|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    239|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    239|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    239|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    239|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    239|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    239|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    239|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    239|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    239|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    239|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    239|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    239|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    239|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  109|    239|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (920:6): [True: 5, False: 234]
  ------------------
  921|      5|		return (0);
  922|      5|	}
  923|       |
  924|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  925|    234|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  144|    234|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    234|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    234|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    234|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    234|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    234|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    234|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    234|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    234|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    234|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    234|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    234|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    234|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    234|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    234|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    234|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    234|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    234|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    234|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    234|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    234|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    234|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    234|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    234|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    234|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    234|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    234|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    234|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    234|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    234|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    234|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    234|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    234|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    234|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    234|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    234|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    234|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    234|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    234|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    234|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    234|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    234|#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|    234|#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|    234|#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|    234|#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|    234|#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|    234|#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|    234|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    234|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    234|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    234|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    234|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    234|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    234|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    234|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    234|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    234|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    234|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|    234|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (925:6): [True: 1, False: 233]
  ------------------
  926|      1|		return (0);
  927|       |
  928|       |	/* Location of Occurrence of Type L Path Table must be
  929|       |	 * available location,
  930|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  931|    233|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|    233|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    233|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    233|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    233|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    233|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    233|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    233|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    233|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    233|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    233|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    233|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    233|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    233|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    233|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    233|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    233|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    233|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    233|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    233|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    233|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    233|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    233|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|    233|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|    233|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    233|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    233|#define PVD_logical_block_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  111|    233|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  932|    233|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    233|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (932:6): [True: 1, False: 232]
  |  Branch (932:40): [True: 1, False: 231]
  ------------------
  933|      2|		return (0);
  934|       |
  935|       |	/* The Type M Path Table must also be at a valid location
  936|       |	 * (although ECMA 119 requires a Type M Path Table, WinISO and
  937|       |	 * probably other programs omit it, so we permit a zero here)
  938|       |	 *
  939|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  940|    231|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|    231|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|    231|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    231|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    231|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    231|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    231|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    231|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    231|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    231|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    231|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    231|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    231|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    231|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    231|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    231|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    231|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    231|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    231|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    231|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    231|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    231|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    231|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    231|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    231|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    231|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    231|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|    231|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|    231|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|    231|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    231|#define PVD_type_1_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  115|    231|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  941|    231|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    229|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (941:7): [True: 229, False: 2]
  |  Branch (941:23): [True: 1, False: 228]
  ------------------
  942|    230|	    || location >= volume_block)
  ------------------
  |  Branch (942:9): [True: 2, False: 228]
  ------------------
  943|      3|		return (0);
  944|       |
  945|       |	/* Reserved field must be 0. */
  946|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  947|    455|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  147|    455|#define PVD_reserved4_size 1
  ------------------
  |  Branch (947:14): [True: 228, False: 227]
  ------------------
  948|    228|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  146|    228|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    228|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    228|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    228|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    228|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    228|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    228|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    228|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    228|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    228|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    228|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    228|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    228|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    228|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    228|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    228|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    228|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    228|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    228|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    228|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    228|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    228|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    228|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    228|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    228|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    228|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    228|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    228|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    228|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    228|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    228|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    228|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    228|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    228|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    228|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    228|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    228|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    228|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    228|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    228|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    228|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    228|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    228|#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|    228|#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|    228|#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|    228|#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|    228|#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|    228|#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|    228|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    228|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    228|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    228|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    228|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    228|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    228|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    228|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|    228|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|    228|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|    228|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|    228|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|    228|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (948:7): [True: 63, False: 165]
  ------------------
  949|     63|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  146|     63|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     63|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     63|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     63|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     63|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     63|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     63|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     63|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     63|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     63|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     63|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     63|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     63|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     63|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     63|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     63|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     63|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     63|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     63|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     63|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     63|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     63|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     63|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     63|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     63|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     63|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     63|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     63|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     63|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     63|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     63|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     63|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     63|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     63|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     63|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     63|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     63|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     63|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     63|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     63|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     63|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     63|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     63|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     63|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     63|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     63|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     63|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     63|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     63|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     63|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     63|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     63|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     63|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     63|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     63|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     63|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     63|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     63|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     63|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     63|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     63|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (949:10): [True: 1, False: 62]
  ------------------
  950|      1|			return (0);
  951|       |
  952|       |	/* Reserved field must be 0. */
  953|    227|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    227|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    227|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    227|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    227|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    227|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    227|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    227|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    227|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    227|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    227|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    227|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    227|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    227|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    227|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    227|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    227|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    227|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    227|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    227|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    227|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    227|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    227|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    227|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    227|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    227|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    227|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    227|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    227|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    227|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    227|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    227|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    227|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    227|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    227|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    227|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    227|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    227|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    227|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    227|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    227|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    227|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    227|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    227|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    227|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    227|#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|    227|#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|    227|#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|    227|#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|    227|#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|    227|#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|    227|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    227|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    227|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    227|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    227|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    227|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    227|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    227|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    227|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    227|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    227|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    227|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    227|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    227|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|    227|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|    227|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|    227|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    227|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    227|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    227|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    227|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    227|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    227|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    227|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    227|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    227|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    227|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    227|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    227|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    227|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    227|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    227|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    227|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    227|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    227|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    227|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    227|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    227|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    227|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    227|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    227|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    227|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    227|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    227|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    227|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    227|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    227|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    227|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    227|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    227|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    227|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    227|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    227|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    227|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    227|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    227|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    227|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    227|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    227|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    227|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    227|#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|    227|#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|    227|#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|    227|#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|    227|#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|    227|#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|    227|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    227|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    227|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    227|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    227|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    227|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    227|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    227|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    227|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    227|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|    227|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|    227|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|    227|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|    227|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|    227|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (953:6): [True: 1, False: 226]
  ------------------
  954|      1|		return (0);
  955|       |
  956|       |	/* XXX TODO: Check other values for sanity; reject more
  957|       |	 * malformed PVDs. XXX */
  958|       |
  959|       |	/* Read Root Directory Record in Volume Descriptor. */
  960|    226|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|    226|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|    226|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    226|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|    226|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    226|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    226|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    226|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    226|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    226|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    226|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    226|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    226|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    226|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    226|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    226|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    226|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    226|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    226|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    226|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    226|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    226|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    226|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    226|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    226|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    226|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    226|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    226|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    226|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    226|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    226|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  111|    226|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  113|    226|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|    226|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    226|#define PVD_type_m_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  119|    226|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  961|    226|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (961:6): [True: 10, False: 216]
  ------------------
  962|     10|		return (0);
  963|     10|	}
  964|       |
  965|    216|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (965:6): [True: 215, False: 1]
  ------------------
  966|    215|		iso9660->logical_block_size = logical_block_size;
  967|    215|		iso9660->volume_block = volume_block;
  968|    215|		iso9660->volume_size =
  969|    215|		    logical_block_size * (uint64_t)volume_block;
  970|    215|		iso9660->primary.location =
  971|    215|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|    215|#define DR_extent_offset 2
  ------------------
  972|    215|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|    215|#define DR_size_offset 10
  ------------------
  973|    215|	}
  974|       |
  975|    216|	return (48);
  976|    226|}
archive_read_support_format_iso9660.c:isNull:
  602|  1.82k|{
  603|  1.82k|	if (bytes == 0)
  ------------------
  |  Branch (603:6): [True: 0, False: 1.82k]
  ------------------
  604|      0|		return (1);
  605|       |
  606|       |	/*
  607|       |	 * If the first byte is zero and every byte equals the following
  608|       |	 * byte, the entire range is zero.
  609|       |	 */
  610|  1.82k|	return (h[offset] == 0 &&
  ------------------
  |  Branch (610:10): [True: 1.80k, False: 19]
  ------------------
  611|  1.80k|	    (bytes == 1 ||
  ------------------
  |  Branch (611:7): [True: 280, False: 1.52k]
  ------------------
  612|  1.52k|	    memcmp(h + offset, h + offset + 1, bytes - 1) == 0));
  ------------------
  |  Branch (612:6): [True: 1.49k, False: 35]
  ------------------
  613|  1.82k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3245|  1.36k|{
 3246|  1.36k|	return (p[0] == p[7]
  ------------------
  |  Branch (3246:10): [True: 1.35k, False: 8]
  ------------------
 3247|  1.35k|		&& p[1] == p[6]
  ------------------
  |  Branch (3247:6): [True: 1.35k, False: 8]
  ------------------
 3248|  1.35k|		&& p[2] == p[5]
  ------------------
  |  Branch (3248:6): [True: 1.34k, False: 8]
  ------------------
 3249|  1.34k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3249:6): [True: 1.33k, False: 9]
  ------------------
 3250|  1.36k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3239|  1.14k|isValid723Integer(const unsigned char *p) {
 3240|  1.14k|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3240:10): [True: 1.14k, False: 6]
  |  Branch (3240:26): [True: 1.13k, False: 4]
  ------------------
 3241|  1.14k|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  979|    450|isRootDirectoryRecord(const unsigned char *p) {
  980|    450|	int flags;
  981|       |
  982|       |	/* ECMA119/ISO9660 requires that the root directory record be _exactly_ 34 bytes.
  983|       |	 * However, we've seen images that have root directory records up to 68 bytes. */
  984|    450|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    450|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    446|#define DR_length_offset 0
  ------------------
  |  Branch (984:6): [True: 4, False: 446]
  |  Branch (984:34): [True: 3, False: 443]
  ------------------
  985|      7|		return (0);
  986|      7|	}
  987|       |
  988|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
  989|    443|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  200|    443|#define DR_extent_offset 2
  ------------------
  |  Branch (989:6): [True: 12, False: 431]
  ------------------
  990|     12|		return (0);
  991|     12|	}
  992|       |
  993|       |	/* The root directory size must be a 7.3.3 integer. */
  994|    431|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  202|    431|#define DR_size_offset 10
  ------------------
  |  Branch (994:6): [True: 12, False: 419]
  ------------------
  995|     12|		return (0);
  996|     12|	}
  997|       |
  998|       |	/* According to the standard, certain bits must be one or zero:
  999|       |	 * Bit 1: must be 1 (this is a directory)
 1000|       |	 * Bit 2: must be 0 (not an associated file)
 1001|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
 1002|       |	 * Bit 7: must be 0 (final directory record for this file)
 1003|       |	 */
 1004|    419|	flags = p[DR_flags_offset];
  ------------------
  |  |  206|    419|#define DR_flags_offset 25
  ------------------
 1005|    419|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1005:6): [True: 3, False: 416]
  ------------------
 1006|      3|		return (0);
 1007|      3|	}
 1008|       |
 1009|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1010|    416|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  212|    416|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1010:6): [True: 4, False: 412]
  ------------------
 1011|      4|		return (0);
 1012|      4|	}
 1013|       |
 1014|       |	/* Root directory name is a single zero byte... */
 1015|    412|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  214|    412|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  216|    409|#define DR_name_offset 33
  ------------------
  |  Branch (1015:6): [True: 3, False: 409]
  |  Branch (1015:36): [True: 3, False: 406]
  ------------------
 1016|      6|		return (0);
 1017|      6|	}
 1018|       |
 1019|       |	/* Nothing looked wrong, so let's accept it. */
 1020|    406|	return (1);
 1021|    412|}
archive_read_support_format_iso9660.c:isJolietSVD:
  677|    388|{
  678|    388|	const unsigned char *p;
  679|    388|	ssize_t logical_block_size;
  680|    388|	int32_t volume_block;
  681|       |
  682|       |	/* Check if current sector is a kind of Supplementary Volume
  683|       |	 * Descriptor. */
  684|    388|	if (!isSVD(h))
  ------------------
  |  Branch (684:6): [True: 278, False: 110]
  ------------------
  685|    278|		return (0);
  686|       |
  687|       |	/* FIXME: do more validations according to joliet spec. */
  688|       |
  689|       |	/* check if this SVD contains joliet extension! */
  690|    110|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  173|    110|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|    110|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  172|    110|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  691|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  692|    110|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (692:6): [True: 100, False: 10]
  |  Branch (692:21): [True: 44, False: 56]
  ------------------
  693|     44|		int level = 0;
  694|       |
  695|     44|		if (p[2] == '@')
  ------------------
  |  Branch (695:7): [True: 10, False: 34]
  ------------------
  696|     10|			level = 1;
  697|     34|		else if (p[2] == 'C')
  ------------------
  |  Branch (697:12): [True: 0, False: 34]
  ------------------
  698|      0|			level = 2;
  699|     34|		else if (p[2] == 'E')
  ------------------
  |  Branch (699:12): [True: 20, False: 14]
  ------------------
  700|     20|			level = 3;
  701|     14|		else /* not joliet */
  702|     14|			return (0);
  703|       |
  704|     30|		iso9660->seenJoliet = level;
  705|       |
  706|     30|	} else /* not joliet */
  707|     66|		return (0);
  708|       |
  709|     30|	logical_block_size =
  710|     30|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|     30|#define SVD_logical_block_size_offset 128
  ------------------
  711|     30|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|     30|#define SVD_volume_space_size_offset 80
  ------------------
  712|       |
  713|     30|	iso9660->logical_block_size = logical_block_size;
  714|     30|	iso9660->volume_block = volume_block;
  715|     30|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  716|       |	/* Read Root Directory Record in Volume Descriptor. */
  717|     30|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|     30|#define SVD_root_directory_record_offset 156
  ------------------
  718|     30|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|     30|#define DR_extent_offset 2
  ------------------
  719|     30|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|     30|#define DR_size_offset 10
  ------------------
  720|       |
  721|     30|	return (48);
  722|    110|}
archive_read_support_format_iso9660.c:isBootRecord:
  617|    386|{
  618|       |
  619|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  620|    386|	if (h[0] != 0)
  ------------------
  |  Branch (620:6): [True: 378, False: 8]
  ------------------
  621|    378|		return (0);
  622|       |
  623|       |	/* Volume Descriptor Version must be 1. */
  624|      8|	if (h[6] != 1)
  ------------------
  |  Branch (624:6): [True: 1, False: 7]
  ------------------
  625|      1|		return (0);
  626|       |
  627|      7|	return (1);
  628|      8|}
archive_read_support_format_iso9660.c:isEVD:
  785|    379|{
  786|    379|	const unsigned char *p;
  787|    379|	ssize_t logical_block_size;
  788|    379|	int32_t volume_block;
  789|    379|	int32_t location;
  790|       |
  791|       |
  792|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  793|    379|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   86|    379|#define PVD_type_offset 0
  ------------------
  |  Branch (793:6): [True: 246, False: 133]
  ------------------
  794|    246|		return (0);
  795|       |
  796|       |	/* EVD version must be 2. */
  797|    133|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   90|    133|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    133|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    133|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    133|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    133|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (797:6): [True: 111, False: 22]
  ------------------
  798|    111|		return (0);
  799|       |
  800|       |	/* Reserved field must be 0. */
  801|     22|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|     22|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|     22|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|     22|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|     22|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|     22|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|     22|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|     22|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (801:6): [True: 1, False: 21]
  ------------------
  802|      1|		return (0);
  803|       |
  804|       |	/* Reserved field must be 0. */
  805|     21|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     21|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|     21|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|     21|#define PVD_reserved2_size 8
  ------------------
  |  Branch (805:6): [True: 2, False: 19]
  ------------------
  806|      2|		return (0);
  807|       |
  808|       |	/* Reserved field must be 0. */
  809|     19|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|     19|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|     19|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|     19|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|     19|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|     19|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|     19|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     19|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     19|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     19|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     19|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     19|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     19|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|     19|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|     19|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|     19|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     19|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|     19|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|     19|#define PVD_reserved3_size 32
  ------------------
  |  Branch (809:6): [True: 2, False: 17]
  ------------------
  810|      2|		return (0);
  811|       |
  812|       |	/* Logical block size must be > 0. */
  813|       |	/* I've looked at Ecma 119 and can't find any stronger
  814|       |	 * restriction on this field. */
  815|     17|	logical_block_size =
  816|     17|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|     17|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|     17|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|     17|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|     17|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|     17|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|     17|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     17|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     17|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     17|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     17|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     17|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     17|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     17|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     17|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     17|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     17|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     17|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     17|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|     17|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|     17|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|     17|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|     17|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|     17|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  817|     17|	if (logical_block_size <= 0)
  ------------------
  |  Branch (817:6): [True: 1, False: 16]
  ------------------
  818|      1|		return (0);
  819|       |
  820|     16|	volume_block =
  821|     16|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|     16|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|     16|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|     16|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|     16|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|     16|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|     16|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     16|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     16|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     16|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     16|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|     16|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|     16|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|     16|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     16|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|     16|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  822|     16|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|     16|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (822:6): [True: 2, False: 14]
  ------------------
  823|      2|		return (0);
  824|       |
  825|       |	/* File structure version must be 2 for ISO9660:1999. */
  826|     14|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  144|     14|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|     14|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|     14|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|     14|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     14|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|     14|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     14|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     14|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     14|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     14|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     14|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     14|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     14|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     14|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     14|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     14|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     14|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     14|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     14|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     14|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     14|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     14|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     14|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     14|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     14|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     14|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     14|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     14|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     14|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     14|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     14|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     14|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     14|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     14|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     14|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     14|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     14|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     14|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     14|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     14|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     14|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     14|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     14|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     14|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     14|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     14|#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|     14|#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|     14|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     14|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     14|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     14|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     14|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     14|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     14|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|     14|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|     14|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|     14|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|     14|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|     14|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (826:6): [True: 1, False: 13]
  ------------------
  827|      1|		return (0);
  828|       |
  829|       |	/* Location of Occurrence of Type L Path Table must be
  830|       |	 * available location,
  831|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  832|     13|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|     13|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|     13|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     13|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|     13|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|     13|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|     13|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     13|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     13|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     13|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     13|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     13|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     13|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     13|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     13|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     13|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     13|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     13|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     13|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     13|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     13|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     13|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     13|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|     13|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|     13|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|     13|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|     13|#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|     13|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  833|     13|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|     13|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (833:6): [True: 2, False: 11]
  |  Branch (833:40): [True: 1, False: 10]
  ------------------
  834|      3|		return (0);
  835|       |
  836|       |	/* Location of Occurrence of Type M Path Table must be
  837|       |	 * available location,
  838|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  839|     10|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|     10|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|     10|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|     10|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|     10|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|     10|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|     10|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     10|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     10|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     10|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     10|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     10|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     10|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     10|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     10|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     10|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     10|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     10|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     10|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     10|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     10|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     10|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     10|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     10|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     10|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     10|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     10|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|     10|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|     10|#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|     10|#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|     10|#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|     10|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  840|     10|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|      8|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (840:7): [True: 8, False: 2]
  |  Branch (840:23): [True: 1, False: 7]
  ------------------
  841|      9|	    || location >= volume_block)
  ------------------
  |  Branch (841:9): [True: 1, False: 8]
  ------------------
  842|      2|		return (0);
  843|       |
  844|       |	/* Reserved field must be 0. */
  845|      8|	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|      8|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      8|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      8|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      8|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      8|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      8|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      8|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      8|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      8|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      8|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      8|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      8|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      8|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      8|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      8|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      8|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      8|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      8|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      8|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      8|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      8|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      8|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      8|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      8|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      8|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      8|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      8|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      8|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      8|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      8|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      8|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      8|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      8|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      8|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      8|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      8|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      8|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      8|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      8|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      8|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      8|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      8|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      8|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      8|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      8|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      8|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      8|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      8|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      8|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      8|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      8|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      8|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      8|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      8|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      8|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      8|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|      8|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      8|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|      8|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|      8|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|      8|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  147|      8|#define PVD_reserved4_size 1
  ------------------
  |  Branch (845:6): [True: 1, False: 7]
  ------------------
  846|      1|		return (0);
  847|       |
  848|       |	/* Reserved field must be 0. */
  849|      7|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|      7|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|      7|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      7|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      7|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|      7|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|      7|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      7|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      7|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      7|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      7|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      7|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      7|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      7|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      7|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      7|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      7|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      7|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      7|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      7|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      7|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      7|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      7|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      7|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      7|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      7|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      7|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      7|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      7|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      7|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      7|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      7|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      7|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      7|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      7|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      7|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      7|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      7|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      7|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      7|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      7|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      7|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      7|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      7|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      7|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      7|#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|      7|#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|      7|#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|      7|#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|      7|#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|      7|#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|      7|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      7|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      7|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      7|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      7|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      7|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      7|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      7|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      7|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      7|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|      7|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|      7|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|      7|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      7|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|      7|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|      7|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|      7|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      7|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      7|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|      7|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|      7|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|      7|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      7|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      7|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      7|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      7|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      7|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      7|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      7|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      7|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      7|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      7|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      7|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      7|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      7|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      7|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      7|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      7|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      7|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      7|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      7|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      7|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      7|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      7|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      7|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      7|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      7|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      7|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      7|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      7|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      7|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      7|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      7|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      7|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      7|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      7|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      7|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      7|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      7|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      7|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      7|#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|      7|#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|      7|#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|      7|#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|      7|#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|      7|#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|      7|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      7|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      7|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      7|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      7|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      7|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      7|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      7|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      7|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      7|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|      7|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|      7|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|      7|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      7|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|      7|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (849:6): [True: 2, False: 5]
  ------------------
  850|      2|		return (0);
  851|       |
  852|       |	/* Read Root Directory Record in Volume Descriptor. */
  853|      5|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|      5|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|      5|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      5|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|      5|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      5|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      5|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      5|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      5|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      5|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      5|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      5|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      5|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      5|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      5|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      5|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      5|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      5|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      5|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      5|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      5|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      5|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      5|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      5|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      5|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      5|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      5|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      5|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      5|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      5|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      5|#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|      5|#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|      5|#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|      5|#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|      5|#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|      5|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  854|      5|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (854:6): [True: 5, False: 0]
  ------------------
  855|      5|		return (0);
  856|      5|	}
  857|       |
  858|      0|	return (48);
  859|      5|}
archive_read_support_format_iso9660.c:isSVD:
  726|    767|{
  727|    767|	const unsigned char *p;
  728|    767|	ssize_t logical_block_size;
  729|    767|	int32_t volume_block;
  730|    767|	int32_t location;
  731|       |
  732|       |
  733|       |	/* Type 2 means it's a SVD. */
  734|    767|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  162|    767|#define SVD_type_offset 0
  ------------------
  |  Branch (734:6): [True: 480, False: 287]
  ------------------
  735|    480|		return (0);
  736|       |
  737|       |	/* Reserved field must be 0. */
  738|    287|	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    287|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  170|    287|#define SVD_reserved1_size	8
  ------------------
  |  Branch (738:6): [True: 7, False: 280]
  ------------------
  739|      7|		return (0);
  740|    280|	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    280|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  185|    280|#define SVD_reserved2_size	1
  ------------------
  |  Branch (740:6): [True: 7, False: 273]
  ------------------
  741|      7|		return (0);
  742|    273|	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    273|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  187|    273|#define SVD_reserved3_size	653
  ------------------
  |  Branch (742:6): [True: 25, False: 248]
  ------------------
  743|     25|		return (0);
  744|       |
  745|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  746|    248|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  183|    248|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (746:6): [True: 13, False: 235]
  ------------------
  747|     13|		return (0);
  748|       |
  749|    235|	logical_block_size =
  750|    235|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|    235|#define SVD_logical_block_size_offset 128
  ------------------
  751|    235|	if (logical_block_size <= 0)
  ------------------
  |  Branch (751:6): [True: 3, False: 232]
  ------------------
  752|      3|		return (0);
  753|       |
  754|    232|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|    232|#define SVD_volume_space_size_offset 80
  ------------------
  755|    232|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    232|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (755:6): [True: 3, False: 229]
  ------------------
  756|      3|		return (0);
  757|       |
  758|       |	/* Location of Occurrence of Type L Path Table must be
  759|       |	 * available location,
  760|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  761|    229|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  178|    229|#define SVD_type_L_path_table_offset 140
  ------------------
  762|    229|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    229|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (762:6): [True: 3, False: 226]
  |  Branch (762:40): [True: 3, False: 223]
  ------------------
  763|      6|		return (0);
  764|       |
  765|       |	/* The Type M Path Table must be at a valid location (WinISO
  766|       |	 * and probably other programs omit this, so we allow zero)
  767|       |	 *
  768|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  769|    223|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  179|    223|#define SVD_type_M_path_table_offset 148
  ------------------
  770|    223|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    219|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (770:7): [True: 219, False: 4]
  |  Branch (770:23): [True: 2, False: 217]
  ------------------
  771|    221|	    || location >= volume_block)
  ------------------
  |  Branch (771:9): [True: 2, False: 219]
  ------------------
  772|      4|		return (0);
  773|       |
  774|       |	/* Read Root Directory Record in Volume Descriptor. */
  775|    219|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|    219|#define SVD_root_directory_record_offset 156
  ------------------
  776|    219|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (776:6): [True: 29, False: 190]
  ------------------
  777|     29|		return (0);
  778|     29|	}
  779|       |
  780|    190|	return (48);
  781|    219|}
archive_read_support_format_iso9660.c:isVolumePartition:
  632|    299|{
  633|    299|	int32_t location;
  634|       |
  635|       |	/* Type of the Volume Partition Descriptor must be 3. */
  636|    299|	if (h[0] != 3)
  ------------------
  |  Branch (636:6): [True: 295, False: 4]
  ------------------
  637|    295|		return (0);
  638|       |
  639|       |	/* Volume Descriptor Version must be 1. */
  640|      4|	if (h[6] != 1)
  ------------------
  |  Branch (640:6): [True: 1, False: 3]
  ------------------
  641|      1|		return (0);
  642|       |	/* Unused Field */
  643|      3|	if (h[7] != 0)
  ------------------
  |  Branch (643:6): [True: 1, False: 2]
  ------------------
  644|      1|		return (0);
  645|       |
  646|      2|	location = archive_le32dec(h + 72);
  647|      2|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   83|      4|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (647:6): [True: 1, False: 1]
  ------------------
  648|      1|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (648:6): [True: 1, False: 0]
  ------------------
  649|      2|		return (0);
  650|      0|	if ((uint32_t)location != archive_be32dec(h + 76))
  ------------------
  |  Branch (650:6): [True: 0, False: 0]
  ------------------
  651|      0|		return (0);
  652|       |
  653|      0|	return (1);
  654|      0|}
archive_read_support_format_iso9660.c:isVDSetTerminator:
  658|    299|{
  659|       |
  660|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  661|    299|	if (h[0] != 255)
  ------------------
  |  Branch (661:6): [True: 98, False: 201]
  ------------------
  662|     98|		return (0);
  663|       |
  664|       |	/* Volume Descriptor Version must be 1. */
  665|    201|	if (h[6] != 1)
  ------------------
  |  Branch (665:6): [True: 1, False: 200]
  ------------------
  666|      1|		return (0);
  667|       |
  668|       |	/* Reserved field must be 0. */
  669|    200|	if (!isNull(h, 7, 2048-7))
  ------------------
  |  Branch (669:6): [True: 4, False: 196]
  ------------------
  670|      4|		return (0);
  671|       |
  672|    196|	return (1);
  673|    200|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1237|    903|{
 1238|    903|	struct iso9660 *iso9660 = a->format->data;
 1239|    903|	struct file_info *file;
 1240|    903|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  233|    903|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1241|       |
 1242|    903|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1242:6): [True: 194, False: 709]
  ------------------
 1243|    194|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  372|    194|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1244|    194|		a->archive.archive_format_name = "ISO9660";
 1245|    194|	}
 1246|       |
 1247|    903|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1247:6): [True: 194, False: 709]
  ------------------
 1248|    194|		r = choose_volume(a, iso9660);
 1249|    194|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    194|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1249:7): [True: 25, False: 169]
  ------------------
 1250|     25|			return (r);
 1251|    194|	}
 1252|       |
 1253|    878|	file = NULL;/* Eliminate a warning. */
 1254|       |	/* Get the next entry that appears after the current offset. */
 1255|    878|	r = next_entry_seek(a, iso9660, &file);
 1256|    878|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    878|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1256:6): [True: 232, False: 646]
  ------------------
 1257|    232|		return (r);
 1258|       |
 1259|    646|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1259:6): [True: 11, False: 635]
  ------------------
 1260|       |		/*
 1261|       |		 * Convert UTF-16BE of a filename to local locale MBS
 1262|       |		 * and store the result into a filename field.
 1263|       |		 */
 1264|     11|		if (iso9660->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1264:7): [True: 6, False: 5]
  ------------------
 1265|      6|			iso9660->sconv_utf16be =
 1266|      6|			    archive_string_conversion_from_charset(
 1267|      6|				&(a->archive), "UTF-16BE", 1);
 1268|      6|			if (iso9660->sconv_utf16be == NULL)
  ------------------
  |  Branch (1268:8): [True: 0, False: 6]
  ------------------
 1269|       |				/* Couldn't allocate memory */
 1270|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1271|      6|		}
 1272|     11|		if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1272:7): [True: 6, False: 5]
  ------------------
 1273|      6|			iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
  ------------------
  |  |  378|      6|#define UTF16_NAME_MAX	1024
  ------------------
 1274|      6|			if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1274:8): [True: 0, False: 6]
  ------------------
 1275|      0|				archive_set_error(&a->archive, ENOMEM,
 1276|      0|				    "No memory");
 1277|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1278|      0|			}
 1279|      6|		}
 1280|     11|		if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1280:7): [True: 6, False: 5]
  ------------------
 1281|      6|			iso9660->utf16be_previous_path = calloc(1, UTF16_NAME_MAX);
  ------------------
  |  |  378|      6|#define UTF16_NAME_MAX	1024
  ------------------
 1282|      6|			if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1282:8): [True: 0, False: 6]
  ------------------
 1283|      0|				archive_set_error(&a->archive, ENOMEM,
 1284|      0|				    "No memory");
 1285|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1286|      0|			}
 1287|      6|		}
 1288|       |
 1289|     11|		iso9660->utf16be_path_len = 0;
 1290|     11|		if (build_pathname_utf16be(iso9660->utf16be_path,
  ------------------
  |  Branch (1290:7): [True: 0, False: 11]
  ------------------
 1291|     11|		    UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file) != 0) {
  ------------------
  |  |  378|     11|#define UTF16_NAME_MAX	1024
  ------------------
 1292|      0|			archive_set_error(&a->archive,
 1293|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1294|      0|			    "Pathname is too long");
 1295|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1296|      0|		}
 1297|       |
 1298|     11|		r = archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     11|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
 1299|     11|		    (const char *)iso9660->utf16be_path,
 1300|     11|		    iso9660->utf16be_path_len,
 1301|     11|		    iso9660->sconv_utf16be);
 1302|     11|		if (r != 0) {
  ------------------
  |  Branch (1302:7): [True: 4, False: 7]
  ------------------
 1303|      4|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1303:8): [True: 0, False: 4]
  ------------------
 1304|      0|				archive_set_error(&a->archive, ENOMEM,
 1305|      0|				    "No memory for Pathname");
 1306|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1307|      0|			}
 1308|      4|			archive_set_error(&a->archive,
 1309|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1310|      4|			    "Pathname cannot be converted "
 1311|      4|			    "from %s to current locale",
 1312|      4|			    archive_string_conversion_charset_name(
 1313|      4|			      iso9660->sconv_utf16be));
 1314|       |
 1315|      4|			rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1316|      4|		}
 1317|    635|	} else {
 1318|    635|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1319|    635|		if (path == NULL) {
  ------------------
  |  Branch (1319:7): [True: 0, False: 635]
  ------------------
 1320|      0|			archive_set_error(&a->archive,
 1321|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1322|      0|			    "Pathname is too long");
 1323|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1324|    635|		} else {
 1325|    635|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    635|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1326|    635|			archive_entry_set_pathname(entry, path);
 1327|    635|		}
 1328|    635|	}
 1329|       |
 1330|    646|	iso9660->entry_bytes_remaining = file->size;
 1331|       |	/* Offset for sparse-file-aware clients. */
 1332|    646|	iso9660->entry_sparse_offset = 0;
 1333|       |
 1334|    646|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1334:6): [True: 93, False: 553]
  ------------------
 1335|     93|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     93|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1336|     93|		    "File is beyond end-of-media: %s",
 1337|     93|		    archive_entry_pathname(entry));
 1338|     93|		iso9660->entry_bytes_remaining = 0;
 1339|     93|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     93|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1340|     93|	}
 1341|       |
 1342|       |	/* Set up the entry structure with information about this entry. */
 1343|    553|	archive_entry_set_mode(entry, file->mode);
 1344|    553|	archive_entry_set_uid(entry, file->uid);
 1345|    553|	archive_entry_set_gid(entry, file->gid);
 1346|    553|	archive_entry_set_nlink(entry, file->nlinks);
 1347|    553|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  311|    553|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1347:6): [True: 1, False: 552]
  ------------------
 1348|      1|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1349|    552|	else
 1350|    552|		archive_entry_unset_birthtime(entry);
 1351|    553|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  312|    553|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1351:6): [True: 236, False: 317]
  ------------------
 1352|    236|		archive_entry_set_mtime(entry, file->mtime, 0);
 1353|    317|	else
 1354|    317|		archive_entry_unset_mtime(entry);
 1355|    553|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  314|    553|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1355:6): [True: 235, False: 318]
  ------------------
 1356|    235|		archive_entry_set_ctime(entry, file->ctime, 0);
 1357|    318|	else
 1358|    318|		archive_entry_unset_ctime(entry);
 1359|    553|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  313|    553|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1359:6): [True: 235, False: 318]
  ------------------
 1360|    235|		archive_entry_set_atime(entry, file->atime, 0);
 1361|    318|	else
 1362|    318|		archive_entry_unset_atime(entry);
 1363|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1364|    553|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1365|    553|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1366|    553|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1366:6): [True: 19, False: 534]
  ------------------
 1367|     19|		archive_entry_copy_symlink(entry, file->symlink.s);
 1368|       |
 1369|       |	/* Note: If the input isn't seekable, we can't rewind to
 1370|       |	 * return the same body again, so if the next entry refers to
 1371|       |	 * the same data, we have to return it as a hardlink to the
 1372|       |	 * original entry. */
 1373|    553|	if (file->number != -1 &&
  ------------------
  |  Branch (1373:6): [True: 413, False: 140]
  ------------------
 1374|    413|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1374:6): [True: 67, False: 346]
  ------------------
 1375|     67|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1375:7): [True: 0, False: 67]
  ------------------
 1376|      0|			r = archive_entry_copy_hardlink_l(entry,
  ------------------
  |  |   74|      0|#define archive_entry_copy_hardlink_l	_archive_entry_copy_hardlink_l
  ------------------
 1377|      0|			    (const char *)iso9660->utf16be_previous_path,
 1378|      0|			    iso9660->utf16be_previous_path_len,
 1379|      0|			    iso9660->sconv_utf16be);
 1380|      0|			if (r != 0) {
  ------------------
  |  Branch (1380:8): [True: 0, False: 0]
  ------------------
 1381|      0|				if (errno == ENOMEM) {
  ------------------
  |  Branch (1381:9): [True: 0, False: 0]
  ------------------
 1382|      0|					archive_set_error(&a->archive, ENOMEM,
 1383|      0|					    "No memory for Linkname");
 1384|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1385|      0|				}
 1386|      0|				archive_set_error(&a->archive,
 1387|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1388|      0|				    "Linkname cannot be converted "
 1389|      0|				    "from %s to current locale",
 1390|      0|				    archive_string_conversion_charset_name(
 1391|      0|				      iso9660->sconv_utf16be));
 1392|      0|				rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1393|      0|			}
 1394|      0|		} else
 1395|     67|			archive_entry_set_hardlink(entry,
 1396|     67|			    iso9660->previous_pathname.s);
 1397|     67|		archive_entry_unset_size(entry);
 1398|     67|		iso9660->entry_bytes_remaining = 0;
 1399|     67|		return (rd_r);
 1400|     67|	}
 1401|       |
 1402|    486|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  215|    486|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  221|    972|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1402:6): [True: 325, False: 161]
  ------------------
 1403|    325|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1403:6): [True: 84, False: 241]
  ------------------
 1404|     84|		int64_t r64;
 1405|       |
 1406|     84|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1407|     84|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1407:7): [True: 0, False: 84]
  ------------------
 1408|       |			/* We can't seek backwards to extract it, so issue
 1409|       |			 * a warning.  Note that this can only happen if
 1410|       |			 * this entry was added to the heap after we passed
 1411|       |			 * this offset, that is, only if the directory
 1412|       |			 * mentioning this entry is later than the body of
 1413|       |			 * the entry. Such layouts are very unusual; most
 1414|       |			 * ISO9660 writers lay out and record all directory
 1415|       |			 * information first, then store all file bodies. */
 1416|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1417|      0|			    "Ignoring out-of-order file @%jx (%s) %jd < %jd",
 1418|      0|			    (uintmax_t)file->number,
 1419|      0|			    iso9660->pathname.s,
 1420|      0|			    (intmax_t)file->offset,
 1421|      0|			    (intmax_t)iso9660->current_position);
 1422|      0|			iso9660->entry_bytes_remaining = 0;
 1423|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1424|      0|		}
 1425|     84|		iso9660->current_position = (uint64_t)r64;
 1426|     84|	}
 1427|       |
 1428|       |	/* Initialize zisofs variables. */
 1429|    486|	iso9660->entry_zisofs.pz = file->pz;
 1430|    486|	if (file->pz) {
  ------------------
  |  Branch (1430:6): [True: 0, False: 486]
  ------------------
 1431|      0|#ifdef HAVE_ZLIB_H
 1432|      0|		struct zisofs  *zisofs;
 1433|       |
 1434|      0|		zisofs = &iso9660->entry_zisofs;
 1435|      0|		zisofs->initialized = 0;
 1436|      0|		zisofs->pz_log2_bs = file->pz_log2_bs;
 1437|      0|		zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
 1438|      0|		zisofs->pz_offset = 0;
 1439|      0|		zisofs->header_avail = 0;
 1440|      0|		zisofs->header_passed = 0;
 1441|      0|		zisofs->block_pointers_avail = 0;
 1442|      0|#endif
 1443|      0|		archive_entry_set_size(entry, file->pz_uncompressed_size);
 1444|      0|	}
 1445|       |
 1446|    486|	iso9660->previous_number = file->number;
 1447|    486|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1447:6): [True: 11, False: 475]
  ------------------
 1448|     11|		memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
 1449|     11|		    iso9660->utf16be_path_len);
 1450|     11|		iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
 1451|     11|	} else
 1452|    486|		archive_strcpy(
  ------------------
  |  |  165|    475|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    950|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 475]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1453|    486|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1454|       |
 1455|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1456|    486|	iso9660->entry_content = file->contents.first;
 1457|    486|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1457:6): [True: 16, False: 470]
  ------------------
 1458|     16|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1459|       |
 1460|    486|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    486|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1460:6): [True: 161, False: 325]
  ------------------
 1461|       |		/* Overwrite nlinks by proper link number which is
 1462|       |		 * calculated from number of sub directories. */
 1463|    161|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1464|       |		/* Directory data has been read completely. */
 1465|    161|		iso9660->entry_bytes_remaining = 0;
 1466|    161|	}
 1467|       |
 1468|    486|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  233|    486|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1468:6): [True: 4, False: 482]
  ------------------
 1469|      4|		return (rd_r);
 1470|    482|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    482|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1471|    486|}
archive_read_support_format_iso9660.c:choose_volume:
 1148|    194|{
 1149|    194|	struct file_info *file;
 1150|    194|	int64_t skipsize;
 1151|    194|	struct vd *vd;
 1152|    194|	const void *block;
 1153|    194|	char seenJoliet;
 1154|       |
 1155|    194|	vd = &(iso9660->primary);
 1156|    194|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1156:6): [True: 0, False: 194]
  ------------------
 1157|      0|		iso9660->seenJoliet = 0;
 1158|    194|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1158:6): [True: 19, False: 175]
  ------------------
 1159|     19|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1159:3): [True: 2, False: 17]
  ------------------
 1160|       |		/* This condition is unlikely; by way of caution. */
 1161|      2|		vd = &(iso9660->joliet);
 1162|       |
 1163|    194|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|    194|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1164|    194|	skipsize = __archive_read_consume(a, skipsize);
 1165|    194|	if (skipsize < 0)
  ------------------
  |  Branch (1165:6): [True: 4, False: 190]
  ------------------
 1166|      4|		return ((int)skipsize);
 1167|    190|	iso9660->current_position = skipsize;
 1168|       |
 1169|    190|	block = __archive_read_ahead(a, vd->size, NULL);
 1170|    190|	if (block == NULL) {
  ------------------
  |  Branch (1170:6): [True: 1, False: 189]
  ------------------
 1171|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1172|      1|		    "Failed to read full block when scanning "
 1173|      1|		    "ISO9660 directory list");
 1174|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1175|      1|	}
 1176|       |
 1177|       |	/*
 1178|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1179|       |	 * avoid converting special name 0x00(Current Directory) and
 1180|       |	 * next byte to UCS2.
 1181|       |	 */
 1182|    189|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1183|    189|	iso9660->seenJoliet = 0;
 1184|    189|	file = parse_file_info(a, NULL, block, vd->size);
 1185|    189|	if (file == NULL)
  ------------------
  |  Branch (1185:6): [True: 16, False: 173]
  ------------------
 1186|     16|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1187|    173|	iso9660->seenJoliet = seenJoliet;
 1188|       |
 1189|       |	/*
 1190|       |	 * If the iso image has both RockRidge and Joliet, we preferentially
 1191|       |	 * use RockRidge Extensions rather than Joliet ones.
 1192|       |	 */
 1193|    173|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1193:6): [True: 172, False: 1]
  |  Branch (1193:35): [True: 66, False: 106]
  ------------------
 1194|     66|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1194:9): [True: 0, False: 66]
  ------------------
 1195|      0|		iso9660->seenJoliet = 0;
 1196|       |
 1197|    173|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1197:6): [True: 172, False: 1]
  |  Branch (1197:35): [True: 106, False: 66]
  ------------------
 1198|    106|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1198:9): [True: 15, False: 91]
  ------------------
 1199|       |		/* Switch reading data from primary to joliet. */
 1200|     15|		vd = &(iso9660->joliet);
 1201|     15|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|     15|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1202|     15|		skipsize -= iso9660->current_position;
 1203|     15|		skipsize = __archive_read_consume(a, skipsize);
 1204|     15|		if (skipsize < 0)
  ------------------
  |  Branch (1204:7): [True: 2, False: 13]
  ------------------
 1205|      2|			return ((int)skipsize);
 1206|     13|		iso9660->current_position += skipsize;
 1207|       |
 1208|     13|		block = __archive_read_ahead(a, vd->size, NULL);
 1209|     13|		if (block == NULL) {
  ------------------
  |  Branch (1209:7): [True: 1, False: 12]
  ------------------
 1210|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1211|      1|			    "Failed to read full block when scanning "
 1212|      1|			    "ISO9660 directory list");
 1213|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1214|      1|		}
 1215|     12|		iso9660->seenJoliet = 0;
 1216|     12|		file = parse_file_info(a, NULL, block, vd->size);
 1217|     12|		if (file == NULL)
  ------------------
  |  Branch (1217:7): [True: 1, False: 11]
  ------------------
 1218|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1219|     11|		iso9660->seenJoliet = seenJoliet;
 1220|     11|	}
 1221|       |
 1222|       |	/* Store the root directory in the pending list. */
 1223|    169|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  451|    169|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  233|    169|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1223:6): [True: 0, False: 169]
  ------------------
 1224|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1225|    169|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1225:6): [True: 66, False: 103]
  ------------------
 1226|     66|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  373|     66|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  372|     66|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1227|     66|		a->archive.archive_format_name =
 1228|     66|		    "ISO9660 with Rockridge extensions";
 1229|     66|	}
 1230|       |
 1231|    169|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    169|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1232|    169|}
archive_read_support_format_iso9660.c:parse_file_info:
 1824|  1.03k|{
 1825|  1.03k|	struct iso9660 *iso9660 = a->format->data;
 1826|  1.03k|	struct file_info *file, *filep;
 1827|  1.03k|	size_t name_len;
 1828|  1.03k|	const unsigned char *rr_start, *rr_end;
 1829|  1.03k|	const unsigned char *p;
 1830|  1.03k|	size_t dr_len = 0;
 1831|  1.03k|	uint64_t fsize, offset;
 1832|  1.03k|	int32_t location;
 1833|  1.03k|	int flags;
 1834|       |
 1835|  1.03k|	if (reclen != 0)
  ------------------
  |  Branch (1835:6): [True: 1.03k, False: 1]
  ------------------
 1836|  1.03k|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  196|  1.03k|#define DR_length_offset 0
  ------------------
 1837|       |	/*
 1838|       |	 * Sanity check that reclen is not zero and dr_len is greater than
 1839|       |	 * reclen but at least 34
 1840|       |	 */
 1841|  1.03k|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1841:6): [True: 1, False: 1.03k]
  |  Branch (1841:21): [True: 0, False: 1.03k]
  |  Branch (1841:40): [True: 14, False: 1.02k]
  ------------------
 1842|     15|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     15|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1843|     15|			"Invalid length of directory record");
 1844|     15|		return (NULL);
 1845|     15|	}
 1846|  1.02k|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  214|  1.02k|#define DR_name_len_offset 32
  ------------------
 1847|  1.02k|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  200|  1.02k|#define DR_extent_offset 2
  ------------------
 1848|  1.02k|	fsize = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  202|  1.02k|#define DR_size_offset 10
  ------------------
 1849|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1850|  1.02k|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1850:6): [True: 6, False: 1.01k]
  |  Branch (1850:32): [True: 5, False: 1.01k]
  ------------------
 1851|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1852|     11|		    "Invalid length of file identifier");
 1853|     11|		return (NULL);
 1854|     11|	}
 1855|       |	/* Sanity check that location doesn't exceed volume block.
 1856|       |	 * Don't check lower limit of location; it's possibility
 1857|       |	 * the location has negative value when file type is symbolic
 1858|       |	 * link or file size is zero. As far as I know latest mkisofs
 1859|       |	 * do that.
 1860|       |	 */
 1861|  1.01k|	if (location > 0 &&
  ------------------
  |  Branch (1861:6): [True: 480, False: 533]
  ------------------
 1862|    480|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1862:6): [True: 4, False: 476]
  ------------------
 1863|    480|	       / iso9660->logical_block_size))
 1864|    480|			> (uint32_t)iso9660->volume_block) {
 1865|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1866|      4|		    "Invalid location of extent of file");
 1867|      4|		return (NULL);
 1868|      4|	}
 1869|       |	/* Sanity check that location doesn't have a negative value
 1870|       |	 * when the file is not empty. it's too large. */
 1871|  1.00k|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1871:6): [True: 612, False: 397]
  |  Branch (1871:20): [True: 4, False: 608]
  ------------------
 1872|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1873|      4|		    "Invalid location of extent of file");
 1874|      4|		return (NULL);
 1875|      4|	}
 1876|       |
 1877|       |	/* Sanity check that this entry does not create a cycle. */
 1878|  1.00k|	offset = iso9660->logical_block_size * (uint64_t)location;
 1879|  2.02k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1879:23): [True: 1.02k, False: 1.00k]
  ------------------
 1880|  1.02k|		if (filep->offset == offset) {
  ------------------
  |  Branch (1880:7): [True: 4, False: 1.02k]
  ------------------
 1881|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1882|      4|			    "Directory structure contains loop");
 1883|      4|			return (NULL);
 1884|      4|		}
 1885|  1.02k|	}
 1886|       |
 1887|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1888|  1.00k|	file = calloc(1, sizeof(*file));
 1889|  1.00k|	if (file == NULL) {
  ------------------
  |  Branch (1889:6): [True: 0, False: 1.00k]
  ------------------
 1890|      0|		archive_set_error(&a->archive, ENOMEM,
 1891|      0|		    "No memory for file entry");
 1892|      0|		return (NULL);
 1893|      0|	}
 1894|  1.00k|	file->parent = parent;
 1895|  1.00k|	file->offset = offset;
 1896|  1.00k|	file->size = fsize;
 1897|  1.00k|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  204|  1.00k|#define DR_date_offset 18
  ------------------
  |  Branch (1897:6): [True: 412, False: 589]
  ------------------
 1898|    412|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    412|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    412|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  314|    412|#define CTIME_IS_SET 8
  ------------------
 1899|    412|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  204|    412|#define DR_date_offset 18
  ------------------
 1900|    412|		file->ctime = file->atime = file->mtime;
 1901|    412|	}
 1902|  1.00k|	file->rede_files.first = NULL;
 1903|  1.00k|	file->rede_files.last = &(file->rede_files.first);
 1904|       |
 1905|  1.00k|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  216|  1.00k|#define DR_name_offset 33
  ------------------
 1906|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1907|       |	 * before fidgeting the name_len below. */
 1908|  1.00k|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1908:29): [True: 253, False: 748]
  ------------------
 1909|  1.00k|	rr_end = isodirrec + dr_len;
 1910|       |
 1911|  1.00k|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1911:6): [True: 22, False: 979]
  ------------------
 1912|       |		/* Joliet names are max 64 chars (128 bytes) according to spec,
 1913|       |		 * but genisoimage/mkisofs allows recording longer Joliet
 1914|       |		 * names which are 103 UCS2 characters(206 bytes) by their
 1915|       |		 * option '-joliet-long'.
 1916|       |		 */
 1917|     22|		if (name_len > 206)
  ------------------
  |  Branch (1917:7): [True: 0, False: 22]
  ------------------
 1918|      0|			name_len = 206;
 1919|     22|		name_len &= ~1;
 1920|       |
 1921|       |		/* trim trailing first version and dot from filename.
 1922|       |		 *
 1923|       |		 * Remember we were in UTF-16BE land!
 1924|       |		 * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
 1925|       |		 * 16 bits big endian characters on Joliet.
 1926|       |		 *
 1927|       |		 * TODO: sanitize filename?
 1928|       |		 *       Joliet allows any UCS-2 char except:
 1929|       |		 *       *, /, :, ;, ? and \.
 1930|       |		 */
 1931|       |		/* Chop off trailing ';1' from files. */
 1932|     22|		if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
  ------------------
  |  Branch (1932:7): [True: 21, False: 1]
  |  Branch (1932:23): [True: 10, False: 11]
  |  Branch (1932:45): [True: 2, False: 8]
  ------------------
 1933|      2|		    && p[name_len-2] == 0 && p[name_len-1] == '1')
  ------------------
  |  Branch (1933:10): [True: 1, False: 1]
  |  Branch (1933:32): [True: 0, False: 1]
  ------------------
 1934|      0|			name_len -= 4;
 1935|       |#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
 1936|       |		/* Chop off trailing '.' from filenames. */
 1937|       |		if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
 1938|       |			name_len -= 2;
 1939|       |#endif
 1940|     22|		if ((file->utf16be_name = malloc(name_len)) == NULL) {
  ------------------
  |  Branch (1940:7): [True: 0, False: 22]
  ------------------
 1941|      0|			archive_set_error(&a->archive, ENOMEM,
 1942|      0|			    "No memory for file name");
 1943|      0|			goto fail;
 1944|      0|		}
 1945|     22|		memcpy(file->utf16be_name, p, name_len);
 1946|     22|		file->utf16be_bytes = name_len;
 1947|    979|	} else {
 1948|       |		/* Chop off trailing ';1' from files. */
 1949|    979|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1949:7): [True: 784, False: 195]
  |  Branch (1949:23): [True: 371, False: 413]
  ------------------
 1950|    371|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1950:5): [True: 324, False: 47]
  ------------------
 1951|    324|			name_len -= 2;
 1952|       |		/* Chop off trailing '.' from filenames. */
 1953|    979|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1953:7): [True: 784, False: 195]
  |  Branch (1953:23): [True: 9, False: 775]
  ------------------
 1954|      9|			--name_len;
 1955|       |
 1956|    979|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    979|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1957|    979|	}
 1958|       |
 1959|  1.00k|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  206|  1.00k|#define DR_flags_offset 25
  ------------------
 1960|  1.00k|	if (flags & 0x02)
  ------------------
  |  Branch (1960:6): [True: 429, False: 572]
  ------------------
 1961|    429|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    429|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1962|    572|	else
 1963|    572|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    572|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1964|  1.00k|	if (flags & 0x80)
  ------------------
  |  Branch (1964:6): [True: 69, False: 932]
  ------------------
 1965|     69|		file->multi_extent = 1;
 1966|    932|	else
 1967|    932|		file->multi_extent = 0;
 1968|       |	/*
 1969|       |	 * Use a location for the file number, which is treated as an inode
 1970|       |	 * number to find out hardlink target. If Rockridge extensions is
 1971|       |	 * being used, the file number will be overwritten by FILE SERIAL
 1972|       |	 * NUMBER of RRIP "PX" extension.
 1973|       |	 * Note: Old mkisofs did not record that FILE SERIAL NUMBER
 1974|       |	 * in ISO images.
 1975|       |	 * Note2: xorriso set 0 to the location of a symlink file.
 1976|       |	 */
 1977|  1.00k|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1977:6): [True: 397, False: 604]
  |  Branch (1977:25): [True: 242, False: 155]
  ------------------
 1978|       |		/* If file->size is zero, its location points wrong place,
 1979|       |		 * and so we should not use it for the file number.
 1980|       |		 * When the location has negative value, it can be used
 1981|       |		 * for the file number.
 1982|       |		 */
 1983|    242|		file->number = -1;
 1984|       |		/* Do not appear before any directory entries. */
 1985|    242|		file->offset = -1;
 1986|    242|	} else
 1987|    759|		file->number = (int64_t)(uint32_t)location;
 1988|       |
 1989|       |	/* Rockridge extensions overwrite information from above. */
 1990|  1.00k|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (1990:6): [True: 176, False: 825]
  ------------------
 1991|    176|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (1991:7): [True: 176, False: 0]
  |  Branch (1991:25): [True: 87, False: 89]
  ------------------
 1992|     87|			p = rr_start;
 1993|     87|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (1993:8): [True: 83, False: 4]
  ------------------
 1994|       |				/*
 1995|       |				 * SP extension stores the suspOffset
 1996|       |				 * (Number of bytes to skip between
 1997|       |				 * filename and SUSP records.)
 1998|       |				 * It is mandatory by the SUSP standard
 1999|       |				 * (IEEE 1281).
 2000|       |				 *
 2001|       |				 * It allows SUSP to coexist with
 2002|       |				 * non-SUSP uses of the System
 2003|       |				 * Use Area by placing non-SUSP data
 2004|       |				 * before SUSP data.
 2005|       |				 *
 2006|       |				 * SP extension must be in the root
 2007|       |				 * directory entry, disable all SUSP
 2008|       |				 * processing if not found.
 2009|       |				 */
 2010|     83|				iso9660->suspOffset = p[6];
 2011|     83|				iso9660->seenSUSP = 1;
 2012|     83|				rr_start += 7;
 2013|     83|			}
 2014|     87|		}
 2015|    176|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2015:7): [True: 83, False: 93]
  ------------------
 2016|     83|			int r;
 2017|       |
 2018|     83|			file->name_continues = 0;
 2019|     83|			file->symlink_continues = 0;
 2020|     83|			rr_start += iso9660->suspOffset;
 2021|     83|			r = parse_rockridge(a, file, rr_start, rr_end);
 2022|     83|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2022:8): [True: 2, False: 81]
  ------------------
 2023|      2|				goto fail;
 2024|       |			/*
 2025|       |			 * A file size of symbolic link files in ISO images
 2026|       |			 * made by makefs is not zero and its location is
 2027|       |			 * the same as those of next regular file. That is
 2028|       |			 * the same as hard like file and it causes unexpected
 2029|       |			 * error.
 2030|       |			 */
 2031|     81|			if (file->size > 0 &&
  ------------------
  |  Branch (2031:8): [True: 5, False: 76]
  ------------------
 2032|      5|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|      5|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|      5|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2032:8): [True: 0, False: 5]
  ------------------
 2033|      0|				file->size = 0;
 2034|      0|				file->number = -1;
 2035|      0|				file->offset = -1;
 2036|      0|			}
 2037|     81|		} else
 2038|       |			/* If there isn't SUSP, disable parsing
 2039|       |			 * rock ridge extensions. */
 2040|     93|			iso9660->opt_support_rockridge = 0;
 2041|    176|	}
 2042|       |
 2043|    999|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2044|       |	/* Tell file's parent how many children that parent has. */
 2045|    999|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2045:6): [True: 814, False: 185]
  |  Branch (2045:24): [True: 329, False: 485]
  ------------------
 2046|    329|		parent->subdirs++;
 2047|       |
 2048|    999|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2048:6): [True: 67, False: 932]
  ------------------
 2049|     67|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2049:7): [True: 0, False: 67]
  |  Branch (2049:25): [True: 0, False: 0]
  ------------------
 2050|      0|		    (flags & 0x02) && iso9660->rr_moved == NULL &&
  ------------------
  |  Branch (2050:7): [True: 0, False: 0]
  |  Branch (2050:25): [True: 0, False: 0]
  ------------------
 2051|      0|		    file->name.s &&
  ------------------
  |  Branch (2051:7): [True: 0, False: 0]
  ------------------
 2052|      0|		    (strcmp(file->name.s, "rr_moved") == 0 ||
  ------------------
  |  Branch (2052:8): [True: 0, False: 0]
  ------------------
 2053|      0|		     strcmp(file->name.s, ".rr_moved") == 0)) {
  ------------------
  |  Branch (2053:8): [True: 0, False: 0]
  ------------------
 2054|      0|			iso9660->rr_moved = file;
 2055|      0|			file->rr_moved = 1;
 2056|      0|			file->rr_moved_has_re_only = 1;
 2057|      0|			file->re = 0;
 2058|      0|			parent->subdirs--;
 2059|     67|		} else if (file->re) {
  ------------------
  |  Branch (2059:14): [True: 1, False: 66]
  ------------------
 2060|       |			/*
 2061|       |			 * Sanity check: file's parent is rr_moved.
 2062|       |			 */
 2063|      1|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2063:8): [True: 1, False: 0]
  |  Branch (2063:26): [True: 0, False: 0]
  ------------------
 2064|      1|				archive_set_error(&a->archive,
 2065|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2066|      1|				    "Invalid Rockridge RE");
 2067|      1|				goto fail;
 2068|      1|			}
 2069|       |			/*
 2070|       |			 * Sanity check: file does not have "CL" extension.
 2071|       |			 */
 2072|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2072:8): [True: 0, False: 0]
  ------------------
 2073|      0|				archive_set_error(&a->archive,
 2074|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2075|      0|				    "Invalid Rockridge RE and CL");
 2076|      0|				goto fail;
 2077|      0|			}
 2078|       |			/*
 2079|       |			 * Sanity check: The file type must be a directory.
 2080|       |			 */
 2081|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2081:8): [True: 0, False: 0]
  ------------------
 2082|      0|				archive_set_error(&a->archive,
 2083|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2084|      0|				    "Invalid Rockridge RE");
 2085|      0|				goto fail;
 2086|      0|			}
 2087|     66|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2087:14): [True: 0, False: 66]
  |  Branch (2087:32): [True: 0, False: 0]
  ------------------
 2088|      0|			file->rr_moved_has_re_only = 0;
 2089|     66|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2089:12): [True: 0, False: 66]
  |  Branch (2089:30): [True: 0, False: 0]
  ------------------
 2090|      0|		    (parent->re || parent->re_descendant))
  ------------------
  |  Branch (2090:8): [True: 0, False: 0]
  |  Branch (2090:22): [True: 0, False: 0]
  ------------------
 2091|      0|			file->re_descendant = 1;
 2092|     66|		if (file->cl_offset) {
  ------------------
  |  Branch (2092:7): [True: 0, False: 66]
  ------------------
 2093|      0|			struct file_info *r;
 2094|       |
 2095|      0|			if (parent == NULL || parent->parent == NULL) {
  ------------------
  |  Branch (2095:8): [True: 0, False: 0]
  |  Branch (2095:26): [True: 0, False: 0]
  ------------------
 2096|      0|				archive_set_error(&a->archive,
 2097|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2098|      0|				    "Invalid Rockridge CL");
 2099|      0|				goto fail;
 2100|      0|			}
 2101|       |			/*
 2102|       |			 * Sanity check: The file type must be a regular file.
 2103|       |			 */
 2104|      0|			if ((flags & 0x02) != 0) {
  ------------------
  |  Branch (2104:8): [True: 0, False: 0]
  ------------------
 2105|      0|				archive_set_error(&a->archive,
 2106|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2107|      0|				    "Invalid Rockridge CL");
 2108|      0|				goto fail;
 2109|      0|			}
 2110|      0|			parent->subdirs++;
 2111|       |			/* Overwrite an offset and a number of this "CL" entry
 2112|       |			 * to appear before other dirs. "+1" to those is to
 2113|       |			 * make sure to appear after "RE" entry which this
 2114|       |			 * "CL" entry should be connected with. */
 2115|      0|			file->offset = file->number = file->cl_offset + 1;
 2116|       |
 2117|       |			/*
 2118|       |			 * Sanity check: cl_offset does not point at its
 2119|       |			 * the parents or itself.
 2120|       |			 */
 2121|      0|			for (r = parent; r; r = r->parent) {
  ------------------
  |  Branch (2121:21): [True: 0, False: 0]
  ------------------
 2122|      0|				if (r->offset == file->cl_offset) {
  ------------------
  |  Branch (2122:9): [True: 0, False: 0]
  ------------------
 2123|      0|					archive_set_error(&a->archive,
 2124|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2125|      0|					    "Invalid Rockridge CL");
 2126|      0|					goto fail;
 2127|      0|				}
 2128|      0|			}
 2129|      0|			if (file->cl_offset == file->offset ||
  ------------------
  |  Branch (2129:8): [True: 0, False: 0]
  ------------------
 2130|      0|			    parent->rr_moved) {
  ------------------
  |  Branch (2130:8): [True: 0, False: 0]
  ------------------
 2131|      0|				archive_set_error(&a->archive,
 2132|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2133|      0|				    "Invalid Rockridge CL");
 2134|      0|				goto fail;
 2135|      0|			}
 2136|      0|		}
 2137|     66|	}
 2138|       |
 2139|       |#if DEBUG
 2140|       |	/* DEBUGGING: Warn about attributes I don't yet fully support. */
 2141|       |	if ((flags & ~0x02) != 0) {
 2142|       |		fprintf(stderr, "\n ** Unrecognized flag: ");
 2143|       |		dump_isodirrec(stderr, isodirrec);
 2144|       |		fprintf(stderr, "\n");
 2145|       |	} else if (archive_le16dec(isodirrec + DR_volume_sequence_number_offset) != 1) {
 2146|       |		fprintf(stderr, "\n ** Unrecognized sequence number: ");
 2147|       |		dump_isodirrec(stderr, isodirrec);
 2148|       |		fprintf(stderr, "\n");
 2149|       |	} else if (*(isodirrec + DR_file_unit_size_offset) != 0) {
 2150|       |		fprintf(stderr, "\n ** Unexpected file unit size: ");
 2151|       |		dump_isodirrec(stderr, isodirrec);
 2152|       |		fprintf(stderr, "\n");
 2153|       |	} else if (*(isodirrec + DR_interleave_offset) != 0) {
 2154|       |		fprintf(stderr, "\n ** Unexpected interleave: ");
 2155|       |		dump_isodirrec(stderr, isodirrec);
 2156|       |		fprintf(stderr, "\n");
 2157|       |	} else if (*(isodirrec + DR_ext_attr_length_offset) != 0) {
 2158|       |		fprintf(stderr, "\n ** Unexpected extended attribute length: ");
 2159|       |		dump_isodirrec(stderr, isodirrec);
 2160|       |		fprintf(stderr, "\n");
 2161|       |	}
 2162|       |#endif
 2163|    998|	register_file(iso9660, file);
 2164|    998|	return (file);
 2165|      3|fail:
 2166|      3|	archive_string_free(&file->name);
 2167|      3|	free(file);
 2168|       |	return (NULL);
 2169|    999|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3254|  1.04k|{
 3255|  1.04k|	int year = v[0];
 3256|  1.04k|	int month = v[1];
 3257|  1.04k|	int day = v[2];
 3258|  1.04k|	int hour = v[3];
 3259|  1.04k|	int minute = v[4];
 3260|  1.04k|	int second = v[5];
 3261|  1.04k|	int gmt_off = (signed char)v[6];
 3262|       |
 3263|       |	/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
 3264|       |	 * that the date is unspecified" */
 3265|  1.04k|	if (year == 0
  ------------------
  |  Branch (3265:6): [True: 416, False: 625]
  ------------------
 3266|    416|	    && month == 0
  ------------------
  |  Branch (3266:9): [True: 355, False: 61]
  ------------------
 3267|    355|	    && day == 0
  ------------------
  |  Branch (3267:9): [True: 340, False: 15]
  ------------------
 3268|    340|	    && hour == 0
  ------------------
  |  Branch (3268:9): [True: 334, False: 6]
  ------------------
 3269|    334|	    && minute == 0
  ------------------
  |  Branch (3269:9): [True: 325, False: 9]
  ------------------
 3270|    325|	    && second == 0
  ------------------
  |  Branch (3270:9): [True: 314, False: 11]
  ------------------
 3271|    314|	    && gmt_off == 0)
  ------------------
  |  Branch (3271:9): [True: 269, False: 45]
  ------------------
 3272|    269|		return 0;
 3273|       |	/*
 3274|       |	 * Sanity-test each individual field
 3275|       |	 */
 3276|       |	/* Year can have any value */
 3277|       |	/* Month must be 1-12 */
 3278|    772|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3278:6): [True: 97, False: 675]
  |  Branch (3278:19): [True: 67, False: 608]
  ------------------
 3279|    164|		return 0;
 3280|       |	/* Day must be 1-31 */
 3281|    608|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3281:6): [True: 81, False: 527]
  |  Branch (3281:17): [True: 51, False: 476]
  ------------------
 3282|    132|		return 0;
 3283|       |	/* Hour must be 0-23 */
 3284|    476|	if (hour > 23)
  ------------------
  |  Branch (3284:6): [True: 16, False: 460]
  ------------------
 3285|     16|		return 0;
 3286|       |	/* Minute must be 0-59 */
 3287|    460|	if (minute > 59)
  ------------------
  |  Branch (3287:6): [True: 17, False: 443]
  ------------------
 3288|     17|		return 0;
 3289|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3290|       |	/* BUT: we should probably allow for the time being in UTC, which
 3291|       |	   allows up to 61 seconds in a minute in certain cases */
 3292|    443|	if (second > 61)
  ------------------
  |  Branch (3292:6): [True: 17, False: 426]
  ------------------
 3293|     17|		return 0;
 3294|       |	/* Offset from GMT must be -48 to +52 */
 3295|    426|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3295:6): [True: 2, False: 424]
  |  Branch (3295:23): [True: 6, False: 418]
  ------------------
 3296|      8|		return 0;
 3297|       |
 3298|       |	/* All tests pass, this is OK */
 3299|    418|	return 1;
 3300|    426|}
archive_read_support_format_iso9660.c:isodate7:
 3304|    418|{
 3305|    418|	struct tm tm;
 3306|    418|	int offset;
 3307|    418|	time_t t;
 3308|       |
 3309|    418|	memset(&tm, 0, sizeof(tm));
 3310|    418|	tm.tm_year = v[0];
 3311|    418|	tm.tm_mon = v[1] - 1;
 3312|    418|	tm.tm_mday = v[2];
 3313|    418|	tm.tm_hour = v[3];
 3314|    418|	tm.tm_min = v[4];
 3315|    418|	tm.tm_sec = v[5];
 3316|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3317|    418|	offset = ((const signed char *)v)[6];
 3318|    418|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3318:6): [True: 416, False: 2]
  |  Branch (3318:22): [True: 412, False: 4]
  ------------------
 3319|    412|		tm.tm_hour -= offset / 4;
 3320|    412|		tm.tm_min -= (offset % 4) * 15;
 3321|    412|	}
 3322|    418|	t = time_from_tm(&tm);
 3323|    418|	if (t == (time_t)-1)
  ------------------
  |  Branch (3323:6): [True: 0, False: 418]
  ------------------
 3324|      0|		return ((time_t)0);
 3325|    418|	return (t);
 3326|    418|}
archive_read_support_format_iso9660.c:time_from_tm:
 3419|    423|{
 3420|       |#if HAVE__MKGMTIME
 3421|       |        return _mkgmtime(t);
 3422|       |#elif HAVE_TIMEGM
 3423|       |        /* Use platform timegm() if available. */
 3424|    423|        return (timegm(t));
 3425|       |#else
 3426|       |        /* Else use direct calculation using POSIX assumptions. */
 3427|       |        /* First, fix up tm_yday based on the year/month/day. */
 3428|       |        if (mktime(t) == (time_t)-1)
 3429|       |                return ((time_t)-1);
 3430|       |        /* Then we can compute timegm() from first principles. */
 3431|       |        return (t->tm_sec
 3432|       |            + t->tm_min * 60
 3433|       |            + t->tm_hour * 3600
 3434|       |            + t->tm_yday * 86400
 3435|       |            + (t->tm_year - 70) * 31536000
 3436|       |            + ((t->tm_year - 69) / 4) * 86400
 3437|       |            - ((t->tm_year - 1) / 100) * 86400
 3438|       |            + ((t->tm_year + 299) / 400) * 86400);
 3439|       |#endif
 3440|    423|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2174|     83|{
 2175|     83|	struct iso9660 *iso9660 = a->format->data;
 2176|     83|	int entry_seen = 0;
 2177|       |
 2178|    202|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2178:9): [True: 195, False: 7]
  ------------------
 2179|    195|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2179:9): [True: 146, False: 49]
  |  Branch (2179:24): [True: 129, False: 17]
  ------------------
 2180|    129|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2180:9): [True: 127, False: 2]
  |  Branch (2180:24): [True: 122, False: 5]
  ------------------
 2181|    122|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2181:9): [True: 121, False: 1]
  ------------------
 2182|    121|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2182:9): [True: 120, False: 1]
  ------------------
 2183|    120|		const unsigned char *data = p + 4;
 2184|    120|		int data_length = p[2] - 4;
 2185|    120|		int version = p[3];
 2186|       |
 2187|    120|		switch(p[0]) {
 2188|      3|		case 'C':
  ------------------
  |  Branch (2188:3): [True: 3, False: 117]
  ------------------
 2189|      3|			if (p[1] == 'E') {
  ------------------
  |  Branch (2189:8): [True: 1, False: 2]
  ------------------
 2190|      1|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2190:9): [True: 0, False: 1]
  |  Branch (2190:25): [True: 0, False: 0]
  ------------------
 2191|       |					/*
 2192|       |					 * CE extension comprises:
 2193|       |					 *   8 byte sector containing extension
 2194|       |					 *   8 byte offset w/in above sector
 2195|       |					 *   8 byte length of continuation
 2196|       |					 */
 2197|      0|					int32_t location =
 2198|      0|					    archive_le32dec(data);
 2199|      0|					file->ce_offset =
 2200|      0|					    archive_le32dec(data+8);
 2201|      0|					file->ce_size =
 2202|      0|					    archive_le32dec(data+16);
 2203|      0|					if (register_CE(a, location, file)
  ------------------
  |  Branch (2203:10): [True: 0, False: 0]
  ------------------
 2204|      0|					    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2205|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2206|      0|				}
 2207|      1|			}
 2208|      2|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2208:13): [True: 1, False: 1]
  ------------------
 2209|      1|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2209:9): [True: 0, False: 1]
  |  Branch (2209:25): [True: 0, False: 0]
  ------------------
 2210|      0|					file->cl_offset = (uint64_t)
 2211|      0|					    iso9660->logical_block_size *
 2212|      0|					    (uint64_t)archive_le32dec(data);
 2213|      0|					iso9660->seenRockridge = 1;
 2214|      0|				}
 2215|      1|			}
 2216|      3|			break;
 2217|      3|		case 'N':
  ------------------
  |  Branch (2217:3): [True: 3, False: 117]
  ------------------
 2218|      3|			if (p[1] == 'M') {
  ------------------
  |  Branch (2218:8): [True: 2, False: 1]
  ------------------
 2219|      2|				if (version == 1) {
  ------------------
  |  Branch (2219:9): [True: 2, False: 0]
  ------------------
 2220|      2|					parse_rockridge_NM1(file,
 2221|      2|					    data, data_length);
 2222|      2|					iso9660->seenRockridge = 1;
 2223|      2|				}
 2224|      2|			}
 2225|      3|			break;
 2226|      7|		case 'P':
  ------------------
  |  Branch (2226:3): [True: 7, False: 113]
  ------------------
 2227|       |			/*
 2228|       |			 * PD extension is padding;
 2229|       |			 * contents are always ignored.
 2230|       |			 *
 2231|       |			 * PL extension won't appear;
 2232|       |			 * contents are always ignored.
 2233|       |			 */
 2234|      7|			if (p[1] == 'N') {
  ------------------
  |  Branch (2234:8): [True: 1, False: 6]
  ------------------
 2235|      1|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2235:9): [True: 0, False: 1]
  |  Branch (2235:25): [True: 0, False: 0]
  ------------------
 2236|      0|					file->rdev = archive_le32dec(data);
 2237|      0|					file->rdev <<= 32;
 2238|      0|					file->rdev |=
 2239|      0|					    archive_le32dec(data + 8);
 2240|      0|					iso9660->seenRockridge = 1;
 2241|      0|				}
 2242|      1|			}
 2243|      6|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2243:13): [True: 3, False: 3]
  ------------------
 2244|       |				/*
 2245|       |				 * PX extension comprises:
 2246|       |				 *   8 bytes for mode,
 2247|       |				 *   8 bytes for nlinks,
 2248|       |				 *   8 bytes for uid,
 2249|       |				 *   8 bytes for gid,
 2250|       |				 *   8 bytes for inode.
 2251|       |				 */
 2252|      3|				if (version == 1) {
  ------------------
  |  Branch (2252:9): [True: 0, False: 3]
  ------------------
 2253|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2253:10): [True: 0, False: 0]
  ------------------
 2254|      0|						file->mode = (__LA_MODE_T)
 2255|      0|						    archive_le32dec(data);
 2256|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2256:10): [True: 0, False: 0]
  ------------------
 2257|      0|						file->nlinks =
 2258|      0|						    archive_le32dec(data + 8);
 2259|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2259:10): [True: 0, False: 0]
  ------------------
 2260|      0|						file->uid =
 2261|      0|						    archive_le32dec(data + 16);
 2262|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2262:10): [True: 0, False: 0]
  ------------------
 2263|      0|						file->gid =
 2264|      0|						    archive_le32dec(data + 24);
 2265|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2265:10): [True: 0, False: 0]
  ------------------
 2266|      0|						file->number =
 2267|      0|						    archive_le32dec(data + 32);
 2268|      0|					iso9660->seenRockridge = 1;
 2269|      0|				}
 2270|      3|			}
 2271|      7|			break;
 2272|      4|		case 'R':
  ------------------
  |  Branch (2272:3): [True: 4, False: 116]
  ------------------
 2273|      4|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2273:8): [True: 1, False: 3]
  |  Branch (2273:23): [True: 1, False: 0]
  ------------------
 2274|      1|				file->re = 1;
 2275|      1|				iso9660->seenRockridge = 1;
 2276|      1|			}
 2277|      3|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2277:13): [True: 0, False: 3]
  |  Branch (2277:28): [True: 0, False: 0]
  ------------------
 2278|       |				/*
 2279|       |				 * RR extension comprises:
 2280|       |				 *    one byte flag value
 2281|       |				 * This extension is obsolete,
 2282|       |				 * so contents are always ignored.
 2283|       |				 */
 2284|      0|			}
 2285|      4|			break;
 2286|     54|		case 'S':
  ------------------
  |  Branch (2286:3): [True: 54, False: 66]
  ------------------
 2287|     54|			if (p[1] == 'L') {
  ------------------
  |  Branch (2287:8): [True: 22, False: 32]
  ------------------
 2288|     22|				if (version == 1) {
  ------------------
  |  Branch (2288:9): [True: 21, False: 1]
  ------------------
 2289|     21|					parse_rockridge_SL1(file,
 2290|     21|					    data, data_length);
 2291|     21|					iso9660->seenRockridge = 1;
 2292|     21|				}
 2293|     22|			}
 2294|     32|			else if (p[1] == 'T'
  ------------------
  |  Branch (2294:13): [True: 2, False: 30]
  ------------------
 2295|      2|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2295:11): [True: 2, False: 0]
  |  Branch (2295:31): [True: 1, False: 1]
  ------------------
 2296|       |				/*
 2297|       |				 * ST extension marks end of this
 2298|       |				 * block of SUSP entries.
 2299|       |				 *
 2300|       |				 * It allows SUSP to coexist with
 2301|       |				 * non-SUSP uses of the System
 2302|       |				 * Use Area by placing non-SUSP data
 2303|       |				 * after SUSP data.
 2304|       |				 */
 2305|      1|				iso9660->seenSUSP = 0;
 2306|      1|				iso9660->seenRockridge = 0;
 2307|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2308|      1|			}
 2309|     53|			break;
 2310|     53|		case 'T':
  ------------------
  |  Branch (2310:3): [True: 44, False: 76]
  ------------------
 2311|     44|			if (p[1] == 'F') {
  ------------------
  |  Branch (2311:8): [True: 43, False: 1]
  ------------------
 2312|     43|				if (version == 1) {
  ------------------
  |  Branch (2312:9): [True: 43, False: 0]
  ------------------
 2313|     43|					parse_rockridge_TF1(file,
 2314|     43|					    data, data_length);
 2315|     43|					iso9660->seenRockridge = 1;
 2316|     43|				}
 2317|     43|			}
 2318|     44|			break;
 2319|      3|		case 'Z':
  ------------------
  |  Branch (2319:3): [True: 3, False: 117]
  ------------------
 2320|      3|			if (p[1] == 'F') {
  ------------------
  |  Branch (2320:8): [True: 2, False: 1]
  ------------------
 2321|      2|				if (version == 1)
  ------------------
  |  Branch (2321:9): [True: 1, False: 1]
  ------------------
 2322|      1|					parse_rockridge_ZF1(file,
 2323|      1|					    data, data_length);
 2324|      2|			}
 2325|      3|			break;
 2326|      2|		default:
  ------------------
  |  Branch (2326:3): [True: 2, False: 118]
  ------------------
 2327|      2|			break;
 2328|    120|		}
 2329|       |
 2330|    119|		p += p[2];
 2331|    119|		entry_seen = 1;
 2332|    119|	}
 2333|       |
 2334|     82|	if (entry_seen)
  ------------------
  |  Branch (2334:6): [True: 80, False: 2]
  ------------------
 2335|     80|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     80|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2336|      2|	else {
 2337|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2338|      2|				  "Tried to parse Rockridge extensions, but none found");
 2339|      2|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2340|      2|	}
 2341|     82|}
archive_read_support_format_iso9660.c:parse_rockridge_NM1:
 2514|      2|{
 2515|      2|	if (!file->name_continues)
  ------------------
  |  Branch (2515:6): [True: 2, False: 0]
  ------------------
 2516|      2|		archive_string_empty(&file->name);
  ------------------
  |  |  181|      2|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2517|      2|	file->name_continues = 0;
 2518|      2|	if (data_length < 1)
  ------------------
  |  Branch (2518:6): [True: 0, False: 2]
  ------------------
 2519|      0|		return;
 2520|       |	/*
 2521|       |	 * NM version 1 extension comprises:
 2522|       |	 *   1 byte flag, value is one of:
 2523|       |	 *     = 0: remainder is name
 2524|       |	 *     = 1: remainder is name, next NM entry continues name
 2525|       |	 *     = 2: "."
 2526|       |	 *     = 4: ".."
 2527|       |	 *     = 32: Implementation specific
 2528|       |	 *     All other values are reserved.
 2529|       |	 */
 2530|      2|	switch(data[0]) {
 2531|      1|	case 0:
  ------------------
  |  Branch (2531:2): [True: 1, False: 1]
  ------------------
 2532|      1|		if (data_length < 2)
  ------------------
  |  Branch (2532:7): [True: 1, False: 0]
  ------------------
 2533|      1|			return;
 2534|      0|		archive_strncat(&file->name,
 2535|      0|		    (const char *)data + 1, data_length - 1);
 2536|      0|		break;
 2537|      0|	case 1:
  ------------------
  |  Branch (2537:2): [True: 0, False: 2]
  ------------------
 2538|      0|		if (data_length < 2)
  ------------------
  |  Branch (2538:7): [True: 0, False: 0]
  ------------------
 2539|      0|			return;
 2540|      0|		archive_strncat(&file->name,
 2541|      0|		    (const char *)data + 1, data_length - 1);
 2542|      0|		file->name_continues = 1;
 2543|      0|		break;
 2544|      0|	case 2:
  ------------------
  |  Branch (2544:2): [True: 0, False: 2]
  ------------------
 2545|      0|		archive_strcat(&file->name, ".");
 2546|      0|		break;
 2547|      0|	case 4:
  ------------------
  |  Branch (2547:2): [True: 0, False: 2]
  ------------------
 2548|      0|		archive_strcat(&file->name, "..");
 2549|      0|		break;
 2550|      1|	default:
  ------------------
  |  Branch (2550:2): [True: 1, False: 1]
  ------------------
 2551|      1|		return;
 2552|      2|	}
 2553|       |
 2554|      2|}
archive_read_support_format_iso9660.c:parse_rockridge_SL1:
 2654|     21|{
 2655|     21|	const char *separator = "";
 2656|       |
 2657|     21|	if (!file->symlink_continues || file->symlink.length < 1)
  ------------------
  |  Branch (2657:6): [True: 21, False: 0]
  |  Branch (2657:34): [True: 0, False: 0]
  ------------------
 2658|     21|		archive_string_empty(&file->symlink);
  ------------------
  |  |  181|     21|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2659|     21|	file->symlink_continues = 0;
 2660|       |
 2661|       |	/*
 2662|       |	 * Defined flag values:
 2663|       |	 *  0: This is the last SL record for this symbolic link
 2664|       |	 *  1: this symbolic link field continues in next SL entry
 2665|       |	 *  All other values are reserved.
 2666|       |	 */
 2667|     21|	if (data_length < 1)
  ------------------
  |  Branch (2667:6): [True: 1, False: 20]
  ------------------
 2668|      1|		return;
 2669|     20|	switch(*data) {
 2670|     16|	case 0:
  ------------------
  |  Branch (2670:2): [True: 16, False: 4]
  ------------------
 2671|     16|		break;
 2672|      3|	case 1:
  ------------------
  |  Branch (2672:2): [True: 3, False: 17]
  ------------------
 2673|      3|		file->symlink_continues = 1;
 2674|      3|		break;
 2675|      1|	default:
  ------------------
  |  Branch (2675:2): [True: 1, False: 19]
  ------------------
 2676|      1|		return;
 2677|     20|	}
 2678|     19|	++data;  /* Skip flag byte. */
 2679|     19|	--data_length;
 2680|       |
 2681|       |	/*
 2682|       |	 * SL extension body stores "components".
 2683|       |	 * Basically, this is a complicated way of storing
 2684|       |	 * a POSIX path.  It also interferes with using
 2685|       |	 * symlinks for storing non-path data. <sigh>
 2686|       |	 *
 2687|       |	 * Each component is 2 bytes (flag and length)
 2688|       |	 * possibly followed by name data.
 2689|       |	 */
 2690|    100|	while (data_length >= 2) {
  ------------------
  |  Branch (2690:9): [True: 86, False: 14]
  ------------------
 2691|     86|		unsigned char flag = *data++;
 2692|     86|		unsigned char nlen = *data++;
 2693|     86|		data_length -= 2;
 2694|       |
 2695|     86|		archive_strcat(&file->symlink, separator);
 2696|     86|		separator = "/";
 2697|       |
 2698|     86|		switch(flag) {
 2699|     32|		case 0: /* Usual case, this is text. */
  ------------------
  |  Branch (2699:3): [True: 32, False: 54]
  ------------------
 2700|     32|			if (data_length < nlen)
  ------------------
  |  Branch (2700:8): [True: 1, False: 31]
  ------------------
 2701|      1|				return;
 2702|     31|			archive_strncat(&file->symlink,
 2703|     31|			    (const char *)data, nlen);
 2704|     31|			break;
 2705|     24|		case 0x01: /* Text continues in next component. */
  ------------------
  |  Branch (2705:3): [True: 24, False: 62]
  ------------------
 2706|     24|			if (data_length < nlen)
  ------------------
  |  Branch (2706:8): [True: 2, False: 22]
  ------------------
 2707|      2|				return;
 2708|     22|			archive_strncat(&file->symlink,
 2709|     22|			    (const char *)data, nlen);
 2710|     22|			separator = "";
 2711|     22|			break;
 2712|     11|		case 0x02: /* Current dir. */
  ------------------
  |  Branch (2712:3): [True: 11, False: 75]
  ------------------
 2713|     11|			archive_strcat(&file->symlink, ".");
 2714|     11|			break;
 2715|      6|		case 0x04: /* Parent dir. */
  ------------------
  |  Branch (2715:3): [True: 6, False: 80]
  ------------------
 2716|      6|			archive_strcat(&file->symlink, "..");
 2717|      6|			break;
 2718|      1|		case 0x08: /* Root of filesystem. */
  ------------------
  |  Branch (2718:3): [True: 1, False: 85]
  ------------------
 2719|      1|			archive_strcat(&file->symlink, "/");
 2720|      1|			separator = "";
 2721|      1|			break;
 2722|      4|		case 0x10: /* Undefined (historically "volume root" */
  ------------------
  |  Branch (2722:3): [True: 4, False: 82]
  ------------------
 2723|      4|			archive_string_empty(&file->symlink);
  ------------------
  |  |  181|      4|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2724|      4|			archive_strcat(&file->symlink, "ROOT");
 2725|      4|			break;
 2726|      6|		case 0x20: /* Undefined (historically "hostname") */
  ------------------
  |  Branch (2726:3): [True: 6, False: 80]
  ------------------
 2727|      6|			archive_strcat(&file->symlink, "hostname");
 2728|      6|			break;
 2729|      2|		default:
  ------------------
  |  Branch (2729:3): [True: 2, False: 84]
  ------------------
 2730|       |			/* TODO: issue a warning ? */
 2731|      2|			return;
 2732|     86|		}
 2733|     81|		data += nlen;
 2734|     81|		data_length -= nlen;
 2735|     81|	}
 2736|     19|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2559|     43|{
 2560|     43|	char flag;
 2561|       |	/*
 2562|       |	 * TF extension comprises:
 2563|       |	 *   one byte flag
 2564|       |	 *   create time (optional)
 2565|       |	 *   modify time (optional)
 2566|       |	 *   access time (optional)
 2567|       |	 *   attribute time (optional)
 2568|       |	 *  Time format and presence of fields
 2569|       |	 *  is controlled by flag bits.
 2570|       |	 */
 2571|     43|	if (data_length < 1)
  ------------------
  |  Branch (2571:6): [True: 1, False: 42]
  ------------------
 2572|      1|		return;
 2573|     42|	flag = data[0];
 2574|     42|	++data;
 2575|     42|	--data_length;
 2576|     42|	if (flag & 0x80) {
  ------------------
  |  Branch (2576:6): [True: 28, False: 14]
  ------------------
 2577|       |		/* Use 17-byte time format. */
 2578|     28|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2578:7): [True: 24, False: 4]
  |  Branch (2578:21): [True: 24, False: 0]
  ------------------
 2579|       |			/* Create time. */
 2580|     24|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2580:8): [True: 0, False: 24]
  ------------------
 2581|      0|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      0|#define BIRTHTIME_IS_SET 1
  ------------------
 2582|      0|				file->birthtime = isodate17(data);
 2583|      0|			}
 2584|     24|			data += 17;
 2585|     24|			data_length -= 17;
 2586|     24|		}
 2587|     28|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2587:7): [True: 23, False: 5]
  |  Branch (2587:21): [True: 23, False: 0]
  ------------------
 2588|       |			/* Modify time. */
 2589|     23|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2589:8): [True: 2, False: 21]
  ------------------
 2590|      2|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      2|#define MTIME_IS_SET 2
  ------------------
 2591|      2|				file->mtime = isodate17(data);
 2592|      2|			}
 2593|     23|			data += 17;
 2594|     23|			data_length -= 17;
 2595|     23|		}
 2596|     28|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2596:7): [True: 23, False: 5]
  |  Branch (2596:21): [True: 22, False: 1]
  ------------------
 2597|       |			/* Access time. */
 2598|     22|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2598:8): [True: 2, False: 20]
  ------------------
 2599|      2|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      2|#define ATIME_IS_SET 4
  ------------------
 2600|      2|				file->atime = isodate17(data);
 2601|      2|			}
 2602|     22|			data += 17;
 2603|     22|			data_length -= 17;
 2604|     22|		}
 2605|     28|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2605:7): [True: 23, False: 5]
  |  Branch (2605:21): [True: 21, False: 2]
  ------------------
 2606|       |			/* Attribute change time. */
 2607|     21|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2607:8): [True: 1, False: 20]
  ------------------
 2608|      1|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      1|#define CTIME_IS_SET 8
  ------------------
 2609|      1|				file->ctime = isodate17(data);
 2610|      1|			}
 2611|     21|		}
 2612|     28|	} else {
 2613|       |		/* Use 7-byte time format. */
 2614|     14|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2614:7): [True: 9, False: 5]
  |  Branch (2614:21): [True: 8, False: 1]
  ------------------
 2615|       |			/* Create time. */
 2616|      8|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2616:8): [True: 1, False: 7]
  ------------------
 2617|      1|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      1|#define BIRTHTIME_IS_SET 1
  ------------------
 2618|      1|				file->birthtime = isodate7(data);
 2619|      1|			}
 2620|      8|			data += 7;
 2621|      8|			data_length -= 7;
 2622|      8|		}
 2623|     14|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2623:7): [True: 10, False: 4]
  |  Branch (2623:21): [True: 9, False: 1]
  ------------------
 2624|       |			/* Modify time. */
 2625|      9|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2625:8): [True: 2, False: 7]
  ------------------
 2626|      2|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      2|#define MTIME_IS_SET 2
  ------------------
 2627|      2|				file->mtime = isodate7(data);
 2628|      2|			}
 2629|      9|			data += 7;
 2630|      9|			data_length -= 7;
 2631|      9|		}
 2632|     14|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2632:7): [True: 13, False: 1]
  |  Branch (2632:21): [True: 12, False: 1]
  ------------------
 2633|       |			/* Access time. */
 2634|     12|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2634:8): [True: 1, False: 11]
  ------------------
 2635|      1|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      1|#define ATIME_IS_SET 4
  ------------------
 2636|      1|				file->atime = isodate7(data);
 2637|      1|			}
 2638|     12|			data += 7;
 2639|     12|			data_length -= 7;
 2640|     12|		}
 2641|     14|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2641:7): [True: 12, False: 2]
  |  Branch (2641:21): [True: 11, False: 1]
  ------------------
 2642|       |			/* Attribute change time. */
 2643|     11|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2643:8): [True: 2, False: 9]
  ------------------
 2644|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      2|#define CTIME_IS_SET 8
  ------------------
 2645|      2|				file->ctime = isodate7(data);
 2646|      2|			}
 2647|     11|		}
 2648|     14|	}
 2649|     42|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3330|     90|{
 3331|       |	/* First 16 bytes are all ASCII digits */
 3332|    745|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3332:18): [True: 714, False: 31]
  ------------------
 3333|    714|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3333:7): [True: 20, False: 694]
  |  Branch (3333:21): [True: 39, False: 655]
  ------------------
 3334|     59|			return 0;
 3335|    714|	}
 3336|       |
 3337|     31|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3338|     31|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3339|     31|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3340|     31|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3341|     31|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3342|     31|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3343|     31|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3344|     31|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3345|     31|	int gmt_off = (signed char)v[16];
 3346|       |
 3347|     31|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3347:6): [True: 12, False: 19]
  |  Branch (3347:19): [True: 11, False: 1]
  |  Branch (3347:33): [True: 10, False: 1]
  ------------------
 3348|     10|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3348:9): [True: 10, False: 0]
  |  Branch (3348:22): [True: 9, False: 1]
  |  Branch (3348:37): [True: 9, False: 0]
  ------------------
 3349|      9|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3349:9): [True: 8, False: 1]
  |  Branch (3349:28): [True: 1, False: 7]
  ------------------
 3350|      1|		return 0;
 3351|       |	/*
 3352|       |	 * Sanity-test each individual field
 3353|       |	 */
 3354|       |
 3355|       |	/* Year must be 1900-2300 */
 3356|       |	/* (Not specified in ECMA-119, but these seem
 3357|       |	   like reasonable limits. */
 3358|     30|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3358:6): [True: 13, False: 17]
  |  Branch (3358:21): [True: 5, False: 12]
  ------------------
 3359|     18|		return 0;
 3360|       |	/* Month must be 1-12 */
 3361|     12|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3361:6): [True: 0, False: 12]
  |  Branch (3361:19): [True: 3, False: 9]
  ------------------
 3362|      3|		return 0;
 3363|       |	/* Day must be 1-31 */
 3364|      9|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3364:6): [True: 1, False: 8]
  |  Branch (3364:17): [True: 0, False: 8]
  ------------------
 3365|      1|		return 0;
 3366|       |	/* Hour must be 0-23 */
 3367|      8|	if (hour > 23)
  ------------------
  |  Branch (3367:6): [True: 1, False: 7]
  ------------------
 3368|      1|		return 0;
 3369|       |	/* Minute must be 0-59 */
 3370|      7|	if (minute > 59)
  ------------------
  |  Branch (3370:6): [True: 0, False: 7]
  ------------------
 3371|      0|		return 0;
 3372|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3373|       |	/* BUT: we should probably allow for the time being in UTC, which
 3374|       |	   allows up to 61 seconds in a minute in certain cases */
 3375|      7|	if (second > 61)
  ------------------
  |  Branch (3375:6): [True: 1, False: 6]
  ------------------
 3376|      1|		return 0;
 3377|       |	/* Hundredths must be 0-99 */
 3378|      6|	if (hundredths > 99)
  ------------------
  |  Branch (3378:6): [True: 0, False: 6]
  ------------------
 3379|      0|		return 0;
 3380|       |	/* Offset from GMT must be -48 to +52 */
 3381|      6|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3381:6): [True: 0, False: 6]
  |  Branch (3381:23): [True: 1, False: 5]
  ------------------
 3382|      1|		return 0;
 3383|       |
 3384|       |	/* All tests pass, this is OK */
 3385|      5|	return 1;
 3386|       |
 3387|      6|}
archive_read_support_format_iso9660.c:isodate17:
 3391|      5|{
 3392|      5|	struct tm tm;
 3393|      5|	int offset;
 3394|      5|	time_t t;
 3395|       |
 3396|      5|	memset(&tm, 0, sizeof(tm));
 3397|      5|	tm.tm_year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3398|      5|	    + (v[2] - '0') * 10 + (v[3] - '0')
 3399|      5|	    - 1900;
 3400|      5|	tm.tm_mon = (v[4] - '0') * 10 + (v[5] - '0') - 1;
 3401|      5|	tm.tm_mday = (v[6] - '0') * 10 + (v[7] - '0');
 3402|      5|	tm.tm_hour = (v[8] - '0') * 10 + (v[9] - '0');
 3403|      5|	tm.tm_min = (v[10] - '0') * 10 + (v[11] - '0');
 3404|      5|	tm.tm_sec = (v[12] - '0') * 10 + (v[13] - '0');
 3405|       |	/* v[16] is the signed timezone offset, in 1/4-hour increments. */
 3406|      5|	offset = ((const signed char *)v)[16];
 3407|      5|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3407:6): [True: 5, False: 0]
  |  Branch (3407:22): [True: 5, False: 0]
  ------------------
 3408|      5|		tm.tm_hour -= offset / 4;
 3409|      5|		tm.tm_min -= (offset % 4) * 15;
 3410|      5|	}
 3411|      5|	t = time_from_tm(&tm);
 3412|      5|	if (t == (time_t)-1)
  ------------------
  |  Branch (3412:6): [True: 0, False: 5]
  ------------------
 3413|      0|		return ((time_t)0);
 3414|      5|	return (t);
 3415|      5|}
archive_read_support_format_iso9660.c:parse_rockridge_ZF1:
 2741|      1|{
 2742|       |
 2743|      1|	if (data_length == 12 && data[0] == 0x70 && data[1] == 0x7a) {
  ------------------
  |  Branch (2743:6): [True: 0, False: 1]
  |  Branch (2743:27): [True: 0, False: 0]
  |  Branch (2743:46): [True: 0, False: 0]
  ------------------
 2744|       |        /* paged zlib */
 2745|      0|        file->pz = 1;
 2746|      0|        file->pz_log2_bs = data[3];
 2747|      0|        if (file->pz_log2_bs < 15 || file->pz_log2_bs > 17) {
  ------------------
  |  Branch (2747:13): [True: 0, False: 0]
  |  Branch (2747:38): [True: 0, False: 0]
  ------------------
 2748|       |            /* TODO: Return an error here instead of silently
 2749|       |             * disabling zisofs. That requires propagating an
 2750|       |             * error return through parse_rockridge() and its
 2751|       |             * callers. */
 2752|      0|            file->pz = 0;
 2753|      0|            return;
 2754|      0|        }
 2755|      0|        file->pz_uncompressed_size = archive_le32dec(&data[4]);
 2756|      0|    }
 2757|      1|}
archive_read_support_format_iso9660.c:register_file:
 2761|    998|{
 2762|       |
 2763|    998|	file->use_next = iso9660->use_files;
 2764|    998|	iso9660->use_files = file;
 2765|    998|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3120|    933|{
 3121|    933|	uint64_t file_key, parent_key;
 3122|    933|	size_t hole, parent;
 3123|       |
 3124|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3125|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3126|    933|	key <<= 16;
 3127|    933|	key += heap->used & 0xFFFF;
 3128|       |
 3129|       |	/* Expand our pending files list as necessary. */
 3130|    933|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3130:6): [True: 169, False: 764]
  ------------------
 3131|    169|		struct file_info **new_pending_files;
 3132|    169|		size_t new_size;
 3133|       |
 3134|    169|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3134:7): [True: 169, False: 0]
  ------------------
 3135|    169|			new_size = 1024;
 3136|      0|		else if (archive_ckd_mul_size(&new_size, heap->allocated, 2)) {
  ------------------
  |  Branch (3136:12): [True: 0, False: 0]
  ------------------
 3137|       |			/* Overflow keeps us from growing the list. */
 3138|      0|			archive_set_error(&a->archive,
 3139|      0|			    ENOMEM, "Out of memory");
 3140|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3141|      0|		}
 3142|    169|		new_pending_files = (struct file_info **)
 3143|    169|		    calloc(new_size, sizeof(new_pending_files[0]));
 3144|    169|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3144:7): [True: 0, False: 169]
  ------------------
 3145|      0|			archive_set_error(&a->archive,
 3146|      0|			    ENOMEM, "Out of memory");
 3147|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3148|      0|		}
 3149|    169|		if (heap->allocated)
  ------------------
  |  Branch (3149:7): [True: 0, False: 169]
  ------------------
 3150|      0|			memcpy(new_pending_files, heap->files,
 3151|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3152|    169|		free(heap->files);
 3153|    169|		heap->files = new_pending_files;
 3154|    169|		heap->allocated = new_size;
 3155|    169|	}
 3156|       |
 3157|    933|	file_key = file->key = key;
 3158|       |
 3159|       |	/*
 3160|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3161|       |	 */
 3162|    933|	hole = heap->used++;
 3163|  1.37k|	while (hole > 0) {
  ------------------
  |  Branch (3163:9): [True: 1.01k, False: 358]
  ------------------
 3164|  1.01k|		parent = (hole - 1) / 2;
 3165|  1.01k|		parent_key = heap->files[parent]->key;
 3166|  1.01k|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3166:7): [True: 575, False: 440]
  ------------------
 3167|    575|			heap->files[hole] = file;
 3168|    575|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    575|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3169|    575|		}
 3170|       |		/* Move parent into hole <==> move hole up tree. */
 3171|    440|		heap->files[hole] = heap->files[parent];
 3172|    440|		hole = parent;
 3173|    440|	}
 3174|    358|	heap->files[0] = file;
 3175|       |
 3176|    358|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    358|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3177|    933|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2794|    878|{
 2795|    878|	struct file_info *file;
 2796|    878|	int r;
 2797|       |
 2798|    878|	r = next_cache_entry(a, iso9660, pfile);
 2799|    878|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    878|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2799:6): [True: 215, False: 663]
  ------------------
 2800|    215|		return (r);
 2801|    663|	file = *pfile;
 2802|       |
 2803|       |	/* Don't waste time seeking for zero-length bodies. */
 2804|    663|	if (file->size == 0)
  ------------------
  |  Branch (2804:6): [True: 243, False: 420]
  ------------------
 2805|    243|		file->offset = iso9660->current_position;
 2806|       |
 2807|       |	/* flush any remaining bytes from the last round to ensure
 2808|       |	 * we're positioned */
 2809|    663|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2809:6): [True: 0, False: 663]
  ------------------
 2810|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2811|      0|		iso9660->entry_bytes_unconsumed = 0;
 2812|      0|	}
 2813|       |
 2814|       |	/* Seek forward to the start of the entry. */
 2815|    663|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2815:6): [True: 30, False: 633]
  ------------------
 2816|     30|		int64_t step;
 2817|       |
 2818|     30|		step = file->offset - iso9660->current_position;
 2819|     30|		step = __archive_read_consume(a, step);
 2820|     30|		if (step < 0)
  ------------------
  |  Branch (2820:7): [True: 17, False: 13]
  ------------------
 2821|     17|			return ((int)step);
 2822|     13|		iso9660->current_position = file->offset;
 2823|     13|	}
 2824|       |
 2825|       |	/* We found body of file; handle it now. */
 2826|    646|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    646|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2827|    663|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2832|    878|{
 2833|    878|	struct file_info *file;
 2834|    878|	struct {
 2835|    878|		struct file_info	*first;
 2836|    878|		struct file_info	**last;
 2837|    878|	}	empty_files;
 2838|    878|	int64_t number;
 2839|    878|	int count;
 2840|       |
 2841|    878|	file = cache_get_entry(iso9660);
 2842|    878|	if (file != NULL) {
  ------------------
  |  Branch (2842:6): [True: 252, False: 626]
  ------------------
 2843|    252|		*pfile = file;
 2844|    252|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    252|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2845|    252|	}
 2846|       |
 2847|    626|	for (;;) {
 2848|    626|		struct file_info *re, *d;
 2849|       |
 2850|    626|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  453|    626|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2851|    626|		if (file == NULL) {
  ------------------
  |  Branch (2851:7): [True: 116, False: 510]
  ------------------
 2852|       |			/*
 2853|       |			 * If directory entries all which are descendant of
 2854|       |			 * rr_moved are still remaining, expose their.
 2855|       |			 */
 2856|    116|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2856:8): [True: 0, False: 116]
  ------------------
 2857|      0|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2857:8): [True: 0, False: 0]
  ------------------
 2858|      0|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2858:8): [True: 0, False: 0]
  ------------------
 2859|       |				/* Expose "rr_moved" entry. */
 2860|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2861|    116|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2861:11): [True: 0, False: 116]
  ------------------
 2862|       |				/* Expose its descendant dirs. */
 2863|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2863:12): [True: 0, False: 0]
  ------------------
 2864|      0|					cache_add_entry(iso9660, d);
 2865|      0|			}
 2866|    116|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2866:8): [True: 0, False: 116]
  ------------------
 2867|      0|				return (next_cache_entry(a, iso9660, pfile));
 2868|    116|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    116|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2869|    116|		}
 2870|       |
 2871|    510|		if (file->cl_offset) {
  ------------------
  |  Branch (2871:7): [True: 0, False: 510]
  ------------------
 2872|      0|			struct file_info *first_re = NULL;
 2873|      0|			int nexted_re = 0;
 2874|       |
 2875|       |			/*
 2876|       |			 * Find "RE" dir for the current file, which
 2877|       |			 * has "CL" flag.
 2878|       |			 */
 2879|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2879:11): [True: 0, False: 0]
  ------------------
 2880|      0|			    != first_re) {
 2881|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2881:9): [True: 0, False: 0]
  ------------------
 2882|      0|					first_re = re;
 2883|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2883:9): [True: 0, False: 0]
  ------------------
 2884|      0|					re->parent->subdirs--;
 2885|      0|					re->parent = file->parent;
 2886|      0|					re->re = 0;
 2887|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2887:10): [True: 0, False: 0]
  ------------------
 2888|      0|						nexted_re = 1;
 2889|      0|						re->re_descendant = 1;
 2890|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2890:11): [True: 0, False: 0]
  ------------------
 2891|      0|							goto fatal_rr;
 2892|       |						/* Move a list of descendants
 2893|       |						 * to a new ancestor. */
 2894|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2894:14): [True: 0, False: 0]
  ------------------
 2895|      0|						    re)) != NULL)
 2896|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2896:12): [True: 0, False: 0]
  ------------------
 2897|      0|							    < 0)
 2898|      0|								goto fatal_rr;
 2899|      0|						break;
 2900|      0|					}
 2901|       |					/* Replace the current file
 2902|       |					 * with "RE" dir */
 2903|      0|					*pfile = file = re;
 2904|       |					/* Expose its descendant */
 2905|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2905:13): [True: 0, False: 0]
  ------------------
 2906|      0|					    file)) != NULL)
 2907|      0|						cache_add_entry(
 2908|      0|						    iso9660, d);
 2909|      0|					break;
 2910|      0|				} else
 2911|      0|					re_add_entry(iso9660, re);
 2912|      0|			}
 2913|      0|			if (nexted_re) {
  ------------------
  |  Branch (2913:8): [True: 0, False: 0]
  ------------------
 2914|       |				/*
 2915|       |				 * Do not expose this at this time
 2916|       |				 * because we have not gotten its full-path
 2917|       |				 * name yet.
 2918|       |				 */
 2919|      0|				continue;
 2920|      0|			}
 2921|    510|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|    510|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|    510|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2921:14): [True: 246, False: 264]
  ------------------
 2922|    246|			int r;
 2923|       |
 2924|       |			/* Read file entries in this dir. */
 2925|    246|			r = read_children(a, file);
 2926|    246|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    246|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2926:8): [True: 99, False: 147]
  ------------------
 2927|     99|				return (r);
 2928|       |
 2929|       |			/*
 2930|       |			 * Handle a special dir of Rockridge extensions,
 2931|       |			 * "rr_moved".
 2932|       |			 */
 2933|    147|			if (file->rr_moved) {
  ------------------
  |  Branch (2933:8): [True: 0, False: 147]
  ------------------
 2934|       |				/*
 2935|       |				 * If this has only the subdirectories which
 2936|       |				 * have "RE" flags, do not expose at this time.
 2937|       |				 */
 2938|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2938:9): [True: 0, False: 0]
  ------------------
 2939|      0|					continue;
 2940|       |				/* Otherwise expose "rr_moved" entry. */
 2941|    147|			} else if (file->re) {
  ------------------
  |  Branch (2941:15): [True: 0, False: 147]
  ------------------
 2942|       |				/*
 2943|       |				 * Do not expose this at this time
 2944|       |				 * because we have not gotten its full-path
 2945|       |				 * name yet.
 2946|       |				 */
 2947|      0|				re_add_entry(iso9660, file);
 2948|      0|				continue;
 2949|    147|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2949:15): [True: 0, False: 147]
  ------------------
 2950|       |				/*
 2951|       |				 * If the top level "RE" entry of this entry
 2952|       |				 * is not exposed, we, accordingly, should not
 2953|       |				 * expose this entry at this time because
 2954|       |				 * we cannot make its proper full-path name.
 2955|       |				 */
 2956|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2956:9): [True: 0, False: 0]
  ------------------
 2957|      0|					continue;
 2958|       |				/* Otherwise we can expose this entry because
 2959|       |				 * it seems its top level "RE" has already been
 2960|       |				 * exposed. */
 2961|      0|			}
 2962|    147|		}
 2963|    411|		break;
 2964|    510|	}
 2965|       |
 2966|    411|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  215|    411|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  216|    822|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2966:6): [True: 147, False: 264]
  |  Branch (2966:44): [True: 33, False: 231]
  ------------------
 2967|    180|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    180|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2968|       |
 2969|    231|	count = 0;
 2970|    231|	number = file->number;
 2971|    231|	iso9660->cache_files.first = NULL;
 2972|    231|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2973|    231|	empty_files.first = NULL;
 2974|    231|	empty_files.last = &empty_files.first;
 2975|       |	/* Collect files which has the same file serial number.
 2976|       |	 * Peek pending_files so that file which number is different
 2977|       |	 * is not put back. */
 2978|    519|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2978:9): [True: 403, False: 116]
  ------------------
 2979|    403|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2979:7): [True: 123, False: 280]
  ------------------
 2980|    288|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2980:7): [True: 165, False: 115]
  ------------------
 2981|    288|		if (file->number == -1) {
  ------------------
  |  Branch (2981:7): [True: 93, False: 195]
  ------------------
 2982|       |			/* This file has the same offset
 2983|       |			 * but it's wrong offset which empty files
 2984|       |			 * and symlink files have.
 2985|       |			 * NOTE: This wrong offset was recorded by
 2986|       |			 * old mkisofs utility. If ISO images is
 2987|       |			 * created by latest mkisofs, this does not
 2988|       |			 * happen.
 2989|       |			 */
 2990|     93|			file->next = NULL;
 2991|     93|			*empty_files.last = file;
 2992|     93|			empty_files.last = &(file->next);
 2993|    195|		} else {
 2994|    195|			count++;
 2995|    195|			cache_add_entry(iso9660, file);
 2996|    195|		}
 2997|    288|		file = next_entry(iso9660);
  ------------------
  |  |  453|    288|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2998|    288|	}
 2999|       |
 3000|    231|	if (count == 0) {
  ------------------
  |  Branch (3000:6): [True: 136, False: 95]
  ------------------
 3001|    136|		*pfile = file;
 3002|    136|		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|    136|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3002:11): [True: 0, False: 136]
  ------------------
 3003|    136|	}
 3004|     95|	if (file->number == -1) {
  ------------------
  |  Branch (3004:6): [True: 30, False: 65]
  ------------------
 3005|     30|		file->next = NULL;
 3006|     30|		*empty_files.last = file;
 3007|     30|		empty_files.last = &(file->next);
 3008|     65|	} else {
 3009|     65|		count++;
 3010|     65|		cache_add_entry(iso9660, file);
 3011|     65|	}
 3012|       |
 3013|     95|	if (count > 1) {
  ------------------
  |  Branch (3013:6): [True: 75, False: 20]
  ------------------
 3014|       |		/* The count is the same as number of hardlink,
 3015|       |		 * so much so that each nlinks of files in cache_file
 3016|       |		 * is overwritten by value of the count.
 3017|       |		 */
 3018|     75|		for (file = iso9660->cache_files.first;
 3019|    315|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3019:7): [True: 240, False: 75]
  ------------------
 3020|    240|			file->nlinks = count;
 3021|     75|	}
 3022|       |	/* If there are empty files, that files are added
 3023|       |	 * to the tail of the cache_files. */
 3024|     95|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3024:6): [True: 30, False: 65]
  ------------------
 3025|     30|		*iso9660->cache_files.last = empty_files.first;
 3026|     30|		iso9660->cache_files.last = empty_files.last;
 3027|     30|	}
 3028|     95|	*pfile = cache_get_entry(iso9660);
 3029|     95|	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|     95|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3029:10): [True: 0, False: 95]
  ------------------
 3030|       |
 3031|      0|fatal_rr:
 3032|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3033|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3034|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3035|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3036|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3037|    231|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3105|    973|{
 3106|    973|	struct file_info *file;
 3107|       |
 3108|    973|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3108:6): [True: 347, False: 626]
  ------------------
 3109|    347|		iso9660->cache_files.first = file->next;
 3110|    347|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3110:7): [True: 76, False: 271]
  ------------------
 3111|     76|			iso9660->cache_files.last =
 3112|     76|			    &(iso9660->cache_files.first);
 3113|    347|	}
 3114|    973|	return (file);
 3115|    973|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3181|    914|{
 3182|    914|	uint64_t a_key, b_key, c_key;
 3183|    914|	size_t a, b, c;
 3184|    914|	struct file_info *r, *tmp;
 3185|       |
 3186|    914|	if (heap->used < 1)
  ------------------
  |  Branch (3186:6): [True: 116, False: 798]
  ------------------
 3187|    116|		return (NULL);
 3188|       |
 3189|       |	/*
 3190|       |	 * The first file in the list is the earliest; we'll return this.
 3191|       |	 */
 3192|    798|	r = heap->files[0];
 3193|       |
 3194|       |	/*
 3195|       |	 * Move the last item in the heap to the root of the tree
 3196|       |	 */
 3197|    798|	heap->files[0] = heap->files[--(heap->used)];
 3198|       |
 3199|       |	/*
 3200|       |	 * Rebalance the heap.
 3201|       |	 */
 3202|    798|	a = 0; /* Starting element and its heap key */
 3203|    798|	a_key = heap->files[a]->key;
 3204|  1.68k|	for (;;) {
 3205|  1.68k|		b = a + a + 1; /* First child */
 3206|  1.68k|		if (b >= heap->used)
  ------------------
  |  Branch (3206:7): [True: 680, False: 1.00k]
  ------------------
 3207|    680|			return (r);
 3208|  1.00k|		b_key = heap->files[b]->key;
 3209|  1.00k|		c = b + 1; /* Use second child if it is smaller. */
 3210|  1.00k|		if (c < heap->used) {
  ------------------
  |  Branch (3210:7): [True: 859, False: 150]
  ------------------
 3211|    859|			c_key = heap->files[c]->key;
 3212|    859|			if (c_key < b_key) {
  ------------------
  |  Branch (3212:8): [True: 353, False: 506]
  ------------------
 3213|    353|				b = c;
 3214|    353|				b_key = c_key;
 3215|    353|			}
 3216|    859|		}
 3217|  1.00k|		if (a_key <= b_key)
  ------------------
  |  Branch (3217:7): [True: 118, False: 891]
  ------------------
 3218|    118|			return (r);
 3219|    891|		tmp = heap->files[a];
 3220|    891|		heap->files[a] = heap->files[b];
 3221|    891|		heap->files[b] = tmp;
 3222|    891|		a = b;
 3223|    891|	}
 3224|    798|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3097|    260|{
 3098|       |	file->next = NULL;
 3099|    260|	*iso9660->cache_files.last = file;
 3100|    260|	iso9660->cache_files.last = &(file->next);
 3101|    260|}
archive_read_support_format_iso9660.c:re_get_entry:
 3049|    116|{
 3050|    116|	struct file_info *file;
 3051|       |
 3052|    116|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3052:6): [True: 0, False: 116]
  ------------------
 3053|      0|		iso9660->re_files.first = file->re_next;
 3054|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3054:7): [True: 0, False: 0]
  ------------------
 3055|      0|			iso9660->re_files.last =
 3056|      0|			    &(iso9660->re_files.first);
 3057|      0|	}
 3058|    116|	return (file);
 3059|    116|}
archive_read_support_format_iso9660.c:read_children:
 1025|    246|{
 1026|    246|	struct iso9660 *iso9660 = a->format->data;
 1027|    246|	const unsigned char *b, *p;
 1028|    246|	struct file_info *multi;
 1029|    246|	size_t step, skip_size;
 1030|       |
 1031|       |	/* flush any remaining bytes from the last round to ensure
 1032|       |	 * we're positioned */
 1033|    246|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1033:6): [True: 0, False: 246]
  ------------------
 1034|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1035|      0|		iso9660->entry_bytes_unconsumed = 0;
 1036|      0|	}
 1037|    246|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1037:6): [True: 21, False: 225]
  ------------------
 1038|     21|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     21|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1039|     21|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1040|     21|		    parent->name.s,
 1041|     21|		    (intmax_t)iso9660->current_position,
 1042|     21|		    (intmax_t)parent->offset);
 1043|     21|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     21|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1044|     21|	}
 1045|    225|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1045:6): [True: 50, False: 175]
  ------------------
 1046|     50|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     50|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1047|     50|		    "Directory is beyond end-of-media: %s",
 1048|     50|		    parent->name.s);
 1049|     50|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     50|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1050|     50|	}
 1051|    175|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1051:6): [True: 85, False: 90]
  ------------------
 1052|     85|		int64_t skipsize;
 1053|       |
 1054|     85|		skipsize = parent->offset - iso9660->current_position;
 1055|     85|		skipsize = __archive_read_consume(a, skipsize);
 1056|     85|		if (skipsize < 0)
  ------------------
  |  Branch (1056:7): [True: 2, False: 83]
  ------------------
 1057|      2|			return ((int)skipsize);
 1058|     83|		iso9660->current_position = parent->offset;
 1059|     83|	}
 1060|       |
 1061|    173|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1062|    173|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1063|    173|	b = __archive_read_ahead(a, step, NULL);
 1064|    173|	if (b == NULL) {
  ------------------
  |  Branch (1064:6): [True: 2, False: 171]
  ------------------
 1065|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1066|      2|		    "Failed to read full block when scanning "
 1067|      2|		    "ISO9660 directory list");
 1068|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1069|      2|	}
 1070|    171|	iso9660->current_position += step;
 1071|    171|	multi = NULL;
 1072|    171|	skip_size = step;
 1073|    603|	while (step) {
  ------------------
  |  Branch (1073:9): [True: 456, False: 147]
  ------------------
 1074|    456|		p = b;
 1075|    456|		b += iso9660->logical_block_size;
 1076|    456|		step -= iso9660->logical_block_size;
 1077|   306k|		for (; p < b && b - p > DR_name_offset && *p != 0 && *p <= b - p;
  ------------------
  |  |  216|   612k|#define DR_name_offset 33
  ------------------
  |  Branch (1077:10): [True: 306k, False: 0]
  |  Branch (1077:19): [True: 306k, False: 149]
  |  Branch (1077:45): [True: 305k, False: 283]
  |  Branch (1077:56): [True: 305k, False: 0]
  ------------------
 1078|   305k|			p += *p) {
 1079|   305k|			struct file_info *child;
 1080|       |
 1081|       |			/* N.B.: these special directory identifiers
 1082|       |			 * are 8 bit "values" even on a
 1083|       |			 * Joliet CD with UCS-2 (16bit) encoding.
 1084|       |			 */
 1085|       |
 1086|       |			/* Skip '.' entry. */
 1087|   305k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   305k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1087:8): [True: 305k, False: 734]
  ------------------
 1088|   305k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  216|   305k|#define DR_name_offset 33
  ------------------
  |  Branch (1088:11): [True: 89, False: 305k]
  ------------------
 1089|     89|				continue;
 1090|       |			/* Skip '..' entry. */
 1091|   305k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   305k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1091:8): [True: 305k, False: 734]
  ------------------
 1092|   305k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  216|   305k|#define DR_name_offset 33
  ------------------
  |  Branch (1092:11): [True: 305k, False: 104]
  ------------------
 1093|   305k|				continue;
 1094|    838|			child = parse_file_info(a, parent, p, b - p);
 1095|    838|			if (child == NULL) {
  ------------------
  |  Branch (1095:8): [True: 24, False: 814]
  ------------------
 1096|     24|				__archive_read_consume(a, skip_size);
 1097|     24|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1098|     24|			}
 1099|    814|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1099:8): [True: 814, False: 0]
  ------------------
 1100|    814|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1100:9): [True: 68, False: 746]
  |  Branch (1100:32): [True: 30, False: 716]
  ------------------
 1101|     98|				struct content *con;
 1102|       |
 1103|     98|				if (multi == NULL) {
  ------------------
  |  Branch (1103:9): [True: 48, False: 50]
  ------------------
 1104|     48|					multi = child;
 1105|     48|					multi->contents.first = NULL;
 1106|     48|					multi->contents.last =
 1107|     48|					    &(multi->contents.first);
 1108|     48|				}
 1109|     98|				con = malloc(sizeof(struct content));
 1110|     98|				if (con == NULL) {
  ------------------
  |  Branch (1110:9): [True: 0, False: 98]
  ------------------
 1111|      0|					archive_set_error(
 1112|      0|					    &a->archive, ENOMEM,
 1113|      0|					    "No memory for multi extent");
 1114|      0|					__archive_read_consume(a, skip_size);
 1115|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1116|      0|				}
 1117|     98|				con->offset = child->offset;
 1118|     98|				con->size = child->size;
 1119|     98|				con->next = NULL;
 1120|     98|				*multi->contents.last = con;
 1121|     98|				multi->contents.last = &(con->next);
 1122|     98|				if (multi == child) {
  ------------------
  |  Branch (1122:9): [True: 48, False: 50]
  ------------------
 1123|     48|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  451|     48|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1123:10): [True: 0, False: 48]
  ------------------
 1124|     48|					    != ARCHIVE_OK)
  ------------------
  |  |  233|     48|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1125|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1126|     50|				} else {
 1127|     50|					multi->size += child->size;
 1128|     50|					if (!child->multi_extent)
  ------------------
  |  Branch (1128:10): [True: 30, False: 20]
  ------------------
 1129|     30|						multi = NULL;
 1130|     50|				}
 1131|     98|			} else
 1132|    716|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  451|    716|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  233|    716|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1132:9): [True: 0, False: 716]
  ------------------
 1133|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1134|    814|		}
 1135|    456|	}
 1136|       |
 1137|    147|	__archive_read_consume(a, skip_size);
 1138|       |
 1139|       |	/* Read data which recorded by RRIP "CE" extension. */
 1140|    147|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  233|    147|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1140:6): [True: 0, False: 147]
  ------------------
 1141|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1142|       |
 1143|    147|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    147|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1144|    147|}
archive_read_support_format_iso9660.c:read_CE:
 2457|    147|{
 2458|    147|	struct read_ce_queue *heap;
 2459|    147|	const unsigned char *b, *p, *end;
 2460|    147|	struct file_info *file;
 2461|    147|	size_t step;
 2462|    147|	uint64_t ce_start, ce_end;
 2463|    147|	int r;
 2464|       |
 2465|       |	/* Read data which RRIP "CE" extension points. */
 2466|    147|	heap = &(iso9660->read_ce_req);
 2467|    147|	step = iso9660->logical_block_size;
 2468|    147|	while (heap->cnt &&
  ------------------
  |  Branch (2468:9): [True: 0, False: 147]
  ------------------
 2469|      0|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2469:6): [True: 0, False: 0]
  ------------------
 2470|      0|		b = __archive_read_ahead(a, step, NULL);
 2471|      0|		if (b == NULL) {
  ------------------
  |  Branch (2471:7): [True: 0, False: 0]
  ------------------
 2472|      0|			archive_set_error(&a->archive,
 2473|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2474|      0|			    "Failed to read full block when scanning "
 2475|      0|			    "ISO9660 directory list");
 2476|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2477|      0|		}
 2478|      0|		do {
 2479|      0|			file = heap->reqs[0].file;
 2480|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2480:8): [True: 0, False: 0]
  ------------------
 2481|      0|				archive_set_error(&a->archive,
 2482|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2483|      0|				    "Malformed CE information");
 2484|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2485|      0|			}
 2486|      0|			ce_start = heap->reqs[0].offset + file->ce_offset;
 2487|      0|			ce_end = ce_start + file->ce_size;
 2488|      0|			if (ce_start < file->ce_processed_end) {
  ------------------
  |  Branch (2488:8): [True: 0, False: 0]
  ------------------
 2489|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2490|      0|				    "Invalid parameter in SUSP \"CE\" extension");
 2491|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2492|      0|			}
 2493|      0|			p = b + file->ce_offset;
 2494|      0|			end = p + file->ce_size;
 2495|      0|			file->ce_processed_end = ce_end;
 2496|      0|			next_CE(heap);
 2497|      0|			r = parse_rockridge(a, file, p, end);
 2498|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2498:8): [True: 0, False: 0]
  ------------------
 2499|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2500|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2500:12): [True: 0, False: 0]
  ------------------
 2501|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2501:7): [True: 0, False: 0]
  ------------------
 2502|       |		/* NOTE: Do not move this consume's code to front of
 2503|       |		 * do-while loop. Registration of nested CE extension
 2504|       |		 * might cause error because of current position. */
 2505|      0|		__archive_read_consume(a, step);
 2506|      0|		iso9660->current_position += step;
 2507|      0|	}
 2508|    147|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    147|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2509|    147|}
archive_read_support_format_iso9660.c:build_pathname_utf16be:
 3466|     11|{
 3467|     11|	if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
  ------------------
  |  Branch (3467:6): [True: 5, False: 6]
  |  Branch (3467:30): [True: 0, False: 5]
  ------------------
 3468|      0|		if (build_pathname_utf16be(p, max, len, file->parent) != 0)
  ------------------
  |  Branch (3468:7): [True: 0, False: 0]
  ------------------
 3469|      0|			return (-1);
 3470|      0|		if (*len + 2 > max)
  ------------------
  |  Branch (3470:7): [True: 0, False: 0]
  ------------------
 3471|      0|			return (-1);/* Path is too long! */
 3472|      0|		p[*len] = 0;
 3473|      0|		p[*len + 1] = '/';
 3474|      0|		*len += 2;
 3475|      0|	}
 3476|     11|	if (file->utf16be_bytes == 0) {
  ------------------
  |  Branch (3476:6): [True: 6, False: 5]
  ------------------
 3477|      6|		if (*len + 2 > max)
  ------------------
  |  Branch (3477:7): [True: 0, False: 6]
  ------------------
 3478|      0|			return (-1);/* Path is too long! */
 3479|      6|		p[*len] = 0;
 3480|      6|		p[*len + 1] = '.';
 3481|      6|		*len += 2;
 3482|      6|	} else {
 3483|      5|		if (*len + file->utf16be_bytes > max)
  ------------------
  |  Branch (3483:7): [True: 0, False: 5]
  ------------------
 3484|      0|			return (-1);/* Path is too long! */
 3485|      5|		memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
 3486|      5|		*len += file->utf16be_bytes;
 3487|      5|	}
 3488|     11|	return (0);
 3489|     11|}
archive_read_support_format_iso9660.c:build_pathname:
 3444|    804|{
 3445|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3446|       |	// to 1000, then something is very, very wrong.
 3447|    804|	if (depth > 1000) {
  ------------------
  |  Branch (3447:6): [True: 0, False: 804]
  ------------------
 3448|      0|		return NULL;
 3449|      0|	}
 3450|    804|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    616|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3450:6): [True: 616, False: 188]
  |  Branch (3450:30): [True: 169, False: 447]
  ------------------
 3451|    169|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3451:7): [True: 0, False: 169]
  ------------------
 3452|      0|			return NULL;
 3453|      0|		}
 3454|    169|		archive_strcat(as, "/");
 3455|    169|	}
 3456|    804|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    804|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3456:6): [True: 72, False: 732]
  ------------------
 3457|     72|		archive_strcat(as, ".");
 3458|    732|	else
 3459|    732|		archive_string_concat(as, &file->name);
 3460|    804|	return (as->s);
 3461|    804|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1475|    709|{
 1476|       |	/* Because read_next_header always does an explicit skip
 1477|       |	 * to the next entry, we don't need to do anything here. */
 1478|    709|	(void)a; /* UNUSED */
 1479|    709|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    709|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1480|    709|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1725|    954|{
 1726|    954|	struct iso9660 *iso9660 = a->format->data;
 1727|    954|	ssize_t bytes_read;
 1728|       |
 1729|    954|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1729:6): [True: 104, False: 850]
  ------------------
 1730|    104|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1731|    104|		iso9660->entry_bytes_unconsumed = 0;
 1732|    104|	}
 1733|       |
 1734|    954|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1734:6): [True: 848, False: 106]
  ------------------
 1735|    848|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1735:7): [True: 20, False: 828]
  ------------------
 1736|     20|			iso9660->entry_content = iso9660->entry_content->next;
 1737|    848|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1737:7): [True: 837, False: 11]
  ------------------
 1738|    837|			*buff = NULL;
 1739|    837|			*size = 0;
 1740|    837|			*offset = iso9660->entry_sparse_offset;
 1741|    837|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    837|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1742|    837|		}
 1743|       |		/* Seek forward to the start of the entry. */
 1744|     11|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1744:7): [True: 6, False: 5]
  ------------------
 1745|      6|			int64_t step;
 1746|       |
 1747|      6|			step = iso9660->entry_content->offset -
 1748|      6|			    iso9660->current_position;
 1749|      6|			step = __archive_read_consume(a, step);
 1750|      6|			if (step < 0)
  ------------------
  |  Branch (1750:8): [True: 1, False: 5]
  ------------------
 1751|      1|				return ((int)step);
 1752|      5|			iso9660->current_position =
 1753|      5|			    iso9660->entry_content->offset;
 1754|      5|		}
 1755|     10|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1755:7): [True: 5, False: 5]
  ------------------
 1756|      5|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1757|      5|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1758|      5|			    iso9660->pathname.s,
 1759|      5|			    (intmax_t)iso9660->entry_content->offset,
 1760|      5|			    (intmax_t)iso9660->current_position);
 1761|      5|			*buff = NULL;
 1762|      5|			*size = 0;
 1763|      5|			*offset = iso9660->entry_sparse_offset;
 1764|      5|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      5|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1765|      5|		}
 1766|      5|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1767|      5|	}
 1768|    111|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1768:6): [True: 0, False: 111]
  ------------------
 1769|      0|		return (zisofs_read_data(a, buff, size, offset));
 1770|       |
 1771|    111|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1772|    111|	if (bytes_read == 0)
  ------------------
  |  Branch (1772:6): [True: 7, False: 104]
  ------------------
 1773|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1774|      7|		    "Truncated input file");
 1775|    111|	if (*buff == NULL)
  ------------------
  |  Branch (1775:6): [True: 7, False: 104]
  ------------------
 1776|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1777|    104|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1777:6): [True: 97, False: 7]
  ------------------
 1778|     97|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1779|    104|	*size = bytes_read;
 1780|    104|	*offset = iso9660->entry_sparse_offset;
 1781|    104|	iso9660->entry_sparse_offset += bytes_read;
 1782|    104|	iso9660->entry_bytes_remaining -= bytes_read;
 1783|    104|	iso9660->entry_bytes_unconsumed = bytes_read;
 1784|    104|	iso9660->current_position += bytes_read;
 1785|    104|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    104|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1786|    111|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1790|  22.2k|{
 1791|  22.2k|	struct iso9660 *iso9660 = a->format->data;
 1792|  22.2k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1793|       |
 1794|  22.2k|	release_files(iso9660);
 1795|  22.2k|	free(iso9660->read_ce_req.reqs);
 1796|  22.2k|	archive_string_free(&iso9660->pathname);
 1797|  22.2k|	archive_string_free(&iso9660->previous_pathname);
 1798|  22.2k|	free(iso9660->pending_files.files);
 1799|  22.2k|#ifdef HAVE_ZLIB_H
 1800|  22.2k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1801|  22.2k|	free(iso9660->entry_zisofs.block_pointers);
 1802|  22.2k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1802:6): [True: 0, False: 22.2k]
  ------------------
 1803|      0|		if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
  ------------------
  |  Branch (1803:7): [True: 0, False: 0]
  ------------------
 1804|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1805|      0|			    "Failed to clean up zlib decompressor");
 1806|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1807|      0|		}
 1808|      0|	}
 1809|  22.2k|#endif
 1810|  22.2k|	free(iso9660->utf16be_path);
 1811|  22.2k|	free(iso9660->utf16be_previous_path);
 1812|  22.2k|	free(iso9660);
 1813|       |	a->format->data = NULL;
 1814|  22.2k|	return (r);
 1815|  22.2k|}
archive_read_support_format_iso9660.c:release_files:
 2769|  22.2k|{
 2770|  22.2k|	struct content *con, *connext;
 2771|  22.2k|	struct file_info *file;
 2772|       |
 2773|  22.2k|	file = iso9660->use_files;
 2774|  23.2k|	while (file != NULL) {
  ------------------
  |  Branch (2774:9): [True: 998, False: 22.2k]
  ------------------
 2775|    998|		struct file_info *next = file->use_next;
 2776|       |
 2777|    998|		archive_string_free(&file->name);
 2778|    998|		archive_string_free(&file->symlink);
 2779|    998|		free(file->utf16be_name);
 2780|    998|		con = file->contents.first;
 2781|  1.09k|		while (con != NULL) {
  ------------------
  |  Branch (2781:10): [True: 98, False: 998]
  ------------------
 2782|     98|			connext = con->next;
 2783|     98|			free(con);
 2784|     98|			con = connext;
 2785|     98|		}
 2786|    998|		free(file);
 2787|    998|		file = next;
 2788|    998|	}
 2789|  22.2k|}

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

archive_read_support_format_mtree:
  214|  22.2k|{
  215|  22.2k|	static const struct archive_rb_tree_ops rb_ops = {
  216|  22.2k|		mtree_cmp_node, mtree_cmp_key,
  217|  22.2k|	};
  218|  22.2k|	struct archive_read *a = (struct archive_read *)_a;
  219|  22.2k|	struct mtree *mtree;
  220|  22.2k|	int r;
  221|       |
  222|  22.2k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  22.2k|	do { \
  |  |  178|  22.2k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  22.2k|			(allowed_states), (function_name)); \
  |  |  180|  22.2k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  22.2k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 22.2k]
  |  |  ------------------
  |  |  181|  22.2k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  22.2k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
  223|  22.2k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
  224|       |
  225|  22.2k|	mtree = calloc(1, sizeof(*mtree));
  226|  22.2k|	if (mtree == NULL) {
  ------------------
  |  Branch (226:6): [True: 0, False: 22.2k]
  ------------------
  227|      0|		archive_set_error(&a->archive, ENOMEM,
  228|      0|		    "Can't allocate mtree data");
  229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|      0|	}
  231|  22.2k|	mtree->checkfs = 0;
  232|  22.2k|	mtree->fd = -1;
  233|       |
  234|  22.2k|	__archive_rb_tree_init(&mtree->rbtree, &rb_ops);
  235|       |
  236|  22.2k|	r = __archive_read_register_format(a, mtree, "mtree",
  237|  22.2k|           mtree_bid, archive_read_format_mtree_options, read_header, read_data, skip, NULL, cleanup, NULL, NULL);
  238|       |
  239|  22.2k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (239:6): [True: 0, False: 22.2k]
  ------------------
  240|      0|		free(mtree);
  241|  22.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  242|  22.2k|}
archive_read_support_format_mtree.c:mtree_cmp_node:
  197|  16.8k|{
  198|  16.8k|	const struct mtree_entry *e1 = (const struct mtree_entry *)n1;
  199|  16.8k|	const struct mtree_entry *e2 = (const struct mtree_entry *)n2;
  200|       |
  201|  16.8k|	return (strcmp(e1->name, e2->name));
  202|  16.8k|}
archive_read_support_format_mtree.c:mtree_cmp_key:
  206|  17.5k|{
  207|  17.5k|	const struct mtree_entry *e = (const struct mtree_entry *)n;
  208|       |
  209|  17.5k|	return (strcmp(e->name, key));
  210|  17.5k|}
archive_read_support_format_mtree.c:cleanup:
  246|  22.2k|{
  247|  22.2k|	struct mtree *mtree = a->format->data;
  248|  22.2k|	struct mtree_entry *p, *q;
  249|       |
  250|       |	/* Close any dangling file descriptor before freeing */
  251|  22.2k|    if (mtree->fd >= 0) {
  ------------------
  |  Branch (251:9): [True: 0, False: 22.2k]
  ------------------
  252|      0|        close(mtree->fd);
  253|      0|        mtree->fd = -1;
  254|      0|    }
  255|  22.2k|	p = mtree->entries;
  256|  80.7k|	while (p != NULL) {
  ------------------
  |  Branch (256:9): [True: 58.5k, False: 22.2k]
  ------------------
  257|  58.5k|		q = p->next;
  258|  58.5k|		free(p->name);
  259|  58.5k|		free_options(p->options);
  260|  58.5k|		free(p);
  261|  58.5k|		p = q;
  262|  58.5k|	}
  263|  22.2k|	archive_string_free(&mtree->line);
  264|  22.2k|	archive_string_free(&mtree->current_dir);
  265|  22.2k|	archive_string_free(&mtree->contents_name);
  266|  22.2k|	archive_entry_linkresolver_free(mtree->resolver);
  267|       |
  268|  22.2k|	free(mtree->buff);
  269|  22.2k|	free(mtree);
  270|  22.2k|	a->format->data = NULL;
  271|  22.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  272|  22.2k|}
archive_read_support_format_mtree.c:free_options:
  184|  61.8k|{
  185|  61.8k|	struct mtree_option *next;
  186|       |
  187|   146k|	for (; head != NULL; head = next) {
  ------------------
  |  Branch (187:9): [True: 84.6k, False: 61.8k]
  ------------------
  188|  84.6k|		next = head->next;
  189|  84.6k|		free(head->value);
  190|  84.6k|		free(head);
  191|  84.6k|	}
  192|  61.8k|}
archive_read_support_format_mtree.c:mtree_bid:
  621|  21.6k|{
  622|  21.6k|	const char *signature = "#mtree";
  623|  21.6k|	const char *p;
  624|       |
  625|  21.6k|	(void)best_bid; /* UNUSED */
  626|       |
  627|       |	/* Now let's look at the actual header and see if it matches. */
  628|  21.6k|	p = __archive_read_ahead(a, strlen(signature), NULL);
  629|  21.6k|	if (p == NULL)
  ------------------
  |  Branch (629:6): [True: 282, False: 21.3k]
  ------------------
  630|    282|		return (-1);
  631|       |
  632|  21.3k|	if (memcmp(p, signature, strlen(signature)) == 0)
  ------------------
  |  Branch (632:6): [True: 45, False: 21.3k]
  ------------------
  633|     45|		return (8 * (int)strlen(signature));
  634|       |
  635|       |	/*
  636|       |	 * There is not a mtree signature. Let's try to detect mtree format.
  637|       |	 */
  638|  21.3k|	return (detect_form(a, NULL));
  639|  21.3k|}
archive_read_support_format_mtree.c:detect_form:
  643|  23.9k|{
  644|  23.9k|	const char *p;
  645|  23.9k|	ssize_t avail, ravail;
  646|  23.9k|	ssize_t len, nl;
  647|  23.9k|	int entry_cnt = 0, multiline = 0;
  648|  23.9k|	int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
  649|       |			* (In this source we call it `form D') . */
  650|       |
  651|  23.9k|	if (is_form_d != NULL)
  ------------------
  |  Branch (651:6): [True: 2.59k, False: 21.3k]
  ------------------
  652|  2.59k|		*is_form_d = 0;
  653|  23.9k|	p = __archive_read_ahead(a, 1, &avail);
  654|  23.9k|	if (p == NULL)
  ------------------
  |  Branch (654:6): [True: 11, False: 23.9k]
  ------------------
  655|     11|		return (-1);
  656|  23.9k|	ravail = avail;
  657|  32.5M|	for (;;) {
  658|  32.5M|		len = next_line(a, &p, &avail, &ravail, &nl);
  659|       |		/* The terminal character of the line should be
  660|       |		 * a new line character, '\r\n' or '\n'. */
  661|  32.5M|		if (len <= 0 || nl == 0)
  ------------------
  |  Branch (661:7): [True: 19.0k, False: 32.5M]
  |  Branch (661:19): [True: 12, False: 32.5M]
  ------------------
  662|  19.0k|			break;
  663|  32.5M|		if (!multiline) {
  ------------------
  |  Branch (663:7): [True: 32.5M, False: 1.64k]
  ------------------
  664|       |			/* Leading whitespace is never significant,
  665|       |			 * ignore it. */
  666|  32.5M|			while (len > 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (666:11): [True: 32.5M, False: 0]
  |  Branch (666:23): [True: 49.6k, False: 32.5M]
  |  Branch (666:36): [True: 1.00k, False: 32.5M]
  ------------------
  667|  50.6k|				++p;
  668|  50.6k|				--avail;
  669|  50.6k|				--len;
  670|  50.6k|			}
  671|       |			/* Skip comment or empty line. */ 
  672|  32.5M|			if (p[0] == '#' || p[0] == '\n' || p[0] == '\r') {
  ------------------
  |  Branch (672:8): [True: 2.34k, False: 32.5M]
  |  Branch (672:23): [True: 508k, False: 32.0M]
  |  Branch (672:39): [True: 31.9M, False: 20.0k]
  ------------------
  673|  32.4M|				p += len;
  674|  32.4M|				avail -= len;
  675|  32.4M|				continue;
  676|  32.4M|			}
  677|  32.5M|		} else {
  678|       |			/* A continuance line; the terminal
  679|       |			 * character of previous line was '\' character. */
  680|  1.64k|			if (bid_keyword_list(p, len, 0, 0) <= 0)
  ------------------
  |  Branch (680:8): [True: 23, False: 1.62k]
  ------------------
  681|     23|				break;
  682|  1.62k|			if (p[len-nl-1] != '\\') {
  ------------------
  |  Branch (682:8): [True: 716, False: 909]
  ------------------
  683|    716|				if (multiline == 1 &&
  ------------------
  |  Branch (683:9): [True: 45, False: 671]
  ------------------
  684|     45|				    ++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  617|     45|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (684:9): [True: 7, False: 38]
  ------------------
  685|      7|					break;
  686|    709|				multiline = 0;
  687|    709|			}
  688|  1.61k|			p += len;
  689|  1.61k|			avail -= len;
  690|  1.61k|			continue;
  691|  1.62k|		}
  692|  20.0k|		if (p[0] != '/') {
  ------------------
  |  Branch (692:7): [True: 14.8k, False: 5.23k]
  ------------------
  693|  14.8k|			int last_is_path, keywords;
  694|       |
  695|  14.8k|			keywords = bid_entry(p, len, nl, &last_is_path);
  696|  14.8k|			if (keywords >= 0) {
  ------------------
  |  Branch (696:8): [True: 13.4k, False: 1.37k]
  ------------------
  697|  13.4k|				if (form_D == 0) {
  ------------------
  |  Branch (697:9): [True: 12.4k, False: 1.07k]
  ------------------
  698|  12.4k|					if (last_is_path)
  ------------------
  |  Branch (698:10): [True: 171, False: 12.2k]
  ------------------
  699|    171|						form_D = 1;
  700|  12.2k|					else if (keywords > 0)
  ------------------
  |  Branch (700:15): [True: 1.69k, False: 10.5k]
  ------------------
  701|       |						/* This line is not `form D'. */
  702|  1.69k|						form_D = -1;
  703|  12.4k|				} else if (form_D == 1) {
  ------------------
  |  Branch (703:16): [True: 142, False: 928]
  ------------------
  704|    142|					if (!last_is_path && keywords > 0)
  ------------------
  |  Branch (704:10): [True: 78, False: 64]
  |  Branch (704:27): [True: 1, False: 77]
  ------------------
  705|       |						/* This this is not `form D'
  706|       |						 * and we cannot accept mixed
  707|       |						 * format. */
  708|      1|						break;
  709|    142|				}
  710|  13.4k|				if (!last_is_path && p[len-nl-1] == '\\')
  ------------------
  |  Branch (710:9): [True: 13.2k, False: 257]
  |  Branch (710:26): [True: 106, False: 13.1k]
  ------------------
  711|       |					/* This line continues. */
  712|    106|					multiline = 1;
  713|  13.3k|				else {
  714|       |					/* We've got plenty of correct lines
  715|       |					 * to assume that this file is an mtree
  716|       |					 * format. */
  717|  13.3k|					if (++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  617|  13.3k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (717:10): [True: 3.25k, False: 10.1k]
  ------------------
  718|  3.25k|						break;
  719|  13.3k|				}
  720|  13.4k|			} else
  721|  1.37k|				break;
  722|  14.8k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (722:14): [True: 5.19k, False: 44]
  |  Branch (722:25): [True: 2.82k, False: 2.37k]
  ------------------
  723|  2.82k|			if (bid_keyword_list(p+4, len-4, 0, 0) <= 0)
  ------------------
  |  Branch (723:8): [True: 28, False: 2.79k]
  ------------------
  724|     28|				break;
  725|       |			/* This line continues. */
  726|  2.79k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (726:8): [True: 34, False: 2.76k]
  ------------------
  727|     34|				multiline = 2;
  728|  2.79k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (728:14): [True: 2.35k, False: 61]
  |  Branch (728:25): [True: 2.24k, False: 113]
  ------------------
  729|  2.24k|			if (bid_keyword_list(p+6, len-6, 1, 0) <= 0)
  ------------------
  |  Branch (729:8): [True: 18, False: 2.22k]
  ------------------
  730|     18|				break;
  731|       |			/* This line continues. */
  732|  2.22k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (732:8): [True: 655, False: 1.56k]
  ------------------
  733|    655|				multiline = 2;
  734|  2.22k|		} else
  735|    174|			break;
  736|       |
  737|       |		/* Test next line. */
  738|  15.2k|		p += len;
  739|  15.2k|		avail -= len;
  740|  15.2k|	}
  741|  23.9k|	if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) {
  ------------------
  |  |  617|  47.8k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (741:6): [True: 3.26k, False: 20.6k]
  |  Branch (741:37): [True: 2.97k, False: 17.6k]
  |  Branch (741:54): [True: 1.95k, False: 1.01k]
  ------------------
  742|  5.21k|		if (is_form_d != NULL) {
  ------------------
  |  Branch (742:7): [True: 2.55k, False: 2.66k]
  ------------------
  743|  2.55k|			if (form_D == 1)
  ------------------
  |  Branch (743:8): [True: 83, False: 2.47k]
  ------------------
  744|     83|				*is_form_d = 1;
  745|  2.55k|		}
  746|  5.21k|		return (32);
  747|  5.21k|	}
  748|       |
  749|  18.6k|	return (0);
  750|  23.9k|}
archive_read_support_format_mtree.c:next_line:
  320|  32.5M|{
  321|  32.5M|	ssize_t len;
  322|  32.5M|	int quit;
  323|       |	
  324|  32.5M|	quit = 0;
  325|  32.5M|	if (*avail == 0) {
  ------------------
  |  Branch (325:6): [True: 1.59k, False: 32.5M]
  ------------------
  326|  1.59k|		*nl = 0;
  327|  1.59k|		len = 0;
  328|  1.59k|	} else
  329|  32.5M|		len = get_line_size(*b, *avail, nl);
  330|       |	/*
  331|       |	 * Read bytes more while it does not reach the end of line.
  332|       |	 */
  333|  32.5M|	while (*nl == 0 && len == *avail && !quit) {
  ------------------
  |  Branch (333:9): [True: 19.4k, False: 32.5M]
  |  Branch (333:21): [True: 3.09k, False: 16.3k]
  |  Branch (333:38): [True: 3.08k, False: 12]
  ------------------
  334|  3.08k|		ssize_t diff = *ravail - *avail;
  335|  3.08k|		size_t nbytes_req = ((size_t)*ravail + 1023) & ~1023U;
  336|  3.08k|		ssize_t tested;
  337|       |
  338|       |		/*
  339|       |		 * Place an arbitrary limit on the line length.
  340|       |		 * mtree is almost free-form input and without line length limits,
  341|       |		 * it can consume a lot of memory.
  342|       |		 */
  343|  3.08k|		if (len >= MAX_LINE_LEN)
  ------------------
  |  |   84|  3.08k|#define	MAX_LINE_LEN		(1024 * 1024)
  ------------------
  |  Branch (343:7): [True: 59, False: 3.02k]
  ------------------
  344|     59|			return (-1);
  345|       |
  346|       |		/* Increase reading bytes if it is not enough for at least
  347|       |		 * two new lines. */
  348|  3.02k|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (348:7): [True: 437, False: 2.58k]
  ------------------
  349|    437|			nbytes_req <<= 1;
  350|       |
  351|  3.02k|		*b = __archive_read_ahead(a, nbytes_req, avail);
  352|  3.02k|		if (*b == NULL) {
  ------------------
  |  Branch (352:7): [True: 2.63k, False: 390]
  ------------------
  353|  2.63k|			if (*ravail >= *avail)
  ------------------
  |  Branch (353:8): [True: 2.60k, False: 29]
  ------------------
  354|  2.60k|				return (0);
  355|       |			/* Reading bytes reaches the end of file. */
  356|     29|			*b = __archive_read_ahead(a, *avail, avail);
  357|     29|			quit = 1;
  358|     29|		}
  359|    419|		*ravail = *avail;
  360|    419|		*b += diff;
  361|    419|		*avail -= diff;
  362|    419|		tested = len;/* Skip some bytes we already determined. */
  363|    419|		len = get_line_size(*b + len, *avail - len, nl);
  364|    419|		if (len >= 0)
  ------------------
  |  Branch (364:7): [True: 394, False: 25]
  ------------------
  365|    394|			len += tested;
  366|    419|	}
  367|  32.5M|	return (len);
  368|  32.5M|}
archive_read_support_format_mtree.c:get_line_size:
  276|  32.5M|{
  277|  32.5M|	ssize_t len;
  278|       |
  279|  32.5M|	len = 0;
  280|   133M|	while (len < avail) {
  ------------------
  |  Branch (280:9): [True: 133M, False: 1.49k]
  ------------------
  281|   133M|		switch (*b) {
  282|  16.3k|		case '\0':/* Non-ascii character or control character. */
  ------------------
  |  Branch (282:3): [True: 16.3k, False: 133M]
  ------------------
  283|  16.3k|			if (nlsize != NULL)
  ------------------
  |  Branch (283:8): [True: 16.3k, False: 0]
  ------------------
  284|  16.3k|				*nlsize = 0;
  285|  16.3k|			return (-1);
  286|  31.9M|		case '\r':
  ------------------
  |  Branch (286:3): [True: 31.9M, False: 101M]
  ------------------
  287|  31.9M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (287:8): [True: 31.9M, False: 137]
  |  Branch (287:25): [True: 2.61k, False: 31.9M]
  ------------------
  288|  2.61k|				if (nlsize != NULL)
  ------------------
  |  Branch (288:9): [True: 2.61k, False: 0]
  ------------------
  289|  2.61k|					*nlsize = 2;
  290|  2.61k|				return (len+2);
  291|  2.61k|			}
  292|       |			/* FALL THROUGH */
  293|  32.5M|		case '\n':
  ------------------
  |  Branch (293:3): [True: 527k, False: 133M]
  ------------------
  294|  32.5M|			if (nlsize != NULL)
  ------------------
  |  Branch (294:8): [True: 32.5M, False: 0]
  ------------------
  295|  32.5M|				*nlsize = 1;
  296|  32.5M|			return (len+1);
  297|   101M|		default:
  ------------------
  |  Branch (297:3): [True: 101M, False: 32.5M]
  ------------------
  298|   101M|			b++;
  299|   101M|			len++;
  300|   101M|			break;
  301|   133M|		}
  302|   133M|	}
  303|  1.49k|	if (nlsize != NULL)
  ------------------
  |  Branch (303:6): [True: 1.49k, False: 0]
  ------------------
  304|  1.49k|		*nlsize = 0;
  305|  1.49k|	return (avail);
  306|  32.5M|}
archive_read_support_format_mtree.c:bid_keyword_list:
  477|  20.4k|{
  478|  20.4k|	int l;
  479|  20.4k|	int keycnt = 0;
  480|       |
  481|  29.2k|	while (len > 0 && *p) {
  ------------------
  |  Branch (481:9): [True: 25.0k, False: 4.25k]
  |  Branch (481:20): [True: 25.0k, False: 0]
  ------------------
  482|  25.0k|		int blank = 0;
  483|       |
  484|       |		/* Test whether there are blank characters in the line. */
  485|  3.18M|		while (len >0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (485:10): [True: 3.18M, False: 257]
  |  Branch (485:21): [True: 3.15M, False: 30.6k]
  |  Branch (485:34): [True: 5.85k, False: 24.7k]
  ------------------
  486|  3.16M|			++p;
  487|  3.16M|			--len;
  488|  3.16M|			blank = 1;
  489|  3.16M|		}
  490|  25.0k|		if (*p == '\n' || *p == '\r')
  ------------------
  |  Branch (490:7): [True: 10.5k, False: 14.4k]
  |  Branch (490:21): [True: 1.96k, False: 12.4k]
  ------------------
  491|  12.5k|			break;
  492|  12.4k|		if (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r'))
  ------------------
  |  Branch (492:7): [True: 945, False: 11.5k]
  |  Branch (492:24): [True: 603, False: 342]
  |  Branch (492:40): [True: 319, False: 23]
  ------------------
  493|    922|			break;
  494|  11.5k|		if (!blank && !last_is_path) /* No blank character. */
  ------------------
  |  Branch (494:7): [True: 281, False: 11.2k]
  |  Branch (494:17): [True: 13, False: 268]
  ------------------
  495|     13|			return (-1);
  496|  11.5k|		if (last_is_path && len == 0)
  ------------------
  |  Branch (496:7): [True: 777, False: 10.7k]
  |  Branch (496:23): [True: 257, False: 520]
  ------------------
  497|    257|				return (keycnt);
  498|       |
  499|  11.2k|		if (unset) {
  ------------------
  |  Branch (499:7): [True: 2.43k, False: 8.83k]
  ------------------
  500|  2.43k|			l = bid_keycmp(p, "all", len);
  501|  2.43k|			if (l > 0)
  ------------------
  |  Branch (501:8): [True: 2.13k, False: 294]
  ------------------
  502|  2.13k|				return (1);
  503|  2.43k|		}
  504|       |		/* Test whether there is a correct key in the line. */
  505|  9.13k|		l = bid_keyword(p, len);
  506|  9.13k|		if (l == 0)
  ------------------
  |  Branch (506:7): [True: 340, False: 8.79k]
  ------------------
  507|    340|			return (-1);/* Unknown keyword was found. */
  508|  8.79k|		p += l;
  509|  8.79k|		len -= l;
  510|  8.79k|		keycnt++;
  511|       |
  512|       |		/* Skip value */
  513|  8.79k|		if (*p == '=') {
  ------------------
  |  Branch (513:7): [True: 5.71k, False: 3.07k]
  ------------------
  514|  5.71k|			int value = 0;
  515|  5.71k|			++p;
  516|  5.71k|			--len;
  517|   212k|			while (len > 0 && *p != ' ' && *p != '\t') {
  ------------------
  |  Branch (517:11): [True: 207k, False: 4.25k]
  |  Branch (517:22): [True: 207k, False: 664]
  |  Branch (517:35): [True: 206k, False: 789]
  ------------------
  518|   206k|				++p;
  519|   206k|				--len;
  520|   206k|				value = 1;
  521|   206k|			}
  522|       |			/* A keyword should have a value unless this is
  523|       |			 * an "/unset" operation. */ 
  524|  5.71k|			if (!unset && value == 0)
  ------------------
  |  Branch (524:8): [True: 5.43k, False: 276]
  |  Branch (524:18): [True: 1, False: 5.43k]
  ------------------
  525|      1|				return (-1);
  526|  5.71k|		}
  527|  8.79k|	}
  528|  17.7k|	return (keycnt);
  529|  20.4k|}
archive_read_support_format_mtree.c:bid_keycmp:
  377|  16.6k|{
  378|  16.6k|	int match_len = 0;
  379|       |
  380|  71.2k|	while (len > 0 && *p && *key) {
  ------------------
  |  Branch (380:9): [True: 71.2k, False: 0]
  |  Branch (380:20): [True: 71.2k, False: 0]
  |  Branch (380:26): [True: 59.9k, False: 11.2k]
  ------------------
  381|  59.9k|		if (*p == *key) {
  ------------------
  |  Branch (381:7): [True: 54.6k, False: 5.36k]
  ------------------
  382|  54.6k|			--len;
  383|  54.6k|			++p;
  384|  54.6k|			++key;
  385|  54.6k|			++match_len;
  386|  54.6k|			continue;
  387|  54.6k|		}
  388|  5.36k|		return (0);/* Not match */
  389|  59.9k|	}
  390|  11.2k|	if (*key != '\0')
  ------------------
  |  Branch (390:6): [True: 0, False: 11.2k]
  ------------------
  391|      0|		return (0);/* Not match */
  392|       |
  393|       |	/* A following character should be specified characters */
  394|  11.2k|	if (p[0] == '=' || p[0] == ' ' || p[0] == '\t' ||
  ------------------
  |  Branch (394:6): [True: 5.82k, False: 5.47k]
  |  Branch (394:21): [True: 421, False: 5.05k]
  |  Branch (394:36): [True: 733, False: 4.32k]
  ------------------
  395|  4.32k|	    p[0] == '\n' || p[0] == '\r' ||
  ------------------
  |  Branch (395:6): [True: 1.69k, False: 2.62k]
  |  Branch (395:22): [True: 686, False: 1.93k]
  ------------------
  396|  1.93k|	   (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r')))
  ------------------
  |  Branch (396:6): [True: 1.58k, False: 356]
  |  Branch (396:23): [True: 1.17k, False: 411]
  |  Branch (396:39): [True: 402, False: 9]
  ------------------
  397|  10.9k|		return (match_len);
  398|    365|	return (0);/* Not match */
  399|  11.2k|}
archive_read_support_format_mtree.c:bid_keyword:
  408|  9.13k|{
  409|  9.13k|	static const char * const keys_c[] = {
  410|  9.13k|		"content", "contents", "cksum", NULL
  411|  9.13k|	};
  412|  9.13k|	static const char * const keys_df[] = {
  413|  9.13k|		"device", "flags", NULL
  414|  9.13k|	};
  415|  9.13k|	static const char * const keys_g[] = {
  416|  9.13k|		"gid", "gname", NULL
  417|  9.13k|	};
  418|  9.13k|	static const char * const keys_il[] = {
  419|  9.13k|		"ignore", "inode", "link", NULL
  420|  9.13k|	};
  421|  9.13k|	static const char * const keys_m[] = {
  422|  9.13k|		"md5", "md5digest", "mode", NULL
  423|  9.13k|	};
  424|  9.13k|	static const char * const keys_no[] = {
  425|  9.13k|		"nlink", "nochange", "optional", NULL
  426|  9.13k|	};
  427|  9.13k|	static const char * const keys_r[] = {
  428|  9.13k|		"resdevice", "rmd160", "rmd160digest", NULL
  429|  9.13k|	};
  430|  9.13k|	static const char * const keys_s[] = {
  431|  9.13k|		"sha1", "sha1digest",
  432|  9.13k|		"sha256", "sha256digest",
  433|  9.13k|		"sha384", "sha384digest",
  434|  9.13k|		"sha512", "sha512digest",
  435|  9.13k|		"size", NULL
  436|  9.13k|	};
  437|  9.13k|	static const char * const keys_t[] = {
  438|  9.13k|		"tags", "time", "type", NULL
  439|  9.13k|	};
  440|  9.13k|	static const char * const keys_u[] = {
  441|  9.13k|		"uid", "uname",	NULL
  442|  9.13k|	};
  443|  9.13k|	const char * const *keys;
  444|  9.13k|	int i;
  445|       |
  446|  9.13k|	switch (*p) {
  447|    194|	case 'c': keys = keys_c; break;
  ------------------
  |  Branch (447:2): [True: 194, False: 8.93k]
  ------------------
  448|  1.09k|	case 'd': case 'f': keys = keys_df; break;
  ------------------
  |  Branch (448:2): [True: 822, False: 8.30k]
  |  Branch (448:12): [True: 271, False: 8.86k]
  ------------------
  449|  4.07k|	case 'g': keys = keys_g; break;
  ------------------
  |  Branch (449:2): [True: 4.07k, False: 5.06k]
  ------------------
  450|    392|	case 'i': case 'l': keys = keys_il; break;
  ------------------
  |  Branch (450:2): [True: 329, False: 8.80k]
  |  Branch (450:12): [True: 63, False: 9.06k]
  ------------------
  451|    171|	case 'm': keys = keys_m; break;
  ------------------
  |  Branch (451:2): [True: 171, False: 8.96k]
  ------------------
  452|    132|	case 'n': case 'o': keys = keys_no; break;
  ------------------
  |  Branch (452:2): [True: 73, False: 9.05k]
  |  Branch (452:12): [True: 59, False: 9.07k]
  ------------------
  453|    702|	case 'r': keys = keys_r; break;
  ------------------
  |  Branch (453:2): [True: 702, False: 8.42k]
  ------------------
  454|    601|	case 's': keys = keys_s; break;
  ------------------
  |  Branch (454:2): [True: 601, False: 8.53k]
  ------------------
  455|    774|	case 't': keys = keys_t; break;
  ------------------
  |  Branch (455:2): [True: 774, False: 8.35k]
  ------------------
  456|    776|	case 'u': keys = keys_u; break;
  ------------------
  |  Branch (456:2): [True: 776, False: 8.35k]
  ------------------
  457|    225|	default: return (0);/* Unknown key */
  ------------------
  |  Branch (457:2): [True: 225, False: 8.90k]
  ------------------
  458|  9.13k|	}
  459|       |
  460|  14.3k|	for (i = 0; keys[i] != NULL; i++) {
  ------------------
  |  Branch (460:14): [True: 14.2k, False: 115]
  ------------------
  461|  14.2k|		int l = bid_keycmp(p, keys[i], len);
  462|  14.2k|		if (l > 0)
  ------------------
  |  Branch (462:7): [True: 8.79k, False: 5.43k]
  ------------------
  463|  8.79k|			return (l);
  464|  14.2k|	}
  465|    115|	return (0);/* Unknown key */
  466|  8.90k|}
archive_read_support_format_mtree.c:bid_entry:
  533|  14.8k|{
  534|  14.8k|	int f = 0;
  535|  14.8k|	static const unsigned char safe_char[256] = {
  536|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
  537|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
  538|       |		/* !"$%&'()*+,-./  EXCLUSION:( )(#) */
  539|  14.8k|		0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
  540|       |		/* 0123456789:;<>?  EXCLUSION:(=) */
  541|  14.8k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
  542|       |		/* @ABCDEFGHIJKLMNO */
  543|  14.8k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
  544|       |		/* PQRSTUVWXYZ[\]^_  */
  545|  14.8k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
  546|       |		/* `abcdefghijklmno */
  547|  14.8k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
  548|       |		/* pqrstuvwxyz{|}~ */
  549|  14.8k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
  550|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
  551|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
  552|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
  553|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
  554|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
  555|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
  556|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
  557|  14.8k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
  558|  14.8k|	};
  559|  14.8k|	ssize_t ll;
  560|  14.8k|	const char *pp = p;
  561|  14.8k|	const char * const pp_end = pp + len;
  562|       |
  563|  14.8k|	*last_is_path = 0;
  564|       |	/*
  565|       |	 * Skip the path-name which is quoted.
  566|       |	 */
  567|  13.1M|	for (;pp < pp_end; ++pp) {
  ------------------
  |  Branch (567:8): [True: 13.1M, False: 0]
  ------------------
  568|  13.1M|		if (!safe_char[*(const unsigned char *)pp]) {
  ------------------
  |  Branch (568:7): [True: 14.8k, False: 13.1M]
  ------------------
  569|  14.8k|			if (*pp != ' ' && *pp != '\t' && *pp != '\r'
  ------------------
  |  Branch (569:8): [True: 13.3k, False: 1.47k]
  |  Branch (569:22): [True: 11.9k, False: 1.43k]
  |  Branch (569:37): [True: 10.6k, False: 1.33k]
  ------------------
  570|  10.6k|			    && *pp != '\n')
  ------------------
  |  Branch (570:11): [True: 1.35k, False: 9.25k]
  ------------------
  571|  1.35k|				f = 0;
  572|  14.8k|			break;
  573|  14.8k|		}
  574|  13.1M|		f = 1;
  575|  13.1M|	}
  576|  14.8k|	ll = pp_end - pp;
  577|       |
  578|       |	/* If a path-name was not found at the first, try to check
  579|       |	 * a mtree format(a.k.a form D) ``NetBSD's mtree -D'' creates,
  580|       |	 * which places the path-name at the last. */
  581|  14.8k|	if (f == 0) {
  ------------------
  |  Branch (581:6): [True: 1.35k, False: 13.4k]
  ------------------
  582|  1.35k|		const char *pb = p + len - nl;
  583|  1.35k|		int name_len = 0;
  584|  1.35k|		int slash;
  585|       |
  586|       |		/* The form D accepts only a single line for an entry. */
  587|  1.35k|		if (pb-2 >= p &&
  ------------------
  |  Branch (587:7): [True: 1.32k, False: 23]
  ------------------
  588|  1.32k|		    pb[-1] == '\\' && (pb[-2] == ' ' || pb[-2] == '\t'))
  ------------------
  |  Branch (588:7): [True: 20, False: 1.30k]
  |  Branch (588:26): [True: 1, False: 19]
  |  Branch (588:43): [True: 2, False: 17]
  ------------------
  589|      3|			return (-1);
  590|  1.34k|		if (pb-1 >= p && pb[-1] == '\\')
  ------------------
  |  Branch (590:7): [True: 1.34k, False: 0]
  |  Branch (590:20): [True: 17, False: 1.33k]
  ------------------
  591|     17|			return (-1);
  592|       |
  593|  1.33k|		slash = 0;
  594|  1.73M|		while (p <= --pb && *pb != ' ' && *pb != '\t') {
  ------------------
  |  Branch (594:10): [True: 1.73M, False: 0]
  |  Branch (594:23): [True: 1.73M, False: 114]
  |  Branch (594:37): [True: 1.73M, False: 218]
  ------------------
  595|  1.73M|			if (!safe_char[*(const unsigned char *)pb])
  ------------------
  |  Branch (595:8): [True: 998, False: 1.73M]
  ------------------
  596|    998|				return (-1);
  597|  1.73M|			name_len++;
  598|       |			/* The pathname should have a slash in this
  599|       |			 * format. */
  600|  1.73M|			if (*pb == '/')
  ------------------
  |  Branch (600:8): [True: 673, False: 1.73M]
  ------------------
  601|    673|				slash = 1;
  602|  1.73M|		}
  603|    332|		if (name_len == 0 || slash == 0)
  ------------------
  |  Branch (603:7): [True: 31, False: 301]
  |  Branch (603:24): [True: 32, False: 269]
  ------------------
  604|     63|			return (-1);
  605|       |		/* If '/' is placed at the first in this field, this is not
  606|       |		 * a valid filename. */
  607|    269|		if (pb[1] == '/')
  ------------------
  |  Branch (607:7): [True: 1, False: 268]
  ------------------
  608|      1|			return (-1);
  609|    268|		ll = len - nl - name_len;
  610|    268|		pp = p;
  611|    268|		*last_is_path = 1;
  612|    268|	}
  613|       |
  614|  13.7k|	return (bid_keyword_list(pp, ll, 0, *last_is_path));
  615|  14.8k|}
archive_read_support_format_mtree.c:read_header:
 1068|  52.4k|{
 1069|  52.4k|	struct mtree *mtree = a->format->data;
 1070|  52.4k|	char *p;
 1071|  52.4k|	int r, use_next;
 1072|       |
 1073|  52.4k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1073:6): [True: 0, False: 52.4k]
  ------------------
 1074|      0|		close(mtree->fd);
 1075|      0|		mtree->fd = -1;
 1076|      0|	}
 1077|       |
 1078|  52.4k|	if (mtree->entries == NULL) {
  ------------------
  |  Branch (1078:6): [True: 2.59k, False: 49.8k]
  ------------------
 1079|  2.59k|		mtree->resolver = archive_entry_linkresolver_new();
 1080|  2.59k|		if (mtree->resolver == NULL)
  ------------------
  |  Branch (1080:7): [True: 0, False: 2.59k]
  ------------------
 1081|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1082|  2.59k|		archive_entry_linkresolver_set_strategy(mtree->resolver,
 1083|  2.59k|		    ARCHIVE_FORMAT_MTREE);
  ------------------
  |  |  379|  2.59k|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1084|  2.59k|		r = read_mtree(a, mtree);
 1085|  2.59k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1085:7): [True: 147, False: 2.45k]
  ------------------
 1086|    147|			return (r);
 1087|  2.59k|	}
 1088|       |
 1089|  52.2k|	a->archive.archive_format = mtree->archive_format;
 1090|  52.2k|	a->archive.archive_format_name = mtree->archive_format_name;
 1091|       |
 1092|   107k|	for (;;) {
 1093|   107k|		if (mtree->this_entry == NULL)
  ------------------
  |  Branch (1093:7): [True: 2.45k, False: 104k]
  ------------------
 1094|  2.45k|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|  2.45k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1095|   104k|		if (strcmp(mtree->this_entry->name, "..") == 0) {
  ------------------
  |  Branch (1095:7): [True: 1.15k, False: 103k]
  ------------------
 1096|  1.15k|			mtree->this_entry->used = 1;
 1097|  1.15k|			if (archive_strlen(&mtree->current_dir) > 0) {
  ------------------
  |  |  178|  1.15k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1097:8): [True: 920, False: 236]
  ------------------
 1098|       |				/* Roll back current path. */
 1099|    920|				p = mtree->current_dir.s
 1100|    920|				    + mtree->current_dir.length - 1;
 1101|  3.73k|				while (p >= mtree->current_dir.s && *p != '/')
  ------------------
  |  Branch (1101:12): [True: 3.34k, False: 393]
  |  Branch (1101:41): [True: 2.81k, False: 527]
  ------------------
 1102|  2.81k|					--p;
 1103|    920|				if (p >= mtree->current_dir.s)
  ------------------
  |  Branch (1103:9): [True: 527, False: 393]
  ------------------
 1104|    527|					--p;
 1105|    920|				mtree->current_dir.length
 1106|    920|				    = p - mtree->current_dir.s + 1;
 1107|    920|			}
 1108|  1.15k|		}
 1109|   104k|		if (!mtree->this_entry->used) {
  ------------------
  |  Branch (1109:7): [True: 49.8k, False: 54.9k]
  ------------------
 1110|  49.8k|			use_next = 0;
 1111|  49.8k|			r = parse_file(a, entry, mtree, mtree->this_entry,
 1112|  49.8k|				&use_next);
 1113|  49.8k|			if (use_next == 0)
  ------------------
  |  Branch (1113:8): [True: 49.8k, False: 0]
  ------------------
 1114|  49.8k|				return (r);
 1115|  49.8k|		}
 1116|  54.9k|		mtree->this_entry = mtree->this_entry->next;
 1117|  54.9k|	}
 1118|  52.2k|}
archive_read_support_format_mtree.c:read_mtree:
  987|  2.59k|{
  988|  2.59k|	ssize_t len;
  989|  2.59k|	uintmax_t counter;
  990|  2.59k|	char *p, *s;
  991|  2.59k|	struct mtree_option *global;
  992|  2.59k|	struct mtree_entry *last_entry;
  993|  2.59k|	int r, is_form_d;
  994|       |
  995|  2.59k|	mtree->archive_format = ARCHIVE_FORMAT_MTREE;
  ------------------
  |  |  379|  2.59k|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
  996|  2.59k|	mtree->archive_format_name = "mtree";
  997|       |
  998|  2.59k|	global = NULL;
  999|  2.59k|	last_entry = NULL;
 1000|       |
 1001|  2.59k|	(void)detect_form(a, &is_form_d);
 1002|       |
 1003|   757k|	for (counter = 1; ; ++counter) {
 1004|   757k|		r = ARCHIVE_OK;
  ------------------
  |  |  233|   757k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1005|   757k|		len = readline(a, mtree, &p, 65536);
 1006|   757k|		if (len == 0) {
  ------------------
  |  Branch (1006:7): [True: 2.45k, False: 754k]
  ------------------
 1007|  2.45k|			mtree->this_entry = mtree->entries;
 1008|  2.45k|			free_options(global);
 1009|  2.45k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1010|  2.45k|		}
 1011|   754k|		if (len < 0) {
  ------------------
  |  Branch (1011:7): [True: 16, False: 754k]
  ------------------
 1012|     16|			free_options(global);
 1013|     16|			return ((int)len);
 1014|     16|		}
 1015|       |		/* Leading whitespace is never significant, ignore it. */
 1016|   756k|		while (*p == ' ' || *p == '\t') {
  ------------------
  |  Branch (1016:10): [True: 1.22k, False: 755k]
  |  Branch (1016:23): [True: 553, False: 754k]
  ------------------
 1017|  1.77k|			++p;
 1018|  1.77k|			--len;
 1019|  1.77k|		}
 1020|       |		/* Skip content lines and blank lines. */
 1021|   754k|		if (*p == '#')
  ------------------
  |  Branch (1021:7): [True: 6.29k, False: 748k]
  ------------------
 1022|  6.29k|			continue;
 1023|   748k|		if (*p == '\r' || *p == '\n' || *p == '\0')
  ------------------
  |  Branch (1023:7): [True: 271, False: 747k]
  |  Branch (1023:21): [True: 685k, False: 62.6k]
  |  Branch (1023:35): [True: 0, False: 62.6k]
  ------------------
 1024|   685k|			continue;
 1025|       |		/* Non-printable characters are not allowed */
 1026|  16.3M|		for (s = p;s < p + len - 1; s++) {
  ------------------
  |  Branch (1026:14): [True: 16.2M, False: 62.5k]
  ------------------
 1027|  16.2M|			if (!isprint((unsigned char)*s) && *s != '\t') {
  ------------------
  |  Branch (1027:8): [True: 11.7k, False: 16.2M]
  |  Branch (1027:39): [True: 80, False: 11.6k]
  ------------------
 1028|     80|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     80|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1029|     80|					"Non-printable character 0x%02X", (unsigned char)(*s));
 1030|     80|				r = ARCHIVE_FATAL;
  ------------------
  |  |  239|     80|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1031|     80|				break;
 1032|     80|			}
 1033|  16.2M|		}
 1034|  62.6k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  62.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1034:7): [True: 80, False: 62.5k]
  ------------------
 1035|     80|			break;
 1036|  62.5k|		if (*p != '/') {
  ------------------
  |  Branch (1036:7): [True: 58.5k, False: 4.06k]
  ------------------
 1037|  58.5k|			r = process_add_entry(a, mtree, &global, p, len,
 1038|  58.5k|			    &last_entry, is_form_d);
 1039|  58.5k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (1039:14): [True: 4.06k, False: 4]
  |  Branch (1039:25): [True: 2.67k, False: 1.39k]
  ------------------
 1040|  2.67k|			if (p[4] != ' ' && p[4] != '\t')
  ------------------
  |  Branch (1040:8): [True: 614, False: 2.05k]
  |  Branch (1040:23): [True: 3, False: 611]
  ------------------
 1041|      3|				break;
 1042|  2.66k|			r = process_global_set(a, &global, p);
 1043|  2.66k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (1043:14): [True: 1.38k, False: 12]
  |  Branch (1043:25): [True: 1.36k, False: 23]
  ------------------
 1044|  1.36k|			if (p[6] != ' ' && p[6] != '\t')
  ------------------
  |  Branch (1044:8): [True: 116, False: 1.24k]
  |  Branch (1044:23): [True: 1, False: 115]
  ------------------
 1045|      1|				break;
 1046|  1.36k|			r = process_global_unset(a, &global, p);
 1047|  1.36k|		} else
 1048|     35|			break;
 1049|       |
 1050|  62.5k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  62.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1050:7): [True: 12, False: 62.5k]
  ------------------
 1051|     12|			free_options(global);
 1052|     12|			return r;
 1053|     12|		}
 1054|  62.5k|	}
 1055|       |
 1056|    119|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    119|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1057|    119|	    "Can't parse line %ju", counter);
 1058|    119|	free_options(global);
 1059|    119|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    119|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1060|  2.59k|}
archive_read_support_format_mtree.c:readline:
 2038|   757k|{
 2039|   757k|	ssize_t bytes_read;
 2040|   757k|	ssize_t total_size = 0;
 2041|   757k|	ssize_t find_off = 0;
 2042|   757k|	const void *nl, *t;
 2043|   757k|	char *u;
 2044|       |
 2045|       |	/* Accumulate line in a line buffer. */
 2046|   892k|	for (;;) {
 2047|       |		/* Read some more. */
 2048|   892k|		t = __archive_read_ahead(a, 1, &bytes_read);
 2049|   892k|		if (t == NULL)
  ------------------
  |  Branch (2049:7): [True: 2.45k, False: 889k]
  ------------------
 2050|  2.45k|			return (0);
 2051|   889k|		if (bytes_read < 0)
  ------------------
  |  Branch (2051:7): [True: 0, False: 889k]
  ------------------
 2052|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2053|   889k|		nl = memchr(t, '\n', bytes_read);
 2054|       |		/* If we found '\n', trim the read to end exactly there. */
 2055|   889k|		if (nl != NULL) {
  ------------------
  |  Branch (2055:7): [True: 888k, False: 1.45k]
  ------------------
 2056|   888k|			bytes_read = ((const char *)nl) - ((const char *)t) + 1;
 2057|   888k|		}
 2058|   889k|		if (total_size + bytes_read + 1 > limit) {
  ------------------
  |  Branch (2058:7): [True: 16, False: 889k]
  ------------------
 2059|     16|			archive_set_error(&a->archive,
 2060|     16|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2061|     16|			    "Line too long");
 2062|     16|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2063|     16|		}
 2064|   889k|		if (archive_string_ensure(&mtree->line,
  ------------------
  |  Branch (2064:7): [True: 0, False: 889k]
  ------------------
 2065|   889k|			total_size + bytes_read + 1) == NULL) {
 2066|      0|			archive_set_error(&a->archive, ENOMEM,
 2067|      0|			    "Can't allocate working buffer");
 2068|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2069|      0|		}
 2070|       |		/* Append new bytes to string. */
 2071|   889k|		memcpy(mtree->line.s + total_size, t, bytes_read);
 2072|   889k|		__archive_read_consume(a, bytes_read);
 2073|   889k|		total_size += bytes_read;
 2074|   889k|		mtree->line.s[total_size] = '\0';
 2075|       |
 2076|  32.2M|		for (u = mtree->line.s + find_off; *u; ++u) {
  ------------------
  |  Branch (2076:38): [True: 32.1M, False: 134k]
  ------------------
 2077|  32.1M|			if (u[0] == '\n') {
  ------------------
  |  Branch (2077:8): [True: 754k, False: 31.3M]
  ------------------
 2078|       |				/* Ends with unescaped newline. */
 2079|       |				/* Check if preceded by '\r' for CRLF handling */
 2080|   754k|				if (u > mtree->line.s && u[-1] == '\r') {
  ------------------
  |  Branch (2080:9): [True: 69.5k, False: 684k]
  |  Branch (2080:30): [True: 502, False: 69.0k]
  ------------------
 2081|       |					/* CRLF ending - remove the '\r' */
 2082|    502|					u[-1] = '\n';
 2083|    502|					u[0] = '\0';
 2084|    502|					total_size--;
 2085|    502|				}
 2086|   754k|				*start = mtree->line.s;
 2087|   754k|				return total_size;
 2088|  31.3M|			} else if (u[0] == '#') {
  ------------------
  |  Branch (2088:15): [True: 13.6M, False: 17.6M]
  ------------------
 2089|       |				/* Ends with comment sequence #...\n */
 2090|  13.6M|				if (nl == NULL) {
  ------------------
  |  Branch (2090:9): [True: 219, False: 13.6M]
  ------------------
 2091|       |					/* But we've not found the \n yet */
 2092|    219|					break;
 2093|    219|				}
 2094|  17.6M|			} else if (u[0] == '\\') {
  ------------------
  |  Branch (2094:15): [True: 8.34k, False: 17.6M]
  ------------------
 2095|  8.34k|				if (u[1] == '\n') {
  ------------------
  |  Branch (2095:9): [True: 652, False: 7.68k]
  ------------------
 2096|       |					/* Trim escaped newline. */
 2097|    652|					total_size -= 2;
 2098|    652|					mtree->line.s[total_size] = '\0';
 2099|    652|					break;
 2100|  7.68k|				} else if (u[1] == '\r' && u[2] == '\n') {
  ------------------
  |  Branch (2100:16): [True: 637, False: 7.05k]
  |  Branch (2100:32): [True: 220, False: 417]
  ------------------
 2101|       |					/* Trim escaped CRLF. */
 2102|    220|					total_size -= 3;
 2103|    220|					mtree->line.s[total_size] = '\0';
 2104|    220|					break;
 2105|  7.46k|				} else if (u[1] != '\0') {
  ------------------
  |  Branch (2105:16): [True: 7.45k, False: 16]
  ------------------
 2106|       |					/* Skip the two-char escape sequence */
 2107|  7.45k|					++u;
 2108|  7.45k|				}
 2109|  8.34k|			}
 2110|  32.1M|		}
 2111|   135k|		find_off = u - mtree->line.s;
 2112|   135k|	}
 2113|   757k|}
archive_read_support_format_mtree.c:process_add_entry:
  873|  58.5k|{
  874|  58.5k|	struct mtree_entry *entry;
  875|  58.5k|	struct mtree_option *iter;
  876|  58.5k|	const char *next, *eq, *name, *end;
  877|  58.5k|	size_t name_len, len;
  878|  58.5k|	int r, i;
  879|       |
  880|  58.5k|	if ((entry = malloc(sizeof(*entry))) == NULL) {
  ------------------
  |  Branch (880:6): [True: 0, False: 58.5k]
  ------------------
  881|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  882|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  883|      0|	}
  884|  58.5k|	entry->next = NULL;
  885|  58.5k|	entry->options = NULL;
  886|  58.5k|	entry->name = NULL;
  887|  58.5k|	entry->used = 0;
  888|  58.5k|	entry->full = 0;
  889|       |
  890|       |	/* Add this entry to list. */
  891|  58.5k|	if (*last_entry == NULL)
  ------------------
  |  Branch (891:6): [True: 2.50k, False: 56.0k]
  ------------------
  892|  2.50k|		mtree->entries = entry;
  893|  56.0k|	else
  894|  56.0k|		(*last_entry)->next = entry;
  895|  58.5k|	*last_entry = entry;
  896|       |
  897|  58.5k|	if (is_form_d) {
  ------------------
  |  Branch (897:6): [True: 1.38k, False: 57.1k]
  ------------------
  898|       |		/* Filename is last item on line. */
  899|       |		/* Adjust line_len to trim trailing whitespace */
  900|  3.24k|		while (line_len > 0) {
  ------------------
  |  Branch (900:10): [True: 3.24k, False: 0]
  ------------------
  901|  3.24k|			char last_character = line[line_len - 1];
  902|  3.24k|			if (last_character == '\r'
  ------------------
  |  Branch (902:8): [True: 0, False: 3.24k]
  ------------------
  903|  3.24k|			    || last_character == '\n'
  ------------------
  |  Branch (903:11): [True: 1.38k, False: 1.86k]
  ------------------
  904|  1.86k|			    || last_character == '\t'
  ------------------
  |  Branch (904:11): [True: 216, False: 1.64k]
  ------------------
  905|  1.86k|			    || last_character == ' ') {
  ------------------
  |  Branch (905:11): [True: 268, False: 1.38k]
  ------------------
  906|  1.86k|				line_len--;
  907|  1.86k|			} else {
  908|  1.38k|				break;
  909|  1.38k|			}
  910|  3.24k|		}
  911|       |		/* Name starts after the last whitespace separator */
  912|  1.38k|		name = line;
  913|  16.5k|		for (i = 0; i < line_len; i++) {
  ------------------
  |  Branch (913:15): [True: 15.1k, False: 1.38k]
  ------------------
  914|  15.1k|			if (line[i] == '\r'
  ------------------
  |  Branch (914:8): [True: 0, False: 15.1k]
  ------------------
  915|  15.1k|			    || line[i] == '\n'
  ------------------
  |  Branch (915:11): [True: 0, False: 15.1k]
  ------------------
  916|  15.1k|			    || line[i] == '\t'
  ------------------
  |  Branch (916:11): [True: 940, False: 14.2k]
  ------------------
  917|  14.2k|			    || line[i] == ' ') {
  ------------------
  |  Branch (917:11): [True: 573, False: 13.6k]
  ------------------
  918|  1.51k|				name = line + i + 1;
  919|  1.51k|			}
  920|  15.1k|		}
  921|  1.38k|		name_len = line + line_len - name;
  922|  1.38k|		end = name;
  923|  57.1k|	} else {
  924|       |		/* Filename is first item on line */
  925|  57.1k|		name_len = strcspn(line, " \t\r\n");
  926|  57.1k|		name = line;
  927|  57.1k|		line += name_len;
  928|  57.1k|		end = line + line_len;
  929|  57.1k|	}
  930|       |	/* name/name_len is the name within the line. */
  931|       |	/* line..end brackets the entire line except the name */
  932|       |
  933|  58.5k|	if ((entry->name = malloc(name_len + 1)) == NULL) {
  ------------------
  |  Branch (933:6): [True: 0, False: 58.5k]
  ------------------
  934|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  935|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  936|      0|	}
  937|       |
  938|  58.5k|	memcpy(entry->name, name, name_len);
  939|  58.5k|	entry->name[name_len] = '\0';
  940|  58.5k|	parse_escapes(entry->name, entry);
  941|       |
  942|  58.5k|	entry->next_dup = NULL;
  943|  58.5k|	if (entry->full) {
  ------------------
  |  Branch (943:6): [True: 8.25k, False: 50.2k]
  ------------------
  944|  8.25k|		if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) {
  ------------------
  |  Branch (944:7): [True: 5.18k, False: 3.07k]
  ------------------
  945|  5.18k|			struct mtree_entry *alt;
  946|  5.18k|			alt = (struct mtree_entry *)__archive_rb_tree_find_node(
  947|  5.18k|			    &mtree->rbtree, entry->name);
  948|  5.18k|			if (alt != NULL) {
  ------------------
  |  Branch (948:8): [True: 5.18k, False: 0]
  ------------------
  949|   819k|				while (alt->next_dup)
  ------------------
  |  Branch (949:12): [True: 814k, False: 5.18k]
  ------------------
  950|   814k|					alt = alt->next_dup;
  951|  5.18k|				alt->next_dup = entry;
  952|  5.18k|			}
  953|  5.18k|		}
  954|  8.25k|	}
  955|       |
  956|   118k|	for (iter = *global; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (956:23): [True: 59.7k, False: 58.5k]
  ------------------
  957|  59.7k|		r = add_option(a, &entry->options, iter->value,
  958|  59.7k|		    strlen(iter->value));
  959|  59.7k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  59.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (959:7): [True: 0, False: 59.7k]
  ------------------
  960|      0|			return (r);
  961|  59.7k|	}
  962|       |
  963|  86.6k|	for (;;) {
  964|  86.6k|		next = line + strspn(line, " \t\r\n");
  965|  86.6k|		if (*next == '\0')
  ------------------
  |  Branch (965:7): [True: 57.1k, False: 29.4k]
  ------------------
  966|  57.1k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  57.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  967|  29.4k|		if (next >= end)
  ------------------
  |  Branch (967:7): [True: 1.38k, False: 28.1k]
  ------------------
  968|  1.38k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.38k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  969|  28.1k|		line = next;
  970|  28.1k|		next = line + strcspn(line, " \t\r\n");
  971|  28.1k|		eq = strchr(line, '=');
  972|  28.1k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (972:7): [True: 18.0k, False: 10.0k]
  |  Branch (972:21): [True: 1.17k, False: 8.83k]
  ------------------
  973|  19.2k|			len = next - line;
  974|  8.83k|		else
  975|  8.83k|			len = eq - line;
  976|       |
  977|  28.1k|		remove_option(&entry->options, line, len);
  978|  28.1k|		r = add_option(a, &entry->options, line, next - line);
  979|  28.1k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  28.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (979:7): [True: 0, False: 28.1k]
  ------------------
  980|      0|			return (r);
  981|  28.1k|		line = next;
  982|  28.1k|	}
  983|  58.5k|}
archive_read_support_format_mtree.c:parse_escapes:
 1895|  59.6k|{
 1896|  59.6k|	char *dest = src;
 1897|  59.6k|	char c;
 1898|       |
 1899|  59.6k|	if (mentry != NULL && strcmp(src, ".") == 0)
  ------------------
  |  Branch (1899:6): [True: 58.5k, False: 1.13k]
  |  Branch (1899:24): [True: 2.09k, False: 56.4k]
  ------------------
 1900|  2.09k|		mentry->full = 1;
 1901|       |
 1902|  15.2M|	while (*src != '\0') {
  ------------------
  |  Branch (1902:9): [True: 15.2M, False: 59.6k]
  ------------------
 1903|  15.2M|		c = *src++;
 1904|  15.2M|		if (c == '/' && mentry != NULL)
  ------------------
  |  Branch (1904:7): [True: 8.41k, False: 15.2M]
  |  Branch (1904:19): [True: 7.75k, False: 663]
  ------------------
 1905|  7.75k|			mentry->full = 1;
 1906|  15.2M|		if (c == '\\') {
  ------------------
  |  Branch (1906:7): [True: 6.60k, False: 15.2M]
  ------------------
 1907|  6.60k|			switch (src[0]) {
  ------------------
  |  Branch (1907:12): [True: 5.96k, False: 641]
  ------------------
 1908|  1.89k|			case '0':
  ------------------
  |  Branch (1908:4): [True: 1.89k, False: 4.71k]
  ------------------
 1909|  1.89k|				if (src[1] < '0' || src[1] > '7') {
  ------------------
  |  Branch (1909:9): [True: 315, False: 1.57k]
  |  Branch (1909:25): [True: 429, False: 1.14k]
  ------------------
 1910|    744|					c = 0;
 1911|    744|					++src;
 1912|    744|					break;
 1913|    744|				}
 1914|       |				/* FALLTHROUGH */
 1915|  1.51k|			case '1':
  ------------------
  |  Branch (1915:4): [True: 365, False: 6.23k]
  ------------------
 1916|  2.23k|			case '2':
  ------------------
  |  Branch (1916:4): [True: 717, False: 5.88k]
  ------------------
 1917|  2.89k|			case '3':
  ------------------
  |  Branch (1917:4): [True: 660, False: 5.94k]
  ------------------
 1918|  2.89k|				if (src[1] >= '0' && src[1] <= '7' &&
  ------------------
  |  Branch (1918:9): [True: 2.18k, False: 709]
  |  Branch (1918:26): [True: 1.72k, False: 461]
  ------------------
 1919|  1.72k|				    src[2] >= '0' && src[2] <= '7') {
  ------------------
  |  Branch (1919:9): [True: 1.37k, False: 349]
  |  Branch (1919:26): [True: 611, False: 761]
  ------------------
 1920|    611|					c = (src[0] - '0') << 6;
 1921|    611|					c |= (src[1] - '0') << 3;
 1922|    611|					c |= (src[2] - '0');
 1923|    611|					src += 3;
 1924|    611|				}
 1925|  2.89k|				break;
 1926|    217|			case 'a':
  ------------------
  |  Branch (1926:4): [True: 217, False: 6.38k]
  ------------------
 1927|    217|				c = '\a';
 1928|    217|				++src;
 1929|    217|				break;
 1930|    246|			case 'b':
  ------------------
  |  Branch (1930:4): [True: 246, False: 6.35k]
  ------------------
 1931|    246|				c = '\b';
 1932|    246|				++src;
 1933|    246|				break;
 1934|    279|			case 'f':
  ------------------
  |  Branch (1934:4): [True: 279, False: 6.32k]
  ------------------
 1935|    279|				c = '\f';
 1936|    279|				++src;
 1937|    279|				break;
 1938|    233|			case 'n':
  ------------------
  |  Branch (1938:4): [True: 233, False: 6.37k]
  ------------------
 1939|    233|				c = '\n';
 1940|    233|				++src;
 1941|    233|				break;
 1942|    289|			case 'r':
  ------------------
  |  Branch (1942:4): [True: 289, False: 6.31k]
  ------------------
 1943|    289|				c = '\r';
 1944|    289|				++src;
 1945|    289|				break;
 1946|    221|			case 's':
  ------------------
  |  Branch (1946:4): [True: 221, False: 6.38k]
  ------------------
 1947|    221|				c = ' ';
 1948|    221|				++src;
 1949|    221|				break;
 1950|    261|			case 't':
  ------------------
  |  Branch (1950:4): [True: 261, False: 6.34k]
  ------------------
 1951|    261|				c = '\t';
 1952|    261|				++src;
 1953|    261|				break;
 1954|    231|			case 'v':
  ------------------
  |  Branch (1954:4): [True: 231, False: 6.37k]
  ------------------
 1955|    231|				c = '\v';
 1956|    231|				++src;
 1957|    231|				break;
 1958|    350|			case '\\':
  ------------------
  |  Branch (1958:4): [True: 350, False: 6.25k]
  ------------------
 1959|    350|				c = '\\';
 1960|    350|				++src;
 1961|    350|				break;
 1962|  6.60k|			}
 1963|  6.60k|		}
 1964|  15.2M|		*dest++ = c;
 1965|  15.2M|	}
 1966|  59.6k|	*dest = '\0';
 1967|  59.6k|}
archive_read_support_format_mtree.c:add_option:
  766|  99.5k|{
  767|  99.5k|	struct mtree_option *opt;
  768|       |
  769|  99.5k|	if ((opt = malloc(sizeof(*opt))) == NULL) {
  ------------------
  |  Branch (769:6): [True: 0, False: 99.5k]
  ------------------
  770|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  771|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  772|      0|	}
  773|  99.5k|	if ((opt->value = malloc(len + 1)) == NULL) {
  ------------------
  |  Branch (773:6): [True: 0, False: 99.5k]
  ------------------
  774|      0|		free(opt);
  775|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  776|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  777|      0|	}
  778|  99.5k|	memcpy(opt->value, value, len);
  779|  99.5k|	opt->value[len] = '\0';
  780|  99.5k|	opt->next = *global;
  781|  99.5k|	*global = opt;
  782|  99.5k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  99.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  783|  99.5k|}
archive_read_support_format_mtree.c:remove_option:
  787|  47.9k|{
  788|  47.9k|	struct mtree_option *iter, *last;
  789|       |
  790|  47.9k|	last = NULL;
  791|   180k|	for (iter = *global; iter != NULL; last = iter, iter = iter->next) {
  ------------------
  |  Branch (791:23): [True: 147k, False: 33.1k]
  ------------------
  792|   147k|		if (strncmp(iter->value, value, len) == 0 &&
  ------------------
  |  Branch (792:7): [True: 24.1k, False: 123k]
  ------------------
  793|  24.1k|		    (iter->value[len] == '\0' ||
  ------------------
  |  Branch (793:8): [True: 13.4k, False: 10.6k]
  ------------------
  794|  10.6k|		     iter->value[len] == '='))
  ------------------
  |  Branch (794:8): [True: 1.43k, False: 9.23k]
  ------------------
  795|  14.8k|			break;
  796|   147k|	}
  797|  47.9k|	if (iter == NULL)
  ------------------
  |  Branch (797:6): [True: 33.1k, False: 14.8k]
  ------------------
  798|  33.1k|		return;
  799|  14.8k|	if (last == NULL)
  ------------------
  |  Branch (799:6): [True: 5.17k, False: 9.68k]
  ------------------
  800|  5.17k|		*global = iter->next;
  801|  9.68k|	else
  802|  9.68k|		last->next = iter->next;
  803|       |
  804|  14.8k|	free(iter->value);
  805|  14.8k|	free(iter);
  806|  14.8k|}
archive_read_support_format_mtree.c:process_global_set:
  811|  2.66k|{
  812|  2.66k|	const char *next, *eq;
  813|  2.66k|	size_t len;
  814|  2.66k|	int r;
  815|       |
  816|  2.66k|	line += 4;
  817|  14.3k|	for (;;) {
  818|  14.3k|		next = line + strspn(line, " \t\r\n");
  819|  14.3k|		if (*next == '\0')
  ------------------
  |  Branch (819:7): [True: 2.66k, False: 11.6k]
  ------------------
  820|  2.66k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  821|  11.6k|		line = next;
  822|  11.6k|		next = line + strcspn(line, " \t\r\n");
  823|  11.6k|		eq = strchr(line, '=');
  824|  11.6k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (824:7): [True: 8.18k, False: 3.47k]
  |  Branch (824:21): [True: 1.54k, False: 1.92k]
  ------------------
  825|  9.73k|			len = next - line;
  826|  1.92k|		else
  827|  1.92k|			len = eq - line;
  828|       |
  829|  11.6k|		remove_option(global, line, len);
  830|  11.6k|		r = add_option(a, global, line, next - line);
  831|  11.6k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (831:7): [True: 0, False: 11.6k]
  ------------------
  832|      0|			return (r);
  833|  11.6k|		line = next;
  834|  11.6k|	}
  835|  2.66k|}
archive_read_support_format_mtree.c:process_global_unset:
  840|  1.36k|{
  841|  1.36k|	const char *next;
  842|  1.36k|	size_t len;
  843|       |
  844|  1.36k|	line += 6;
  845|  1.36k|	if (strchr(line, '=') != NULL) {
  ------------------
  |  Branch (845:6): [True: 12, False: 1.34k]
  ------------------
  846|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  847|     12|		    "/unset shall not contain `='");
  848|     12|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  849|     12|	}
  850|       |
  851|  10.3k|	for (;;) {
  852|  10.3k|		next = line + strspn(line, " \t\r\n");
  853|  10.3k|		if (*next == '\0')
  ------------------
  |  Branch (853:7): [True: 1.34k, False: 8.97k]
  ------------------
  854|  1.34k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  855|  8.97k|		line = next;
  856|  8.97k|		len = strcspn(line, " \t\r\n");
  857|       |
  858|  8.97k|		if (len == 3 && strncmp(line, "all", 3) == 0) {
  ------------------
  |  Branch (858:7): [True: 1.69k, False: 7.28k]
  |  Branch (858:19): [True: 759, False: 931]
  ------------------
  859|    759|			free_options(*global);
  860|    759|			*global = NULL;
  861|  8.21k|		} else {
  862|  8.21k|			remove_option(global, line, len);
  863|  8.21k|		}
  864|       |
  865|  8.97k|		line += len;
  866|  8.97k|	}
  867|  1.34k|}
archive_read_support_format_mtree.c:parse_file:
 1128|  49.8k|{
 1129|  49.8k|	const char *path;
 1130|  49.8k|	la_seek_stat_t st_storage, *st;
 1131|  49.8k|	struct mtree_entry *mp;
 1132|  49.8k|	struct archive_entry *sparse_entry;
 1133|  49.8k|	int r = ARCHIVE_OK, r1, parsed_kws;
  ------------------
  |  |  233|  49.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1134|       |
 1135|  49.8k|	mentry->used = 1;
 1136|       |
 1137|       |	/* Initialize reasonable defaults. */
 1138|  49.8k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  49.8k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1139|  49.8k|	archive_entry_set_size(entry, 0);
 1140|  49.8k|	archive_string_empty(&mtree->contents_name);
  ------------------
  |  |  181|  49.8k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1141|       |
 1142|       |	/* Parse options from this line. */
 1143|  49.8k|	parsed_kws = 0;
 1144|  49.8k|	r = parse_line(a, entry, mtree, mentry, &parsed_kws);
 1145|       |
 1146|  49.8k|	if (mentry->full) {
  ------------------
  |  Branch (1146:6): [True: 2.75k, False: 47.0k]
  ------------------
 1147|  2.75k|		archive_entry_copy_pathname(entry, mentry->name);
 1148|       |		/*
 1149|       |		 * "Full" entries are allowed to have multiple lines
 1150|       |		 * and those lines aren't required to be adjacent.  We
 1151|       |		 * don't support multiple lines for "relative" entries
 1152|       |		 * nor do we make any attempt to merge data from
 1153|       |		 * separate "relative" and "full" entries.  (Merging
 1154|       |		 * "relative" and "full" entries would require dealing
 1155|       |		 * with pathname canonicalization, which is a very
 1156|       |		 * tricky subject.)
 1157|       |		 */
 1158|  2.75k|		mp = (struct mtree_entry *)__archive_rb_tree_find_node(
 1159|  2.75k|		    &mtree->rbtree, mentry->name);
 1160|  9.51k|		for (; mp; mp = mp->next_dup) {
  ------------------
  |  Branch (1160:10): [True: 6.76k, False: 2.75k]
  ------------------
 1161|  6.76k|			if (mp->full && !mp->used) {
  ------------------
  |  Branch (1161:8): [True: 6.76k, False: 0]
  |  Branch (1161:20): [True: 4.01k, False: 2.75k]
  ------------------
 1162|       |				/* Later lines override earlier ones. */
 1163|  4.01k|				mp->used = 1;
 1164|  4.01k|				r1 = parse_line(a, entry, mtree, mp, &parsed_kws);
 1165|  4.01k|				if (r1 < r)
  ------------------
  |  Branch (1165:9): [True: 13, False: 4.00k]
  ------------------
 1166|     13|					r = r1;
 1167|  4.01k|			}
 1168|  6.76k|		}
 1169|  47.0k|	} else {
 1170|       |		/*
 1171|       |		 * Relative entries require us to construct
 1172|       |		 * the full path and possibly update the
 1173|       |		 * current directory.
 1174|       |		 */
 1175|  47.0k|		size_t n = archive_strlen(&mtree->current_dir);
  ------------------
  |  |  178|  47.0k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1176|  47.0k|		if (n > 0)
  ------------------
  |  Branch (1176:7): [True: 914, False: 46.1k]
  ------------------
 1177|    914|			archive_strcat(&mtree->current_dir, "/");
 1178|  47.0k|		archive_strcat(&mtree->current_dir, mentry->name);
 1179|  47.0k|		archive_entry_copy_pathname(entry, mtree->current_dir.s);
 1180|  47.0k|		if (archive_entry_filetype(entry) != AE_IFDIR)
  ------------------
  |  |  221|  47.0k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1180:7): [True: 45.9k, False: 1.07k]
  ------------------
 1181|  45.9k|			mtree->current_dir.length = n;
 1182|  47.0k|	}
 1183|       |
 1184|  49.8k|	if (mtree->checkfs) {
  ------------------
  |  Branch (1184:6): [True: 0, False: 49.8k]
  ------------------
 1185|       |		/*
 1186|       |		 * Try to open and stat the file to get the real size
 1187|       |		 * and other file info.  It would be nice to avoid
 1188|       |		 * this here so that getting a listing of an mtree
 1189|       |		 * wouldn't require opening every referenced contents
 1190|       |		 * file.  But then we wouldn't know the actual
 1191|       |		 * contents size, so I don't see a really viable way
 1192|       |		 * around this.  (Also, we may want to someday pull
 1193|       |		 * other unspecified info from the contents file on
 1194|       |		 * disk.)
 1195|       |		 */
 1196|      0|		mtree->fd = -1;
 1197|      0|		if (archive_strlen(&mtree->contents_name) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1197:7): [True: 0, False: 0]
  ------------------
 1198|      0|			path = mtree->contents_name.s;
 1199|      0|		else
 1200|      0|			path = archive_entry_pathname(entry);
 1201|       |
 1202|      0|		if (archive_entry_filetype(entry) == AE_IFREG ||
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1202:7): [True: 0, False: 0]
  ------------------
 1203|      0|				archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1203:5): [True: 0, False: 0]
  ------------------
 1204|      0|			mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC);
  ------------------
  |  |   63|      0|#define	O_BINARY 0
  ------------------
 1205|      0|			__archive_ensure_cloexec_flag(mtree->fd);
 1206|      0|			if (mtree->fd == -1 && (
  ------------------
  |  Branch (1206:8): [True: 0, False: 0]
  ------------------
 1207|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1208|       |        /*
 1209|       |         * On Windows, attempting to open a file with an
 1210|       |         * invalid name result in EINVAL (Error 22)
 1211|       |         */
 1212|       |				(errno != ENOENT && errno != EINVAL)
 1213|       |#else
 1214|      0|				errno != ENOENT
  ------------------
  |  Branch (1214:5): [True: 0, False: 0]
  ------------------
 1215|      0|#endif
 1216|      0|        || archive_strlen(&mtree->contents_name) > 0)) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1216:12): [True: 0, False: 0]
  ------------------
 1217|      0|				archive_set_error(&a->archive, errno,
 1218|      0|						"Can't open %s", path);
 1219|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1220|      0|			}
 1221|      0|		}
 1222|       |
 1223|      0|		st = &st_storage;
 1224|      0|		if (mtree->fd >= 0) {
  ------------------
  |  Branch (1224:7): [True: 0, False: 0]
  ------------------
 1225|      0|			if (la_seek_fstat(mtree->fd, st) == -1) {
  ------------------
  |  |   41|      0|#define la_seek_fstat(fd, st)	fstat((fd), (st))
  ------------------
  |  Branch (1225:8): [True: 0, False: 0]
  ------------------
 1226|      0|				archive_set_error(&a->archive, errno,
 1227|      0|						"Could not fstat %s", path);
 1228|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1229|       |				/* If we can't stat it, don't keep it open. */
 1230|      0|				close(mtree->fd);
 1231|      0|				mtree->fd = -1;
 1232|      0|				st = NULL;
 1233|      0|			}
 1234|      0|		}
 1235|      0|#ifdef HAVE_LSTAT
 1236|      0|		else if (lstat(path, st) == -1)
  ------------------
  |  Branch (1236:12): [True: 0, False: 0]
  ------------------
 1237|       |#else
 1238|       |		else if (la_seek_stat(path, st) == -1)
 1239|       |#endif
 1240|      0|		{
 1241|      0|			st = NULL;
 1242|      0|		}
 1243|       |
 1244|       |		/*
 1245|       |		 * Check for a mismatch between the type in the specification
 1246|       |		 * and the type of the contents object on disk.
 1247|       |		 */
 1248|      0|		if (st != NULL) {
  ------------------
  |  Branch (1248:7): [True: 0, False: 0]
  ------------------
 1249|      0|			if (((st->st_mode & S_IFMT) == S_IFREG &&
  ------------------
  |  Branch (1249:9): [True: 0, False: 0]
  ------------------
 1250|      0|			      archive_entry_filetype(entry) == AE_IFREG)
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1250:10): [True: 0, False: 0]
  ------------------
 1251|      0|#ifdef S_IFLNK
 1252|      0|			  ||((st->st_mode & S_IFMT) == S_IFLNK &&
  ------------------
  |  Branch (1252:9): [True: 0, False: 0]
  ------------------
 1253|      0|			      archive_entry_filetype(entry) == AE_IFLNK)
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1253:10): [True: 0, False: 0]
  ------------------
 1254|      0|#endif
 1255|      0|#ifdef S_IFSOCK
 1256|      0|			  ||((st->st_mode & S_IFSOCK) == S_IFSOCK &&
  ------------------
  |  Branch (1256:9): [True: 0, False: 0]
  ------------------
 1257|      0|			      archive_entry_filetype(entry) == AE_IFSOCK)
  ------------------
  |  |  218|      0|#define AE_IFSOCK	((__LA_MODE_T)0140000)
  ------------------
  |  Branch (1257:10): [True: 0, False: 0]
  ------------------
 1258|      0|#endif
 1259|      0|#ifdef S_IFCHR
 1260|      0|			  ||((st->st_mode & S_IFMT) == S_IFCHR &&
  ------------------
  |  Branch (1260:9): [True: 0, False: 0]
  ------------------
 1261|      0|			      archive_entry_filetype(entry) == AE_IFCHR)
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1261:10): [True: 0, False: 0]
  ------------------
 1262|      0|#endif
 1263|      0|#ifdef S_IFBLK
 1264|      0|			  ||((st->st_mode & S_IFMT) == S_IFBLK &&
  ------------------
  |  Branch (1264:9): [True: 0, False: 0]
  ------------------
 1265|      0|			      archive_entry_filetype(entry) == AE_IFBLK)
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1265:10): [True: 0, False: 0]
  ------------------
 1266|      0|#endif
 1267|      0|			  ||((st->st_mode & S_IFMT) == S_IFDIR &&
  ------------------
  |  Branch (1267:9): [True: 0, False: 0]
  ------------------
 1268|      0|			      archive_entry_filetype(entry) == AE_IFDIR)
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1268:10): [True: 0, False: 0]
  ------------------
 1269|      0|#ifdef S_IFIFO
 1270|      0|			  ||((st->st_mode & S_IFMT) == S_IFIFO &&
  ------------------
  |  Branch (1270:9): [True: 0, False: 0]
  ------------------
 1271|      0|			      archive_entry_filetype(entry) == AE_IFIFO)
  ------------------
  |  |  222|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1271:10): [True: 0, False: 0]
  ------------------
 1272|      0|#endif
 1273|      0|			) {
 1274|       |				/* Types match. */
 1275|      0|			} else {
 1276|       |				/* Types don't match; bail out gracefully. */
 1277|      0|				if (mtree->fd >= 0)
  ------------------
  |  Branch (1277:9): [True: 0, False: 0]
  ------------------
 1278|      0|					close(mtree->fd);
 1279|      0|				mtree->fd = -1;
 1280|      0|				if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   81|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1280:9): [True: 0, False: 0]
  ------------------
 1281|       |					/* It's not an error for an optional
 1282|       |					 * entry to not match disk. */
 1283|      0|					*use_next = 1;
 1284|      0|				} else if (r == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1284:16): [True: 0, False: 0]
  ------------------
 1285|      0|					archive_set_error(&a->archive,
 1286|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1287|      0|					    "mtree specification has different"
 1288|      0|					    " type for %s",
 1289|      0|					    archive_entry_pathname(entry));
 1290|      0|					r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1291|      0|				}
 1292|      0|				return (r);
 1293|      0|			}
 1294|      0|		}
 1295|       |
 1296|       |		/*
 1297|       |		 * If there is a contents file on disk, pick some of the
 1298|       |		 * metadata from that file.  For most of these, we only
 1299|       |		 * set it from the contents if it wasn't already parsed
 1300|       |		 * from the specification.
 1301|       |		 */
 1302|      0|		if (st != NULL) {
  ------------------
  |  Branch (1302:7): [True: 0, False: 0]
  ------------------
 1303|      0|			if (((parsed_kws & MTREE_HAS_DEVICE) == 0 ||
  ------------------
  |  |   69|      0|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
  |  Branch (1303:9): [True: 0, False: 0]
  ------------------
 1304|      0|				(parsed_kws & MTREE_HAS_NOCHANGE) != 0) &&
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1304:5): [True: 0, False: 0]
  ------------------
 1305|      0|				(archive_entry_filetype(entry) == AE_IFCHR ||
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1305:6): [True: 0, False: 0]
  ------------------
 1306|      0|				 archive_entry_filetype(entry) == AE_IFBLK))
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1306:6): [True: 0, False: 0]
  ------------------
 1307|      0|				archive_entry_set_rdev(entry, st->st_rdev);
 1308|      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 (1308:8): [True: 0, False: 0]
  ------------------
 1309|      0|				== 0 ||
 1310|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1310:8): [True: 0, False: 0]
  ------------------
 1311|      0|				archive_entry_set_gid(entry, st->st_gid);
 1312|      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 (1312:8): [True: 0, False: 0]
  ------------------
 1313|      0|				== 0 ||
 1314|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1314:8): [True: 0, False: 0]
  ------------------
 1315|      0|				archive_entry_set_uid(entry, st->st_uid);
 1316|      0|			if ((parsed_kws & MTREE_HAS_MTIME) == 0 ||
  ------------------
  |  |   73|      0|#define	MTREE_HAS_MTIME		0x0010
  ------------------
  |  Branch (1316:8): [True: 0, False: 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|       |#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
 1319|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1320|       |						st->st_mtimespec.tv_nsec);
 1321|       |#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
 1322|      0|				archive_entry_set_mtime(entry, st->st_mtime,
 1323|      0|						st->st_mtim.tv_nsec);
 1324|       |#elif HAVE_STRUCT_STAT_ST_MTIME_N
 1325|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1326|       |						st->st_mtime_n);
 1327|       |#elif HAVE_STRUCT_STAT_ST_UMTIME
 1328|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1329|       |						st->st_umtime*1000);
 1330|       |#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
 1331|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1332|       |						st->st_mtime_usec*1000);
 1333|       |#else
 1334|       |				archive_entry_set_mtime(entry, st->st_mtime, 0);
 1335|       |#endif
 1336|      0|			}
 1337|      0|			if ((parsed_kws & MTREE_HAS_NLINK) == 0 ||
  ------------------
  |  |   74|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
  |  Branch (1337:8): [True: 0, False: 0]
  ------------------
 1338|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1338:8): [True: 0, False: 0]
  ------------------
 1339|      0|				archive_entry_set_nlink(entry, st->st_nlink);
 1340|      0|			if ((parsed_kws & MTREE_HAS_PERM) == 0 ||
  ------------------
  |  |   75|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
  |  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_perm(entry, st->st_mode);
 1343|      0|			if ((parsed_kws & MTREE_HAS_SIZE) == 0 ||
  ------------------
  |  |   76|      0|#define	MTREE_HAS_SIZE		0x0080
  ------------------
  |  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_size(entry, st->st_size);
 1346|      0|			archive_entry_set_ino(entry, st->st_ino);
 1347|      0|			archive_entry_set_dev(entry, st->st_dev);
 1348|       |
 1349|      0|			archive_entry_linkify(mtree->resolver, &entry,
 1350|      0|				&sparse_entry);
 1351|      0|		} else if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   81|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1351:14): [True: 0, False: 0]
  ------------------
 1352|       |			/*
 1353|       |			 * Couldn't open the entry, stat it or the on-disk type
 1354|       |			 * didn't match.  If this entry is optional, just
 1355|       |			 * ignore it and read the next header entry.
 1356|       |			 */
 1357|      0|			*use_next = 1;
 1358|      0|			return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1359|      0|		}
 1360|      0|	}
 1361|       |
 1362|  49.8k|	mtree->cur_size = archive_entry_size(entry);
 1363|  49.8k|	mtree->offset = 0;
 1364|       |
 1365|  49.8k|	return r;
 1366|  49.8k|}
archive_read_support_format_mtree.c:parse_line:
 1374|  53.8k|{
 1375|  53.8k|	struct mtree_option *iter;
 1376|  53.8k|	int r = ARCHIVE_OK, r1;
  ------------------
  |  |  233|  53.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1377|       |
 1378|   129k|	for (iter = mp->options; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1378:27): [True: 76.0k, False: 53.8k]
  ------------------
 1379|  76.0k|		r1 = parse_keyword(a, mtree, entry, iter, parsed_kws);
 1380|  76.0k|		if (r1 < r)
  ------------------
  |  Branch (1380:7): [True: 29.1k, False: 46.8k]
  ------------------
 1381|  29.1k|			r = r1;
 1382|  76.0k|	}
 1383|  53.8k|	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |  233|   107k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |   77|  24.6k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
  |  Branch (1383:6): [True: 24.6k, False: 29.1k]
  |  Branch (1383:25): [True: 23.2k, False: 1.44k]
  ------------------
 1384|  23.2k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  23.2k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1385|  23.2k|		    "Missing type keyword in mtree specification");
 1386|  23.2k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  23.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1387|  23.2k|	}
 1388|  30.6k|	return (r);
 1389|  53.8k|}
archive_read_support_format_mtree.c:parse_keyword:
 1555|  76.0k|{
 1556|  76.0k|	char *val, *key;
 1557|       |
 1558|  76.0k|	key = opt->value;
 1559|       |
 1560|  76.0k|	if (*key == '\0')
  ------------------
  |  Branch (1560:6): [True: 0, False: 76.0k]
  ------------------
 1561|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1562|       |
 1563|  76.0k|	if (strcmp(key, "nochange") == 0) {
  ------------------
  |  Branch (1563:6): [True: 255, False: 75.7k]
  ------------------
 1564|    255|		*parsed_kws |= MTREE_HAS_NOCHANGE;
  ------------------
  |  |   82|    255|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
 1565|    255|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    255|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1566|    255|	}
 1567|  75.7k|	if (strcmp(key, "optional") == 0) {
  ------------------
  |  Branch (1567:6): [True: 426, False: 75.3k]
  ------------------
 1568|    426|		*parsed_kws |= MTREE_HAS_OPTIONAL;
  ------------------
  |  |   81|    426|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
 1569|    426|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    426|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1570|    426|	}
 1571|  75.3k|	if (strcmp(key, "ignore") == 0) {
  ------------------
  |  Branch (1571:6): [True: 80, False: 75.2k]
  ------------------
 1572|       |		/*
 1573|       |		 * The mtree processing is not recursive, so
 1574|       |		 * recursion will only happen for explicitly listed
 1575|       |		 * entries.
 1576|       |		 */
 1577|     80|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     80|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1578|     80|	}
 1579|       |
 1580|  75.2k|	val = strchr(key, '=');
 1581|  75.2k|	if (val == NULL) {
  ------------------
  |  Branch (1581:6): [True: 32.5k, False: 42.6k]
  ------------------
 1582|  32.5k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  32.5k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1583|  32.5k|		    "Malformed attribute \"%s\" (%d)", key, key[0]);
 1584|  32.5k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  32.5k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1585|  32.5k|	}
 1586|       |
 1587|  42.6k|	*val = '\0';
 1588|  42.6k|	++val;
 1589|       |
 1590|  42.6k|	switch (key[0]) {
 1591|  1.04k|	case 'c':
  ------------------
  |  Branch (1591:2): [True: 1.04k, False: 41.6k]
  ------------------
 1592|  1.04k|		if (strcmp(key, "content") == 0
  ------------------
  |  Branch (1592:7): [True: 275, False: 773]
  ------------------
 1593|    773|		    || strcmp(key, "contents") == 0) {
  ------------------
  |  Branch (1593:10): [True: 395, False: 378]
  ------------------
 1594|    670|			parse_escapes(val, NULL);
 1595|    670|			archive_strcpy(&mtree->contents_name, val);
  ------------------
  |  |  165|    670|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  1.34k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 670]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1596|    670|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    670|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1597|    670|		}
 1598|    378|		if (strcmp(key, "cksum") == 0)
  ------------------
  |  Branch (1598:7): [True: 227, False: 151]
  ------------------
 1599|    227|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    227|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1600|    151|		break;
 1601|  8.38k|	case 'd':
  ------------------
  |  Branch (1601:2): [True: 8.38k, False: 34.2k]
  ------------------
 1602|  8.38k|		if (strcmp(key, "device") == 0) {
  ------------------
  |  Branch (1602:7): [True: 7.36k, False: 1.02k]
  ------------------
 1603|       |			/* stat(2) st_rdev field, e.g. the major/minor IDs
 1604|       |			 * of a char/block special file */
 1605|  7.36k|			int r;
 1606|  7.36k|			dev_t dev;
 1607|       |
 1608|  7.36k|			*parsed_kws |= MTREE_HAS_DEVICE;
  ------------------
  |  |   69|  7.36k|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
 1609|  7.36k|			r = parse_device(&dev, &a->archive, val);
 1610|  7.36k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  7.36k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1610:8): [True: 1.85k, False: 5.50k]
  ------------------
 1611|  1.85k|				archive_entry_set_rdev(entry, dev);
 1612|  7.36k|			return r;
 1613|  7.36k|		}
 1614|  1.02k|		break;
 1615|  2.20k|	case 'f':
  ------------------
  |  Branch (1615:2): [True: 2.20k, False: 40.4k]
  ------------------
 1616|  2.20k|		if (strcmp(key, "flags") == 0) {
  ------------------
  |  Branch (1616:7): [True: 1.45k, False: 743]
  ------------------
 1617|  1.45k|			*parsed_kws |= MTREE_HAS_FFLAGS;
  ------------------
  |  |   70|  1.45k|#define	MTREE_HAS_FFLAGS	0x0002
  ------------------
 1618|  1.45k|			archive_entry_copy_fflags_text(entry, val);
 1619|  1.45k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1620|  1.45k|		}
 1621|    743|		break;
 1622|  1.18k|	case 'g':
  ------------------
  |  Branch (1622:2): [True: 1.18k, False: 41.4k]
  ------------------
 1623|  1.18k|		if (strcmp(key, "gid") == 0) {
  ------------------
  |  Branch (1623:7): [True: 521, False: 667]
  ------------------
 1624|    521|			*parsed_kws |= MTREE_HAS_GID;
  ------------------
  |  |   71|    521|#define	MTREE_HAS_GID		0x0004
  ------------------
 1625|    521|			archive_entry_set_gid(entry, mtree_atol(&val, 10));
 1626|    521|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    521|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1627|    521|		}
 1628|    667|		if (strcmp(key, "gname") == 0) {
  ------------------
  |  Branch (1628:7): [True: 216, False: 451]
  ------------------
 1629|    216|			*parsed_kws |= MTREE_HAS_GNAME;
  ------------------
  |  |   72|    216|#define	MTREE_HAS_GNAME		0x0008
  ------------------
 1630|    216|			archive_entry_copy_gname(entry, val);
 1631|    216|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    216|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1632|    216|		}
 1633|    451|		break;
 1634|    827|	case 'i':
  ------------------
  |  Branch (1634:2): [True: 827, False: 41.8k]
  ------------------
 1635|    827|		if (strcmp(key, "inode") == 0) {
  ------------------
  |  Branch (1635:7): [True: 576, False: 251]
  ------------------
 1636|    576|			archive_entry_set_ino(entry, mtree_atol(&val, 10));
 1637|    576|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    576|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1638|    576|		}
 1639|    251|		break;
 1640|  1.28k|	case 'l':
  ------------------
  |  Branch (1640:2): [True: 1.28k, False: 41.3k]
  ------------------
 1641|  1.28k|		if (strcmp(key, "link") == 0) {
  ------------------
  |  Branch (1641:7): [True: 466, False: 823]
  ------------------
 1642|    466|			parse_escapes(val, NULL);
 1643|    466|			archive_entry_copy_symlink(entry, val);
 1644|    466|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    466|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1645|    466|		}
 1646|    823|		break;
 1647|  2.63k|	case 'm':
  ------------------
  |  Branch (1647:2): [True: 2.63k, False: 40.0k]
  ------------------
 1648|  2.63k|		if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) {
  ------------------
  |  Branch (1648:7): [True: 1.08k, False: 1.55k]
  |  Branch (1648:34): [True: 384, False: 1.16k]
  ------------------
 1649|  1.46k|			return parse_digest(a, entry, val,
 1650|  1.46k|			    ARCHIVE_ENTRY_DIGEST_MD5);
  ------------------
  |  |  444|  1.46k|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
 1651|  1.46k|		}
 1652|  1.16k|		if (strcmp(key, "mode") == 0) {
  ------------------
  |  Branch (1652:7): [True: 788, False: 378]
  ------------------
 1653|    788|			if (val[0] < '0' || val[0] > '7') {
  ------------------
  |  Branch (1653:8): [True: 252, False: 536]
  |  Branch (1653:24): [True: 312, False: 224]
  ------------------
 1654|    564|				archive_set_error(&a->archive,
 1655|    564|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    564|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1656|    564|				    "Symbolic or non-octal mode \"%s\" unsupported", val);
 1657|    564|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|    564|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1658|    564|			}
 1659|    224|			*parsed_kws |= MTREE_HAS_PERM;
  ------------------
  |  |   75|    224|#define	MTREE_HAS_PERM		0x0040
  ------------------
 1660|    224|			archive_entry_set_perm(entry, (mode_t)mtree_atol(&val, 8));
 1661|    224|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1662|    788|		}
 1663|    378|		break;
 1664|    471|	case 'n':
  ------------------
  |  Branch (1664:2): [True: 471, False: 42.1k]
  ------------------
 1665|    471|		if (strcmp(key, "nlink") == 0) {
  ------------------
  |  Branch (1665:7): [True: 160, False: 311]
  ------------------
 1666|    160|			*parsed_kws |= MTREE_HAS_NLINK;
  ------------------
  |  |   74|    160|#define	MTREE_HAS_NLINK		0x0020
  ------------------
 1667|    160|			archive_entry_set_nlink(entry,
 1668|    160|				(unsigned int)mtree_atol(&val, 10));
 1669|    160|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    160|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1670|    160|		}
 1671|    311|		break;
 1672|  7.40k|	case 'r':
  ------------------
  |  Branch (1672:2): [True: 7.40k, False: 35.2k]
  ------------------
 1673|  7.40k|		if (strcmp(key, "resdevice") == 0) {
  ------------------
  |  Branch (1673:7): [True: 6.00k, False: 1.39k]
  ------------------
 1674|       |			/* stat(2) st_dev field, e.g. the device ID where the
 1675|       |			 * inode resides */
 1676|  6.00k|			int r;
 1677|  6.00k|			dev_t dev;
 1678|       |
 1679|  6.00k|			r = parse_device(&dev, &a->archive, val);
 1680|  6.00k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  6.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1680:8): [True: 1.20k, False: 4.80k]
  ------------------
 1681|  1.20k|				archive_entry_set_dev(entry, dev);
 1682|  6.00k|			return r;
 1683|  6.00k|		}
 1684|  1.39k|		if (strcmp(key, "rmd160") == 0 ||
  ------------------
  |  Branch (1684:7): [True: 403, False: 993]
  ------------------
 1685|    993|		    strcmp(key, "rmd160digest") == 0) {
  ------------------
  |  Branch (1685:7): [True: 323, False: 670]
  ------------------
 1686|    726|			return parse_digest(a, entry, val,
 1687|    726|			    ARCHIVE_ENTRY_DIGEST_RMD160);
  ------------------
  |  |  445|    726|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
 1688|    726|		}
 1689|    670|		break;
 1690|  5.16k|	case 's':
  ------------------
  |  Branch (1690:2): [True: 5.16k, False: 37.4k]
  ------------------
 1691|  5.16k|		if (strcmp(key, "sha1") == 0 ||
  ------------------
  |  Branch (1691:7): [True: 1.49k, False: 3.66k]
  ------------------
 1692|  3.66k|		    strcmp(key, "sha1digest") == 0) {
  ------------------
  |  Branch (1692:7): [True: 292, False: 3.37k]
  ------------------
 1693|  1.79k|			return parse_digest(a, entry, val,
 1694|  1.79k|			    ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  446|  1.79k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
 1695|  1.79k|		}
 1696|  3.37k|		if (strcmp(key, "sha256") == 0 ||
  ------------------
  |  Branch (1696:7): [True: 296, False: 3.07k]
  ------------------
 1697|  3.07k|		    strcmp(key, "sha256digest") == 0) {
  ------------------
  |  Branch (1697:7): [True: 227, False: 2.85k]
  ------------------
 1698|    523|			return parse_digest(a, entry, val,
 1699|    523|			    ARCHIVE_ENTRY_DIGEST_SHA256);
  ------------------
  |  |  447|    523|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
 1700|    523|		}
 1701|  2.85k|		if (strcmp(key, "sha384") == 0 ||
  ------------------
  |  Branch (1701:7): [True: 203, False: 2.64k]
  ------------------
 1702|  2.64k|		    strcmp(key, "sha384digest") == 0) {
  ------------------
  |  Branch (1702:7): [True: 329, False: 2.31k]
  ------------------
 1703|    532|			return parse_digest(a, entry, val,
 1704|    532|			    ARCHIVE_ENTRY_DIGEST_SHA384);
  ------------------
  |  |  448|    532|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
 1705|    532|		}
 1706|  2.31k|		if (strcmp(key, "sha512") == 0 ||
  ------------------
  |  Branch (1706:7): [True: 486, False: 1.83k]
  ------------------
 1707|  1.83k|		    strcmp(key, "sha512digest") == 0) {
  ------------------
  |  Branch (1707:7): [True: 273, False: 1.56k]
  ------------------
 1708|    759|			return parse_digest(a, entry, val,
 1709|    759|			    ARCHIVE_ENTRY_DIGEST_SHA512);
  ------------------
  |  |  449|    759|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
 1710|    759|		}
 1711|  1.56k|		if (strcmp(key, "size") == 0) {
  ------------------
  |  Branch (1711:7): [True: 571, False: 989]
  ------------------
 1712|    571|			archive_entry_set_size(entry, mtree_atol(&val, 10));
 1713|    571|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    571|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1714|    571|		}
 1715|    989|		break;
 1716|  9.85k|	case 't':
  ------------------
  |  Branch (1716:2): [True: 9.85k, False: 32.7k]
  ------------------
 1717|  9.85k|		if (strcmp(key, "tags") == 0) {
  ------------------
  |  Branch (1717:7): [True: 331, False: 9.52k]
  ------------------
 1718|       |			/*
 1719|       |			 * Comma delimited list of tags.
 1720|       |			 * Ignore the tags for now, but the interface
 1721|       |			 * should be extended to allow inclusion/exclusion.
 1722|       |			 */
 1723|    331|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    331|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1724|    331|		}
 1725|  9.52k|		if (strcmp(key, "time") == 0) {
  ------------------
  |  Branch (1725:7): [True: 4.58k, False: 4.93k]
  ------------------
 1726|  4.58k|			int64_t m;
 1727|  4.58k|			long ns = 0;
 1728|       |
 1729|  4.58k|			*parsed_kws |= MTREE_HAS_MTIME;
  ------------------
  |  |   73|  4.58k|#define	MTREE_HAS_MTIME		0x0010
  ------------------
 1730|  4.58k|			m = mtree_atol(&val, 10);
 1731|       |			/* Replicate an old mtree bug:
 1732|       |			 * 123456789.1 represents 123456789
 1733|       |			 * seconds and 1 nanosecond. */
 1734|  4.58k|			if (*val == '.') {
  ------------------
  |  Branch (1734:8): [True: 4.03k, False: 550]
  ------------------
 1735|  4.03k|				int64_t v;
 1736|       |
 1737|  4.03k|				++val;
 1738|  4.03k|				v = mtree_atol(&val, 10);
 1739|  4.03k|				if (v < 0)
  ------------------
  |  Branch (1739:9): [True: 2.02k, False: 2.01k]
  ------------------
 1740|  2.02k|					ns = 0;
 1741|  2.01k|				else if (v > 999999999)
  ------------------
  |  Branch (1741:14): [True: 1.57k, False: 443]
  ------------------
 1742|  1.57k|					ns = 999999999;
 1743|    443|				else
 1744|    443|					ns = (long)v;
 1745|  4.03k|			}
 1746|  4.58k|			if (m > TIME_MAX)
  ------------------
  |  |  251|  4.58k|#define TIME_MAX (((time_t)0 < (time_t)-1) ? (time_t)~0 :		\
  |  |  ------------------
  |  |  |  Branch (251:19): [Folded, False: 4.58k]
  |  |  ------------------
  |  |  252|  4.58k|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MAX :	\
  |  |  ------------------
  |  |  |  Branch (252:6): [True: 4.58k, Folded]
  |  |  ------------------
  |  |  253|  4.58k|	    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 (1746:8): [True: 0, False: 4.58k]
  ------------------
 1747|      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 */)
  ------------------
 1748|  4.58k|			else if (m < TIME_MIN)
  ------------------
  |  |  259|  4.58k|#define TIME_MIN (((time_t)0 < (time_t)-1) ? (time_t)0 :		\
  |  |  ------------------
  |  |  |  Branch (259:19): [Folded, False: 4.58k]
  |  |  ------------------
  |  |  260|  4.58k|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MIN :	\
  |  |  ------------------
  |  |  |  Branch (260:6): [True: 4.58k, Folded]
  |  |  ------------------
  |  |  261|  4.58k|	    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 (1748:13): [True: 0, False: 4.58k]
  ------------------
 1749|      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 */)
  ------------------
 1750|  4.58k|			archive_entry_set_mtime(entry, (time_t)m, ns);
 1751|  4.58k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1752|  4.58k|		}
 1753|  4.93k|		if (strcmp(key, "type") == 0) {
  ------------------
  |  Branch (1753:7): [True: 4.15k, False: 780]
  ------------------
 1754|  4.15k|			switch (val[0]) {
 1755|    304|			case 'b':
  ------------------
  |  Branch (1755:4): [True: 304, False: 3.85k]
  ------------------
 1756|    304|				if (strcmp(val, "block") == 0) {
  ------------------
  |  Branch (1756:9): [True: 0, False: 304]
  ------------------
 1757|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1758|      0|					archive_entry_set_filetype(entry,
 1759|      0|						AE_IFBLK);
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1760|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1761|      0|				}
 1762|    304|				break;
 1763|    502|			case 'c':
  ------------------
  |  Branch (1763:4): [True: 502, False: 3.65k]
  ------------------
 1764|    502|				if (strcmp(val, "char") == 0) {
  ------------------
  |  Branch (1764:9): [True: 269, False: 233]
  ------------------
 1765|    269|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    269|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1766|    269|					archive_entry_set_filetype(entry,
 1767|    269|						AE_IFCHR);
  ------------------
  |  |  219|    269|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1768|    269|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    269|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1769|    269|				}
 1770|    233|				break;
 1771|  1.37k|			case 'd':
  ------------------
  |  Branch (1771:4): [True: 1.37k, False: 2.78k]
  ------------------
 1772|  1.37k|				if (strcmp(val, "dir") == 0) {
  ------------------
  |  Branch (1772:9): [True: 1.12k, False: 249]
  ------------------
 1773|  1.12k|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|  1.12k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1774|  1.12k|					archive_entry_set_filetype(entry,
 1775|  1.12k|						AE_IFDIR);
  ------------------
  |  |  221|  1.12k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1776|  1.12k|					return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1777|  1.12k|				}
 1778|    249|				break;
 1779|  1.19k|			case 'f':
  ------------------
  |  Branch (1779:4): [True: 1.19k, False: 2.95k]
  ------------------
 1780|  1.19k|				if (strcmp(val, "fifo") == 0) {
  ------------------
  |  Branch (1780:9): [True: 547, False: 652]
  ------------------
 1781|    547|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    547|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1782|    547|					archive_entry_set_filetype(entry,
 1783|    547|						AE_IFIFO);
  ------------------
  |  |  222|    547|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1784|    547|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    547|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1785|    547|				}
 1786|    652|				if (strcmp(val, "file") == 0) {
  ------------------
  |  Branch (1786:9): [True: 87, False: 565]
  ------------------
 1787|     87|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|     87|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1788|     87|					archive_entry_set_filetype(entry,
 1789|     87|						AE_IFREG);
  ------------------
  |  |  216|     87|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1790|     87|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     87|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1791|     87|				}
 1792|    565|				break;
 1793|    565|			case 'l':
  ------------------
  |  Branch (1793:4): [True: 320, False: 3.83k]
  ------------------
 1794|    320|				if (strcmp(val, "link") == 0) {
  ------------------
  |  Branch (1794:9): [True: 226, False: 94]
  ------------------
 1795|    226|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    226|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1796|    226|					archive_entry_set_filetype(entry,
 1797|    226|						AE_IFLNK);
  ------------------
  |  |  217|    226|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1798|    226|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    226|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1799|    226|				}
 1800|     94|				break;
 1801|    456|			default:
  ------------------
  |  Branch (1801:4): [True: 456, False: 3.70k]
  ------------------
 1802|    456|				break;
 1803|  4.15k|			}
 1804|  1.90k|			archive_set_error(&a->archive,
 1805|  1.90k|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.90k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1806|  1.90k|			    "Unrecognized file type \"%s\"; "
 1807|  1.90k|			    "assuming \"file\"", val);
 1808|  1.90k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  1.90k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1809|  1.90k|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.90k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1810|  4.15k|		}
 1811|    780|		break;
 1812|  1.36k|	case 'u':
  ------------------
  |  Branch (1812:2): [True: 1.36k, False: 41.2k]
  ------------------
 1813|  1.36k|		if (strcmp(key, "uid") == 0) {
  ------------------
  |  Branch (1813:7): [True: 398, False: 971]
  ------------------
 1814|    398|			*parsed_kws |= MTREE_HAS_UID;
  ------------------
  |  |   78|    398|#define	MTREE_HAS_UID		0x0200
  ------------------
 1815|    398|			archive_entry_set_uid(entry, mtree_atol(&val, 10));
 1816|    398|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    398|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1817|    398|		}
 1818|    971|		if (strcmp(key, "uname") == 0) {
  ------------------
  |  Branch (1818:7): [True: 596, False: 375]
  ------------------
 1819|    596|			*parsed_kws |= MTREE_HAS_UNAME;
  ------------------
  |  |   79|    596|#define	MTREE_HAS_UNAME		0x0400
  ------------------
 1820|    596|			archive_entry_copy_uname(entry, val);
 1821|    596|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    596|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1822|    596|		}
 1823|    375|		break;
 1824|    825|	default:
  ------------------
  |  Branch (1824:2): [True: 825, False: 41.8k]
  ------------------
 1825|    825|		break;
 1826|  42.6k|	}
 1827|  7.76k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  7.76k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1828|  7.76k|	    "Unrecognized key %s=%s", key, val);
 1829|  7.76k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  7.76k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1830|  42.6k|}
archive_read_support_format_mtree.c:parse_device:
 1416|  13.3k|{
 1417|  13.3k|#define MAX_PACK_ARGS 3
 1418|  13.3k|	unsigned long numbers[MAX_PACK_ARGS];
 1419|  13.3k|	char *p, *dev;
 1420|  13.3k|	int argc;
 1421|  13.3k|	pack_t *pack;
 1422|  13.3k|	dev_t result;
 1423|  13.3k|	const char *error = NULL;
 1424|       |
 1425|  13.3k|	memset(pdev, 0, sizeof(*pdev));
 1426|  13.3k|	if ((dev = strchr(val, ',')) != NULL) {
  ------------------
  |  Branch (1426:6): [True: 12.5k, False: 843]
  ------------------
 1427|       |		/*
 1428|       |		 * Device's major/minor are given in a specified format.
 1429|       |		 * Decode and pack it accordingly.
 1430|       |		 */
 1431|  12.5k|		*dev++ = '\0';
 1432|  12.5k|		if ((pack = pack_find(val)) == NULL) {
  ------------------
  |  Branch (1432:7): [True: 1.07k, False: 11.4k]
  ------------------
 1433|  1.07k|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.07k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1434|  1.07k|			    "Unknown format `%s'", val);
 1435|  1.07k|			return ARCHIVE_WARN;
  ------------------
  |  |  235|  1.07k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1436|  1.07k|		}
 1437|  11.4k|		argc = 0;
 1438|  36.7k|		while ((p = la_strsep(&dev, ",")) != NULL) {
  ------------------
  |  Branch (1438:10): [True: 26.4k, False: 10.3k]
  ------------------
 1439|  26.4k|			if (*p == '\0') {
  ------------------
  |  Branch (1439:8): [True: 353, False: 26.0k]
  ------------------
 1440|    353|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    353|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1441|    353|				    "Missing number");
 1442|    353|				return ARCHIVE_WARN;
  ------------------
  |  |  235|    353|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1443|    353|			}
 1444|  26.0k|			if (argc >= MAX_PACK_ARGS) {
  ------------------
  |  | 1417|  26.0k|#define MAX_PACK_ARGS 3
  ------------------
  |  Branch (1444:8): [True: 723, False: 25.3k]
  ------------------
 1445|    723|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    723|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1446|    723|				    "Too many arguments");
 1447|    723|				return ARCHIVE_WARN;
  ------------------
  |  |  235|    723|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1448|    723|			}
 1449|  25.3k|			numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
 1450|  25.3k|		}
 1451|  10.3k|		if (argc < 2) {
  ------------------
  |  Branch (1451:7): [True: 961, False: 9.41k]
  ------------------
 1452|    961|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    961|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1453|    961|			    "Not enough arguments");
 1454|    961|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    961|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1455|    961|		}
 1456|  9.41k|		result = (*pack)(argc, numbers, &error);
 1457|  9.41k|		if (error != NULL) {
  ------------------
  |  Branch (1457:7): [True: 7.20k, False: 2.21k]
  ------------------
 1458|  7.20k|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  7.20k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1459|  7.20k|			    "%s", error);
 1460|  7.20k|			return ARCHIVE_WARN;
  ------------------
  |  |  235|  7.20k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1461|  7.20k|		}
 1462|  9.41k|	} else {
 1463|       |		/* file system raw value. */
 1464|    843|		result = (dev_t)mtree_atol(&val, 0);
 1465|    843|	}
 1466|  3.05k|	*pdev = result;
 1467|  3.05k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1468|  13.3k|#undef MAX_PACK_ARGS
 1469|  13.3k|}
archive_read_support_format_mtree.c:la_strsep:
 1402|  36.7k|{
 1403|  36.7k|	char *p, *s;
 1404|  36.7k|	if (sp == NULL || *sp == NULL || **sp == '\0')
  ------------------
  |  Branch (1404:6): [True: 0, False: 36.7k]
  |  Branch (1404:20): [True: 0, False: 36.7k]
  |  Branch (1404:35): [True: 10.3k, False: 26.4k]
  ------------------
 1405|  10.3k|		return(NULL);
 1406|  26.4k|	s = *sp;
 1407|  26.4k|	p = s + strcspn(s, sep);
 1408|  26.4k|	if (*p != '\0')
  ------------------
  |  Branch (1408:6): [True: 17.5k, False: 8.89k]
  ------------------
 1409|  17.5k|		*p++ = '\0';
 1410|  26.4k|	*sp = p;
 1411|  26.4k|	return(s);
 1412|  36.7k|}
archive_read_support_format_mtree.c:mtree_atol:
 1990|  37.2k|{
 1991|  37.2k|	int64_t l;
 1992|  37.2k|	int digit;
 1993|       |
 1994|  37.2k|	if (base == 0) {
  ------------------
  |  Branch (1994:6): [True: 26.1k, False: 11.0k]
  ------------------
 1995|  26.1k|		if (**p != '0')
  ------------------
  |  Branch (1995:7): [True: 25.0k, False: 1.13k]
  ------------------
 1996|  25.0k|			base = 10;
 1997|  1.13k|		else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
  ------------------
  |  Branch (1997:12): [True: 119, False: 1.01k]
  |  Branch (1997:30): [True: 420, False: 598]
  ------------------
 1998|    539|			*p += 2;
 1999|    539|			base = 16;
 2000|    598|		} else {
 2001|    598|			base = 8;
 2002|    598|		}
 2003|  26.1k|	}
 2004|       |
 2005|  37.2k|	if (**p == '-') {
  ------------------
  |  Branch (2005:6): [True: 17.6k, False: 19.5k]
  ------------------
 2006|  17.6k|		++(*p);
 2007|       |
 2008|  17.6k|		l = 0;
 2009|  17.6k|		digit = parsedigit(**p);
 2010|   100k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2010:10): [True: 89.6k, False: 11.0k]
  |  Branch (2010:24): [True: 85.3k, False: 4.30k]
  ------------------
 2011|  85.3k|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2011:8): [True: 505, False: 84.8k]
  ------------------
 2012|  84.8k|			    archive_ckd_sub_i64(&l, l, digit))
  ------------------
  |  Branch (2012:8): [True: 1.81k, False: 83.0k]
  ------------------
 2013|  2.32k|				return INT64_MIN;
 2014|  83.0k|			digit = parsedigit(*++(*p));
 2015|  83.0k|		}
 2016|  15.3k|		return l;
 2017|  19.5k|	} else {
 2018|  19.5k|		l = 0;
 2019|  19.5k|		digit = parsedigit(**p);
 2020|  78.2k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2020:10): [True: 65.2k, False: 12.9k]
  |  Branch (2020:24): [True: 59.5k, False: 5.70k]
  ------------------
 2021|  59.5k|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2021:8): [True: 651, False: 58.9k]
  ------------------
 2022|  58.9k|			    archive_ckd_add_i64(&l, l, digit))
  ------------------
  |  Branch (2022:8): [True: 224, False: 58.7k]
  ------------------
 2023|    875|				return INT64_MAX;
 2024|  58.7k|			digit = parsedigit(*++(*p));
 2025|  58.7k|		}
 2026|  18.6k|		return l;
 2027|  19.5k|	}
 2028|  37.2k|}
archive_read_support_format_mtree.c:parsedigit:
 1972|   178k|{
 1973|   178k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1973:6): [True: 164k, False: 14.5k]
  |  Branch (1973:18): [True: 144k, False: 19.6k]
  ------------------
 1974|   144k|		return c - '0';
 1975|  34.1k|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1975:11): [True: 9.61k, False: 24.5k]
  |  Branch (1975:23): [True: 5.42k, False: 4.19k]
  ------------------
 1976|  5.42k|		return 10 + c - 'a';
 1977|  28.7k|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (1977:11): [True: 10.8k, False: 17.8k]
  |  Branch (1977:23): [True: 4.68k, False: 6.17k]
  ------------------
 1978|  4.68k|		return 10 + c - 'A';
 1979|  24.0k|	else
 1980|  24.0k|		return -1;
 1981|   178k|}
archive_read_support_format_mtree.c:parse_digest:
 1490|  5.79k|{
 1491|  5.79k|	unsigned char digest_buf[64];
 1492|  5.79k|	int high, low;
 1493|  5.79k|	size_t i, j, len;
 1494|       |
 1495|  5.79k|	switch (type) {
 1496|  1.46k|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|  1.46k|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1496:2): [True: 1.46k, False: 4.33k]
  ------------------
 1497|  1.46k|		len = sizeof(entry->digest.md5);
 1498|  1.46k|		break;
 1499|    726|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|    726|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1499:2): [True: 726, False: 5.07k]
  ------------------
 1500|    726|		len = sizeof(entry->digest.rmd160);
 1501|    726|		break;
 1502|  1.79k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|  1.79k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1502:2): [True: 1.79k, False: 4.00k]
  ------------------
 1503|  1.79k|		len = sizeof(entry->digest.sha1);
 1504|  1.79k|		break;
 1505|    523|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|    523|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1505:2): [True: 523, False: 5.27k]
  ------------------
 1506|    523|		len = sizeof(entry->digest.sha256);
 1507|    523|		break;
 1508|    532|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|    532|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1508:2): [True: 532, False: 5.26k]
  ------------------
 1509|    532|		len = sizeof(entry->digest.sha384);
 1510|    532|		break;
 1511|    759|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|    759|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1511:2): [True: 759, False: 5.03k]
  ------------------
 1512|    759|		len = sizeof(entry->digest.sha512);
 1513|    759|		break;
 1514|      0|	default:
  ------------------
  |  Branch (1514:2): [True: 0, False: 5.79k]
  ------------------
 1515|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1516|      0|			"Internal error: Unknown digest type");
 1517|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1518|  5.79k|	}
 1519|       |
 1520|  5.79k|	if (len > sizeof(digest_buf)) {
  ------------------
  |  Branch (1520:6): [True: 0, False: 5.79k]
  ------------------
 1521|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1522|      0|			"Internal error: Digest storage too large");
 1523|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1524|      0|	}
 1525|       |
 1526|  5.79k|	len *= 2;
 1527|       |
 1528|  5.79k|	if (mtree_strnlen(digest, len+1) != len) {
  ------------------
  |  |  145|  5.79k|#define mtree_strnlen(a,b) strnlen(a,b)
  ------------------
  |  Branch (1528:6): [True: 3.64k, False: 2.15k]
  ------------------
 1529|  3.64k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  3.64k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1530|  3.64k|				  "incorrect digest length, ignoring");
 1531|  3.64k|		return ARCHIVE_WARN;
  ------------------
  |  |  235|  3.64k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1532|  3.64k|	}
 1533|       |
 1534|  28.7k|	for (i = 0, j = 0; i < len; i += 2, j++) {
  ------------------
  |  Branch (1534:21): [True: 28.1k, False: 652]
  ------------------
 1535|  28.1k|		high = parse_hex_nibble(digest[i]);
 1536|  28.1k|		low = parse_hex_nibble(digest[i+1]);
 1537|  28.1k|		if (high == -1 || low == -1) {
  ------------------
  |  Branch (1537:7): [True: 766, False: 27.3k]
  |  Branch (1537:21): [True: 737, False: 26.6k]
  ------------------
 1538|  1.50k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.50k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1539|  1.50k|					  "invalid digest data, ignoring");
 1540|  1.50k|			return ARCHIVE_WARN;
  ------------------
  |  |  235|  1.50k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1541|  1.50k|		}
 1542|       |
 1543|  26.6k|		digest_buf[j] = high << 4 | low;
 1544|  26.6k|	}
 1545|       |
 1546|    652|	return archive_entry_set_digest(entry, type, digest_buf);
 1547|  2.15k|}
archive_read_support_format_mtree.c:parse_hex_nibble:
 1473|  56.2k|{
 1474|  56.2k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1474:6): [True: 55.5k, False: 654]
  |  Branch (1474:18): [True: 30.7k, False: 24.8k]
  ------------------
 1475|  30.7k|		return c - '0';
 1476|  25.4k|	if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1476:6): [True: 24.2k, False: 1.21k]
  |  Branch (1476:18): [True: 23.5k, False: 760]
  ------------------
 1477|  23.5k|		return 10 + c - 'a';
 1478|       |#if 0
 1479|       |	/* XXX: Is uppercase something we should support? */
 1480|       |	if (c >= 'A' && c <= 'F')
 1481|       |		return 10 + c - 'A';
 1482|       |#endif
 1483|       |
 1484|  1.97k|	return -1;
 1485|  25.4k|}
archive_read_support_format_mtree.c:read_data:
 1835|  49.8k|{
 1836|  49.8k|	struct mtree *mtree = a->format->data;
 1837|  49.8k|	size_t bytes_to_read;
 1838|  49.8k|	ssize_t bytes_read;
 1839|       |
 1840|  49.8k|	if (mtree->fd < 0) {
  ------------------
  |  Branch (1840:6): [True: 49.8k, False: 0]
  ------------------
 1841|  49.8k|		*buff = NULL;
 1842|  49.8k|		*offset = 0;
 1843|  49.8k|		*size = 0;
 1844|  49.8k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  49.8k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1845|  49.8k|	}
 1846|      0|	if (mtree->buff == NULL) {
  ------------------
  |  Branch (1846:6): [True: 0, False: 0]
  ------------------
 1847|      0|		mtree->buffsize = 64 * 1024;
 1848|      0|		mtree->buff = malloc(mtree->buffsize);
 1849|      0|		if (mtree->buff == NULL) {
  ------------------
  |  Branch (1849:7): [True: 0, False: 0]
  ------------------
 1850|      0|			archive_set_error(&a->archive, ENOMEM,
 1851|      0|			    "Can't allocate memory");
 1852|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1853|      0|		}
 1854|      0|	}
 1855|       |
 1856|      0|	*buff = mtree->buff;
 1857|      0|	*offset = mtree->offset;
 1858|      0|	if ((int64_t)mtree->buffsize > mtree->cur_size - mtree->offset)
  ------------------
  |  Branch (1858:6): [True: 0, False: 0]
  ------------------
 1859|      0|		bytes_to_read = (size_t)(mtree->cur_size - mtree->offset);
 1860|      0|	else
 1861|      0|		bytes_to_read = mtree->buffsize;
 1862|      0|	bytes_read = read(mtree->fd, mtree->buff, bytes_to_read);
 1863|      0|	if (bytes_read < 0) {
  ------------------
  |  Branch (1863:6): [True: 0, False: 0]
  ------------------
 1864|      0|		archive_set_error(&a->archive, errno, "Can't read");
 1865|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1866|      0|	}
 1867|      0|	if (bytes_read == 0) {
  ------------------
  |  Branch (1867:6): [True: 0, False: 0]
  ------------------
 1868|      0|		*size = 0;
 1869|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1870|      0|	}
 1871|      0|	mtree->offset += bytes_read;
 1872|      0|	*size = bytes_read;
 1873|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1874|      0|}
archive_read_support_format_mtree.c:skip:
 1879|  49.8k|{
 1880|  49.8k|	struct mtree *mtree = a->format->data;
 1881|       |
 1882|  49.8k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1882:6): [True: 0, False: 49.8k]
  ------------------
 1883|      0|		close(mtree->fd);
 1884|      0|		mtree->fd = -1;
 1885|      0|	}
 1886|  49.8k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  49.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1887|  49.8k|}

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

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

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

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

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

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

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

archive_array_append:
  250|    272|{
  251|    272|	return archive_string_append(as, p, s);
  252|    272|}
archive_string_concat:
  256|    732|{
  257|    732|	if (archive_string_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (257:6): [True: 0, False: 732]
  ------------------
  258|      0|		__archive_errx(1, "Out of memory");
  259|    732|}
archive_wstring_concat:
  264|  11.9k|{
  265|  11.9k|	if (archive_wstring_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (265:6): [True: 0, False: 11.9k]
  ------------------
  266|      0|		__archive_errx(1, "Out of memory");
  267|  11.9k|}
archive_string_free:
  271|  17.5M|{
  272|  17.5M|	as->length = 0;
  273|  17.5M|	as->buffer_length = 0;
  274|  17.5M|	free(as->s);
  275|       |	as->s = NULL;
  276|  17.5M|}
archive_wstring_free:
  280|  5.40M|{
  281|  5.40M|	as->length = 0;
  282|  5.40M|	as->buffer_length = 0;
  283|  5.40M|	free(as->s);
  284|       |	as->s = NULL;
  285|  5.40M|}
archive_wstring_ensure:
  289|   456k|{
  290|   456k|	return (struct archive_wstring *)
  291|   456k|		archive_string_ensure((struct archive_string *)as,
  292|   456k|					s * sizeof(wchar_t));
  293|   456k|}
archive_string_ensure:
  298|  32.5M|{
  299|  32.5M|	char *p;
  300|  32.5M|	size_t new_length;
  301|       |
  302|       |	/* If buffer is already big enough, don't reallocate. */
  303|  32.5M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (303:6): [True: 31.0M, False: 1.46M]
  |  Branch (303:15): [True: 31.0M, False: 37.0k]
  ------------------
  304|  31.0M|		return (as);
  305|       |
  306|       |	/*
  307|       |	 * Growing the buffer at least exponentially ensures that
  308|       |	 * append operations are always linear in the number of
  309|       |	 * characters appended.  Using a smaller growth rate for
  310|       |	 * larger buffers reduces memory waste somewhat at the cost of
  311|       |	 * a larger constant factor.
  312|       |	 */
  313|  1.50M|	if (as->buffer_length < 32)
  ------------------
  |  Branch (313:6): [True: 1.46M, False: 37.0k]
  ------------------
  314|       |		/* Start with a minimum 32-character buffer. */
  315|  1.46M|		new_length = 32;
  316|  37.0k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (316:11): [True: 36.8k, False: 109]
  ------------------
  317|       |		/* Buffers under 8k are doubled for speed. */
  318|  36.8k|		new_length = as->buffer_length + as->buffer_length;
  319|    109|	else {
  320|       |		/* Buffers 8k and over grow by at least 25% each time. */
  321|    109|		new_length = as->buffer_length + as->buffer_length / 4;
  322|       |		/* Be safe: If size wraps, fail. */
  323|    109|		if (new_length < as->buffer_length) {
  ------------------
  |  Branch (323:7): [True: 0, False: 109]
  ------------------
  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|    109|	}
  330|       |	/*
  331|       |	 * The computation above is a lower limit to how much we'll
  332|       |	 * grow the buffer.  In any case, we have to grow it enough to
  333|       |	 * hold the request.
  334|       |	 */
  335|  1.50M|	if (new_length < s)
  ------------------
  |  Branch (335:6): [True: 826k, False: 679k]
  ------------------
  336|   826k|		new_length = s;
  337|       |	/* Now we can reallocate the buffer. */
  338|  1.50M|	p = realloc(as->s, new_length);
  339|  1.50M|	if (p == NULL) {
  ------------------
  |  Branch (339:6): [True: 0, False: 1.50M]
  ------------------
  340|       |		/* On failure, wipe the string and return NULL. */
  341|      0|		archive_string_free(as);
  342|      0|		errno = ENOMEM;/* Make sure errno has ENOMEM. */
  343|      0|		return (NULL);
  344|      0|	}
  345|       |
  346|  1.50M|	as->s = p;
  347|  1.50M|	as->buffer_length = new_length;
  348|  1.50M|	return (as);
  349|  1.50M|}
archive_strncat:
  360|   425k|{
  361|   425k|	size_t s;
  362|   425k|	const char *p, *pp;
  363|       |
  364|   425k|	p = (const char *)_p;
  365|       |
  366|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  367|   425k|	s = 0;
  368|   425k|	pp = p;
  369|  34.0M|	while (s < n && *pp) {
  ------------------
  |  Branch (369:9): [True: 33.8M, False: 194k]
  |  Branch (369:18): [True: 33.6M, False: 231k]
  ------------------
  370|  33.6M|		pp++;
  371|  33.6M|		s++;
  372|  33.6M|	}
  373|   425k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (373:6): [True: 0, False: 425k]
  ------------------
  374|      0|		__archive_errx(1, "Out of memory");
  375|   425k|	return (as);
  376|   425k|}
archive_wstrncat:
  380|  7.88k|{
  381|  7.88k|	size_t s;
  382|  7.88k|	const wchar_t *pp;
  383|       |
  384|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  385|  7.88k|	s = 0;
  386|  7.88k|	pp = p;
  387|  57.5k|	while (s < n && *pp) {
  ------------------
  |  Branch (387:9): [True: 49.8k, False: 7.73k]
  |  Branch (387:18): [True: 49.6k, False: 151]
  ------------------
  388|  49.6k|		pp++;
  389|  49.6k|		s++;
  390|  49.6k|	}
  391|  7.88k|	if ((as = archive_wstring_append(as, p, s)) == NULL)
  ------------------
  |  Branch (391:6): [True: 0, False: 7.88k]
  ------------------
  392|      0|		__archive_errx(1, "Out of memory");
  393|  7.88k|	return (as);
  394|  7.88k|}
archive_strcat:
  398|   204k|{
  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|   204k|	return archive_strncat(as, p, 0x1000000);
  406|   204k|}
archive_wstrcat:
  410|    151|{
  411|       |	/* Ditto. */
  412|    151|	return archive_wstrncat(as, p, 0x1000000);
  413|    151|}
archive_strappend_char:
  417|  29.1M|{
  418|  29.1M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (418:6): [True: 0, False: 29.1M]
  ------------------
  419|      0|		__archive_errx(1, "Out of memory");
  420|  29.1M|	return (as);
  421|  29.1M|}
archive_wstrappend_wchar:
  425|    151|{
  426|    151|	if ((as = archive_wstring_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (426:6): [True: 0, False: 151]
  ------------------
  427|      0|		__archive_errx(1, "Out of memory");
  428|    151|	return (as);
  429|    151|}
archive_wstring_append_from_mbs:
  623|   414k|{
  624|   414k|	size_t r;
  625|   414k|	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|   414k|	size_t mbs_length = len;
  632|   414k|	const char *mbs = p;
  633|   414k|	wchar_t *wcs;
  634|   414k|#if HAVE_MBRTOWC
  635|   414k|	mbstate_t shift_state;
  636|       |
  637|   414k|	memset(&shift_state, 0, sizeof(shift_state));
  638|   414k|#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|   414k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (643:6): [True: 0, False: 414k]
  ------------------
  644|      0|		return (-1);
  645|   414k|	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|  35.1M|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (651:9): [True: 34.7M, False: 375k]
  |  Branch (651:17): [True: 34.7M, 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|  34.7M|#if HAVE_MBRTOWC
  669|  34.7M|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  670|       |#else
  671|       |		r = mbtowc(wcs, mbs, mbs_length);
  672|       |#endif
  673|  34.7M|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (673:7): [True: 38.5k, False: 34.7M]
  |  Branch (673:26): [True: 0, False: 34.7M]
  ------------------
  674|  38.5k|			ret_val = -1;
  675|  38.5k|			break;
  676|  38.5k|		}
  677|  34.7M|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (677:7): [True: 0, False: 34.7M]
  |  Branch (677:17): [True: 0, False: 34.7M]
  ------------------
  678|      0|			break;
  679|  34.7M|		wcs++;
  680|       |		// wcs_length--;
  681|  34.7M|		mbs += r;
  682|  34.7M|		mbs_length -= r;
  683|  34.7M|	}
  684|   414k|	dest->length = wcs - dest->s;
  685|   414k|	dest->s[dest->length] = L'\0';
  686|   414k|	return (ret_val);
  687|   414k|}
archive_string_append_from_wcs:
  817|  6.54k|{
  818|       |	/* We cannot use the standard wcstombs() here because it
  819|       |	 * cannot tell us how big the output buffer should be.  So
  820|       |	 * I've built a loop around wcrtomb() or wctomb() that
  821|       |	 * converts a character at a time and resizes the string as
  822|       |	 * needed.  We prefer wcrtomb() when it's available because
  823|       |	 * it's thread-safe. */
  824|  6.54k|	int n, ret_val = 0;
  825|  6.54k|	char *p;
  826|  6.54k|	char *end;
  827|  6.54k|#if HAVE_WCRTOMB
  828|  6.54k|	mbstate_t shift_state;
  829|       |
  830|  6.54k|	memset(&shift_state, 0, sizeof(shift_state));
  831|       |#else
  832|       |	/* Clear the shift state before starting. */
  833|       |	wctomb(NULL, L'\0');
  834|       |#endif
  835|       |	/*
  836|       |	 * Allocate buffer for MBS.
  837|       |	 * We need this allocation here since it is possible that
  838|       |	 * as->s is still NULL.
  839|       |	 */
  840|  6.54k|	if (archive_string_ensure(as, as->length + len + 1) == NULL)
  ------------------
  |  Branch (840:6): [True: 0, False: 6.54k]
  ------------------
  841|      0|		return (-1);
  842|       |
  843|  6.54k|	p = as->s + as->length;
  844|  6.54k|	end = as->s + as->buffer_length - MB_CUR_MAX -1;
  845|  41.2k|	while (*w != L'\0' && len > 0) {
  ------------------
  |  Branch (845:9): [True: 34.7k, False: 6.54k]
  |  Branch (845:24): [True: 34.7k, False: 0]
  ------------------
  846|  34.7k|		if (p >= end) {
  ------------------
  |  Branch (846:7): [True: 293, False: 34.4k]
  ------------------
  847|    293|			as->length = p - as->s;
  848|    293|			as->s[as->length] = '\0';
  849|       |			/* Re-allocate buffer for MBS. */
  850|    293|			if (archive_string_ensure(as,
  ------------------
  |  Branch (850:8): [True: 0, False: 293]
  ------------------
  851|    293|			    as->length + max(len * 2,
  ------------------
  |  |   78|    293|#define max(a, b)       ((a)>(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (78:26): [True: 293, False: 0]
  |  |  ------------------
  ------------------
  852|    293|			    (size_t)MB_CUR_MAX) + 1) == NULL)
  853|      0|				return (-1);
  854|    293|			p = as->s + as->length;
  855|    293|			end = as->s + as->buffer_length - MB_CUR_MAX -1;
  856|    293|		}
  857|  34.7k|#if HAVE_WCRTOMB
  858|  34.7k|		n = wcrtomb(p, *w++, &shift_state);
  859|       |#else
  860|       |		n = wctomb(p, *w++);
  861|       |#endif
  862|  34.7k|		if (n == -1) {
  ------------------
  |  Branch (862:7): [True: 0, False: 34.7k]
  ------------------
  863|      0|			if (errno == EILSEQ) {
  ------------------
  |  Branch (863:8): [True: 0, False: 0]
  ------------------
  864|       |				/* Skip an illegal wide char. */
  865|      0|				*p++ = '?';
  866|      0|				ret_val = -1;
  867|      0|			} else {
  868|      0|				ret_val = -1;
  869|      0|				break;
  870|      0|			}
  871|      0|		} else
  872|  34.7k|			p += n;
  873|  34.7k|		len--;
  874|  34.7k|	}
  875|  6.54k|	as->length = p - as->s;
  876|  6.54k|	as->s[as->length] = '\0';
  877|  6.54k|	return (ret_val);
  878|  6.54k|}
archive_string_conversion_to_charset:
 1778|   388k|{
 1779|   388k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   89|   388k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1780|       |
 1781|   388k|	if (best_effort)
  ------------------
  |  Branch (1781:6): [True: 388k, False: 0]
  ------------------
 1782|   388k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|   388k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1783|   388k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1784|   388k|}
archive_string_conversion_from_charset:
 1789|  31.2k|{
 1790|  31.2k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   91|  31.2k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1791|       |
 1792|  31.2k|	if (best_effort)
  ------------------
  |  Branch (1792:6): [True: 31.2k, False: 0]
  ------------------
 1793|  31.2k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  31.2k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1794|  31.2k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1795|  31.2k|}
archive_string_default_conversion_for_read:
 1851|  8.78k|{
 1852|  8.78k|	(void)a; /* UNUSED */
 1853|       |	return (NULL);
 1854|  8.78k|}
archive_string_conversion_free:
 1869|  22.2k|{
 1870|  22.2k|	struct archive_string_conv *sc; 
 1871|  22.2k|	struct archive_string_conv *sc_next; 
 1872|       |
 1873|  26.3k|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1873:22): [True: 4.06k, False: 22.2k]
  ------------------
 1874|  4.06k|		sc_next = sc->next;
 1875|  4.06k|		free_sconv_object(sc);
 1876|  4.06k|	}
 1877|  22.2k|	a->sconv = NULL;
 1878|  22.2k|	free(a->current_code);
 1879|       |	a->current_code = NULL;
 1880|  22.2k|}
archive_string_conversion_charset_name:
 1887|  3.89k|{
 1888|  3.89k|	if (sc == NULL) {
  ------------------
  |  Branch (1888:6): [True: 0, False: 3.89k]
  ------------------
 1889|      0|		return "current locale";
 1890|      0|	}
 1891|  3.89k|	if (sc->flag & SCONV_TO_CHARSET)
  ------------------
  |  |   89|  3.89k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1891:6): [True: 0, False: 3.89k]
  ------------------
 1892|      0|		return (sc->to_charset);
 1893|  3.89k|	else
 1894|  3.89k|		return (sc->from_charset);
 1895|  3.89k|}
archive_strncpy_l:
 2010|   779k|{
 2011|   779k|	as->length = 0;
 2012|   779k|	return (archive_strncat_l(as, _p, n, sc));
 2013|   779k|}
archive_strncat_l:
 2018|   779k|{
 2019|   779k|	const void *s;
 2020|   779k|	size_t length = 0;
 2021|   779k|	int i, r = 0, r2;
 2022|       |
 2023|   779k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2023:6): [True: 779k, False: 0]
  |  Branch (2023:20): [True: 680k, False: 99.2k]
  ------------------
 2024|   680k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|   362k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   362k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   362k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2024:7): [True: 362k, False: 317k]
  |  Branch (2024:21): [True: 5.01k, False: 357k]
  ------------------
 2025|  5.01k|			length = utf16nbytes(_p, n);
 2026|   675k|		else
 2027|   675k|			length = mbsnbytes(_p, n);
 2028|   680k|	}
 2029|       |
 2030|       |	/* We must allocate memory even if there is no data for conversion
 2031|       |	 * or copy. This simulates archive_string_append behavior. */
 2032|   779k|	if (length == 0) {
  ------------------
  |  Branch (2032:6): [True: 126k, False: 652k]
  ------------------
 2033|   126k|		size_t tn = 1;
 2034|   126k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  77.6k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  77.6k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  77.6k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2034:7): [True: 77.6k, False: 49.2k]
  |  Branch (2034:21): [True: 0, False: 77.6k]
  ------------------
 2035|      0|			tn = 2;
 2036|   126k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2036:7): [True: 0, False: 126k]
  ------------------
 2037|      0|			return (-1);
 2038|   126k|		as->s[as->length] = 0;
 2039|   126k|		if (tn == 2)
  ------------------
  |  Branch (2039:7): [True: 0, False: 126k]
  ------------------
 2040|      0|			as->s[as->length+1] = 0;
 2041|   126k|		return (0);
 2042|   126k|	}
 2043|       |
 2044|       |	/*
 2045|       |	 * If sc is NULL, we just make a copy.
 2046|       |	 */
 2047|   652k|	if (sc == NULL) {
  ------------------
  |  Branch (2047:6): [True: 292k, False: 360k]
  ------------------
 2048|   292k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2048:7): [True: 0, False: 292k]
  ------------------
 2049|      0|			return (-1);/* No memory */
 2050|   292k|		return (0);
 2051|   292k|	}
 2052|       |
 2053|   360k|	s = _p;
 2054|   360k|	i = 0;
 2055|   360k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2055:6): [True: 31.8k, False: 328k]
  ------------------
 2056|  31.8k|		sc->utftmp.length = 0;
 2057|  31.8k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2058|  31.8k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2058:7): [True: 18.8k, False: 12.9k]
  |  Branch (2058:18): [True: 3, False: 18.8k]
  ------------------
 2059|      3|			return (r2);
 2060|  31.8k|		if (r > r2)
  ------------------
  |  Branch (2060:7): [True: 18.8k, False: 12.9k]
  ------------------
 2061|  18.8k|			r = r2;
 2062|  31.8k|		s = sc->utftmp.s;
 2063|  31.8k|		length = sc->utftmp.length;
 2064|  31.8k|		++i;
 2065|  31.8k|	}
 2066|   360k|	r2 = sc->converter[i](as, s, length, sc);
 2067|   360k|	if (r > r2)
  ------------------
  |  Branch (2067:6): [True: 25.8k, False: 334k]
  ------------------
 2068|  25.8k|		r = r2;
 2069|   360k|	return (r);
 2070|   360k|}
archive_mstring_clean:
 3924|  5.34M|{
 3925|  5.34M|	archive_wstring_free(&(aes->aes_wcs));
 3926|  5.34M|	archive_string_free(&(aes->aes_mbs));
 3927|  5.34M|	archive_string_free(&(aes->aes_utf8));
 3928|  5.34M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3929|  5.34M|	aes->aes_set = 0;
 3930|  5.34M|}
archive_mstring_get_utf8:
 3944|   411k|{
 3945|   411k|	struct archive_string_conv *sc;
 3946|   411k|	int r;
 3947|       |
 3948|       |	/* If we already have a UTF8 form, return that immediately. */
 3949|   411k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   411k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3949:6): [True: 14.4k, False: 396k]
  ------------------
 3950|  14.4k|		*p = aes->aes_utf8.s;
 3951|  14.4k|		return (0);
 3952|  14.4k|	}
 3953|       |
 3954|   396k|	*p = NULL;
 3955|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 3956|       |	/*
 3957|       |	 * On Windows, first try converting from WCS because (1) there's no
 3958|       |	 * guarantee that the conversion to MBS will succeed, e.g. when using
 3959|       |	 * CP_ACP, and (2) that's more efficient than converting to MBS, just to
 3960|       |	 * convert back to WCS again before finally converting to UTF-8
 3961|       |	 */
 3962|       |	if ((aes->aes_set & AES_SET_WCS) != 0) {
 3963|       |		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3964|       |		if (sc == NULL)
 3965|       |			return (-1);/* Couldn't allocate memory for sc. */
 3966|       |		archive_string_empty(&(aes->aes_utf8));
 3967|       |		r = archive_string_append_from_wcs_in_codepage(&(aes->aes_utf8),
 3968|       |			aes->aes_wcs.s, aes->aes_wcs.length, sc);
 3969|       |		if (a == NULL)
 3970|       |			free_sconv_object(sc);
 3971|       |		if (r == 0) {
 3972|       |			aes->aes_set |= AES_SET_UTF8;
 3973|       |			*p = aes->aes_utf8.s;
 3974|       |			return (0);/* success. */
 3975|       |		} else
 3976|       |			return (-1);/* failure. */
 3977|       |	}
 3978|       |#endif
 3979|       |	/* Try converting WCS to MBS first if MBS does not exist yet. */
 3980|   396k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   396k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3980:6): [True: 8.30k, False: 388k]
  ------------------
 3981|  8.30k|		const char *pm; /* unused */
 3982|  8.30k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3983|  8.30k|	}
 3984|   396k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   396k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3984:6): [True: 388k, False: 8.30k]
  ------------------
 3985|   388k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3986|   388k|		if (sc == NULL)
  ------------------
  |  Branch (3986:7): [True: 0, False: 388k]
  ------------------
 3987|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3988|   388k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 3989|   388k|		    aes->aes_mbs.length, sc);
 3990|   388k|		if (a == NULL)
  ------------------
  |  Branch (3990:7): [True: 388k, False: 0]
  ------------------
 3991|   388k|			free_sconv_object(sc);
 3992|   388k|		if (r == 0) {
  ------------------
  |  Branch (3992:7): [True: 365k, False: 23.0k]
  ------------------
 3993|   365k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|   365k|#define	AES_SET_UTF8 2
  ------------------
 3994|   365k|			*p = aes->aes_utf8.s;
 3995|   365k|			return (0);/* success. */
 3996|   365k|		} else
 3997|  23.0k|			return (-1);/* failure. */
 3998|   388k|	}
 3999|  8.30k|	return (0);/* success. */
 4000|   396k|}
archive_mstring_get_mbs:
 4005|  1.50M|{
 4006|  1.50M|	struct archive_string_conv *sc;
 4007|  1.50M|	int r, ret = 0;
 4008|       |
 4009|       |	/* If we already have an MBS form, return that immediately. */
 4010|  1.50M|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  1.50M|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4010:6): [True: 905k, False: 596k]
  ------------------
 4011|   905k|		*p = aes->aes_mbs.s;
 4012|   905k|		return (ret);
 4013|   905k|	}
 4014|       |
 4015|   596k|	*p = NULL;
 4016|       |	/* If there's a WCS form, try converting with the native locale. */
 4017|   596k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   596k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4017:6): [True: 6.54k, False: 589k]
  ------------------
 4018|  6.54k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  6.54k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4019|  6.54k|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 4020|  6.54k|		    aes->aes_wcs.s, aes->aes_wcs.length);
 4021|  6.54k|		*p = aes->aes_mbs.s;
 4022|  6.54k|		if (r == 0) {
  ------------------
  |  Branch (4022:7): [True: 6.54k, False: 0]
  ------------------
 4023|  6.54k|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|  6.54k|#define	AES_SET_MBS 1
  ------------------
 4024|  6.54k|			return (ret);
 4025|  6.54k|		} else
 4026|      0|			ret = -1;
 4027|  6.54k|	}
 4028|       |
 4029|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 4030|   589k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   589k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4030:6): [True: 1.52k, False: 588k]
  ------------------
 4031|  1.52k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  1.52k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4032|  1.52k|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4033|  1.52k|		if (sc == NULL)
  ------------------
  |  Branch (4033:7): [True: 0, False: 1.52k]
  ------------------
 4034|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4035|  1.52k|		r = archive_strncpy_l(&(aes->aes_mbs),
 4036|  1.52k|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4037|  1.52k|		if (a == NULL)
  ------------------
  |  Branch (4037:7): [True: 1.52k, False: 0]
  ------------------
 4038|  1.52k|			free_sconv_object(sc);
 4039|  1.52k|		*p = aes->aes_mbs.s;
 4040|  1.52k|		if (r == 0) {
  ------------------
  |  Branch (4040:7): [True: 0, False: 1.52k]
  ------------------
 4041|      0|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|      0|#define	AES_SET_MBS 1
  ------------------
 4042|      0|			ret = 0;/* success; overwrite previous error. */
 4043|      0|		} else
 4044|  1.52k|			ret = -1;/* failure. */
 4045|  1.52k|	}
 4046|   589k|	return (ret);
 4047|   589k|}
archive_mstring_get_wcs:
 4052|   751k|{
 4053|   751k|	int r, ret = 0;
 4054|       |
 4055|   751k|	(void)a;/* UNUSED */
 4056|       |	/* Return WCS form if we already have it. */
 4057|   751k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   751k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4057:6): [True: 65.5k, False: 686k]
  ------------------
 4058|  65.5k|		*wp = aes->aes_wcs.s;
 4059|  65.5k|		return (ret);
 4060|  65.5k|	}
 4061|       |
 4062|   686k|	*wp = NULL;
 4063|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4064|       |	/*
 4065|       |	 * On Windows, prefer converting from UTF-8 directly to WCS because:
 4066|       |	 * (1) there's no guarantee that the string can be represented in MBS (e.g.
 4067|       |	 * with CP_ACP), and (2) in order to convert from UTF-8 to MBS, we're going
 4068|       |	 * to need to convert from UTF-8 to WCS anyway and its wasteful to throw
 4069|       |	 * away that intermediate result
 4070|       |	 */
 4071|       |	if (aes->aes_set & AES_SET_UTF8) {
 4072|       |		struct archive_string_conv *sc;
 4073|       |
 4074|       |		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4075|       |		if (sc != NULL) {
 4076|       |			archive_wstring_empty((&aes->aes_wcs));
 4077|       |			r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4078|       |			    aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4079|       |			if (a == NULL)
 4080|       |				free_sconv_object(sc);
 4081|       |			if (r == 0) {
 4082|       |				aes->aes_set |= AES_SET_WCS;
 4083|       |				*wp = aes->aes_wcs.s;
 4084|       |				return (0);
 4085|       |			}
 4086|       |		}
 4087|       |	}
 4088|       |#endif
 4089|       |	/* Try converting UTF8 to MBS first if MBS does not exist yet. */
 4090|   686k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   686k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4090:6): [True: 282k, False: 403k]
  ------------------
 4091|   282k|		const char *p; /* unused */
 4092|   282k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4093|   282k|	}
 4094|       |	/* Try converting MBS to WCS using native locale. */
 4095|   686k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   686k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4095:6): [True: 403k, False: 282k]
  ------------------
 4096|   403k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   403k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4097|   403k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4098|   403k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4099|   403k|		if (r == 0) {
  ------------------
  |  Branch (4099:7): [True: 365k, False: 38.5k]
  ------------------
 4100|   365k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|   365k|#define	AES_SET_WCS 4
  ------------------
 4101|   365k|			*wp = aes->aes_wcs.s;
 4102|   365k|		} else
 4103|  38.5k|			ret = -1;/* failure. */
 4104|   403k|	}
 4105|   686k|	return (ret);
 4106|   751k|}
archive_mstring_copy_mbs:
 4176|  80.4k|{
 4177|  80.4k|	if (mbs == NULL) {
  ------------------
  |  Branch (4177:6): [True: 5.96k, False: 74.4k]
  ------------------
 4178|  5.96k|		aes->aes_set = 0;
 4179|  5.96k|		return (0);
 4180|  5.96k|	}
 4181|  74.4k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4182|  80.4k|}
archive_mstring_copy_mbs_len:
 4187|  83.9k|{
 4188|  83.9k|	if (mbs == NULL) {
  ------------------
  |  Branch (4188:6): [True: 0, False: 83.9k]
  ------------------
 4189|      0|		aes->aes_set = 0;
 4190|      0|		return (0);
 4191|      0|	}
 4192|  83.9k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  83.9k|#define	AES_SET_MBS 1
  ------------------
 4193|  83.9k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  83.9k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4194|  83.9k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  83.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4195|  83.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  83.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4196|  83.9k|	return (0);
 4197|  83.9k|}
archive_mstring_copy_wcs:
 4201|  6.93k|{
 4202|  6.93k|	return archive_mstring_copy_wcs_len(aes, wcs,
 4203|  6.93k|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4203:5): [True: 0, False: 6.93k]
  ------------------
 4204|  6.93k|}
archive_mstring_copy_wcs_len:
 4223|  6.93k|{
 4224|  6.93k|	if (wcs == NULL) {
  ------------------
  |  Branch (4224:6): [True: 0, False: 6.93k]
  ------------------
 4225|      0|		aes->aes_set = 0;
 4226|      0|		return (0);
 4227|      0|	}
 4228|  6.93k|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  222|  6.93k|#define	AES_SET_WCS 4
  ------------------
 4229|  6.93k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  6.93k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4230|  6.93k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  6.93k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4231|  6.93k|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|  6.93k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4232|  6.93k|	return (0);
 4233|  6.93k|}
archive_mstring_copy_mbs_len_l:
 4238|   375k|{
 4239|   375k|	int r;
 4240|       |
 4241|   375k|	if (mbs == NULL) {
  ------------------
  |  Branch (4241:6): [True: 9.40k, False: 365k]
  ------------------
 4242|  9.40k|		aes->aes_set = 0;
 4243|  9.40k|		return (0);
 4244|  9.40k|	}
 4245|   365k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|   365k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4246|   365k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   365k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4247|   365k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|   365k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4248|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4249|       |	/*
 4250|       |	 * Internationalization programming on Windows must use Wide
 4251|       |	 * characters because Windows platform cannot make locale UTF-8.
 4252|       |	 */
 4253|       |	if (sc == NULL) {
 4254|       |		if (archive_string_append(&(aes->aes_mbs),
 4255|       |			mbs, mbsnbytes(mbs, len)) == NULL) {
 4256|       |			aes->aes_set = 0;
 4257|       |			r = -1;
 4258|       |		} else {
 4259|       |			aes->aes_set = AES_SET_MBS;
 4260|       |			r = 0;
 4261|       |		}
 4262|       |#if defined(HAVE_ICONV)
 4263|       |	} else if (sc != NULL && sc->cd_w != (iconv_t)-1) {
 4264|       |		/*
 4265|       |		 * This case happens only when MultiByteToWideChar() cannot
 4266|       |		 * handle sc->from_cp, and we have to iconv in order to
 4267|       |		 * translate character-set to wchar_t,UTF-16.
 4268|       |		 */
 4269|       |		iconv_t cd = sc->cd;
 4270|       |		unsigned from_cp;
 4271|       |		int flag;
 4272|       |
 4273|       |		/*
 4274|       |		 * Translate multi-bytes from some character-set to UTF-8.
 4275|       |		 */ 
 4276|       |		sc->cd = sc->cd_w;
 4277|       |		r = archive_strncpy_l(&(aes->aes_utf8), mbs, len, sc);
 4278|       |		sc->cd = cd;
 4279|       |		if (r != 0) {
 4280|       |			aes->aes_set = 0;
 4281|       |			return (r);
 4282|       |		}
 4283|       |		aes->aes_set = AES_SET_UTF8;
 4284|       |
 4285|       |		/*
 4286|       |		 * Append the UTF-8 string into wstring.
 4287|       |		 */ 
 4288|       |		flag = sc->flag;
 4289|       |		sc->flag &= ~(SCONV_NORMALIZATION_C
 4290|       |				| SCONV_TO_UTF16| SCONV_FROM_UTF16);
 4291|       |		from_cp = sc->from_cp;
 4292|       |		sc->from_cp = CP_UTF8;
 4293|       |		r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4294|       |			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4295|       |		sc->flag = flag;
 4296|       |		sc->from_cp = from_cp;
 4297|       |		if (r == 0)
 4298|       |			aes->aes_set |= AES_SET_WCS;
 4299|       |#endif
 4300|       |	} else {
 4301|       |		r = archive_wstring_append_from_mbs_in_codepage(
 4302|       |		    &(aes->aes_wcs), mbs, len, sc);
 4303|       |		if (r == 0)
 4304|       |			aes->aes_set = AES_SET_WCS;
 4305|       |		else
 4306|       |			aes->aes_set = 0;
 4307|       |	}
 4308|       |#else
 4309|   365k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4310|   365k|	if (r == 0)
  ------------------
  |  Branch (4310:6): [True: 359k, False: 6.44k]
  ------------------
 4311|   359k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|   359k|#define	AES_SET_MBS 1
  ------------------
 4312|  6.44k|	else
 4313|  6.44k|		aes->aes_set = 0;
 4314|   365k|#endif
 4315|   365k|	return (r);
 4316|   375k|}
archive_mstring_update_utf8:
 4331|  23.9k|{
 4332|  23.9k|	struct archive_string_conv *sc;
 4333|  23.9k|	int r;
 4334|       |
 4335|  23.9k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4335:6): [True: 0, False: 23.9k]
  ------------------
 4336|      0|		aes->aes_set = 0;
 4337|      0|		return (0); /* Succeeded in clearing everything. */
 4338|      0|	}
 4339|       |
 4340|       |	/* Save the UTF8 string. */
 4341|  23.9k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  23.9k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  47.9k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 23.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4342|       |
 4343|       |	/* Empty the mbs and wcs strings. */
 4344|  23.9k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  23.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4345|  23.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  23.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4346|       |
 4347|  23.9k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  23.9k|#define	AES_SET_UTF8 2
  ------------------
 4348|       |
 4349|  23.9k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4350|  23.9k|	if (sc == NULL)
  ------------------
  |  Branch (4350:6): [True: 0, False: 23.9k]
  ------------------
 4351|      0|		return (-1);/* Couldn't allocate memory for sc. */
 4352|       |
 4353|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4354|       |	/* On Windows, there's no good way to convert from UTF8 -> MBS directly, so
 4355|       |	 * prefer to first convert to WCS as (1) it's wasteful to throw away the
 4356|       |	 * intermediate result, and (2) WCS will still be set even if we fail to
 4357|       |	 * convert to MBS (e.g. with ACP that can't represent the characters) */
 4358|       |	r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4359|       |		aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4360|       |
 4361|       |	if (a == NULL)
 4362|       |		free_sconv_object(sc);
 4363|       |	if (r != 0)
 4364|       |		return (-1); /* This will guarantee we can't convert to MBS */
 4365|       |	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS; /* Both UTF8 and WCS set. */
 4366|       |
 4367|       |	/* Try converting WCS to MBS, return false on failure. */
 4368|       |	if (archive_string_append_from_wcs(&(aes->aes_mbs), aes->aes_wcs.s,
 4369|       |	    aes->aes_wcs.length))
 4370|       |		return (-1);
 4371|       |#else
 4372|       |	/* Try converting UTF-8 to MBS, return false on failure. */
 4373|  23.9k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  23.9k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 23.9k]
  |  |  ------------------
  ------------------
 4374|       |
 4375|  23.9k|	if (a == NULL)
  ------------------
  |  Branch (4375:6): [True: 23.9k, False: 0]
  ------------------
 4376|  23.9k|		free_sconv_object(sc);
 4377|  23.9k|	if (r != 0)
  ------------------
  |  Branch (4377:6): [True: 13.6k, False: 10.3k]
  ------------------
 4378|  13.6k|		return (-1);
 4379|  10.3k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  221|  10.3k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  220|  10.3k|#define	AES_SET_MBS 1
  ------------------
 4380|       |
 4381|       |	/* Try converting MBS to WCS, return false on failure. */
 4382|  10.3k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4382:6): [True: 0, False: 10.3k]
  ------------------
 4383|  10.3k|	    aes->aes_mbs.length))
 4384|      0|		return (-1);
 4385|  10.3k|#endif
 4386|       |
 4387|       |	/* All conversions succeeded. */
 4388|  10.3k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  221|  10.3k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  222|  10.3k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  220|  10.3k|#define	AES_SET_MBS 1
  ------------------
 4389|       |
 4390|  10.3k|	return (0);
 4391|  10.3k|}
archive_string.c:archive_string_append:
  226|  29.8M|{
  227|  29.8M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (227:6): [True: 0, False: 29.8M]
  ------------------
  228|      0|		return (NULL);
  229|  29.8M|	if (s)
  ------------------
  |  Branch (229:6): [True: 29.8M, False: 24.4k]
  ------------------
  230|  29.8M|		memmove(as->s + as->length, p, s);
  231|  29.8M|	as->length += s;
  232|  29.8M|	as->s[as->length] = 0;
  233|  29.8M|	return (as);
  234|  29.8M|}
archive_string.c:archive_wstring_append:
  238|  20.0k|{
  239|  20.0k|	if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (239:6): [True: 0, False: 20.0k]
  ------------------
  240|      0|		return (NULL);
  241|  20.0k|	if (s)
  ------------------
  |  Branch (241:6): [True: 13.3k, False: 6.65k]
  ------------------
  242|  13.3k|		wmemmove(as->s + as->length, p, s);
  243|  20.0k|	as->length += s;
  244|  20.0k|	as->s[as->length] = 0;
  245|  20.0k|	return (as);
  246|  20.0k|}
archive_string.c:get_sconv_object:
 1696|   419k|{
 1697|   419k|	struct archive_string_conv *sc;
 1698|   419k|	unsigned current_codepage;
 1699|       |
 1700|       |	/* Check if we have made the sconv object. */
 1701|   419k|	sc = find_sconv_object(a, fc, tc);
 1702|   419k|	if (sc != NULL)
  ------------------
  |  Branch (1702:6): [True: 1.69k, False: 417k]
  ------------------
 1703|  1.69k|		return (sc);
 1704|       |
 1705|   417k|	if (a == NULL)
  ------------------
  |  Branch (1705:6): [True: 413k, False: 4.06k]
  ------------------
 1706|   413k|		current_codepage = get_current_codepage();
 1707|  4.06k|	else
 1708|  4.06k|		current_codepage = a->current_codepage;
 1709|       |
 1710|   417k|	sc = create_sconv_object(canonical_charset_name(fc),
 1711|   417k|	    canonical_charset_name(tc), current_codepage, flag);
 1712|   417k|	if (sc == NULL) {
  ------------------
  |  Branch (1712:6): [True: 0, False: 417k]
  ------------------
 1713|      0|		if (a != NULL)
  ------------------
  |  Branch (1713:7): [True: 0, False: 0]
  ------------------
 1714|      0|			archive_set_error(a, ENOMEM,
 1715|      0|			    "Could not allocate memory for "
 1716|      0|			    "a string conversion object");
 1717|      0|		return (NULL);
 1718|      0|	}
 1719|       |
 1720|       |	/*
 1721|       |	 * If there is no converter for current string conversion object,
 1722|       |	 * we cannot handle this conversion.
 1723|       |	 */
 1724|   417k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1724:6): [True: 0, False: 417k]
  ------------------
 1725|      0|		if (a != NULL) {
  ------------------
  |  Branch (1725:7): [True: 0, False: 0]
  ------------------
 1726|      0|#if HAVE_ICONV
 1727|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1728|      0|			    "iconv_open failed: Cannot handle ``%s''",
 1729|      0|			    (flag & SCONV_TO_CHARSET)?tc:fc);
  ------------------
  |  |   89|      0|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1729:8): [True: 0, False: 0]
  ------------------
 1730|       |#else
 1731|       |			archive_set_error(a, ARCHIVE_ERRNO_MISC,
 1732|       |			    "A character-set conversion not fully supported "
 1733|       |			    "on this platform");
 1734|       |#endif
 1735|      0|		}
 1736|       |		/* Failed; free a sconv object. */
 1737|      0|		free_sconv_object(sc);
 1738|      0|		return (NULL);
 1739|      0|	}
 1740|       |
 1741|       |	/*
 1742|       |	 * Success!
 1743|       |	 */
 1744|   417k|	if (a != NULL)
  ------------------
  |  Branch (1744:6): [True: 4.06k, False: 413k]
  ------------------
 1745|  4.06k|		add_sconv_object(a, sc);
 1746|   417k|	return (sc);
 1747|   417k|}
archive_string.c:find_sconv_object:
  908|   419k|{
  909|   419k|	struct archive_string_conv *sc; 
  910|       |
  911|   419k|	if (a == NULL)
  ------------------
  |  Branch (911:6): [True: 413k, False: 5.76k]
  ------------------
  912|   413k|		return (NULL);
  913|       |
  914|  14.3k|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (914:22): [True: 10.2k, False: 4.06k]
  ------------------
  915|  10.2k|		if (strcmp(sc->from_charset, fc) == 0 &&
  ------------------
  |  Branch (915:7): [True: 1.69k, False: 8.54k]
  ------------------
  916|  1.69k|		    strcmp(sc->to_charset, tc) == 0)
  ------------------
  |  Branch (916:7): [True: 1.69k, False: 0]
  ------------------
  917|  1.69k|			break;
  918|  10.2k|	}
  919|  5.76k|	return (sc);
  920|   419k|}
archive_string.c:get_current_codepage:
 1674|   417k|{
 1675|   417k|	return (-1);/* Unknown */
 1676|   417k|}
archive_string.c:create_sconv_object:
 1169|   417k|{
 1170|   417k|	struct archive_string_conv *sc; 
 1171|       |
 1172|   417k|	sc = calloc(1, sizeof(*sc));
 1173|   417k|	if (sc == NULL)
  ------------------
  |  Branch (1173:6): [True: 0, False: 417k]
  ------------------
 1174|      0|		return (NULL);
 1175|   417k|	sc->next = NULL;
 1176|   417k|	sc->from_charset = strdup(fc);
 1177|   417k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1177:6): [True: 0, False: 417k]
  ------------------
 1178|      0|		free(sc);
 1179|      0|		return (NULL);
 1180|      0|	}
 1181|   417k|	sc->to_charset = strdup(tc);
 1182|   417k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1182:6): [True: 0, False: 417k]
  ------------------
 1183|      0|		free(sc->from_charset);
 1184|      0|		free(sc);
 1185|      0|		return (NULL);
 1186|      0|	}
 1187|   417k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|   417k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 417k]
  |  |  ------------------
  ------------------
 1188|       |
 1189|   417k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|   417k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1189:6): [True: 388k, False: 29.5k]
  ------------------
 1190|       |		/*
 1191|       |		 * Convert characters from the current locale charset to
 1192|       |		 * a specified charset.
 1193|       |		 */
 1194|   388k|		sc->from_cp = current_codepage;
 1195|   388k|		sc->to_cp = make_codepage_from_charset(tc);
 1196|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1197|       |		if (IsValidCodePage(sc->to_cp))
 1198|       |			flag |= SCONV_WIN_CP;
 1199|       |#endif
 1200|   388k|	} else if (flag & SCONV_FROM_CHARSET) {
  ------------------
  |  |   91|  29.5k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1200:13): [True: 29.5k, False: 0]
  ------------------
 1201|       |		/*
 1202|       |		 * Convert characters from a specified charset to
 1203|       |		 * the current locale charset.
 1204|       |		 */
 1205|  29.5k|		sc->to_cp = current_codepage;
 1206|  29.5k|		sc->from_cp = make_codepage_from_charset(fc);
 1207|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1208|       |		if (IsValidCodePage(sc->from_cp))
 1209|       |			flag |= SCONV_WIN_CP;
 1210|       |#endif
 1211|  29.5k|	}
 1212|       |
 1213|       |	/*
 1214|       |	 * Check if "from charset" and "to charset" are the same.
 1215|       |	 */
 1216|   417k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1216:6): [True: 0, False: 417k]
  ------------------
 1217|   417k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1217:7): [True: 0, False: 417k]
  |  Branch (1217:38): [True: 0, False: 0]
  ------------------
 1218|      0|		sc->same = 1;
 1219|   417k|	else
 1220|   417k|		sc->same = 0;
 1221|       |
 1222|       |	/*
 1223|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1224|       |	 */
 1225|   417k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1225:6): [True: 388k, False: 29.5k]
  ------------------
 1226|   388k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|   388k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1227|  29.5k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1227:11): [True: 0, False: 29.5k]
  ------------------
 1228|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1229|  29.5k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1229:11): [True: 0, False: 29.5k]
  ------------------
 1230|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  109|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1231|   417k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1231:6): [True: 28.4k, False: 389k]
  ------------------
 1232|  28.4k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  28.4k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1233|   389k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1233:11): [True: 667, False: 388k]
  ------------------
 1234|    667|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  108|    667|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1235|   388k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1235:11): [True: 241, False: 388k]
  ------------------
 1236|    241|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  110|    241|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
 1237|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1238|       |	if (sc->to_cp == CP_UTF8)
 1239|       |		flag |= SCONV_TO_UTF8;
 1240|       |	else if (sc->to_cp == CP_UTF16BE)
 1241|       |		flag |= SCONV_TO_UTF16BE | SCONV_WIN_CP;
 1242|       |	else if (sc->to_cp == CP_UTF16LE)
 1243|       |		flag |= SCONV_TO_UTF16LE | SCONV_WIN_CP;
 1244|       |	if (sc->from_cp == CP_UTF8)
 1245|       |		flag |= SCONV_FROM_UTF8;
 1246|       |	else if (sc->from_cp == CP_UTF16BE)
 1247|       |		flag |= SCONV_FROM_UTF16BE | SCONV_WIN_CP;
 1248|       |	else if (sc->from_cp == CP_UTF16LE)
 1249|       |		flag |= SCONV_FROM_UTF16LE | SCONV_WIN_CP;
 1250|       |#endif
 1251|       |
 1252|       |	/*
 1253|       |	 * Set a flag for Unicode NFD. Usually iconv cannot correctly
 1254|       |	 * handle it. So we have to translate NFD characters to NFC ones
 1255|       |	 * ourselves before iconv handles. Another reason is to prevent
 1256|       |	 * that the same sight of two filenames, one is NFC and other
 1257|       |	 * is NFD, would be in its directory.
 1258|       |	 * On Mac OS X, although its filesystem layer automatically
 1259|       |	 * convert filenames to NFD, it would be useful for filename
 1260|       |	 * comparing to find out the same filenames that we normalize
 1261|       |	 * that to be NFD ourselves.
 1262|       |	 */
 1263|   417k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   417k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1263:6): [True: 29.5k, False: 388k]
  ------------------
 1264|  29.5k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  112|  29.5k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  29.5k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  29.5k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  106|  29.5k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1264:6): [True: 29.3k, False: 252]
  ------------------
 1265|       |#if defined(__APPLE__)
 1266|       |		if (flag & SCONV_TO_UTF8)
 1267|       |			flag |= SCONV_NORMALIZATION_D;
 1268|       |		else
 1269|       |#endif
 1270|  29.3k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   98|  29.3k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1271|  29.3k|	}
 1272|       |#if defined(__APPLE__)
 1273|       |	/*
 1274|       |	 * In case writing an archive file, make sure that a filename
 1275|       |	 * going to be passed to iconv is a Unicode NFC string since
 1276|       |	 * a filename in HFS Plus filesystem is a Unicode NFD one and
 1277|       |	 * iconv cannot handle it with "UTF-8" charset. It is simpler
 1278|       |	 * than a use of "UTF-8-MAC" charset.
 1279|       |	 */
 1280|       |	if ((flag & SCONV_TO_CHARSET) &&
 1281|       |	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1282|       |	    !(flag & (SCONV_TO_UTF16 | SCONV_TO_UTF8)))
 1283|       |		flag |= SCONV_NORMALIZATION_C;
 1284|       |	/*
 1285|       |	 * In case reading an archive file. make sure that a filename
 1286|       |	 * will be passed to users is a Unicode NFD string in order to
 1287|       |	 * correctly compare the filename with other one which comes
 1288|       |	 * from HFS Plus filesystem.
 1289|       |	 */
 1290|       |	if ((flag & SCONV_FROM_CHARSET) &&
 1291|       |	   !(flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1292|       |	    (flag & SCONV_TO_UTF8))
 1293|       |		flag |= SCONV_NORMALIZATION_D;
 1294|       |#endif
 1295|       |
 1296|   417k|#if defined(HAVE_ICONV)
 1297|   417k|	sc->cd_w = (iconv_t)-1;
 1298|       |	/*
 1299|       |	 * Create an iconv object.
 1300|       |	 */
 1301|   417k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|   417k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|   417k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   417k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   417k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1301:7): [True: 388k, False: 29.5k]
  ------------------
 1302|   388k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  106|   388k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  112|   388k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   388k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   388k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1302:6): [True: 0, False: 388k]
  ------------------
 1303|   417k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|   417k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1303:6): [True: 0, False: 417k]
  ------------------
 1304|       |		/* This case we won't use iconv. */
 1305|      0|		sc->cd = (iconv_t)-1;
 1306|   417k|	} else {
 1307|   417k|		sc->cd = iconv_open(tc, fc);
 1308|   417k|		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
  ------------------
  |  |   93|    252|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1308:7): [True: 252, False: 417k]
  |  Branch (1308:32): [True: 0, False: 252]
  ------------------
 1309|       |			/*
 1310|       |			 * Unfortunately, all of iconv implements do support
 1311|       |			 * "CP932" character-set, so we should use "SJIS"
 1312|       |			 * instead if iconv_open failed.
 1313|       |			 */
 1314|      0|			if (strcmp(tc, "CP932") == 0)
  ------------------
  |  Branch (1314:8): [True: 0, False: 0]
  ------------------
 1315|      0|				sc->cd = iconv_open("SJIS", fc);
 1316|      0|			else if (strcmp(fc, "CP932") == 0)
  ------------------
  |  Branch (1316:13): [True: 0, False: 0]
  ------------------
 1317|      0|				sc->cd = iconv_open(tc, "SJIS");
 1318|      0|		}
 1319|       |#if defined(__FreeBSD__) && !defined(HAVE_LIBICONV)
 1320|       |		/*
 1321|       |		 * FreeBSD's native iconv() by default returns the number of
 1322|       |		 * invalid characters in the input string, as specified by
 1323|       |		 * POSIX, but iconv_strncat_in_locale() assumes GNU iconv
 1324|       |		 * semantics.
 1325|       |		 */
 1326|       |		int v = 1;
 1327|       |
 1328|       |		(void)iconvctl(sc->cd, ICONV_SET_ILSEQ_INVALID, &v);
 1329|       |#elif defined(_WIN32) && !defined(__CYGWIN__)
 1330|       |		/*
 1331|       |		 * archive_mstring on Windows directly convert multi-bytes
 1332|       |		 * into archive_wstring in order not to depend on locale
 1333|       |		 * so that you can do a I18N programming. This will be
 1334|       |		 * used only in archive_mstring_copy_mbs_len_l so far.
 1335|       |		 */
 1336|       |		if (flag & SCONV_FROM_CHARSET) {
 1337|       |			sc->cd_w = iconv_open("UTF-8", fc);
 1338|       |			if (sc->cd_w == (iconv_t)-1 &&
 1339|       |			    (sc->flag & SCONV_BEST_EFFORT)) {
 1340|       |				if (strcmp(fc, "CP932") == 0)
 1341|       |					sc->cd_w = iconv_open("UTF-8", "SJIS");
 1342|       |			}
 1343|       |		}
 1344|       |#endif /* _WIN32 && !__CYGWIN__ */
 1345|   417k|	}
 1346|   417k|#endif	/* HAVE_ICONV */
 1347|       |
 1348|   417k|	sc->flag = flag;
 1349|       |
 1350|       |	/*
 1351|       |	 * Set up converters.
 1352|       |	 */
 1353|   417k|	setup_converter(sc);
 1354|       |
 1355|   417k|	return (sc);
 1356|   417k|}
archive_string.c:make_codepage_from_charset:
 1679|   417k|{
 1680|   417k|	(void)charset; /* UNUSED */
 1681|   417k|	return (-1);/* Unknown */
 1682|   417k|}
archive_string.c:canonical_charset_name:
 1129|   835k|{
 1130|   835k|	char cs[16];
 1131|   835k|	char *p;
 1132|   835k|	const char *s;
 1133|       |
 1134|   835k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1134:6): [True: 0, False: 835k]
  |  Branch (1134:25): [True: 0, False: 835k]
  ------------------
 1135|   835k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1135:9): [True: 0, False: 835k]
  ------------------
 1136|      0|		return (charset);
 1137|       |
 1138|       |	/* Copy name to uppercase. */
 1139|   835k|	p = cs;
 1140|   835k|	s = charset;
 1141|  8.78M|	while (*s) {
  ------------------
  |  Branch (1141:9): [True: 7.94M, False: 835k]
  ------------------
 1142|  7.94M|		char c = *s++;
 1143|  7.94M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1143:7): [True: 0, False: 7.94M]
  |  Branch (1143:19): [True: 0, False: 0]
  ------------------
 1144|      0|			c -= 'a' - 'A';
 1145|  7.94M|		*p++ = c;
 1146|  7.94M|	}
 1147|   835k|	*p++ = '\0';
 1148|       |
 1149|   835k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1149:6): [True: 416k, False: 419k]
  ------------------
 1150|   419k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1150:6): [True: 0, False: 419k]
  ------------------
 1151|   416k|		return ("UTF-8");
 1152|   419k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1152:6): [True: 667, False: 418k]
  ------------------
 1153|   418k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1153:6): [True: 0, False: 418k]
  ------------------
 1154|    667|		return ("UTF-16BE");
 1155|   418k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1155:6): [True: 241, False: 418k]
  ------------------
 1156|   418k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1156:6): [True: 0, False: 418k]
  ------------------
 1157|    241|		return ("UTF-16LE");
 1158|   418k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1158:6): [True: 0, False: 418k]
  ------------------
 1159|      0|		return ("CP932");
 1160|   418k|	return (charset);
 1161|   418k|}
archive_string.c:add_sconv_object:
  927|  4.06k|{
  928|  4.06k|	struct archive_string_conv **psc; 
  929|       |
  930|       |	/* Add a new sconv to sconv list. */
  931|  4.06k|	psc = &(a->sconv);
  932|  5.78k|	while (*psc != NULL)
  ------------------
  |  Branch (932:9): [True: 1.71k, False: 4.06k]
  ------------------
  933|  1.71k|		psc = &((*psc)->next);
  934|  4.06k|	*psc = sc;
  935|  4.06k|}
archive_string.c:get_current_charset:
 1751|   419k|{
 1752|   419k|	const char *cur_charset;
 1753|       |
 1754|   419k|	if (a == NULL)
  ------------------
  |  Branch (1754:6): [True: 413k, False: 5.76k]
  ------------------
 1755|   413k|		cur_charset = default_iconv_charset("");
 1756|  5.76k|	else {
 1757|  5.76k|		cur_charset = default_iconv_charset(a->current_code);
 1758|  5.76k|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1758:7): [True: 3.81k, False: 1.95k]
  ------------------
 1759|  3.81k|			a->current_code = strdup(cur_charset);
 1760|  3.81k|			a->current_codepage = get_current_codepage();
 1761|  3.81k|			a->current_oemcp = get_current_oemcp();
 1762|  3.81k|		}
 1763|  5.76k|	}
 1764|   419k|	return (cur_charset);
 1765|   419k|}
archive_string.c:default_iconv_charset:
  445|   419k|default_iconv_charset(const char *charset) {
  446|   419k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (446:6): [True: 415k, False: 3.81k]
  |  Branch (446:25): [True: 1.95k, False: 413k]
  ------------------
  447|  1.95k|		return charset;
  448|       |#if HAVE_LOCALE_CHARSET && !defined(__APPLE__)
  449|       |	/* locale_charset() is broken on Mac OS */
  450|       |	return locale_charset();
  451|       |#elif HAVE_NL_LANGINFO
  452|   417k|	return nl_langinfo(CODESET);
  453|       |#elif defined(__BIONIC__)
  454|       |	return "UTF-8";
  455|       |#else
  456|       |	return "";
  457|       |#endif
  458|   419k|}
archive_string.c:get_current_oemcp:
 1685|  3.81k|{
 1686|  3.81k|	return (-1);/* Unknown */
 1687|  3.81k|}
archive_string.c:free_sconv_object:
 1363|   417k|{
 1364|   417k|	free(sc->from_charset);
 1365|   417k|	free(sc->to_charset);
 1366|   417k|	archive_string_free(&sc->utftmp);
 1367|   417k|#if HAVE_ICONV
 1368|   417k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1368:6): [True: 417k, False: 252]
  ------------------
 1369|   417k|		iconv_close(sc->cd);
 1370|   417k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1370:6): [True: 0, False: 417k]
  ------------------
 1371|      0|		iconv_close(sc->cd_w);
 1372|   417k|#endif
 1373|   417k|	free(sc);
 1374|   417k|}
archive_string.c:setup_converter:
  949|   417k|{
  950|       |
  951|       |	/* Reset. */
  952|   417k|	sc->nconverter = 0;
  953|       |
  954|       |	/*
  955|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  956|       |	 * made by libarchive2.x.
  957|       |	 */
  958|   417k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|   417k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (958:6): [True: 0, False: 417k]
  ------------------
  959|      0|		add_converter(sc, strncat_from_utf8_libarchive2);
  960|      0|		return;
  961|      0|	}
  962|       |
  963|       |	/*
  964|       |	 * Convert a string to UTF-16BE/LE.
  965|       |	 */
  966|   417k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|   417k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   417k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   417k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (966:6): [True: 0, False: 417k]
  ------------------
  967|       |		/*
  968|       |		 * If the current locale is UTF-8, we can translate
  969|       |		 * a UTF-8 string into a UTF-16BE string.
  970|       |		 */
  971|      0|		if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (971:7): [True: 0, False: 0]
  ------------------
  972|      0|			add_converter(sc, archive_string_append_unicode);
  973|      0|			return;
  974|      0|		}
  975|       |
  976|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  977|       |		if (sc->flag & SCONV_WIN_CP) {
  978|       |			if (sc->flag & SCONV_TO_UTF16BE)
  979|       |				add_converter(sc, win_strncat_to_utf16be);
  980|       |			else
  981|       |				add_converter(sc, win_strncat_to_utf16le);
  982|       |			return;
  983|       |		}
  984|       |#endif
  985|       |
  986|      0|#if defined(HAVE_ICONV)
  987|      0|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (987:7): [True: 0, False: 0]
  ------------------
  988|      0|			add_converter(sc, iconv_strncat_in_locale);
  989|      0|			return;
  990|      0|		}
  991|      0|#endif
  992|       |
  993|      0|		if (sc->flag & SCONV_BEST_EFFORT) {
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (993:7): [True: 0, False: 0]
  ------------------
  994|      0|			if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (994:8): [True: 0, False: 0]
  ------------------
  995|      0|				add_converter(sc,
  996|      0|					best_effort_strncat_to_utf16be);
  997|      0|			else
  998|      0|				add_converter(sc,
  999|      0|					best_effort_strncat_to_utf16le);
 1000|      0|		} else
 1001|       |			/* Make sure we have no converter. */
 1002|      0|			sc->nconverter = 0;
 1003|      0|		return;
 1004|      0|	}
 1005|       |
 1006|       |	/*
 1007|       |	 * Convert a string from UTF-16BE/LE.
 1008|       |	 */
 1009|   417k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|   417k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   417k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   417k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1009:6): [True: 908, False: 417k]
  ------------------
 1010|       |		/*
 1011|       |		 * At least we should normalize a UTF-16BE string.
 1012|       |		 */
 1013|    908|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|    908|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1013:7): [True: 0, False: 908]
  ------------------
 1014|      0|			add_converter(sc,archive_string_normalize_D);
 1015|    908|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|    908|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1015:12): [True: 908, False: 0]
  ------------------
 1016|    908|			add_converter(sc, archive_string_normalize_C);
 1017|       |
 1018|    908|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|    908|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1018:7): [True: 0, False: 908]
  ------------------
 1019|       |			/*
 1020|       |			 * If the current locale is UTF-8, we can translate
 1021|       |			 * a UTF-16BE/LE string into a UTF-8 string directly.
 1022|       |			 */
 1023|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1023:8): [True: 0, False: 0]
  ------------------
 1024|      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.
  ------------------
 1025|      0|				add_converter(sc,
 1026|      0|				    archive_string_append_unicode);
 1027|      0|			return;
 1028|      0|		}
 1029|       |
 1030|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1031|       |		if (sc->flag & SCONV_WIN_CP) {
 1032|       |			if (sc->flag & SCONV_FROM_UTF16BE)
 1033|       |				add_converter(sc, win_strncat_from_utf16be);
 1034|       |			else
 1035|       |				add_converter(sc, win_strncat_from_utf16le);
 1036|       |			return;
 1037|       |		}
 1038|       |#endif
 1039|       |
 1040|    908|#if defined(HAVE_ICONV)
 1041|    908|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1041:7): [True: 908, False: 0]
  ------------------
 1042|    908|			add_converter(sc, iconv_strncat_in_locale);
 1043|    908|			return;
 1044|    908|		}
 1045|      0|#endif
 1046|       |
 1047|      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 (1047:7): [True: 0, False: 0]
  ------------------
 1048|      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. */
  ------------------
 1049|      0|			add_converter(sc, best_effort_strncat_from_utf16be);
 1050|      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 (1050:12): [True: 0, False: 0]
  ------------------
 1051|      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. */
  ------------------
 1052|      0|			add_converter(sc, best_effort_strncat_from_utf16le);
 1053|      0|		else
 1054|       |			/* Make sure we have no converter. */
 1055|      0|			sc->nconverter = 0;
 1056|      0|		return;
 1057|    908|	}
 1058|       |
 1059|   417k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|   417k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1059:6): [True: 28.4k, False: 388k]
  ------------------
 1060|       |		/*
 1061|       |		 * At least we should normalize a UTF-8 string.
 1062|       |		 */
 1063|  28.4k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|  28.4k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1063:7): [True: 0, False: 28.4k]
  ------------------
 1064|      0|			add_converter(sc,archive_string_normalize_D);
 1065|  28.4k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|  28.4k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1065:12): [True: 28.4k, False: 0]
  ------------------
 1066|  28.4k|			add_converter(sc, archive_string_normalize_C);
 1067|       |
 1068|       |		/*
 1069|       |		 * Copy UTF-8 string with a check of CESU-8.
 1070|       |		 * Apparently, iconv does not check surrogate pairs in UTF-8
 1071|       |		 * when both from-charset and to-charset are UTF-8, and then
 1072|       |		 * we use our UTF-8 copy code.
 1073|       |		 */
 1074|  28.4k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  28.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1074:7): [True: 0, False: 28.4k]
  ------------------
 1075|       |			/*
 1076|       |			 * If the current locale is UTF-8, we can translate
 1077|       |			 * a UTF-16BE string into a UTF-8 string directly.
 1078|       |			 */
 1079|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1079:8): [True: 0, False: 0]
  ------------------
 1080|      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.
  ------------------
 1081|      0|				add_converter(sc, strncat_from_utf8_to_utf8);
 1082|      0|			return;
 1083|      0|		}
 1084|  28.4k|	}
 1085|       |
 1086|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1087|       |	/*
 1088|       |	 * On Windows we can use Windows API for a string conversion.
 1089|       |	 */
 1090|       |	if (sc->flag & SCONV_WIN_CP) {
 1091|       |		add_converter(sc, strncat_in_codepage);
 1092|       |		return;
 1093|       |	}
 1094|       |#endif
 1095|       |
 1096|   417k|#if HAVE_ICONV
 1097|   417k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1097:6): [True: 416k, False: 252]
  ------------------
 1098|   416k|		add_converter(sc, iconv_strncat_in_locale);
 1099|       |		/*
 1100|       |		 * iconv generally does not support UTF-8-MAC and so
 1101|       |		 * we have to the output of iconv from NFC to NFD if
 1102|       |		 * need.
 1103|       |		 */
 1104|   416k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   416k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1104:7): [True: 28.4k, False: 388k]
  ------------------
 1105|  28.4k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  105|  28.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1105:7): [True: 0, False: 28.4k]
  ------------------
 1106|      0|			if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1106:8): [True: 0, False: 0]
  ------------------
 1107|      0|				add_converter(sc, archive_string_normalize_D);
 1108|      0|		}
 1109|   416k|		return;
 1110|   416k|	}
 1111|    252|#endif
 1112|       |
 1113|       |	/*
 1114|       |	 * Try conversion in the best effort or no conversion.
 1115|       |	 */
 1116|    252|	if ((sc->flag & SCONV_BEST_EFFORT) || sc->same)
  ------------------
  |  |   93|    252|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1116:6): [True: 252, False: 0]
  |  Branch (1116:40): [True: 0, False: 0]
  ------------------
 1117|    252|		add_converter(sc, best_effort_strncat_in_locale);
 1118|      0|	else
 1119|       |		/* Make sure we have no converter. */
 1120|      0|		sc->nconverter = 0;
 1121|    252|}
archive_string.c:add_converter:
  941|   447k|{
  942|   447k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (942:6): [True: 0, False: 447k]
  |  Branch (942:20): [True: 0, False: 447k]
  ------------------
  943|      0|		__archive_errx(1, "Programming error");
  944|   447k|	sc->converter[sc->nconverter++] = converter;
  945|   447k|}
archive_string.c:_utf8_to_unicode:
 2370|  3.84M|{
 2371|  3.84M|	static const char utf8_count[256] = {
 2372|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2373|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2374|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2375|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2376|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2377|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2378|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2379|  3.84M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2380|  3.84M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2381|  3.84M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2382|  3.84M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2383|  3.84M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2384|  3.84M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2385|  3.84M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2386|  3.84M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2387|  3.84M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2388|  3.84M|	};
 2389|  3.84M|	int ch, i;
 2390|  3.84M|	int cnt;
 2391|  3.84M|	uint32_t wc;
 2392|       |
 2393|       |	/* Sanity check. */
 2394|  3.84M|	if (n == 0)
  ------------------
  |  Branch (2394:6): [True: 29.6k, False: 3.81M]
  ------------------
 2395|  29.6k|		return (0);
 2396|       |	/*
 2397|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2398|       |	 */
 2399|  3.81M|	ch = (unsigned char)*s;
 2400|  3.81M|	if (ch == 0)
  ------------------
  |  Branch (2400:6): [True: 0, False: 3.81M]
  ------------------
 2401|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2402|  3.81M|	cnt = utf8_count[ch];
 2403|       |
 2404|       |	/* Invalid sequence or there are not plenty bytes. */
 2405|  3.81M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2405:6): [True: 2.38k, False: 3.81M]
  ------------------
 2406|  2.38k|		cnt = (int)n;
 2407|  2.60k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2407:15): [True: 934, False: 1.67k]
  ------------------
 2408|    934|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2408:8): [True: 714, False: 220]
  ------------------
 2409|    714|				cnt = i;
 2410|    714|				break;
 2411|    714|			}
 2412|    934|		}
 2413|  2.38k|		goto invalid_sequence;
 2414|  2.38k|	}
 2415|       |
 2416|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2417|  3.81M|	switch (cnt) {
 2418|  3.51M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2418:2): [True: 3.51M, False: 296k]
  ------------------
 2419|  3.51M|		*pwc = ch & 0x7f;
 2420|  3.51M|		return (cnt);
 2421|  58.1k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2421:2): [True: 58.1k, False: 3.75M]
  ------------------
 2422|  58.1k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2422:7): [True: 15.6k, False: 42.4k]
  ------------------
 2423|  15.6k|			cnt = 1;
 2424|  15.6k|			goto invalid_sequence;
 2425|  15.6k|		}
 2426|  42.4k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2427|  42.4k|		return (cnt);
 2428|  42.9k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2428:2): [True: 42.9k, False: 3.77M]
  ------------------
 2429|  42.9k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2429:7): [True: 17.5k, False: 25.3k]
  ------------------
 2430|  17.5k|			cnt = 1;
 2431|  17.5k|			goto invalid_sequence;
 2432|  17.5k|		}
 2433|  25.3k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2433:7): [True: 4.82k, False: 20.5k]
  ------------------
 2434|  4.82k|			cnt = 2;
 2435|  4.82k|			goto invalid_sequence;
 2436|  4.82k|		}
 2437|  20.5k|		wc = ((ch & 0x0f) << 12)
 2438|  20.5k|		    | ((s[1] & 0x3f) << 6)
 2439|  20.5k|		    | (s[2] & 0x3f);
 2440|  20.5k|		if (wc < 0x800)
  ------------------
  |  Branch (2440:7): [True: 420, False: 20.1k]
  ------------------
 2441|    420|			goto invalid_sequence;/* Overlong sequence. */
 2442|  20.1k|		break;
 2443|  20.1k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2443:2): [True: 11.9k, False: 3.80M]
  ------------------
 2444|  11.9k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2444:7): [True: 1.25k, False: 10.7k]
  ------------------
 2445|  1.25k|			cnt = 1;
 2446|  1.25k|			goto invalid_sequence;
 2447|  1.25k|		}
 2448|  10.7k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2448:7): [True: 1.70k, False: 9.00k]
  ------------------
 2449|  1.70k|			cnt = 2;
 2450|  1.70k|			goto invalid_sequence;
 2451|  1.70k|		}
 2452|  9.00k|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2452:7): [True: 3.76k, False: 5.24k]
  ------------------
 2453|  3.76k|			cnt = 3;
 2454|  3.76k|			goto invalid_sequence;
 2455|  3.76k|		}
 2456|  5.24k|		wc = ((ch & 0x07) << 18)
 2457|  5.24k|		    | ((s[1] & 0x3f) << 12)
 2458|  5.24k|		    | ((s[2] & 0x3f) << 6)
 2459|  5.24k|		    | (s[3] & 0x3f);
 2460|  5.24k|		if (wc < 0x10000)
  ------------------
  |  Branch (2460:7): [True: 386, False: 4.85k]
  ------------------
 2461|    386|			goto invalid_sequence;/* Overlong sequence. */
 2462|  4.85k|		break;
 2463|   183k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2463:2): [True: 183k, False: 3.63M]
  ------------------
 2464|   183k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2464:7): [True: 7.13k, False: 176k]
  |  Branch (2464:21): [True: 452, False: 176k]
  ------------------
 2465|  7.58k|			cnt = 2;
 2466|   176k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2466:12): [True: 101k, False: 74.2k]
  |  Branch (2466:26): [True: 4.25k, False: 97.5k]
  ------------------
 2467|  4.25k|			cnt = 4;
 2468|   171k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2468:12): [True: 97.5k, False: 74.2k]
  |  Branch (2468:26): [True: 4.69k, False: 92.8k]
  ------------------
 2469|  4.69k|			cnt = 5;
 2470|   167k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2470:12): [True: 680, False: 166k]
  |  Branch (2470:26): [True: 2.91k, False: 163k]
  ------------------
 2471|  3.59k|			cnt = 6;
 2472|   163k|		else
 2473|   163k|			cnt = 1;
 2474|   183k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2474:7): [True: 2.59k, False: 181k]
  ------------------
 2475|  2.59k|			cnt = (int)n;
 2476|   193k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2476:15): [True: 27.7k, False: 166k]
  ------------------
 2477|  27.7k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2477:8): [True: 17.6k, False: 10.1k]
  ------------------
 2478|  17.6k|				cnt = i;
 2479|  17.6k|				break;
 2480|  17.6k|			}
 2481|  27.7k|		}
 2482|   183k|		goto invalid_sequence;
 2483|  3.81M|	}
 2484|       |
 2485|       |	/* The code point larger than 0x10FFFF is not legal
 2486|       |	 * Unicode values. */
 2487|  25.0k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|  25.0k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2487:6): [True: 918, False: 24.0k]
  ------------------
 2488|    918|		goto invalid_sequence;
 2489|       |	/* Correctly gets a Unicode, returns used bytes. */
 2490|  24.0k|	*pwc = wc;
 2491|  24.0k|	return (cnt);
 2492|   232k|invalid_sequence:
 2493|   232k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|   232k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2494|   232k|	return (cnt * -1);
 2495|  25.0k|}
archive_string.c:unicode_to_utf16be:
 2675|  14.1k|{
 2676|  14.1k|	char *utf16 = p;
 2677|       |
 2678|  14.1k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2678:6): [True: 52, False: 14.1k]
  ------------------
 2679|       |		/* We have a code point that won't fit into a
 2680|       |		 * wchar_t; convert it to a surrogate pair. */
 2681|     52|		if (remaining < 4)
  ------------------
  |  Branch (2681:7): [True: 0, False: 52]
  ------------------
 2682|      0|			return (0);
 2683|     52|		uc -= 0x10000;
 2684|     52|		archive_be16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2685|     52|		archive_be16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2686|     52|		return (4);
 2687|  14.1k|	} else {
 2688|  14.1k|		if (remaining < 2)
  ------------------
  |  Branch (2688:7): [True: 0, False: 14.1k]
  ------------------
 2689|      0|			return (0);
 2690|  14.1k|		archive_be16enc(utf16, (uint16_t)uc);
 2691|  14.1k|		return (2);
 2692|  14.1k|	}
 2693|  14.1k|}
archive_string.c:unicode_to_utf16le:
 2697|  4.29k|{
 2698|  4.29k|	char *utf16 = p;
 2699|       |
 2700|  4.29k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2700:6): [True: 70, False: 4.22k]
  ------------------
 2701|       |		/* We have a code point that won't fit into a
 2702|       |		 * wchar_t; convert it to a surrogate pair. */
 2703|     70|		if (remaining < 4)
  ------------------
  |  Branch (2703:7): [True: 0, False: 70]
  ------------------
 2704|      0|			return (0);
 2705|     70|		uc -= 0x10000;
 2706|     70|		archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2707|     70|		archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2708|     70|		return (4);
 2709|  4.22k|	} else {
 2710|  4.22k|		if (remaining < 2)
  ------------------
  |  Branch (2710:7): [True: 0, False: 4.22k]
  ------------------
 2711|      0|			return (0);
 2712|  4.22k|		archive_le16enc(utf16, (uint16_t)uc);
 2713|  4.22k|		return (2);
 2714|  4.22k|	}
 2715|  4.29k|}
archive_string.c:unicode_to_utf8:
 2569|   346k|{
 2570|   346k|	char *_p = p;
 2571|       |
 2572|       |	/* Invalid Unicode char maps to Replacement character */
 2573|   346k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  133|   346k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2573:6): [True: 0, False: 346k]
  ------------------
 2574|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2575|       |	/* Translate code point to UTF8 */
 2576|   346k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2576:6): [True: 83.7k, False: 262k]
  ------------------
 2577|  83.7k|		if (remaining == 0)
  ------------------
  |  Branch (2577:7): [True: 636, False: 83.1k]
  ------------------
 2578|    636|			return (0);
 2579|  83.1k|		*p++ = (char)uc;
 2580|   262k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2580:13): [True: 26.9k, False: 235k]
  ------------------
 2581|  26.9k|		if (remaining < 2)
  ------------------
  |  Branch (2581:7): [True: 179, False: 26.7k]
  ------------------
 2582|    179|			return (0);
 2583|  26.7k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2584|  26.7k|		*p++ = 0x80 | (uc & 0x3f);
 2585|   235k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2585:13): [True: 234k, False: 1.53k]
  ------------------
 2586|   234k|		if (remaining < 3)
  ------------------
  |  Branch (2586:7): [True: 2.87k, False: 231k]
  ------------------
 2587|  2.87k|			return (0);
 2588|   231k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2589|   231k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2590|   231k|		*p++ = 0x80 | (uc & 0x3f);
 2591|   231k|	} else {
 2592|  1.53k|		if (remaining < 4)
  ------------------
  |  Branch (2592:7): [True: 135, False: 1.39k]
  ------------------
 2593|    135|			return (0);
 2594|  1.39k|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2595|  1.39k|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2596|  1.39k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2597|  1.39k|		*p++ = 0x80 | (uc & 0x3f);
 2598|  1.39k|	}
 2599|   342k|	return (p - _p);
 2600|   346k|}
archive_string.c:utf16be_to_unicode:
 2604|  43.6k|{
 2605|  43.6k|	return (utf16_to_unicode(pwc, s, n, 1));
 2606|  43.6k|}
archive_string.c:utf16_to_unicode:
 2616|  71.2k|{
 2617|  71.2k|	const char *utf16 = s;
 2618|  71.2k|	unsigned uc;
 2619|       |
 2620|  71.2k|	if (n == 0)
  ------------------
  |  Branch (2620:6): [True: 3.06k, False: 68.1k]
  ------------------
 2621|  3.06k|		return (0);
 2622|  68.1k|	if (n == 1) {
  ------------------
  |  Branch (2622:6): [True: 0, False: 68.1k]
  ------------------
 2623|       |		/* set the Replacement Character instead. */
 2624|      0|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2625|      0|		return (-1);
 2626|      0|	}
 2627|       |
 2628|  68.1k|	if (be)
  ------------------
  |  Branch (2628:6): [True: 41.3k, False: 26.7k]
  ------------------
 2629|  41.3k|		uc = archive_be16dec(utf16);
 2630|  26.7k|	else
 2631|  26.7k|		uc = archive_le16dec(utf16);
 2632|  68.1k|	utf16 += 2;
 2633|       |		
 2634|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2635|  68.1k|	if (IS_HIGH_SURROGATE_LA(uc)) {
  ------------------
  |  |  130|  68.1k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 20.8k, False: 47.2k]
  |  |  |  Branch (130:53): [True: 12.7k, False: 8.12k]
  |  |  ------------------
  ------------------
 2636|  12.7k|		unsigned uc2;
 2637|       |
 2638|  12.7k|		if (n >= 4) {
  ------------------
  |  Branch (2638:7): [True: 12.7k, False: 12]
  ------------------
 2639|  12.7k|			if (be)
  ------------------
  |  Branch (2639:8): [True: 9.27k, False: 3.47k]
  ------------------
 2640|  9.27k|				uc2 = archive_be16dec(utf16);
 2641|  3.47k|			else
 2642|  3.47k|				uc2 = archive_le16dec(utf16);
 2643|  12.7k|		} else
 2644|     12|			uc2 = 0;
 2645|  12.7k|		if (IS_LOW_SURROGATE_LA(uc2)) {
  ------------------
  |  |  131|  12.7k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 211, False: 12.5k]
  |  |  |  Branch (131:53): [True: 122, False: 89]
  |  |  ------------------
  ------------------
 2646|    122|			uc = combine_surrogate_pair(uc, uc2);
 2647|    122|			utf16 += 2;
 2648|  12.6k|		} else {
 2649|       |	 		/* Undescribed code point should be U+FFFD
 2650|       |		 	* (replacement character). */
 2651|  12.6k|			*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  12.6k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2652|  12.6k|			return (-2);
 2653|  12.6k|		}
 2654|  12.7k|	}
 2655|       |
 2656|       |	/*
 2657|       |	 * Surrogate pair values(0xd800 through 0xdfff) are only
 2658|       |	 * used by UTF-16, so, after above calculation, the code
 2659|       |	 * must not be surrogate values, and Unicode has no codes
 2660|       |	 * larger than 0x10ffff. Thus, those are not legal Unicode
 2661|       |	 * values.
 2662|       |	 */
 2663|  55.5k|	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  132|   111k|#define IS_SURROGATE_PAIR_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 8.24k, False: 47.2k]
  |  |  |  Branch (132:53): [True: 4.04k, False: 4.20k]
  |  |  ------------------
  ------------------
              	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  133|  51.4k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2663:34): [True: 0, False: 51.4k]
  ------------------
 2664|       |	 	/* Undescribed code point should be U+FFFD
 2665|       |	 	* (replacement character). */
 2666|  4.04k|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  4.04k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2667|  4.04k|		return (((int)(utf16 - s)) * -1);
 2668|  4.04k|	}
 2669|  51.4k|	*pwc = uc;
 2670|  51.4k|	return ((int)(utf16 - s));
 2671|  55.5k|}
archive_string.c:combine_surrogate_pair:
 2511|  1.34k|{
 2512|  1.34k|	uc -= 0xD800;
 2513|  1.34k|	uc *= 0x400;
 2514|  1.34k|	uc += uc2 - 0xDC00;
 2515|  1.34k|	uc += 0x10000;
 2516|  1.34k|	return (uc);
 2517|  1.34k|}
archive_string.c:utf16le_to_unicode:
 2610|  27.5k|{
 2611|  27.5k|	return (utf16_to_unicode(pwc, s, n, 0));
 2612|  27.5k|}
archive_string.c:cesu8_to_unicode:
 2530|  3.83M|{
 2531|  3.83M|	uint32_t wc = 0;
 2532|  3.83M|	int cnt;
 2533|       |
 2534|  3.83M|	cnt = _utf8_to_unicode(&wc, s, n);
 2535|  3.83M|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  130|  18.1k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 11.6k, False: 6.51k]
  |  |  |  Branch (130:53): [True: 8.77k, False: 2.86k]
  |  |  ------------------
  ------------------
  |  Branch (2535:6): [True: 18.1k, False: 3.81M]
  ------------------
 2536|  8.77k|		uint32_t wc2 = 0;
 2537|  8.77k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2537:7): [True: 216, False: 8.55k]
  ------------------
 2538|       |			/* Invalid byte sequence. */
 2539|    216|			goto invalid_sequence;
 2540|    216|		}
 2541|  8.55k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2542|  8.55k|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  131|  1.99k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 1.65k, False: 340]
  |  |  |  Branch (131:53): [True: 1.22k, False: 431]
  |  |  ------------------
  ------------------
  |  Branch (2542:7): [True: 6.55k, False: 1.99k]
  ------------------
 2543|       |			/* Invalid byte sequence. */
 2544|  7.33k|			goto invalid_sequence;
 2545|  7.33k|		}
 2546|  1.22k|		wc = combine_surrogate_pair(wc, wc2);
 2547|  1.22k|		cnt = 6;
 2548|  3.82M|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|  9.38k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 2.86k, False: 6.51k]
  |  |  |  Branch (131:53): [True: 1.49k, False: 1.36k]
  |  |  ------------------
  ------------------
  |  Branch (2548:13): [True: 9.38k, False: 3.81M]
  ------------------
 2549|       |		/* Invalid byte sequence. */
 2550|  1.49k|		goto invalid_sequence;
 2551|  1.49k|	}
 2552|  3.82M|	*pwc = wc;
 2553|  3.82M|	return (cnt);
 2554|  9.04k|invalid_sequence:
 2555|  9.04k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  9.04k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2556|  9.04k|	if (cnt > 0)
  ------------------
  |  Branch (2556:6): [True: 2.71k, False: 6.33k]
  ------------------
 2557|  2.71k|		cnt *= -1;
 2558|  9.04k|	return (cnt);
 2559|  3.83M|}
archive_string.c:iconv_strncat_in_locale:
 2100|   360k|{
 2101|   360k|	ICONV_CONST char *itp;
 2102|   360k|	size_t remaining;
 2103|   360k|	iconv_t cd;
 2104|   360k|	char *outp;
 2105|   360k|	size_t avail, bs;
 2106|   360k|	int return_value = 0; /* success */
 2107|   360k|	size_t to_size, from_size;
 2108|       |
 2109|   360k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|   360k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   360k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   360k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2109:6): [True: 0, False: 360k]
  ------------------
 2110|      0|		to_size = 2;
 2111|   360k|	else
 2112|   360k|		to_size = 1;
 2113|   360k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|   360k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   360k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   360k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2113:6): [True: 3.04k, False: 357k]
  ------------------
 2114|  3.04k|		from_size = 2;
 2115|   357k|	else
 2116|   357k|		from_size = 1;
 2117|       |
 2118|   360k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2118:6): [True: 0, False: 360k]
  ------------------
 2119|      0|		return (-1);
 2120|       |
 2121|   360k|	cd = sc->cd;
 2122|   360k|	itp = (char *)(uintptr_t)_p;
 2123|   360k|	remaining = length;
 2124|   360k|	outp = as->s + as->length;
 2125|   360k|	avail = as->buffer_length - as->length - to_size;
 2126|  1.23M|	while (remaining >= from_size) {
  ------------------
  |  Branch (2126:9): [True: 1.22M, False: 11.7k]
  ------------------
 2127|  1.22M|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2128|       |
 2129|  1.22M|		if (result != (size_t)-1)
  ------------------
  |  Branch (2129:7): [True: 348k, False: 878k]
  ------------------
 2130|   348k|			break; /* Conversion completed. */
 2131|       |
 2132|   878k|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2132:7): [True: 878k, False: 545]
  |  Branch (2132:26): [True: 0, False: 545]
  ------------------
 2133|       |			/*
 2134|       |		 	 * If an output charset is UTF-8 or UTF-16BE/LE,
 2135|       |			 * unknown character should be U+FFFD
 2136|       |			 * (replacement character).
 2137|       |			 */
 2138|   878k|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|   878k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|   878k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   878k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   878k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2138:8): [True: 218k, False: 659k]
  ------------------
 2139|   218k|				size_t rbytes;
 2140|   218k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|   218k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2140:9): [True: 218k, False: 0]
  ------------------
 2141|   218k|					rbytes = sizeof(utf8_replacement_char);
 2142|      0|				else
 2143|      0|					rbytes = 2;
 2144|       |
 2145|   218k|				if (avail < rbytes) {
  ------------------
  |  Branch (2145:9): [True: 583, False: 218k]
  ------------------
 2146|    583|					as->length = outp - as->s;
 2147|    583|					bs = as->buffer_length +
 2148|    583|					    (remaining * to_size) + rbytes;
 2149|    583|					if (NULL ==
  ------------------
  |  Branch (2149:10): [True: 0, False: 583]
  ------------------
 2150|    583|					    archive_string_ensure(as, bs))
 2151|      0|						return (-1);
 2152|    583|					outp = as->s + as->length;
 2153|    583|					avail = as->buffer_length
 2154|    583|					    - as->length - to_size;
 2155|    583|				}
 2156|   218k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|   218k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2156:9): [True: 218k, False: 0]
  ------------------
 2157|   218k|					memcpy(outp, utf8_replacement_char, sizeof(utf8_replacement_char));
 2158|      0|				else if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (2158:14): [True: 0, False: 0]
  ------------------
 2159|      0|					archive_be16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2160|      0|				else
 2161|      0|					archive_le16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2162|   218k|				outp += rbytes;
 2163|   218k|				avail -= rbytes;
 2164|   659k|			} else {
 2165|       |				/* Skip the illegal input bytes. */
 2166|   659k|				*outp++ = '?';
 2167|   659k|				avail--;
 2168|   659k|			}
 2169|   878k|			itp += from_size;
 2170|   878k|			remaining -= from_size;
 2171|   878k|			return_value = -1; /* failure */
 2172|   878k|		} else {
 2173|       |			/* E2BIG no output buffer,
 2174|       |			 * Increase an output buffer.  */
 2175|    545|			as->length = outp - as->s;
 2176|    545|			bs = as->buffer_length + remaining * 2;
 2177|    545|			if (NULL == archive_string_ensure(as, bs))
  ------------------
  |  Branch (2177:8): [True: 0, False: 545]
  ------------------
 2178|      0|				return (-1);
 2179|    545|			outp = as->s + as->length;
 2180|    545|			avail = as->buffer_length - as->length - to_size;
 2181|    545|		}
 2182|   878k|	}
 2183|   360k|	as->length = outp - as->s;
 2184|   360k|	as->s[as->length] = 0;
 2185|   360k|	if (to_size == 2)
  ------------------
  |  Branch (2185:6): [True: 0, False: 360k]
  ------------------
 2186|      0|		as->s[as->length+1] = 0;
 2187|   360k|	return (return_value);
 2188|   360k|}
archive_string.c:archive_string_normalize_C:
 3002|  31.8k|{
 3003|  31.8k|	const char *s = (const char *)_p;
 3004|  31.8k|	char *p, *endp;
 3005|  31.8k|	uint32_t uc, uc2;
 3006|  31.8k|	size_t w;
 3007|  31.8k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3008|  31.8k|	int (*parse)(uint32_t *, const char *, size_t);
 3009|  31.8k|	size_t (*unparse)(char *, size_t, uint32_t);
 3010|       |
 3011|  31.8k|	always_replace = 1;
 3012|  31.8k|	ts = 1;/* text size. */
 3013|  31.8k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  31.8k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3013:6): [True: 0, False: 31.8k]
  ------------------
 3014|      0|		unparse = unicode_to_utf16be;
 3015|      0|		ts = 2;
 3016|      0|		if (sc->flag & SCONV_FROM_UTF16BE)
  ------------------
  |  |  108|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3016:7): [True: 0, False: 0]
  ------------------
 3017|      0|			always_replace = 0;
 3018|  31.8k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  109|  31.8k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (3018:13): [True: 0, False: 31.8k]
  ------------------
 3019|      0|		unparse = unicode_to_utf16le;
 3020|      0|		ts = 2;
 3021|      0|		if (sc->flag & SCONV_FROM_UTF16LE)
  ------------------
  |  |  110|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3021:7): [True: 0, False: 0]
  ------------------
 3022|      0|			always_replace = 0;
 3023|  31.8k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  31.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (3023:13): [True: 0, False: 31.8k]
  ------------------
 3024|      0|		unparse = unicode_to_utf8;
 3025|      0|		if (sc->flag & SCONV_FROM_UTF8)
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (3025:7): [True: 0, False: 0]
  ------------------
 3026|      0|			always_replace = 0;
 3027|  31.8k|	} else {
 3028|       |		/*
 3029|       |		 * This case is going to be converted to another
 3030|       |		 * character-set through iconv.
 3031|       |		 */
 3032|  31.8k|		always_replace = 0;
 3033|  31.8k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  31.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3033:7): [True: 2.23k, False: 29.6k]
  ------------------
 3034|  2.23k|			unparse = unicode_to_utf16be;
 3035|  2.23k|			ts = 2;
 3036|  29.6k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  29.6k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3036:14): [True: 809, False: 28.8k]
  ------------------
 3037|    809|			unparse = unicode_to_utf16le;
 3038|    809|			ts = 2;
 3039|  28.8k|		} else {
 3040|  28.8k|			unparse = unicode_to_utf8;
 3041|  28.8k|		}
 3042|  31.8k|	}
 3043|       |
 3044|  31.8k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  31.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3044:6): [True: 2.23k, False: 29.6k]
  ------------------
 3045|  2.23k|		parse = utf16be_to_unicode;
 3046|  2.23k|		tm = 1;
 3047|  2.23k|		spair = 4;/* surrogate pair size in UTF-16. */
 3048|  29.6k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  29.6k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3048:13): [True: 809, False: 28.8k]
  ------------------
 3049|    809|		parse = utf16le_to_unicode;
 3050|    809|		tm = 1;
 3051|    809|		spair = 4;/* surrogate pair size in UTF-16. */
 3052|  28.8k|	} else {
 3053|  28.8k|		parse = cesu8_to_unicode;
 3054|  28.8k|		tm = ts;
 3055|  28.8k|		spair = 6;/* surrogate pair size in UTF-8. */
 3056|  28.8k|	}
 3057|       |
 3058|  31.8k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (3058:6): [True: 0, False: 31.8k]
  ------------------
 3059|      0|		return (-1);
 3060|       |
 3061|  31.8k|	p = as->s + as->length;
 3062|  31.8k|	endp = as->s + as->buffer_length - ts;
 3063|   288k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3063:9): [True: 281k, False: 6.84k]
  ------------------
 3064|   281k|		const char *ucptr, *uc2ptr;
 3065|       |
 3066|   281k|		if (n < 0) {
  ------------------
  |  Branch (3066:7): [True: 195k, False: 86.2k]
  ------------------
 3067|       |			/* Use a replaced unicode character. */
 3068|   195k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2932|   195k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2933|   197k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2933:9): [True: 2.11k, False: 195k]
  |  |  ------------------
  |  | 2934|  2.11k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2923|  2.11k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|  2.11k|	as->length = p - as->s;			\
  |  |  |  | 2925|  2.11k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 2.11k]
  |  |  |  |  ------------------
  |  |  |  | 2926|  2.11k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|  2.11k|		return (-1);			\
  |  |  |  | 2928|  2.11k|	p = as->s + as->length;			\
  |  |  |  | 2929|  2.11k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|  2.11k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 2.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2935|  2.11k|	}					\
  |  | 2936|   195k|	p += w;					\
  |  | 2937|   195k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2937:10): [Folded, False: 195k]
  |  |  ------------------
  ------------------
 3069|   195k|			s += n*-1;
 3070|   195k|			len -= n*-1;
 3071|   195k|			ret = -1;
 3072|   195k|			continue;
 3073|   195k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3073:14): [True: 528, False: 85.6k]
  |  Branch (3073:28): [True: 0, False: 85.6k]
  ------------------
 3074|       |			/* uc is converted from a surrogate pair.
 3075|       |			 * this should be treated as a changed code. */
 3076|    528|			ucptr = NULL;
 3077|  85.6k|		else
 3078|  85.6k|			ucptr = s;
 3079|  86.2k|		s += n;
 3080|  86.2k|		len -= n;
 3081|       |
 3082|       |		/* Read second code point. */
 3083|  3.50M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3083:10): [True: 3.42M, False: 75.5k]
  ------------------
 3084|  3.42M|			uint32_t ucx[FDC_MAX];
 3085|  3.42M|			int ccx[FDC_MAX];
 3086|  3.42M|			int cl, cx, i, nx, ucx_size;
 3087|  3.42M|			int LIndex,SIndex;
 3088|  3.42M|			uint32_t nfc;
 3089|       |
 3090|  3.42M|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3090:8): [True: 386, False: 3.42M]
  |  Branch (3090:23): [True: 0, False: 3.42M]
  ------------------
 3091|       |				/* uc2 is converted from a surrogate pair.
 3092|       |			 	 * this should be treated as a changed code. */
 3093|    386|				uc2ptr = NULL;
 3094|  3.42M|			else
 3095|  3.42M|				uc2ptr = s;
 3096|  3.42M|			s += n2;
 3097|  3.42M|			len -= n2;
 3098|       |
 3099|       |			/*
 3100|       |			 * If current second code point is out of decomposable
 3101|       |			 * code points, finding compositions is unneeded.
 3102|       |			 */
 3103|  3.42M|			if (!IS_DECOMPOSABLE_BLOCK(uc2)) {
  ------------------
  |  |  986|  3.42M|	(((uc)>>8) <= 0x1D2 && u_decomposable_blocks[(uc)>>8])
  |  |  ------------------
  |  |  |  Branch (986:3): [True: 3.42M, False: 1.54k]
  |  |  |  Branch (986:25): [True: 36.7k, False: 3.39M]
  |  |  ------------------
  ------------------
 3104|  3.39M|				WRITE_UC();
  ------------------
  |  | 2945|  3.39M|#define WRITE_UC()	do {			\
  |  | 2946|  3.39M|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2946:6): [True: 3.39M, False: 1.03k]
  |  |  ------------------
  |  | 2947|  3.39M|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2947:7): [True: 6.99k, False: 3.38M]
  |  |  ------------------
  |  | 2948|  3.39M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2923|  6.99k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|  6.99k|	as->length = p - as->s;			\
  |  |  |  | 2925|  6.99k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 6.99k]
  |  |  |  |  ------------------
  |  |  |  | 2926|  6.99k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|  6.99k|		return (-1);			\
  |  |  |  | 2928|  6.99k|	p = as->s + as->length;			\
  |  |  |  | 2929|  6.99k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|  6.99k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 6.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2949|  3.39M|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2949:11): [True: 3.39M, False: 0]
  |  |  ------------------
  |  | 2950|    967|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 967, False: 3.39M]
  |  |  ------------------
  |  | 2951|    967|			*p++ = *ucptr++;	\
  |  | 2952|    967|			/* FALL THROUGH */	\
  |  | 2953|  4.02k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 3.05k, False: 3.38M]
  |  |  ------------------
  |  | 2954|  4.02k|			*p++ = *ucptr++;	\
  |  | 2955|  4.02k|			/* FALL THROUGH */	\
  |  | 2956|  37.9k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 33.9k, False: 3.35M]
  |  |  ------------------
  |  | 2957|  37.9k|			*p++ = *ucptr++;	\
  |  | 2958|  37.9k|			/* FALL THROUGH */	\
  |  | 2959|  3.39M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2959:3): [True: 3.35M, False: 37.9k]
  |  |  ------------------
  |  | 2960|  3.39M|			*p++ = *ucptr;		\
  |  | 2961|  3.39M|			break;			\
  |  | 2962|  3.39M|		}				\
  |  | 2963|  3.39M|		ucptr = NULL;			\
  |  | 2964|  3.39M|	} else {				\
  |  | 2965|  1.03k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2932|  1.03k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2933|  1.13k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2933:9): [True: 93, False: 1.03k]
  |  |  |  |  ------------------
  |  |  |  | 2934|     93|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|     93|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2924|     93|	as->length = p - as->s;			\
  |  |  |  |  |  | 2925|     93|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2925:6): [True: 0, False: 93]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2926|     93|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2927|     93|		return (-1);			\
  |  |  |  |  |  | 2928|     93|	p = as->s + as->length;			\
  |  |  |  |  |  | 2929|     93|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2930|     93|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2930:10): [Folded, False: 93]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2935|     93|	}					\
  |  |  |  | 2936|  1.03k|	p += w;					\
  |  |  |  | 2937|  1.03k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:10): [Folded, False: 1.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2966|  1.03k|	}					\
  |  | 2967|  3.39M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2967:10): [Folded, False: 3.39M]
  |  |  ------------------
  ------------------
 3105|  3.39M|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2917|  3.39M|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2918|  3.39M|	uc = uc2;				\
  |  | 2919|  3.39M|	ucptr = uc2ptr;				\
  |  | 2920|  3.39M|	n = n2;					\
  |  | 2921|  3.39M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2921:10): [Folded, False: 3.39M]
  |  |  ------------------
  ------------------
 3106|  3.39M|				continue;
 3107|  3.39M|			}
 3108|       |
 3109|       |			/*
 3110|       |			 * Try to combine current code points.
 3111|       |			 */
 3112|       |			/*
 3113|       |			 * We have to combine Hangul characters according to
 3114|       |			 * http://uniicode.org/reports/tr15/#Hangul
 3115|       |			 */
 3116|  36.7k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2871|  36.7k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3116:8): [True: 20.0k, False: 16.7k]
  ------------------
 3117|  20.0k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2874|  20.0k|#define HC_LCOUNT	19
  ------------------
  |  Branch (3117:8): [True: 1.91k, False: 18.0k]
  ------------------
 3118|       |				/*
 3119|       |				 * Hangul Composition.
 3120|       |				 * 1. Two current code points are L and V.
 3121|       |				 */
 3122|  1.91k|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2872|  1.91k|#define HC_VBASE	0x1161
  ------------------
 3123|  1.91k|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2875|    896|#define HC_VCOUNT	21
  ------------------
  |  Branch (3123:9): [True: 896, False: 1.02k]
  |  Branch (3123:24): [True: 372, False: 524]
  ------------------
 3124|       |					/* Make syllable of form LV. */
 3125|    372|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2909|    372|#define UPDATE_UC(new_uc)	do {		\
  |  | 2910|    372|	uc = new_uc;				\
  |  | 2911|    372|	ucptr = NULL;				\
  |  | 2912|    372|} while (0)
  |  |  ------------------
  |  |  |  Branch (2912:10): [Folded, False: 372]
  |  |  ------------------
  ------------------
 3126|    372|					    (LIndex * HC_VCOUNT + VIndex) *
 3127|    372|					     HC_TCOUNT);
 3128|  1.54k|				} else {
 3129|  1.54k|					WRITE_UC();
  ------------------
  |  | 2945|  1.54k|#define WRITE_UC()	do {			\
  |  | 2946|  1.54k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2946:6): [True: 1.54k, False: 0]
  |  |  ------------------
  |  | 2947|  1.54k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2947:7): [True: 28, False: 1.51k]
  |  |  ------------------
  |  | 2948|  1.54k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2923|     28|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|     28|	as->length = p - as->s;			\
  |  |  |  | 2925|     28|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 28]
  |  |  |  |  ------------------
  |  |  |  | 2926|     28|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|     28|		return (-1);			\
  |  |  |  | 2928|     28|	p = as->s + as->length;			\
  |  |  |  | 2929|     28|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|     28|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2949|  1.54k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2949:11): [True: 1.54k, False: 0]
  |  |  ------------------
  |  | 2950|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 1.54k]
  |  |  ------------------
  |  | 2951|      0|			*p++ = *ucptr++;	\
  |  | 2952|      0|			/* FALL THROUGH */	\
  |  | 2953|    530|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 530, False: 1.01k]
  |  |  ------------------
  |  | 2954|    530|			*p++ = *ucptr++;	\
  |  | 2955|    530|			/* FALL THROUGH */	\
  |  | 2956|  1.54k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 1.01k, False: 530]
  |  |  ------------------
  |  | 2957|  1.54k|			*p++ = *ucptr++;	\
  |  | 2958|  1.54k|			/* FALL THROUGH */	\
  |  | 2959|  1.54k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2959:3): [True: 0, False: 1.54k]
  |  |  ------------------
  |  | 2960|  1.54k|			*p++ = *ucptr;		\
  |  | 2961|  1.54k|			break;			\
  |  | 2962|  1.54k|		}				\
  |  | 2963|  1.54k|		ucptr = NULL;			\
  |  | 2964|  1.54k|	} else {				\
  |  | 2965|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2932|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2933|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2933:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2934|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2924|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2925|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2925:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2926|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2927|      0|		return (-1);			\
  |  |  |  |  |  | 2928|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2929|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2930|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2930:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2935|      0|	}					\
  |  |  |  | 2936|      0|	p += w;					\
  |  |  |  | 2937|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2966|      0|	}					\
  |  | 2967|  1.54k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2967:10): [Folded, False: 1.54k]
  |  |  ------------------
  ------------------
 3130|  1.54k|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2917|  1.54k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2918|  1.54k|	uc = uc2;				\
  |  | 2919|  1.54k|	ucptr = uc2ptr;				\
  |  | 2920|  1.54k|	n = n2;					\
  |  | 2921|  1.54k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2921:10): [Folded, False: 1.54k]
  |  |  ------------------
  ------------------
 3131|  1.54k|				}
 3132|  1.91k|				continue;
 3133|  34.8k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2870|  34.8k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3133:15): [True: 5.60k, False: 29.2k]
  ------------------
 3134|  5.60k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2878|  40.4k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2874|  5.60k|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2877|  5.60k|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2875|  5.60k|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2876|  5.60k|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2876|  3.56k|#define HC_TCOUNT	28
  ------------------
  |  Branch (3134:8): [True: 3.56k, False: 2.04k]
  |  Branch (3134:30): [True: 947, False: 2.61k]
  ------------------
 3135|       |				/*
 3136|       |				 * Hangul Composition.
 3137|       |				 * 2. Two current code points are LV and T.
 3138|       |				 */
 3139|    947|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2873|    947|#define HC_TBASE	0x11A7
  ------------------
 3140|    947|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2876|    675|#define HC_TCOUNT	28
  ------------------
  |  Branch (3140:9): [True: 675, False: 272]
  |  Branch (3140:23): [True: 27, False: 648]
  ------------------
 3141|       |					/* Make syllable of form LVT. */
 3142|     27|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2909|     27|#define UPDATE_UC(new_uc)	do {		\
  |  | 2910|     27|	uc = new_uc;				\
  |  | 2911|     27|	ucptr = NULL;				\
  |  | 2912|     27|} while (0)
  |  |  ------------------
  |  |  |  Branch (2912:10): [Folded, False: 27]
  |  |  ------------------
  ------------------
 3143|    920|				} else {
 3144|    920|					WRITE_UC();
  ------------------
  |  | 2945|    920|#define WRITE_UC()	do {			\
  |  | 2946|    920|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2946:6): [True: 692, False: 228]
  |  |  ------------------
  |  | 2947|    692|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2947:7): [True: 25, False: 667]
  |  |  ------------------
  |  | 2948|    692|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2923|     25|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|     25|	as->length = p - as->s;			\
  |  |  |  | 2925|     25|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 25]
  |  |  |  |  ------------------
  |  |  |  | 2926|     25|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|     25|		return (-1);			\
  |  |  |  | 2928|     25|	p = as->s + as->length;			\
  |  |  |  | 2929|     25|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|     25|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2949|    692|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2949:11): [True: 692, False: 0]
  |  |  ------------------
  |  | 2950|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 692]
  |  |  ------------------
  |  | 2951|      0|			*p++ = *ucptr++;	\
  |  | 2952|      0|			/* FALL THROUGH */	\
  |  | 2953|    227|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 227, False: 465]
  |  |  ------------------
  |  | 2954|    227|			*p++ = *ucptr++;	\
  |  | 2955|    227|			/* FALL THROUGH */	\
  |  | 2956|    692|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 465, False: 227]
  |  |  ------------------
  |  | 2957|    692|			*p++ = *ucptr++;	\
  |  | 2958|    692|			/* FALL THROUGH */	\
  |  | 2959|    692|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2959:3): [True: 0, False: 692]
  |  |  ------------------
  |  | 2960|    692|			*p++ = *ucptr;		\
  |  | 2961|    692|			break;			\
  |  | 2962|    692|		}				\
  |  | 2963|    692|		ucptr = NULL;			\
  |  | 2964|    692|	} else {				\
  |  | 2965|    228|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2932|    228|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2933|    242|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2933:9): [True: 14, False: 228]
  |  |  |  |  ------------------
  |  |  |  | 2934|     14|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|     14|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2924|     14|	as->length = p - as->s;			\
  |  |  |  |  |  | 2925|     14|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2925:6): [True: 0, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2926|     14|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2927|     14|		return (-1);			\
  |  |  |  |  |  | 2928|     14|	p = as->s + as->length;			\
  |  |  |  |  |  | 2929|     14|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2930|     14|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2930:10): [Folded, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2935|     14|	}					\
  |  |  |  | 2936|    228|	p += w;					\
  |  |  |  | 2937|    228|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:10): [Folded, False: 228]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2966|    228|	}					\
  |  | 2967|    920|} while (0)
  |  |  ------------------
  |  |  |  Branch (2967:10): [Folded, False: 920]
  |  |  ------------------
  ------------------
 3145|    920|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2917|    920|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2918|    920|	uc = uc2;				\
  |  | 2919|    920|	ucptr = uc2ptr;				\
  |  | 2920|    920|	n = n2;					\
  |  | 2921|    920|} while (0)
  |  |  ------------------
  |  |  |  Branch (2921:10): [Folded, False: 920]
  |  |  ------------------
  ------------------
 3146|    920|				}
 3147|    947|				continue;
 3148|  33.8k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3148:15): [True: 1.68k, False: 32.2k]
  ------------------
 3149|       |				/* A composition to current code points
 3150|       |				 * is found. */
 3151|  1.68k|				UPDATE_UC(nfc);
  ------------------
  |  | 2909|  1.68k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2910|  1.68k|	uc = new_uc;				\
  |  | 2911|  1.68k|	ucptr = NULL;				\
  |  | 2912|  1.68k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2912:10): [Folded, False: 1.68k]
  |  |  ------------------
  ------------------
 3152|  1.68k|				continue;
 3153|  32.2k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1007|  32.2k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 476, False: 31.7k]
  |  |  ------------------
  |  | 1008|  32.2k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3153:15): [True: 21.4k, False: 10.7k]
  ------------------
 3154|       |				/* Clearly 'uc2' the second code point is not
 3155|       |				 * a decomposable code. */
 3156|  21.4k|				WRITE_UC();
  ------------------
  |  | 2945|  21.4k|#define WRITE_UC()	do {			\
  |  | 2946|  21.4k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2946:6): [True: 21.1k, False: 331]
  |  |  ------------------
  |  | 2947|  21.1k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2947:7): [True: 57, False: 21.1k]
  |  |  ------------------
  |  | 2948|  21.1k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2923|     57|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|     57|	as->length = p - as->s;			\
  |  |  |  | 2925|     57|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 57]
  |  |  |  |  ------------------
  |  |  |  | 2926|     57|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|     57|		return (-1);			\
  |  |  |  | 2928|     57|	p = as->s + as->length;			\
  |  |  |  | 2929|     57|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|     57|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2949|  21.1k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2949:11): [True: 21.1k, False: 0]
  |  |  ------------------
  |  | 2950|    311|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 311, False: 20.8k]
  |  |  ------------------
  |  | 2951|    311|			*p++ = *ucptr++;	\
  |  | 2952|    311|			/* FALL THROUGH */	\
  |  | 2953|    693|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 382, False: 20.7k]
  |  |  ------------------
  |  | 2954|    693|			*p++ = *ucptr++;	\
  |  | 2955|    693|			/* FALL THROUGH */	\
  |  | 2956|  17.1k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 16.4k, False: 4.72k]
  |  |  ------------------
  |  | 2957|  17.1k|			*p++ = *ucptr++;	\
  |  | 2958|  17.1k|			/* FALL THROUGH */	\
  |  | 2959|  21.1k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2959:3): [True: 4.03k, False: 17.1k]
  |  |  ------------------
  |  | 2960|  21.1k|			*p++ = *ucptr;		\
  |  | 2961|  21.1k|			break;			\
  |  | 2962|  21.1k|		}				\
  |  | 2963|  21.1k|		ucptr = NULL;			\
  |  | 2964|  21.1k|	} else {				\
  |  | 2965|    331|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2932|    331|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2933|    343|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2933:9): [True: 12, False: 331]
  |  |  |  |  ------------------
  |  |  |  | 2934|     12|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|     12|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2924|     12|	as->length = p - as->s;			\
  |  |  |  |  |  | 2925|     12|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2925:6): [True: 0, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2926|     12|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2927|     12|		return (-1);			\
  |  |  |  |  |  | 2928|     12|	p = as->s + as->length;			\
  |  |  |  |  |  | 2929|     12|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2930|     12|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2930:10): [Folded, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2935|     12|	}					\
  |  |  |  | 2936|    331|	p += w;					\
  |  |  |  | 2937|    331|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:10): [Folded, False: 331]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2966|    331|	}					\
  |  | 2967|  21.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2967:10): [Folded, False: 21.4k]
  |  |  ------------------
  ------------------
 3157|  21.4k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2917|  21.4k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2918|  21.4k|	uc = uc2;				\
  |  | 2919|  21.4k|	ucptr = uc2ptr;				\
  |  | 2920|  21.4k|	n = n2;					\
  |  | 2921|  21.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2921:10): [Folded, False: 21.4k]
  |  |  ------------------
  ------------------
 3158|  21.4k|				continue;
 3159|  21.4k|			}
 3160|       |
 3161|       |			/*
 3162|       |			 * Collect following decomposable code points.
 3163|       |			 */
 3164|  10.7k|			cx = 0;
 3165|  10.7k|			ucx[0] = uc2;
 3166|  10.7k|			ccx[0] = cl;
 3167|  10.7k|			COLLECT_CPS(1);
  ------------------
  |  | 2972|  10.7k|#define COLLECT_CPS(start)	do {		\
  |  | 2973|  10.7k|	int _i;					\
  |  | 2974|  22.8k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2903|  22.8k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2974:19): [True: 22.5k, False: 307]
  |  |  ------------------
  |  | 2975|  22.5k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2976|  22.5k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2976:7): [True: 3.42k, False: 19.0k]
  |  |  ------------------
  |  | 2977|  22.5k|			break;			\
  |  | 2978|  22.5k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  19.0k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 1.00k, False: 18.0k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  19.0k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2979|  19.0k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2979:7): [True: 12.2k, False: 6.83k]
  |  |  |  Branch (2979:19): [True: 7.38k, False: 4.86k]
  |  |  |  Branch (2979:32): [True: 6.98k, False: 404]
  |  |  ------------------
  |  | 2980|  19.0k|			break;			\
  |  | 2981|  19.0k|		s += nx;			\
  |  | 2982|  12.1k|		len -= nx;			\
  |  | 2983|  12.1k|		cl = cx;			\
  |  | 2984|  12.1k|		ccx[_i] = cx;			\
  |  | 2985|  12.1k|	}					\
  |  | 2986|  10.7k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2903|  10.7k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2986:6): [True: 307, False: 10.4k]
  |  |  ------------------
  |  | 2987|    307|		ret = -1;			\
  |  | 2988|    307|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2903|    307|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2989|    307|	} else					\
  |  | 2990|  10.7k|		ucx_size = _i;			\
  |  | 2991|  10.7k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2991:10): [Folded, False: 10.7k]
  |  |  ------------------
  ------------------
 3168|       |
 3169|       |			/*
 3170|       |			 * Find a composed code in the collected code points.
 3171|       |			 */
 3172|  10.7k|			i = 1;
 3173|  33.2k|			while (i < ucx_size) {
  ------------------
  |  Branch (3173:11): [True: 22.5k, False: 10.7k]
  ------------------
 3174|  22.5k|				int j;
 3175|       |
 3176|  22.5k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3176:9): [True: 17.9k, False: 4.54k]
  ------------------
 3177|  17.9k|					i++;
 3178|  17.9k|					continue;
 3179|  17.9k|				}
 3180|       |
 3181|       |				/*
 3182|       |				 * nfc is composed of uc and ucx[i].
 3183|       |				 */
 3184|  4.54k|				UPDATE_UC(nfc);
  ------------------
  |  | 2909|  4.54k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2910|  4.54k|	uc = new_uc;				\
  |  | 2911|  4.54k|	ucptr = NULL;				\
  |  | 2912|  4.54k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2912:10): [Folded, False: 4.54k]
  |  |  ------------------
  ------------------
 3185|       |
 3186|       |				/*
 3187|       |				 * Remove ucx[i] by shifting
 3188|       |				 * following code points.
 3189|       |				 */
 3190|  6.28k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3190:17): [True: 1.74k, False: 4.54k]
  ------------------
 3191|  1.74k|					ucx[j] = ucx[j+1];
 3192|  1.74k|					ccx[j] = ccx[j+1];
 3193|  1.74k|				}
 3194|  4.54k|				ucx_size --;
 3195|       |
 3196|       |				/*
 3197|       |				 * Collect following code points blocked
 3198|       |				 * by ucx[i] the removed code point.
 3199|       |				 */
 3200|  4.54k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3200:9): [True: 4.54k, False: 0]
  |  Branch (3200:25): [True: 4.14k, False: 402]
  ------------------
 3201|  4.14k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3201:9): [True: 2.85k, False: 1.28k]
  |  Branch (3201:19): [True: 2.51k, False: 340]
  ------------------
 3202|  2.51k|					cl =  ccx[ucx_size-1];
 3203|  2.51k|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 2972|  2.51k|#define COLLECT_CPS(start)	do {		\
  |  | 2973|  2.51k|	int _i;					\
  |  | 2974|  6.40k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2903|  6.40k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2974:19): [True: 6.15k, False: 248]
  |  |  ------------------
  |  | 2975|  6.15k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2976|  6.15k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2976:7): [True: 1.91k, False: 4.24k]
  |  |  ------------------
  |  | 2977|  6.15k|			break;			\
  |  | 2978|  6.15k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  4.24k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 211, False: 4.03k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  4.24k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2979|  4.24k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2979:7): [True: 1.72k, False: 2.51k]
  |  |  |  Branch (2979:19): [True: 356, False: 1.36k]
  |  |  |  Branch (2979:32): [True: 356, False: 0]
  |  |  ------------------
  |  | 2980|  4.24k|			break;			\
  |  | 2981|  4.24k|		s += nx;			\
  |  | 2982|  3.88k|		len -= nx;			\
  |  | 2983|  3.88k|		cl = cx;			\
  |  | 2984|  3.88k|		ccx[_i] = cx;			\
  |  | 2985|  3.88k|	}					\
  |  | 2986|  2.51k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2903|  2.51k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2986:6): [True: 248, False: 2.26k]
  |  |  ------------------
  |  | 2987|    248|		ret = -1;			\
  |  | 2988|    248|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2903|    248|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2989|    248|	} else					\
  |  | 2990|  2.51k|		ucx_size = _i;			\
  |  | 2991|  2.51k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2991:10): [Folded, False: 2.51k]
  |  |  ------------------
  ------------------
 3204|  2.51k|				}
 3205|       |				/*
 3206|       |				 * Restart finding a composed code with
 3207|       |				 * the updated uc from the top of the
 3208|       |				 * collected code points.
 3209|       |				 */
 3210|  4.54k|				i = 0;
 3211|  4.54k|			}
 3212|       |
 3213|       |			/*
 3214|       |			 * Apparently the current code points are not
 3215|       |			 * decomposed characters or already composed.
 3216|       |			 */
 3217|  10.7k|			WRITE_UC();
  ------------------
  |  | 2945|  10.7k|#define WRITE_UC()	do {			\
  |  | 2946|  10.7k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2946:6): [True: 5.91k, False: 4.79k]
  |  |  ------------------
  |  | 2947|  5.91k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2947:7): [True: 77, False: 5.84k]
  |  |  ------------------
  |  | 2948|  5.91k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2923|     77|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|     77|	as->length = p - as->s;			\
  |  |  |  | 2925|     77|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 77]
  |  |  |  |  ------------------
  |  |  |  | 2926|     77|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|     77|		return (-1);			\
  |  |  |  | 2928|     77|	p = as->s + as->length;			\
  |  |  |  | 2929|     77|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|     77|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 77]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2949|  5.91k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2949:11): [True: 5.91k, False: 0]
  |  |  ------------------
  |  | 2950|    229|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 229, False: 5.68k]
  |  |  ------------------
  |  | 2951|    229|			*p++ = *ucptr++;	\
  |  | 2952|    229|			/* FALL THROUGH */	\
  |  | 2953|  1.03k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 803, False: 5.11k]
  |  |  ------------------
  |  | 2954|  1.03k|			*p++ = *ucptr++;	\
  |  | 2955|  1.03k|			/* FALL THROUGH */	\
  |  | 2956|  2.69k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 1.66k, False: 4.25k]
  |  |  ------------------
  |  | 2957|  2.69k|			*p++ = *ucptr++;	\
  |  | 2958|  2.69k|			/* FALL THROUGH */	\
  |  | 2959|  5.91k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2959:3): [True: 3.22k, False: 2.69k]
  |  |  ------------------
  |  | 2960|  5.91k|			*p++ = *ucptr;		\
  |  | 2961|  5.91k|			break;			\
  |  | 2962|  5.91k|		}				\
  |  | 2963|  5.91k|		ucptr = NULL;			\
  |  | 2964|  5.91k|	} else {				\
  |  | 2965|  4.79k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2932|  4.79k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2933|  4.83k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2933:9): [True: 43, False: 4.79k]
  |  |  |  |  ------------------
  |  |  |  | 2934|     43|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|     43|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2924|     43|	as->length = p - as->s;			\
  |  |  |  |  |  | 2925|     43|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2925:6): [True: 0, False: 43]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2926|     43|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2927|     43|		return (-1);			\
  |  |  |  |  |  | 2928|     43|	p = as->s + as->length;			\
  |  |  |  |  |  | 2929|     43|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2930|     43|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2930:10): [Folded, False: 43]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2935|     43|	}					\
  |  |  |  | 2936|  4.79k|	p += w;					\
  |  |  |  | 2937|  4.79k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:10): [Folded, False: 4.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2966|  4.79k|	}					\
  |  | 2967|  10.7k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2967:10): [Folded, False: 10.7k]
  |  |  ------------------
  ------------------
 3218|  32.8k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3218:16): [True: 22.1k, False: 10.7k]
  ------------------
 3219|  22.1k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2932|  32.8k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2933|  22.2k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2933:9): [True: 96, False: 22.1k]
  |  |  ------------------
  |  | 2934|     96|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2923|     96|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|     96|	as->length = p - as->s;			\
  |  |  |  | 2925|     96|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 96]
  |  |  |  |  ------------------
  |  |  |  | 2926|     96|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|     96|		return (-1);			\
  |  |  |  | 2928|     96|	p = as->s + as->length;			\
  |  |  |  | 2929|     96|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|     96|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 96]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2935|     96|	}					\
  |  | 2936|  22.1k|	p += w;					\
  |  | 2937|  22.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2937:10): [Folded, False: 22.1k]
  |  |  ------------------
  ------------------
 3220|       |
 3221|       |			/*
 3222|       |			 * Flush out remaining canonical combining characters.
 3223|       |			 */
 3224|  10.7k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3224:8): [True: 5.37k, False: 5.33k]
  |  Branch (3224:18): [True: 2.22k, False: 3.15k]
  |  Branch (3224:30): [True: 2.21k, False: 10]
  ------------------
 3225|  87.6k|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3225:12): [True: 86.0k, False: 1.63k]
  ------------------
 3226|  87.6k|				    > 0) {
 3227|  86.0k|					cx = CCC(ucx[0]);
  ------------------
  |  | 1007|  86.0k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 642, False: 85.4k]
  |  |  ------------------
  |  | 1008|  86.0k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
 3228|  86.0k|					if (cl > cx)
  ------------------
  |  Branch (3228:10): [True: 587, False: 85.4k]
  ------------------
 3229|    587|						break;
 3230|  85.4k|					s += nx;
 3231|  85.4k|					len -= nx;
 3232|  85.4k|					cl = cx;
 3233|  85.4k|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2932|  85.4k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2933|  86.1k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2933:9): [True: 678, False: 85.4k]
  |  |  ------------------
  |  | 2934|    678|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2923|    678|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|    678|	as->length = p - as->s;			\
  |  |  |  | 2925|    678|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 678]
  |  |  |  |  ------------------
  |  |  |  | 2926|    678|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|    678|		return (-1);			\
  |  |  |  | 2928|    678|	p = as->s + as->length;			\
  |  |  |  | 2929|    678|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|    678|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 678]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2935|    678|	}					\
  |  | 2936|  85.4k|	p += w;					\
  |  | 2937|  85.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2937:10): [Folded, False: 85.4k]
  |  |  ------------------
  ------------------
 3234|  85.4k|				}
 3235|  2.21k|			}
 3236|  10.7k|			break;
 3237|  10.7k|		}
 3238|  86.2k|		if (n2 < 0) {
  ------------------
  |  Branch (3238:7): [True: 50.4k, False: 35.7k]
  ------------------
 3239|  50.4k|			WRITE_UC();
  ------------------
  |  | 2945|  50.4k|#define WRITE_UC()	do {			\
  |  | 2946|  50.4k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2946:6): [True: 49.4k, False: 1.07k]
  |  |  ------------------
  |  | 2947|  49.4k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2947:7): [True: 163, False: 49.2k]
  |  |  ------------------
  |  | 2948|  49.4k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2923|    163|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|    163|	as->length = p - as->s;			\
  |  |  |  | 2925|    163|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 163]
  |  |  |  |  ------------------
  |  |  |  | 2926|    163|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|    163|		return (-1);			\
  |  |  |  | 2928|    163|	p = as->s + as->length;			\
  |  |  |  | 2929|    163|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|    163|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 163]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2949|  49.4k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2949:11): [True: 49.4k, False: 0]
  |  |  ------------------
  |  | 2950|    784|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 784, False: 48.6k]
  |  |  ------------------
  |  | 2951|    784|			*p++ = *ucptr++;	\
  |  | 2952|    784|			/* FALL THROUGH */	\
  |  | 2953|  2.82k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 2.04k, False: 47.3k]
  |  |  ------------------
  |  | 2954|  2.82k|			*p++ = *ucptr++;	\
  |  | 2955|  2.82k|			/* FALL THROUGH */	\
  |  | 2956|  5.88k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 3.05k, False: 46.3k]
  |  |  ------------------
  |  | 2957|  5.88k|			*p++ = *ucptr++;	\
  |  | 2958|  5.88k|			/* FALL THROUGH */	\
  |  | 2959|  49.4k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2959:3): [True: 43.5k, False: 5.88k]
  |  |  ------------------
  |  | 2960|  49.4k|			*p++ = *ucptr;		\
  |  | 2961|  49.4k|			break;			\
  |  | 2962|  49.4k|		}				\
  |  | 2963|  49.4k|		ucptr = NULL;			\
  |  | 2964|  49.4k|	} else {				\
  |  | 2965|  1.07k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2932|  1.07k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2933|  1.10k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2933:9): [True: 24, False: 1.07k]
  |  |  |  |  ------------------
  |  |  |  | 2934|     24|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|     24|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2924|     24|	as->length = p - as->s;			\
  |  |  |  |  |  | 2925|     24|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2925:6): [True: 0, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2926|     24|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2927|     24|		return (-1);			\
  |  |  |  |  |  | 2928|     24|	p = as->s + as->length;			\
  |  |  |  |  |  | 2929|     24|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2930|     24|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2930:10): [Folded, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2935|     24|	}					\
  |  |  |  | 2936|  1.07k|	p += w;					\
  |  |  |  | 2937|  1.07k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:10): [Folded, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2966|  1.07k|	}					\
  |  | 2967|  50.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2967:10): [Folded, False: 50.4k]
  |  |  ------------------
  ------------------
 3240|       |			/* Use a replaced unicode character. */
 3241|  50.4k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2932|  50.4k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2933|  51.2k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2933:9): [True: 725, False: 50.4k]
  |  |  ------------------
  |  | 2934|    725|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2923|    725|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|    725|	as->length = p - as->s;			\
  |  |  |  | 2925|    725|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 725]
  |  |  |  |  ------------------
  |  |  |  | 2926|    725|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|    725|		return (-1);			\
  |  |  |  | 2928|    725|	p = as->s + as->length;			\
  |  |  |  | 2929|    725|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|    725|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 725]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2935|    725|	}					\
  |  | 2936|  50.4k|	p += w;					\
  |  | 2937|  50.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2937:10): [Folded, False: 50.4k]
  |  |  ------------------
  ------------------
 3242|  50.4k|			s += n2*-1;
 3243|  50.4k|			len -= n2*-1;
 3244|  50.4k|			ret = -1;
 3245|  50.4k|			continue;
 3246|  50.4k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3246:14): [True: 25.0k, False: 10.7k]
  ------------------
 3247|  25.0k|			WRITE_UC();
  ------------------
  |  | 2945|  25.0k|#define WRITE_UC()	do {			\
  |  | 2946|  25.0k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2946:6): [True: 24.9k, False: 49]
  |  |  ------------------
  |  | 2947|  24.9k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2947:7): [True: 212, False: 24.7k]
  |  |  ------------------
  |  | 2948|  24.9k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2923|    212|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2924|    212|	as->length = p - as->s;			\
  |  |  |  | 2925|    212|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2925:6): [True: 0, False: 212]
  |  |  |  |  ------------------
  |  |  |  | 2926|    212|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2927|    212|		return (-1);			\
  |  |  |  | 2928|    212|	p = as->s + as->length;			\
  |  |  |  | 2929|    212|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2930|    212|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:10): [Folded, False: 212]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2949|  24.9k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2949:11): [True: 24.9k, False: 0]
  |  |  ------------------
  |  | 2950|    216|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 216, False: 24.7k]
  |  |  ------------------
  |  | 2951|    216|			*p++ = *ucptr++;	\
  |  | 2952|    216|			/* FALL THROUGH */	\
  |  | 2953|    451|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 235, False: 24.7k]
  |  |  ------------------
  |  | 2954|    451|			*p++ = *ucptr++;	\
  |  | 2955|    451|			/* FALL THROUGH */	\
  |  | 2956|  3.48k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 3.03k, False: 21.9k]
  |  |  ------------------
  |  | 2957|  3.48k|			*p++ = *ucptr++;	\
  |  | 2958|  3.48k|			/* FALL THROUGH */	\
  |  | 2959|  24.9k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2959:3): [True: 21.4k, False: 3.48k]
  |  |  ------------------
  |  | 2960|  24.9k|			*p++ = *ucptr;		\
  |  | 2961|  24.9k|			break;			\
  |  | 2962|  24.9k|		}				\
  |  | 2963|  24.9k|		ucptr = NULL;			\
  |  | 2964|  24.9k|	} else {				\
  |  | 2965|     49|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2932|     49|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2933|     73|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2933:9): [True: 24, False: 49]
  |  |  |  |  ------------------
  |  |  |  | 2934|     24|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2923|     24|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2924|     24|	as->length = p - as->s;			\
  |  |  |  |  |  | 2925|     24|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2925:6): [True: 0, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2926|     24|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2927|     24|		return (-1);			\
  |  |  |  |  |  | 2928|     24|	p = as->s + as->length;			\
  |  |  |  |  |  | 2929|     24|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2930|     24|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2930:10): [Folded, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2935|     24|	}					\
  |  |  |  | 2936|     49|	p += w;					\
  |  |  |  | 2937|     49|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:10): [Folded, False: 49]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2966|     49|	}					\
  |  | 2967|  25.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2967:10): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 3248|  25.0k|			break;
 3249|  25.0k|		}
 3250|  86.2k|	}
 3251|  31.8k|	as->length = p - as->s;
 3252|  31.8k|	as->s[as->length] = '\0';
 3253|  31.8k|	if (ts == 2)
  ------------------
  |  Branch (3253:6): [True: 3.04k, False: 28.8k]
  ------------------
 3254|  3.04k|		as->s[as->length+1] = '\0';
 3255|  31.8k|	return (ret);
 3256|  31.8k|}
archive_string.c:get_nfc:
 2882|  56.4k|{
 2883|  56.4k|	int t, b;
 2884|       |
 2885|  56.4k|	t = 0;
 2886|  56.4k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2887|   590k|	while (b >= t) {
  ------------------
  |  Branch (2887:9): [True: 540k, False: 50.1k]
  ------------------
 2888|   540k|		int m = (t + b) / 2;
 2889|   540k|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2889:7): [True: 280k, False: 259k]
  ------------------
 2890|   280k|			t = m + 1;
 2891|   259k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2891:12): [True: 224k, False: 35.7k]
  ------------------
 2892|   224k|			b = m - 1;
 2893|  35.7k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2893:12): [True: 22.0k, False: 13.7k]
  ------------------
 2894|  22.0k|			t = m + 1;
 2895|  13.7k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2895:12): [True: 7.55k, False: 6.23k]
  ------------------
 2896|  7.55k|			b = m - 1;
 2897|  6.23k|		else
 2898|  6.23k|			return (u_composition_table[m].nfc);
 2899|   540k|	}
 2900|  50.1k|	return (0);
 2901|  56.4k|}
archive_string.c:best_effort_strncat_in_locale:
 2306|     19|{
 2307|     19|	size_t remaining;
 2308|     19|	const uint8_t *itp;
 2309|     19|	int return_value = 0; /* success */
 2310|       |
 2311|       |	/*
 2312|       |	 * If both from-locale and to-locale is the same, this makes a copy.
 2313|       |	 * And then this checks all copied MBS can be WCS if so returns 0.
 2314|       |	 */
 2315|     19|	if (sc->same) {
  ------------------
  |  Branch (2315:6): [True: 0, False: 19]
  ------------------
 2316|      0|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2316:7): [True: 0, False: 0]
  ------------------
 2317|      0|			return (-1);/* No memory */
 2318|      0|		return (invalid_mbs(_p, length, sc));
 2319|      0|	}
 2320|       |
 2321|       |	/*
 2322|       |	 * If a character is ASCII, this just copies it. If not, this
 2323|       |	 * assigns '?' character instead but in UTF-8 locale this assigns
 2324|       |	 * byte sequence 0xEF 0xBD 0xBD, which are code point U+FFFD,
 2325|       |	 * a Replacement Character in Unicode.
 2326|       |	 */
 2327|       |
 2328|     19|	remaining = length;
 2329|     19|	itp = (const uint8_t *)_p;
 2330|    573|	while (remaining > 0 && *itp) {
  ------------------
  |  Branch (2330:9): [True: 554, False: 19]
  |  Branch (2330:26): [True: 554, False: 0]
  ------------------
 2331|    554|		if (*itp > 127) {
  ------------------
  |  Branch (2331:7): [True: 188, False: 366]
  ------------------
 2332|       |			// Non-ASCII: Substitute with suitable replacement
 2333|    188|			if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|    188|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2333:8): [True: 0, False: 188]
  ------------------
 2334|      0|				if (archive_string_append(as, utf8_replacement_char, sizeof(utf8_replacement_char)) == NULL) {
  ------------------
  |  Branch (2334:9): [True: 0, False: 0]
  ------------------
 2335|      0|					__archive_errx(1, "Out of memory");
 2336|      0|				}
 2337|    188|			} else {
 2338|    188|				archive_strappend_char(as, '?');
 2339|    188|			}
 2340|    188|			return_value = -1;
 2341|    366|		} else {
 2342|    366|			archive_strappend_char(as, *itp);
 2343|    366|		}
 2344|    554|		++itp;
 2345|    554|		--remaining;
 2346|    554|	}
 2347|     19|	return (return_value);
 2348|     19|}
archive_string.c:utf16nbytes:
 1988|  5.01k|{
 1989|  5.01k|	size_t s;
 1990|  5.01k|	const char *p, *pp;
 1991|       |
 1992|  5.01k|	if (_p == NULL)
  ------------------
  |  Branch (1992:6): [True: 0, False: 5.01k]
  ------------------
 1993|      0|		return (0);
 1994|  5.01k|	p = (const char *)_p;
 1995|       |
 1996|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1997|  5.01k|	s = 0;
 1998|  5.01k|	pp = p;
 1999|  5.01k|	n >>= 1;
 2000|  72.7k|	while (s < n && (pp[0] || pp[1])) {
  ------------------
  |  Branch (2000:9): [True: 70.1k, False: 2.66k]
  |  Branch (2000:19): [True: 55.5k, False: 14.6k]
  |  Branch (2000:28): [True: 12.2k, False: 2.34k]
  ------------------
 2001|  67.7k|		pp += 2;
 2002|  67.7k|		s++;
 2003|  67.7k|	}
 2004|  5.01k|	return (s<<1);
 2005|  5.01k|}
archive_string.c:mbsnbytes:
 1968|   675k|{
 1969|   675k|	size_t s;
 1970|   675k|	const char *p, *pp;
 1971|       |
 1972|   675k|	if (_p == NULL)
  ------------------
  |  Branch (1972:6): [True: 0, False: 675k]
  ------------------
 1973|      0|		return (0);
 1974|   675k|	p = (const char *)_p;
 1975|       |
 1976|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1977|   675k|	s = 0;
 1978|   675k|	pp = p;
 1979|  63.5M|	while (s < n && *pp) {
  ------------------
  |  Branch (1979:9): [True: 62.8M, False: 626k]
  |  Branch (1979:18): [True: 62.8M, False: 49.0k]
  ------------------
 1980|  62.8M|		pp++;
 1981|  62.8M|		s++;
 1982|  62.8M|	}
 1983|   675k|	return (s);
 1984|   675k|}

archive_string_sprintf:
   77|  58.6k|{
   78|  58.6k|	va_list ap;
   79|       |
   80|  58.6k|	va_start(ap, fmt);
   81|  58.6k|	archive_string_vsprintf(as, fmt, ap);
   82|       |	va_end(ap);
   83|  58.6k|}
archive_string_vsprintf:
   92|   755k|{
   93|   755k|	char long_flag;
   94|   755k|	intmax_t s; /* Signed integer temp. */
   95|   755k|	uintmax_t u; /* Unsigned integer temp. */
   96|   755k|	const char *p, *p2;
   97|   755k|	const wchar_t *pw;
   98|       |
   99|   755k|	if (archive_string_ensure(as, 64) == NULL)
  ------------------
  |  Branch (99:6): [True: 0, False: 755k]
  ------------------
  100|      0|		__archive_errx(1, "Out of memory");
  101|       |
  102|   755k|	if (fmt == NULL) {
  ------------------
  |  Branch (102:6): [True: 0, False: 755k]
  ------------------
  103|      0|		as->s[0] = 0;
  104|      0|		return;
  105|      0|	}
  106|       |
  107|  29.8M|	for (p = fmt; *p != '\0'; p++) {
  ------------------
  |  Branch (107:16): [True: 29.0M, False: 755k]
  ------------------
  108|  29.0M|		const char *saved_p = p;
  109|       |
  110|  29.0M|		if (*p != '%') {
  ------------------
  |  Branch (110:7): [True: 28.7M, False: 342k]
  ------------------
  111|  28.7M|			archive_strappend_char(as, *p);
  112|  28.7M|			continue;
  113|  28.7M|		}
  114|       |
  115|   342k|		p++;
  116|       |
  117|   342k|		long_flag = '\0';
  118|   342k|		switch(*p) {
  ------------------
  |  Branch (118:10): [True: 59.8k, False: 283k]
  ------------------
  119|    532|		case 'l':
  ------------------
  |  Branch (119:3): [True: 532, False: 342k]
  ------------------
  120|    532|			if (p[1] == 'l') {
  ------------------
  |  Branch (120:8): [True: 366, False: 166]
  ------------------
  121|    366|				long_flag = 'L';
  122|    366|				p += 2;
  123|    366|				break;
  124|    366|			}
  125|    166|			__LA_FALLTHROUGH;
  126|  49.9k|		case 'j':
  ------------------
  |  Branch (126:3): [True: 49.8k, False: 293k]
  ------------------
  127|  59.4k|		case 'z':
  ------------------
  |  Branch (127:3): [True: 9.48k, False: 333k]
  ------------------
  128|  59.4k|			long_flag = *p;
  129|  59.4k|			p++;
  130|  59.4k|			break;
  131|   342k|		}
  132|       |
  133|   342k|		switch (*p) {
  134|      0|		case '%':
  ------------------
  |  Branch (134:3): [True: 0, False: 342k]
  ------------------
  135|      0|			archive_strappend_char(as, '%');
  136|      0|			break;
  137|  1.38k|		case 'c':
  ------------------
  |  Branch (137:3): [True: 1.38k, False: 341k]
  ------------------
  138|  1.38k|			s = va_arg(ap, int);
  139|  1.38k|			archive_strappend_char(as, (char)s);
  140|  1.38k|			break;
  141|   179k|		case 'd':
  ------------------
  |  Branch (141:3): [True: 179k, False: 163k]
  ------------------
  142|   179k|			switch(long_flag) {
  143|  44.0k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (143:4): [True: 44.0k, False: 135k]
  ------------------
  144|      0|			case 'l': s = va_arg(ap, long); break;
  ------------------
  |  Branch (144:4): [True: 0, False: 179k]
  ------------------
  145|     89|			case 'L': s = va_arg(ap, long long); break;
  ------------------
  |  Branch (145:4): [True: 89, False: 179k]
  ------------------
  146|      0|			case 'z': s = va_arg(ap, ssize_t); break;
  ------------------
  |  Branch (146:4): [True: 0, False: 179k]
  ------------------
  147|   135k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (147:4): [True: 135k, False: 44.1k]
  ------------------
  148|   179k|			}
  149|   179k|			append_int(as, s, 10);
  150|   179k|			break;
  151|   137k|		case 's':
  ------------------
  |  Branch (151:3): [True: 137k, False: 205k]
  ------------------
  152|   137k|			switch(long_flag) {
  153|      0|			case 'l':
  ------------------
  |  Branch (153:4): [True: 0, False: 137k]
  ------------------
  154|      0|			case 'L':
  ------------------
  |  Branch (154:4): [True: 0, False: 137k]
  ------------------
  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|   137k|			default:
  ------------------
  |  Branch (162:4): [True: 137k, False: 0]
  ------------------
  163|   137k|				p2 = va_arg(ap, char *);
  164|   137k|				if (p2 == NULL)
  ------------------
  |  Branch (164:9): [True: 2, False: 137k]
  ------------------
  165|      2|					p2 = "(null)";
  166|   137k|				archive_strcat(as, p2);
  167|   137k|				break;
  168|   137k|			}
  169|   137k|			break;
  170|   137k|		case 'S':
  ------------------
  |  Branch (170:3): [True: 0, False: 342k]
  ------------------
  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|  24.4k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (178:3): [True: 0, False: 342k]
  |  Branch (178:13): [True: 24.1k, False: 318k]
  |  Branch (178:23): [True: 284, False: 342k]
  |  Branch (178:33): [True: 57, False: 342k]
  ------------------
  179|       |			/* Common handling for unsigned integer formats. */
  180|  24.4k|			switch(long_flag) {
  181|  5.80k|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (181:4): [True: 5.80k, False: 18.6k]
  ------------------
  182|    166|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (182:4): [True: 166, False: 24.3k]
  ------------------
  183|    277|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (183:4): [True: 277, False: 24.1k]
  ------------------
  184|  9.48k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (184:4): [True: 9.48k, False: 14.9k]
  ------------------
  185|  8.73k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (185:4): [True: 8.73k, False: 15.7k]
  ------------------
  186|  24.4k|			}
  187|       |			/* Format it in the correct base. */
  188|  24.4k|			switch (*p) {
  189|      0|			case 'o': append_uint(as, u, 8); break;
  ------------------
  |  Branch (189:4): [True: 0, False: 24.4k]
  ------------------
  190|  24.1k|			case 'u': append_uint(as, u, 10); break;
  ------------------
  |  Branch (190:4): [True: 24.1k, False: 341]
  ------------------
  191|    341|			default: append_uint(as, u, 16); break;
  ------------------
  |  Branch (191:4): [True: 341, False: 24.1k]
  ------------------
  192|  24.4k|			}
  193|  24.4k|			break;
  194|  24.4k|		default:
  ------------------
  |  Branch (194:3): [True: 80, False: 342k]
  ------------------
  195|       |			/* Rewind and print the initial '%' literally. */
  196|     80|			p = saved_p;
  197|     80|			archive_strappend_char(as, *p);
  198|   342k|		}
  199|   342k|	}
  200|   755k|}
archive_string_sprintf.c:append_int:
   63|   179k|{
   64|   179k|	uintmax_t ud;
   65|       |
   66|   179k|	if (d < 0) {
  ------------------
  |  Branch (66:6): [True: 13.5k, False: 165k]
  ------------------
   67|  13.5k|		archive_strappend_char(as, '-');
   68|  13.5k|		ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
  ------------------
  |  Branch (68:8): [True: 18, False: 13.5k]
  ------------------
   69|  13.5k|	} else
   70|   165k|		ud = d;
   71|   179k|	append_uint(as, ud, base);
   72|   179k|}
archive_string_sprintf.c:append_uint:
   54|   428k|{
   55|   428k|	static const char digits[] = "0123456789abcdef";
   56|   428k|	if (d >= base)
  ------------------
  |  Branch (56:6): [True: 224k, False: 203k]
  ------------------
   57|   224k|		append_uint(as, d/base, base);
   58|   428k|	archive_strappend_char(as, digits[d % base]);
   59|   428k|}

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

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

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

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

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

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

