archive_acl_clear:
  129|  1.77M|{
  130|  1.77M|	struct archive_acl_entry *ap;
  131|       |
  132|  1.77M|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 1.38k, False: 1.77M]
  ------------------
  133|  1.38k|		ap = acl->acl_head->next;
  134|  1.38k|		archive_mstring_clean(&acl->acl_head->name);
  135|  1.38k|		free(acl->acl_head);
  136|  1.38k|		acl->acl_head = ap;
  137|  1.38k|	}
  138|  1.77M|	free(acl->acl_text_w);
  139|  1.77M|	acl->acl_text_w = NULL;
  140|  1.77M|	free(acl->acl_text);
  141|  1.77M|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|  1.77M|	acl->acl_types = 0;
  144|  1.77M|	acl->acl_state = 0; /* Not counting. */
  145|  1.77M|}
archive_acl_count:
  380|    830|{
  381|    830|	int count;
  382|    830|	struct archive_acl_entry *ap;
  383|       |
  384|    830|	count = 0;
  385|    830|	ap = acl->acl_head;
  386|  2.21k|	while (ap != NULL) {
  ------------------
  |  Branch (386:9): [True: 1.38k, False: 830]
  ------------------
  387|  1.38k|		if ((ap->type & want_type) != 0)
  ------------------
  |  Branch (387:7): [True: 1.38k, False: 0]
  ------------------
  388|  1.38k|			count++;
  389|  1.38k|		ap = ap->next;
  390|  1.38k|	}
  391|       |
  392|    830|	if (count > 0 && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0))
  ------------------
  |  |  554|    209|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (392:6): [True: 209, False: 621]
  |  Branch (392:19): [True: 126, False: 83]
  ------------------
  393|    126|		count += 3;
  394|    830|	return (count);
  395|    830|}
archive_acl_reset:
  413|    830|{
  414|    830|	int count, cutoff;
  415|       |
  416|    830|	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|    830|	if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
  ------------------
  |  |  554|    830|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (423:6): [True: 198, False: 632]
  ------------------
  424|    198|		cutoff = 3;
  425|    632|	else
  426|    632|		cutoff = 0;
  427|       |
  428|    830|	if (count > cutoff)
  ------------------
  |  Branch (428:6): [True: 209, False: 621]
  ------------------
  429|    209|		acl->acl_state = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  569|    209|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  430|    621|	else
  431|    621|		acl->acl_state = 0;
  432|    830|	acl->acl_p = acl->acl_head;
  433|    830|	return (count);
  434|    830|}
archive_acl_from_text_l:
 1506|    780|{
 1507|    780|	return archive_acl_from_text_nl(acl, text, strlen(text), want_type, sc);
 1508|    780|}
archive_acl_from_text_nl:
 1513|    830|{
 1514|    830|	struct {
 1515|    830|		const char *start;
 1516|    830|		const char *end;
 1517|    830|	} field[6], name;
 1518|       |
 1519|    830|	const char *s, *st, *text_end;
 1520|    830|	int numfields, fields, n, r, sol, ret;
 1521|    830|	int type, types, tag, permset, id;
 1522|    830|	size_t len;
 1523|    830|	char sep;
 1524|       |
 1525|    830|	switch (want_type) {
 1526|      0|	case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
  ------------------
  |  |  560|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  554|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  561|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  555|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (1526:2): [True: 0, False: 830]
  ------------------
 1527|      0|		want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
  ------------------
  |  |  554|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 1528|      0|		__LA_FALLTHROUGH;
 1529|    491|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  554|    491|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (1529:2): [True: 491, False: 339]
  ------------------
 1530|    507|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  555|    507|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (1530:2): [True: 16, False: 814]
  ------------------
 1531|    507|		numfields = 5;
 1532|    507|		break;
 1533|    323|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  562|    323|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  556|    323|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  563|    323|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  557|    323|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  564|    323|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  558|    323|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  565|    323|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  559|    323|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1533:2): [True: 323, False: 507]
  ------------------
 1534|    323|		numfields = 6;
 1535|    323|		break;
 1536|      0|	default:
  ------------------
  |  Branch (1536:2): [True: 0, False: 830]
  ------------------
 1537|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|    830|	}
 1539|       |
 1540|    830|	ret = ARCHIVE_OK;
  ------------------
  |  |  234|    830|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1541|    830|	types = 0;
 1542|    830|	text_end = (text == NULL) ? text : text + length;
  ------------------
  |  Branch (1542:13): [True: 0, False: 830]
  ------------------
 1543|       |
 1544|  37.2k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1544:9): [True: 37.2k, False: 0]
  |  Branch (1544:25): [True: 36.4k, False: 810]
  |  Branch (1544:39): [True: 36.4k, False: 20]
  ------------------
 1545|       |		/*
 1546|       |		 * Parse the fields out of the next entry,
 1547|       |		 * advance 'text' to start of next entry.
 1548|       |		 */
 1549|  36.4k|		fields = 0;
 1550|  70.8k|		do {
 1551|  70.8k|			const char *start, *end;
 1552|  70.8k|			next_field(&text, &length, &start, &end, &sep);
 1553|  70.8k|			if (fields < numfields) {
  ------------------
  |  Branch (1553:8): [True: 68.4k, False: 2.44k]
  ------------------
 1554|  68.4k|				field[fields].start = start;
 1555|  68.4k|				field[fields].end = end;
 1556|  68.4k|			}
 1557|  70.8k|			++fields;
 1558|  70.8k|		} while (sep == ':');
  ------------------
  |  Branch (1558:12): [True: 34.4k, False: 36.4k]
  ------------------
 1559|       |
 1560|       |		/* Set remaining fields to blank. */
 1561|   159k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1561:20): [True: 122k, False: 36.4k]
  ------------------
 1562|   122k|			field[n].start = field[n].end = NULL;
 1563|       |
 1564|  36.4k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1564:7): [True: 0, False: 36.4k]
  |  Branch (1564:33): [True: 0, False: 36.4k]
  ------------------
 1565|       |			/* This should never happen */
 1566|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1567|      0|		}
 1568|       |
 1569|  36.4k|		if (field[0].start == text_end) {
  ------------------
  |  Branch (1569:7): [True: 25, False: 36.3k]
  ------------------
 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|     25|			ret = ARCHIVE_WARN;
  ------------------
  |  |  236|     25|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|     25|			continue;
 1579|     25|		}
 1580|       |
 1581|  36.3k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1581:7): [True: 117, False: 36.2k]
  ------------------
 1582|       |			/* Comment, skip entry */
 1583|    117|			continue;
 1584|    117|		}
 1585|       |
 1586|  36.2k|		n = 0;
 1587|  36.2k|		sol = 0;
 1588|  36.2k|		id = -1;
 1589|  36.2k|		permset = 0;
 1590|  36.2k|		name.start = name.end = NULL;
 1591|       |
 1592|  36.2k|		if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  562|  36.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  556|  36.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  563|  36.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  557|  36.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  564|  36.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  558|  36.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  565|  36.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  559|  36.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1592:7): [True: 27.1k, False: 9.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|  27.1k|			s = field[0].start;
 1603|  27.1k|			len = field[0].end - field[0].start;
 1604|  27.1k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1604:8): [True: 2.40k, False: 24.7k]
  |  Branch (1604:22): [True: 1.64k, False: 753]
  |  Branch (1604:35): [True: 229, False: 524]
  ------------------
 1605|  1.82k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1605:11): [True: 179, False: 50]
  ------------------
 1606|  1.82k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  555|  1.82k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1607|  1.82k|				if (len > 7)
  ------------------
  |  Branch (1607:9): [True: 178, False: 1.64k]
  ------------------
 1608|    178|					field[0].start += 7;
 1609|  1.64k|				else
 1610|  1.64k|					n = 1;
 1611|  1.82k|			} else
 1612|  25.2k|				type = want_type;
 1613|       |
 1614|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1615|  27.1k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1615:8): [True: 1.08k, False: 26.0k]
  ------------------
 1616|  27.1k|			    &id) < 0) {
 1617|  1.08k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|  1.08k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|  1.08k|				continue;
 1619|  1.08k|			}
 1620|       |			/* Field n+3 is optional. */
 1621|  26.0k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1621:8): [True: 25.4k, False: 621]
  |  Branch (1621:20): [True: 2.54k, False: 22.8k]
  ------------------
 1622|  2.54k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1622:8): [True: 74, False: 2.46k]
  ------------------
 1623|  2.54k|			    &id) < 0) {
 1624|     74|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|     74|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1625|     74|				continue;
 1626|     74|			}
 1627|       |
 1628|  25.9k|			tag = 0;
 1629|  25.9k|			s = field[n].start;
 1630|  25.9k|			len = field[n].end - field[n].start;
 1631|       |
 1632|  25.9k|			if (len == 0) {
  ------------------
  |  Branch (1632:8): [True: 3.01k, False: 22.9k]
  ------------------
 1633|  3.01k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|  3.01k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1634|  3.01k|				continue;
 1635|  3.01k|			}
 1636|       |
 1637|  22.9k|			st = s + 1; 
 1638|       |
 1639|  22.9k|			switch (*s) {
 1640|  3.64k|			case 'u':
  ------------------
  |  Branch (1640:4): [True: 3.64k, False: 19.3k]
  ------------------
 1641|  3.64k|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1641:9): [True: 943, False: 2.70k]
  |  Branch (1641:22): [True: 1.36k, False: 1.33k]
  ------------------
 1642|  1.36k|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1642:12): [True: 1.15k, False: 219]
  ------------------
 1643|  2.09k|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  569|  2.09k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1644|  3.64k|				break;
 1645|  2.41k|			case 'g':
  ------------------
  |  Branch (1645:4): [True: 2.41k, False: 20.5k]
  ------------------
 1646|  2.41k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1646:9): [True: 1.40k, False: 1.00k]
  |  Branch (1646:22): [True: 422, False: 582]
  ------------------
 1647|    422|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1647:12): [True: 273, False: 149]
  ------------------
 1648|  1.68k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  571|  1.68k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1649|  2.41k|				break;
 1650|  2.20k|			case 'o':
  ------------------
  |  Branch (1650:4): [True: 2.20k, False: 20.7k]
  ------------------
 1651|  2.20k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1651:9): [True: 886, False: 1.31k]
  |  Branch (1651:22): [True: 468, False: 847]
  ------------------
 1652|    468|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1652:12): [True: 235, False: 233]
  ------------------
 1653|  1.12k|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  573|  1.12k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1654|  2.20k|				break;
 1655|    798|			case 'm':
  ------------------
  |  Branch (1655:4): [True: 798, False: 22.1k]
  ------------------
 1656|    798|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1656:9): [True: 359, False: 439]
  |  Branch (1656:22): [True: 290, False: 149]
  ------------------
 1657|    290|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1657:12): [True: 39, False: 251]
  ------------------
 1658|    398|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  572|    398|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1659|    798|				break;
 1660|  13.8k|			default:
  ------------------
  |  Branch (1660:4): [True: 13.8k, False: 9.05k]
  ------------------
 1661|  13.8k|					break;
 1662|  22.9k|			}
 1663|       |
 1664|  22.9k|			switch (tag) {
 1665|  1.12k|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  573|  1.12k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1665:4): [True: 1.12k, False: 21.8k]
  ------------------
 1666|  1.51k|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  572|  1.51k|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1666:4): [True: 398, False: 22.5k]
  ------------------
 1667|  1.51k|				if (fields == (n + 2)
  ------------------
  |  Branch (1667:9): [True: 689, False: 830]
  ------------------
 1668|    689|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1668:12): [True: 677, False: 12]
  ------------------
 1669|    677|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1669:12): [True: 244, False: 433]
  ------------------
 1670|    677|				    field[n + 1].end, &permset)) {
 1671|       |					/* This is Solaris-style "other:rwx" */
 1672|    244|					sol = 1;
 1673|  1.27k|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1673:16): [True: 398, False: 877]
  ------------------
 1674|    398|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1674:9): [True: 105, False: 293]
  ------------------
 1675|       |					/* Invalid mask or other field */
 1676|    105|					ret = ARCHIVE_WARN;
  ------------------
  |  |  236|    105|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1677|    105|					continue;
 1678|    105|				}
 1679|  1.41k|				break;
 1680|  2.09k|			case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  569|  2.09k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1680:4): [True: 2.09k, False: 20.8k]
  ------------------
 1681|  3.77k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  571|  3.77k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1681:4): [True: 1.68k, False: 21.2k]
  ------------------
 1682|  3.77k|				if (id != -1 ||
  ------------------
  |  Branch (1682:9): [True: 747, False: 3.02k]
  ------------------
 1683|  3.24k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1683:9): [True: 2.49k, False: 532]
  ------------------
 1684|  3.24k|					name = field[n + 1];
 1685|  3.24k|					if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
  ------------------
  |  |  569|  3.24k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1685:10): [True: 2.03k, False: 1.20k]
  ------------------
 1686|  2.03k|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  568|  2.03k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1687|  1.20k|					else
 1688|  1.20k|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  570|  1.20k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1689|  3.24k|				}
 1690|  3.77k|				break;
 1691|  17.6k|			default:
  ------------------
  |  Branch (1691:4): [True: 17.6k, False: 5.29k]
  ------------------
 1692|       |				/* Invalid tag, skip entry */
 1693|  17.6k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|  17.6k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1694|  17.6k|				continue;
 1695|  22.9k|			}
 1696|       |
 1697|       |			/*
 1698|       |			 * Without "default:" we expect mode in field 3
 1699|       |			 * Exception: Solaris other and mask fields
 1700|       |			 */
 1701|  5.18k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1701:8): [True: 4.83k, False: 352]
  |  Branch (1701:24): [True: 3.05k, False: 1.78k]
  ------------------
 1702|  4.83k|			    field[n + 2 - sol].end, &permset)) {
 1703|       |				/* Invalid mode, skip entry */
 1704|  3.05k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|  3.05k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1705|  3.05k|				continue;
 1706|  3.05k|			}
 1707|  9.16k|		} else {
 1708|       |			/* NFS4 ACLs */
 1709|  9.16k|			s = field[0].start;
 1710|  9.16k|			len = field[0].end - field[0].start;
 1711|  9.16k|			tag = 0;
 1712|       |
 1713|  9.16k|			switch (len) {
 1714|    786|			case 4:
  ------------------
  |  Branch (1714:4): [True: 786, False: 8.37k]
  ------------------
 1715|    786|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1715:9): [True: 370, False: 416]
  ------------------
 1716|    370|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  568|    370|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1717|    786|				break;
 1718|    987|			case 5:
  ------------------
  |  Branch (1718:4): [True: 987, False: 8.17k]
  ------------------
 1719|    987|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1719:9): [True: 485, False: 502]
  ------------------
 1720|    485|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  570|    485|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1721|    987|				break;
 1722|  1.88k|			case 6:
  ------------------
  |  Branch (1722:4): [True: 1.88k, False: 7.27k]
  ------------------
 1723|  1.88k|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1723:9): [True: 892, False: 996]
  ------------------
 1724|    892|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  569|    892|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1725|    996|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1725:14): [True: 454, False: 542]
  ------------------
 1726|    454|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  571|    454|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1727|  1.88k|				break;
 1728|    974|			case 9:
  ------------------
  |  Branch (1728:4): [True: 974, False: 8.18k]
  ------------------
 1729|    974|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1729:9): [True: 232, False: 742]
  ------------------
 1730|    232|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  574|    232|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1731|    974|				break;
 1732|  4.52k|			default:
  ------------------
  |  Branch (1732:4): [True: 4.52k, False: 4.63k]
  ------------------
 1733|  4.52k|				break;
 1734|  9.16k|			}
 1735|       |
 1736|  9.16k|			if (tag == 0) {
  ------------------
  |  Branch (1736:8): [True: 6.73k, False: 2.43k]
  ------------------
 1737|       |				/* Invalid tag, skip entry */
 1738|  6.73k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|  6.73k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1739|  6.73k|				continue;
 1740|  6.73k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  568|  4.86k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1740:15): [True: 370, False: 2.06k]
  ------------------
 1741|  2.06k|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  570|  2.06k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1741:8): [True: 485, False: 1.57k]
  ------------------
 1742|    855|				n = 1;
 1743|    855|				name = field[1];
 1744|    855|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1744:9): [True: 63, False: 792]
  ------------------
 1745|     63|					ret = ARCHIVE_WARN;
  ------------------
  |  |  236|     63|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1746|     63|					continue;
 1747|     63|				}
 1748|    855|			} else
 1749|  1.57k|				n = 0;
 1750|       |
 1751|  2.37k|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1751:8): [True: 505, False: 1.86k]
  ------------------
 1752|  2.37k|			    field[1 + n].end, &permset)) {
 1753|       |				/* Invalid NFSv4 perms, skip entry */
 1754|    505|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|    505|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1755|    505|				continue;
 1756|    505|			}
 1757|  1.86k|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1757:8): [True: 500, False: 1.36k]
  ------------------
 1758|  1.86k|			    field[2 + n].end, &permset)) {
 1759|       |				/* Invalid NFSv4 flags, skip entry */
 1760|    500|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|    500|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1761|    500|				continue;
 1762|    500|			}
 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: 473, False: 892]
  ------------------
 1767|    473|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1767:9): [True: 145, False: 328]
  ------------------
 1768|    145|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  557|    145|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1769|    892|			} else if (len == 5) {
  ------------------
  |  Branch (1769:15): [True: 435, False: 457]
  ------------------
 1770|    435|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1770:9): [True: 80, False: 355]
  ------------------
 1771|     80|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  556|     80|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1772|    355|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1772:14): [True: 16, False: 339]
  ------------------
 1773|     16|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  558|     16|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1774|    339|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1774:14): [True: 267, False: 72]
  ------------------
 1775|    267|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  559|    267|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1776|    435|			}
 1777|  1.36k|			if (type == 0) {
  ------------------
  |  Branch (1777:8): [True: 857, False: 508]
  ------------------
 1778|       |				/* Invalid entry type, skip entry */
 1779|    857|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|    857|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1780|    857|				continue;
 1781|    857|			}
 1782|    508|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1782:8): [True: 43, False: 465]
  ------------------
 1783|    508|			    &id) < 0) {
 1784|     43|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|     43|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1785|     43|				continue;
 1786|     43|			}
 1787|    508|		}
 1788|       |
 1789|       |		/* Add entry to the internal list. */
 1790|  2.59k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1791|  2.59k|		    tag, id, name.start, name.end - name.start, sc);
 1792|  2.59k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  236|  2.59k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1792:7): [True: 0, False: 2.59k]
  ------------------
 1793|      0|			return (r);
 1794|  2.59k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  2.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 981, False: 1.61k]
  ------------------
 1795|    981|			ret = ARCHIVE_WARN;
  ------------------
  |  |  236|    981|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1796|  2.59k|		types |= type;
 1797|  2.59k|	}
 1798|       |
 1799|       |	/* Reset ACL */
 1800|    830|	archive_acl_reset(acl, types);
 1801|       |
 1802|    830|	return (ret);
 1803|    830|}
archive_acl.c:acl_special:
  240|  2.59k|{
  241|  2.59k|	if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
  ------------------
  |  |  554|  5.19k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (241:6): [True: 1.88k, False: 710]
  ------------------
  242|  1.88k|	    && ((permset & ~007) == 0)) {
  ------------------
  |  Branch (242:9): [True: 1.88k, False: 0]
  ------------------
  243|  1.88k|		switch (tag) {
  ------------------
  |  Branch (243:11): [True: 562, False: 1.32k]
  ------------------
  244|     39|		case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  569|     39|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (244:3): [True: 39, False: 1.84k]
  ------------------
  245|     39|			acl->mode &= ~0700;
  246|     39|			acl->mode |= (permset & 7) << 6;
  247|     39|			return (0);
  248|     55|		case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  571|     55|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (248:3): [True: 55, False: 1.83k]
  ------------------
  249|     55|			acl->mode &= ~0070;
  250|     55|			acl->mode |= (permset & 7) << 3;
  251|     55|			return (0);
  252|    468|		case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  573|    468|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (252:3): [True: 468, False: 1.42k]
  ------------------
  253|    468|			acl->mode &= ~0007;
  254|    468|			acl->mode |= permset & 7;
  255|    468|			return (0);
  256|  1.88k|		}
  257|  1.88k|	}
  258|  2.03k|	return (1);
  259|  2.59k|}
archive_acl.c:acl_new_entry:
  268|  2.03k|{
  269|  2.03k|	struct archive_acl_entry *ap, *aq;
  270|       |
  271|       |	/* Reject an invalid type */
  272|  2.03k|	switch (type) {
  273|  1.32k|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  554|  1.32k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (273:2): [True: 1.32k, False: 710]
  ------------------
  274|  1.57k|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  555|  1.57k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (274:2): [True: 245, False: 1.79k]
  ------------------
  275|  1.65k|	case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
  ------------------
  |  |  556|  1.65k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
  |  Branch (275:2): [True: 80, False: 1.95k]
  ------------------
  276|  1.79k|	case ARCHIVE_ENTRY_ACL_TYPE_DENY:
  ------------------
  |  |  557|  1.79k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
  |  Branch (276:2): [True: 145, False: 1.89k]
  ------------------
  277|  1.81k|	case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
  ------------------
  |  |  558|  1.81k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
  |  Branch (277:2): [True: 16, False: 2.02k]
  ------------------
  278|  2.03k|	case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
  ------------------
  |  |  559|  2.03k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
  |  Branch (278:2): [True: 224, False: 1.81k]
  ------------------
  279|  2.03k|		break;
  280|      0|	default:
  ------------------
  |  Branch (280:2): [True: 0, False: 2.03k]
  ------------------
  281|      0|		return (NULL);
  282|  2.03k|	}
  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.03k|	if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  562|  2.03k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  556|  2.03k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  563|  2.03k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  557|  2.03k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  564|  2.03k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  558|  2.03k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  565|  2.03k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  559|  2.03k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (287:6): [True: 465, False: 1.57k]
  ------------------
  288|    465|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  562|    465|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  556|    465|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  563|    465|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  557|    465|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  564|    465|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  558|    465|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  565|    465|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  559|    465|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (288:7): [True: 0, False: 465]
  ------------------
  289|      0|			return (NULL);
  290|      0|		}
  291|    465|		if (permset &
  ------------------
  |  Branch (291:7): [True: 0, False: 465]
  ------------------
  292|    465|		    ~(ARCHIVE_ENTRY_ACL_PERMS_NFS4
  ------------------
  |  |  515|    465|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  489|    465|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  516|    465|	    | ARCHIVE_ENTRY_ACL_READ_DATA		\
  |  |  ------------------
  |  |  |  |  492|    465|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  |  |  ------------------
  |  |  517|    465|	    | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 		\
  |  |  ------------------
  |  |  |  |  493|    465|#define	ARCHIVE_ENTRY_ACL_LIST_DIRECTORY      0x00000008
  |  |  ------------------
  |  |  518|    465|	    | ARCHIVE_ENTRY_ACL_WRITE_DATA		\
  |  |  ------------------
  |  |  |  |  494|    465|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  |  |  ------------------
  |  |  519|    465|	    | ARCHIVE_ENTRY_ACL_ADD_FILE		\
  |  |  ------------------
  |  |  |  |  495|    465|#define	ARCHIVE_ENTRY_ACL_ADD_FILE            0x00000010
  |  |  ------------------
  |  |  520|    465|	    | ARCHIVE_ENTRY_ACL_APPEND_DATA		\
  |  |  ------------------
  |  |  |  |  496|    465|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  |  |  ------------------
  |  |  521|    465|	    | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY	\
  |  |  ------------------
  |  |  |  |  497|    465|#define	ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY    0x00000020
  |  |  ------------------
  |  |  522|    465|	    | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  498|    465|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  |  |  ------------------
  |  |  523|    465|	    | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  499|    465|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  |  |  ------------------
  |  |  524|    465|	    | ARCHIVE_ENTRY_ACL_DELETE_CHILD		\
  |  |  ------------------
  |  |  |  |  500|    465|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  |  |  ------------------
  |  |  525|    465|	    | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES		\
  |  |  ------------------
  |  |  |  |  501|    465|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  |  |  ------------------
  |  |  526|    465|	    | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES	\
  |  |  ------------------
  |  |  |  |  502|    465|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  |  |  ------------------
  |  |  527|    465|	    | ARCHIVE_ENTRY_ACL_DELETE			\
  |  |  ------------------
  |  |  |  |  503|    465|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  |  |  ------------------
  |  |  528|    465|	    | ARCHIVE_ENTRY_ACL_READ_ACL		\
  |  |  ------------------
  |  |  |  |  504|    465|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  |  |  ------------------
  |  |  529|    465|	    | ARCHIVE_ENTRY_ACL_WRITE_ACL		\
  |  |  ------------------
  |  |  |  |  505|    465|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  |  |  ------------------
  |  |  530|    465|	    | ARCHIVE_ENTRY_ACL_WRITE_OWNER		\
  |  |  ------------------
  |  |  |  |  506|    465|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  |  |  ------------------
  |  |  531|    465|	    | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
  |  |  ------------------
  |  |  |  |  507|    465|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  |  |  ------------------
  ------------------
  293|    465|			| ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) {
  ------------------
  |  |  545|    465|	(ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT			\
  |  |  ------------------
  |  |  |  |  537|    465|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  |  |  ------------------
  |  |  546|    465|	    | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT		\
  |  |  ------------------
  |  |  |  |  538|    465|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  |  |  ------------------
  |  |  547|    465|	    | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT	\
  |  |  ------------------
  |  |  |  |  539|    465|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  |  |  ------------------
  |  |  548|    465|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY		\
  |  |  ------------------
  |  |  |  |  540|    465|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  |  |  ------------------
  |  |  549|    465|	    | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS		\
  |  |  ------------------
  |  |  |  |  541|    465|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  |  |  ------------------
  |  |  550|    465|	    | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS		\
  |  |  ------------------
  |  |  |  |  542|    465|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  |  |  ------------------
  |  |  551|    465|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
  |  |  ------------------
  |  |  |  |  536|    465|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  |  |  ------------------
  ------------------
  294|      0|			return (NULL);
  295|      0|		}
  296|  1.57k|	} else	if (type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  560|  1.57k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  554|  1.57k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  561|  1.57k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  555|  1.57k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (296:13): [True: 1.57k, False: 0]
  ------------------
  297|  1.57k|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  560|  1.57k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  554|  1.57k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  561|  1.57k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  555|  1.57k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (297:7): [True: 0, False: 1.57k]
  ------------------
  298|      0|			return (NULL);
  299|      0|		}
  300|  1.57k|		if (permset & ~ARCHIVE_ENTRY_ACL_PERMS_POSIX1E) {
  ------------------
  |  |  510|  1.57k|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  489|  1.57k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  511|  1.57k|	    | ARCHIVE_ENTRY_ACL_WRITE			\
  |  |  ------------------
  |  |  |  |  490|  1.57k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  |  |  ------------------
  |  |  512|  1.57k|	    | ARCHIVE_ENTRY_ACL_READ)
  |  |  ------------------
  |  |  |  |  491|  1.57k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  |  |  ------------------
  ------------------
  |  Branch (300:7): [True: 0, False: 1.57k]
  ------------------
  301|      0|			return (NULL);
  302|      0|		}
  303|  1.57k|	} else {
  304|      0|		return (NULL);
  305|      0|	}
  306|       |
  307|       |	/* Verify the tag is valid and compatible with NFS4 or POSIX.1e. */
  308|  2.03k|	switch (tag) {
  309|    432|	case ARCHIVE_ENTRY_ACL_USER:
  ------------------
  |  |  568|    432|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (309:2): [True: 432, False: 1.60k]
  ------------------
  310|    673|	case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  569|    673|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (310:2): [True: 241, False: 1.79k]
  ------------------
  311|  1.66k|	case ARCHIVE_ENTRY_ACL_GROUP:
  ------------------
  |  |  570|  1.66k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (311:2): [True: 996, False: 1.04k]
  ------------------
  312|  1.74k|	case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  571|  1.74k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (312:2): [True: 77, False: 1.95k]
  ------------------
  313|       |		/* Tags valid in both NFS4 and POSIX.1e */
  314|  1.74k|		break;
  315|    170|	case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  572|    170|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (315:2): [True: 170, False: 1.86k]
  ------------------
  316|    261|	case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  573|    261|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (316:2): [True: 91, False: 1.94k]
  ------------------
  317|       |		/* Tags valid only in POSIX.1e. */
  318|    261|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  560|    261|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  554|    261|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  561|    261|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  555|    261|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (318:7): [True: 0, False: 261]
  ------------------
  319|      0|			return (NULL);
  320|      0|		}
  321|    261|		break;
  322|    261|	case ARCHIVE_ENTRY_ACL_EVERYONE:
  ------------------
  |  |  574|     29|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
  |  Branch (322:2): [True: 29, False: 2.00k]
  ------------------
  323|       |		/* Tags valid only in NFS4. */
  324|     29|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  562|     29|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  556|     29|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  563|     29|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  557|     29|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  564|     29|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  558|     29|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  565|     29|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  559|     29|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (324:7): [True: 0, False: 29]
  ------------------
  325|      0|			return (NULL);
  326|      0|		}
  327|     29|		break;
  328|     29|	default:
  ------------------
  |  Branch (328:2): [True: 0, False: 2.03k]
  ------------------
  329|       |		/* No other values are valid. */
  330|      0|		return (NULL);
  331|  2.03k|	}
  332|       |
  333|  2.03k|	free(acl->acl_text_w);
  334|  2.03k|	acl->acl_text_w = NULL;
  335|  2.03k|	free(acl->acl_text);
  336|  2.03k|	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.03k|	ap = acl->acl_head;
  345|  2.03k|	aq = NULL;
  346|  17.5k|	while (ap != NULL) {
  ------------------
  |  Branch (346:9): [True: 16.2k, False: 1.38k]
  ------------------
  347|  16.2k|		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
  ------------------
  |  |  562|  16.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  556|  16.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  563|  16.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  557|  16.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  564|  16.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  558|  16.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  565|  16.2k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  559|  16.2k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (347:7): [True: 12.9k, False: 3.25k]
  ------------------
  348|  12.9k|		    ap->type == type && ap->tag == tag && ap->id == id) {
  ------------------
  |  Branch (348:7): [True: 10.6k, False: 2.26k]
  |  Branch (348:27): [True: 9.13k, False: 1.56k]
  |  Branch (348:45): [True: 8.19k, False: 935]
  ------------------
  349|  8.19k|			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
  ------------------
  |  |  568|  15.5k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (349:8): [True: 444, False: 7.75k]
  |  Branch (349:21): [True: 5.29k, False: 2.45k]
  ------------------
  350|  5.29k|			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
  ------------------
  |  |  570|  5.29k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (350:8): [True: 203, False: 5.09k]
  ------------------
  351|    647|				ap->permset = permset;
  352|    647|				return (ap);
  353|    647|			}
  354|  8.19k|		}
  355|  15.5k|		aq = ap;
  356|  15.5k|		ap = ap->next;
  357|  15.5k|	}
  358|       |
  359|       |	/* Add a new entry to the end of the list. */
  360|  1.38k|	ap = calloc(1, sizeof(*ap));
  361|  1.38k|	if (ap == NULL)
  ------------------
  |  Branch (361:6): [True: 0, False: 1.38k]
  ------------------
  362|      0|		return (NULL);
  363|  1.38k|	if (aq == NULL)
  ------------------
  |  Branch (363:6): [True: 209, False: 1.18k]
  ------------------
  364|    209|		acl->acl_head = ap;
  365|  1.18k|	else
  366|  1.18k|		aq->next = ap;
  367|  1.38k|	ap->type = type;
  368|  1.38k|	ap->tag = tag;
  369|  1.38k|	ap->id = id;
  370|  1.38k|	ap->permset = permset;
  371|  1.38k|	acl->acl_types |= type;
  372|  1.38k|	return (ap);
  373|  1.38k|}
archive_acl.c:archive_acl_add_entry_len_l:
  209|  2.59k|{
  210|  2.59k|	struct archive_acl_entry *ap;
  211|  2.59k|	int r;
  212|       |
  213|  2.59k|	if (acl_special(acl, type, permset, tag) == 0)
  ------------------
  |  Branch (213:6): [True: 562, False: 2.03k]
  ------------------
  214|    562|		return ARCHIVE_OK;
  ------------------
  |  |  234|    562|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  215|  2.03k|	ap = acl_new_entry(acl, type, permset, tag, id);
  216|  2.03k|	if (ap == NULL) {
  ------------------
  |  Branch (216:6): [True: 0, False: 2.03k]
  ------------------
  217|       |		/* XXX Error XXX */
  218|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  219|      0|	}
  220|  2.03k|	if (name != NULL  &&  *name != '\0' && len > 0) {
  ------------------
  |  Branch (220:6): [True: 1.42k, False: 608]
  |  Branch (220:24): [True: 1.42k, False: 0]
  |  Branch (220:41): [True: 1.25k, False: 171]
  ------------------
  221|  1.25k|		r = archive_mstring_copy_mbs_len_l(&ap->name, name, len, sc);
  222|  1.25k|	} else {
  223|    779|		r = 0;
  224|    779|		archive_mstring_clean(&ap->name);
  225|    779|	}
  226|  2.03k|	if (r == 0)
  ------------------
  |  Branch (226:6): [True: 1.05k, False: 981]
  ------------------
  227|  1.05k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  228|    981|	else if (errno == ENOMEM)
  ------------------
  |  Branch (228:11): [True: 0, False: 981]
  ------------------
  229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|    981|	else
  231|    981|		return (ARCHIVE_WARN);
  ------------------
  |  |  236|    981|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  232|  2.03k|}
archive_acl.c:isint:
 1812|  31.0k|{
 1813|  31.0k|	int n = 0;
 1814|  31.0k|	if (start >= end)
  ------------------
  |  Branch (1814:6): [True: 20.0k, False: 10.9k]
  ------------------
 1815|  20.0k|		return (0);
 1816|  33.4k|	while (start < end) {
  ------------------
  |  Branch (1816:9): [True: 32.0k, False: 1.42k]
  ------------------
 1817|  32.0k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1817:7): [True: 4.20k, False: 27.8k]
  |  Branch (1817:23): [True: 4.05k, False: 23.7k]
  ------------------
 1818|  8.26k|			return (0);
 1819|  23.7k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1819:7): [True: 248, False: 23.5k]
  ------------------
 1820|  23.5k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1820:8): [True: 1.01k, False: 22.5k]
  |  Branch (1820:29): [True: 1.01k, False: 5]
  ------------------
 1821|  1.26k|			return (-1);
 1822|  22.5k|		} else {
 1823|  22.5k|			n *= 10;
 1824|  22.5k|			n += *start - '0';
 1825|  22.5k|		}
 1826|  22.5k|		start++;
 1827|  22.5k|	}
 1828|  1.42k|	*result = n;
 1829|  1.42k|	return (1);
 1830|  10.9k|}
archive_acl.c:ismode:
 1839|  5.51k|{
 1840|  5.51k|	const char *p;
 1841|       |
 1842|  5.51k|	if (start >= end)
  ------------------
  |  Branch (1842:6): [True: 2.22k, False: 3.28k]
  ------------------
 1843|  2.22k|		return (0);
 1844|  3.28k|	p = start;
 1845|  3.28k|	*permset = 0;
 1846|  10.9k|	while (p < end) {
  ------------------
  |  Branch (1846:9): [True: 8.89k, False: 2.02k]
  ------------------
 1847|  8.89k|		switch (*p++) {
 1848|  2.27k|		case 'r': case 'R':
  ------------------
  |  Branch (1848:3): [True: 1.02k, False: 7.87k]
  |  Branch (1848:13): [True: 1.25k, False: 7.64k]
  ------------------
 1849|  2.27k|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  491|  2.27k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1850|  2.27k|			break;
 1851|  1.38k|		case 'w': case 'W':
  ------------------
  |  Branch (1851:3): [True: 660, False: 8.23k]
  |  Branch (1851:13): [True: 720, False: 8.17k]
  ------------------
 1852|  1.38k|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  490|  1.38k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1853|  1.38k|			break;
 1854|  1.73k|		case 'x': case 'X':
  ------------------
  |  Branch (1854:3): [True: 739, False: 8.15k]
  |  Branch (1854:13): [True: 996, False: 7.89k]
  ------------------
 1855|  1.73k|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  489|  1.73k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1856|  1.73k|			break;
 1857|  2.24k|		case '-':
  ------------------
  |  Branch (1857:3): [True: 2.24k, False: 6.65k]
  ------------------
 1858|  2.24k|			break;
 1859|  1.26k|		default:
  ------------------
  |  Branch (1859:3): [True: 1.26k, False: 7.62k]
  ------------------
 1860|  1.26k|			return (0);
 1861|  8.89k|		}
 1862|  8.89k|	}
 1863|  2.02k|	return (1);
 1864|  3.28k|}
archive_acl.c:is_nfs4_perms:
 1873|  2.37k|{
 1874|  2.37k|	const char *p = start;
 1875|       |
 1876|  10.2k|	while (p < end) {
  ------------------
  |  Branch (1876:9): [True: 8.43k, False: 1.86k]
  ------------------
 1877|  8.43k|		switch (*p++) {
 1878|    328|		case 'r':
  ------------------
  |  Branch (1878:3): [True: 328, False: 8.10k]
  ------------------
 1879|    328|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  492|    328|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1880|    328|			break;
 1881|    364|		case 'w':
  ------------------
  |  Branch (1881:3): [True: 364, False: 8.06k]
  ------------------
 1882|    364|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  494|    364|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1883|    364|			break;
 1884|    932|		case 'x':
  ------------------
  |  Branch (1884:3): [True: 932, False: 7.50k]
  ------------------
 1885|    932|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  489|    932|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1886|    932|			break;
 1887|    286|		case 'p':
  ------------------
  |  Branch (1887:3): [True: 286, False: 8.14k]
  ------------------
 1888|    286|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  496|    286|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1889|    286|			break;
 1890|    339|		case 'D':
  ------------------
  |  Branch (1890:3): [True: 339, False: 8.09k]
  ------------------
 1891|    339|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  500|    339|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1892|    339|			break;
 1893|    416|		case 'd':
  ------------------
  |  Branch (1893:3): [True: 416, False: 8.01k]
  ------------------
 1894|    416|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  503|    416|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1895|    416|			break;
 1896|    632|		case 'a':
  ------------------
  |  Branch (1896:3): [True: 632, False: 7.80k]
  ------------------
 1897|    632|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  501|    632|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1898|    632|			break;
 1899|    684|		case 'A':
  ------------------
  |  Branch (1899:3): [True: 684, False: 7.74k]
  ------------------
 1900|    684|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  502|    684|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1901|    684|			break;
 1902|    364|		case 'R':
  ------------------
  |  Branch (1902:3): [True: 364, False: 8.06k]
  ------------------
 1903|    364|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  498|    364|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1904|    364|			break;
 1905|    568|		case 'W':
  ------------------
  |  Branch (1905:3): [True: 568, False: 7.86k]
  ------------------
 1906|    568|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  499|    568|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1907|    568|			break;
 1908|  1.11k|		case 'c':
  ------------------
  |  Branch (1908:3): [True: 1.11k, False: 7.31k]
  ------------------
 1909|  1.11k|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  504|  1.11k|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1910|  1.11k|			break;
 1911|    305|		case 'C':
  ------------------
  |  Branch (1911:3): [True: 305, False: 8.12k]
  ------------------
 1912|    305|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  505|    305|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1913|    305|			break;
 1914|    407|		case 'o':
  ------------------
  |  Branch (1914:3): [True: 407, False: 8.02k]
  ------------------
 1915|    407|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  506|    407|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1916|    407|			break;
 1917|    512|		case 's':
  ------------------
  |  Branch (1917:3): [True: 512, False: 7.92k]
  ------------------
 1918|    512|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  507|    512|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1919|    512|			break;
 1920|    675|		case '-':
  ------------------
  |  Branch (1920:3): [True: 675, False: 7.75k]
  ------------------
 1921|    675|			break;
 1922|    505|		default:
  ------------------
  |  Branch (1922:3): [True: 505, False: 7.92k]
  ------------------
 1923|    505|			return(0);
 1924|  8.43k|		}
 1925|  8.43k|	}
 1926|  1.86k|	return (1);
 1927|  2.37k|}
archive_acl.c:is_nfs4_flags:
 1936|  1.86k|{
 1937|  1.86k|	const char *p = start;
 1938|       |
 1939|  6.96k|	while (p < end) {
  ------------------
  |  Branch (1939:9): [True: 5.59k, False: 1.36k]
  ------------------
 1940|  5.59k|		switch(*p++) {
 1941|    664|		case 'f':
  ------------------
  |  Branch (1941:3): [True: 664, False: 4.93k]
  ------------------
 1942|    664|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  537|    664|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1943|    664|			break;
 1944|    881|		case 'd':
  ------------------
  |  Branch (1944:3): [True: 881, False: 4.71k]
  ------------------
 1945|    881|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  538|    881|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1946|    881|			break;
 1947|    847|		case 'i':
  ------------------
  |  Branch (1947:3): [True: 847, False: 4.75k]
  ------------------
 1948|    847|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  540|    847|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1949|    847|			break;
 1950|    386|		case 'n':
  ------------------
  |  Branch (1950:3): [True: 386, False: 5.21k]
  ------------------
 1951|    386|			*permset |=
 1952|    386|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  539|    386|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1953|    386|			break;
 1954|    627|		case 'S':
  ------------------
  |  Branch (1954:3): [True: 627, False: 4.97k]
  ------------------
 1955|    627|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  541|    627|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1956|    627|			break;
 1957|    234|		case 'F':
  ------------------
  |  Branch (1957:3): [True: 234, False: 5.36k]
  ------------------
 1958|    234|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  542|    234|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1959|    234|			break;
 1960|    316|		case 'I':
  ------------------
  |  Branch (1960:3): [True: 316, False: 5.28k]
  ------------------
 1961|    316|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  536|    316|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1962|    316|			break;
 1963|  1.14k|		case '-':
  ------------------
  |  Branch (1963:3): [True: 1.14k, False: 4.45k]
  ------------------
 1964|  1.14k|			break;
 1965|    500|		default:
  ------------------
  |  Branch (1965:3): [True: 500, False: 5.09k]
  ------------------
 1966|    500|			return (0);
 1967|  5.59k|		}
 1968|  5.59k|	}
 1969|  1.36k|	return (1);
 1970|  1.86k|}
archive_acl.c:next_field:
 1983|  70.8k|{
 1984|       |	/* Skip leading whitespace to find start of field. */
 1985|   120k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1985:9): [True: 120k, False: 54]
  |  Branch (1985:20): [True: 2.88k, False: 117k]
  |  Branch (1985:34): [True: 2.21k, False: 114k]
  |  Branch (1985:49): [True: 44.1k, False: 70.8k]
  ------------------
 1986|  49.2k|		(*p)++;
 1987|  49.2k|		(*l)--;
 1988|  49.2k|	}
 1989|  70.8k|	*start = *p;
 1990|       |
 1991|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1992|   406k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1992:9): [True: 405k, False: 692]
  |  Branch (1992:19): [True: 401k, False: 3.97k]
  |  Branch (1992:33): [True: 400k, False: 1.16k]
  |  Branch (1992:48): [True: 370k, False: 29.7k]
  |  Branch (1992:63): [True: 368k, False: 1.80k]
  |  Branch (1992:77): [True: 336k, False: 32.7k]
  |  Branch (1992:91): [True: 335k, False: 763]
  ------------------
 1993|   335k|		(*p)++;
 1994|   335k|		(*l)--;
 1995|   335k|	}
 1996|  70.8k|	*end = *p;
 1997|       |
 1998|       |	/* Scan for the separator. */
 1999|   119k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1999:9): [True: 118k, False: 747]
  |  Branch (1999:19): [True: 116k, False: 2.26k]
  |  Branch (1999:33): [True: 82.2k, False: 34.4k]
  |  Branch (1999:47): [True: 49.6k, False: 32.5k]
  |  Branch (1999:62): [True: 48.8k, False: 859]
  ------------------
 2000|  48.8k|		(*p)++;
 2001|  48.8k|		(*l)--;
 2002|  48.8k|	}
 2003|  70.8k|	if (*l > 0)
  ------------------
  |  Branch (2003:6): [True: 70.1k, False: 747]
  ------------------
 2004|  70.1k|		*sep = **p;
 2005|    747|	else
 2006|    747|		*sep = '\0';
 2007|       |
 2008|       |	/* Handle in-field comments */
 2009|  70.8k|	if (*sep == '#') {
  ------------------
  |  Branch (2009:6): [True: 859, False: 70.0k]
  ------------------
 2010|  9.27k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (2010:10): [True: 9.24k, False: 32]
  |  Branch (2010:20): [True: 9.14k, False: 91]
  |  Branch (2010:34): [True: 8.41k, False: 736]
  ------------------
 2011|  8.41k|			(*p)++;
 2012|  8.41k|			(*l)--;
 2013|  8.41k|		}
 2014|    859|		if (*l > 0)
  ------------------
  |  Branch (2014:7): [True: 827, False: 32]
  ------------------
 2015|    827|			*sep = **p;
 2016|     32|		else
 2017|     32|			*sep = '\0';
 2018|    859|	}
 2019|       |
 2020|       |	/* Skip separator. */
 2021|  70.8k|	if (*l > 0) {
  ------------------
  |  Branch (2021:6): [True: 70.1k, False: 779]
  ------------------
 2022|  70.1k|		(*p)++;
 2023|  70.1k|		(*l)--;
 2024|  70.1k|	}
 2025|  70.8k|}

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

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

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

__archive_check_magic:
  138|  4.27M|{
  139|  4.27M|	char states1[64];
  140|  4.27M|	char states2[64];
  141|  4.27M|	const char *handle_type;
  142|       |
  143|       |	/*
  144|       |	 * If this isn't some form of archive handle,
  145|       |	 * then the library user has screwed up so bad that
  146|       |	 * we don't even have a reliable way to report an error.
  147|       |	 */
  148|  4.27M|	handle_type = archive_handle_type_name(a->magic);
  149|       |
  150|  4.27M|	if (!handle_type) {
  ------------------
  |  Branch (150:6): [True: 0, False: 4.27M]
  ------------------
  151|      0|		errmsg("PROGRAMMER ERROR: Function ");
  152|      0|		errmsg(function);
  153|      0|		errmsg(" invoked with invalid archive handle\n");
  154|      0|		diediedie();
  155|      0|	}
  156|       |
  157|  4.27M|	if (a->magic != magic) {
  ------------------
  |  Branch (157:6): [True: 0, False: 4.27M]
  ------------------
  158|      0|		archive_set_error(a, -1,
  159|      0|		    "PROGRAMMER ERROR: Function '%s' invoked"
  160|      0|		    " on '%s' archive object, which is not supported",
  161|      0|		    function,
  162|      0|		    handle_type);
  163|      0|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  164|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  165|      0|	}
  166|       |
  167|  4.27M|	if ((a->state & state) == 0) {
  ------------------
  |  Branch (167:6): [True: 19.7k, False: 4.25M]
  ------------------
  168|       |		/* If we're already FATAL, don't overwrite the error. */
  169|  19.7k|		if (a->state != ARCHIVE_STATE_FATAL) {
  ------------------
  |  |   96|  19.7k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (169:7): [True: 3.62k, False: 16.1k]
  ------------------
  170|  3.62k|			write_all_states(states1, a->state);
  171|  3.62k|			write_all_states(states2, state);
  172|  3.62k|			archive_set_error(a, -1,
  173|  3.62k|			    "INTERNAL ERROR: Function '%s' invoked with"
  174|  3.62k|			    " archive structure in state '%s',"
  175|  3.62k|			    " should be in state '%s'",
  176|  3.62k|			    function,
  177|  3.62k|			    states1,
  178|  3.62k|			    states2);
  179|  3.62k|		}
  180|  19.7k|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  19.7k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  181|  19.7k|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|  19.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  182|  19.7k|	}
  183|  4.25M|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  4.25M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  184|  4.27M|}
archive_check_magic.c:archive_handle_type_name:
   99|  4.27M|{
  100|  4.27M|	switch (m) {
  101|      0|	case ARCHIVE_WRITE_MAGIC:	return ("archive_write");
  ------------------
  |  |   58|      0|#define	ARCHIVE_WRITE_MAGIC	(0xb0c5c0deU)
  ------------------
  |  Branch (101:2): [True: 0, False: 4.27M]
  ------------------
  102|  4.27M|	case ARCHIVE_READ_MAGIC:	return ("archive_read");
  ------------------
  |  |   59|  4.27M|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  |  Branch (102:2): [True: 4.27M, False: 0]
  ------------------
  103|      0|	case ARCHIVE_WRITE_DISK_MAGIC:	return ("archive_write_disk");
  ------------------
  |  |   60|      0|#define	ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U)
  ------------------
  |  Branch (103:2): [True: 0, False: 4.27M]
  ------------------
  104|      0|	case ARCHIVE_READ_DISK_MAGIC:	return ("archive_read_disk");
  ------------------
  |  |   61|      0|#define	ARCHIVE_READ_DISK_MAGIC (0xbadb0c5U)
  ------------------
  |  Branch (104:2): [True: 0, False: 4.27M]
  ------------------
  105|      0|	case ARCHIVE_MATCH_MAGIC:	return ("archive_match");
  ------------------
  |  |   62|      0|#define	ARCHIVE_MATCH_MAGIC	(0xcad11c9U)
  ------------------
  |  Branch (105:2): [True: 0, False: 4.27M]
  ------------------
  106|      0|	default:			return NULL;
  ------------------
  |  Branch (106:2): [True: 0, False: 4.27M]
  ------------------
  107|  4.27M|	}
  108|  4.27M|}
archive_check_magic.c:write_all_states:
  112|  7.24k|{
  113|  7.24k|	unsigned int lowbit;
  114|       |
  115|  7.24k|	*buff = '\0';
  116|       |
  117|       |	/* A trick for computing the lowest set bit. */
  118|  14.4k|	while ((lowbit = states & (1 + ~states)) != 0) {
  ------------------
  |  Branch (118:9): [True: 7.24k, False: 7.24k]
  ------------------
  119|  7.24k|		states &= ~lowbit;		/* Clear the low bit. */
  120|  7.24k|		strcat(buff, state_name(lowbit));
  121|  7.24k|		if (states != 0)
  ------------------
  |  Branch (121:7): [True: 0, False: 7.24k]
  ------------------
  122|      0|			strcat(buff, "/");
  123|  7.24k|	}
  124|  7.24k|}
archive_check_magic.c:state_name:
   83|  7.24k|{
   84|  7.24k|	switch (s) {
   85|      0|	case ARCHIVE_STATE_NEW:		return ("new");
  ------------------
  |  |   76|      0|#define	ARCHIVE_STATE_NEW	0x01U
  ------------------
  |  Branch (85:2): [True: 0, False: 7.24k]
  ------------------
   86|      0|	case ARCHIVE_STATE_OPEN:	return ("open");
  ------------------
  |  |   78|      0|#define	ARCHIVE_STATE_OPEN	0x02U
  ------------------
  |  Branch (86:2): [True: 0, False: 7.24k]
  ------------------
   87|      0|	case ARCHIVE_STATE_HEADER:	return ("header");
  ------------------
  |  |   80|      0|#define	ARCHIVE_STATE_HEADER	0x04U
  ------------------
  |  Branch (87:2): [True: 0, False: 7.24k]
  ------------------
   88|  3.62k|	case ARCHIVE_STATE_DATA:	return ("data");
  ------------------
  |  |   84|  3.62k|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  |  Branch (88:2): [True: 3.62k, False: 3.62k]
  ------------------
   89|    100|	case ARCHIVE_STATE_DATA_RECOVERY: return ("data_recovery");
  ------------------
  |  |   88|    100|#define	ARCHIVE_STATE_DATA_RECOVERY	0x10U
  ------------------
  |  Branch (89:2): [True: 100, False: 7.14k]
  ------------------
   90|  3.52k|	case ARCHIVE_STATE_EOF:		return ("eof");
  ------------------
  |  |   91|  3.52k|#define	ARCHIVE_STATE_EOF	0x20U
  ------------------
  |  Branch (90:2): [True: 3.52k, False: 3.72k]
  ------------------
   91|      0|	case ARCHIVE_STATE_CLOSED:	return ("closed");
  ------------------
  |  |   93|      0|#define	ARCHIVE_STATE_CLOSED	0x40U
  ------------------
  |  Branch (91:2): [True: 0, False: 7.24k]
  ------------------
   92|      0|	case ARCHIVE_STATE_FATAL:	return ("fatal");
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (92:2): [True: 0, False: 7.24k]
  ------------------
   93|      0|	default:			return ("??");
  ------------------
  |  Branch (93:2): [True: 0, False: 7.24k]
  ------------------
   94|  7.24k|	}
   95|  7.24k|}

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

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

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

archive_digest.c:__archive_md5init:
  286|      9|{
  287|      9|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (287:7): [True: 0, False: 9]
  ------------------
  288|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  289|      9|  if (!EVP_DigestInit(*ctx, EVP_md5()))
  ------------------
  |  Branch (289:7): [True: 0, False: 9]
  ------------------
  290|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  291|      9|  return (ARCHIVE_OK);
  ------------------
  |  |  234|      9|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  292|      9|}
archive_digest.c:__archive_md5update:
  297|     73|{
  298|     73|  EVP_DigestUpdate(*ctx, indata, insize);
  299|     73|  return (ARCHIVE_OK);
  ------------------
  |  |  234|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  300|     73|}
archive_digest.c:__archive_md5final:
  304|      9|{
  305|       |  /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so
  306|       |   * this is meant to cope with that. Real fix is probably to fix
  307|       |   * archive_write_set_format_xar.c
  308|       |   */
  309|      9|  if (*ctx) {
  ------------------
  |  Branch (309:7): [True: 9, False: 0]
  ------------------
  310|      9|    EVP_DigestFinal(*ctx, md, NULL);
  311|      9|    EVP_MD_CTX_free(*ctx);
  312|      9|    *ctx = NULL;
  313|      9|  }
  314|      9|  return (ARCHIVE_OK);
  ------------------
  |  |  234|      9|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  315|      9|}
archive_digest.c:__archive_sha1init:
  701|  1.17k|{
  702|  1.17k|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (702:7): [True: 0, False: 1.17k]
  ------------------
  703|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  704|  1.17k|  if (!EVP_DigestInit(*ctx, EVP_sha1()))
  ------------------
  |  Branch (704:7): [True: 0, False: 1.17k]
  ------------------
  705|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  706|  1.17k|  return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  707|  1.17k|}
archive_digest.c:__archive_sha1update:
  712|  4.10k|{
  713|  4.10k|  EVP_DigestUpdate(*ctx, indata, insize);
  714|  4.10k|  return (ARCHIVE_OK);
  ------------------
  |  |  234|  4.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  715|  4.10k|}
archive_digest.c:__archive_sha1final:
  719|  1.17k|{
  720|       |  /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so
  721|       |   * this is meant to cope with that. Real fix is probably to fix
  722|       |   * archive_write_set_format_xar.c
  723|       |   */
  724|  1.17k|  if (*ctx) {
  ------------------
  |  Branch (724:7): [True: 1.17k, False: 0]
  ------------------
  725|  1.17k|    EVP_DigestFinal(*ctx, md, NULL);
  726|  1.17k|    EVP_MD_CTX_free(*ctx);
  727|  1.17k|    *ctx = NULL;
  728|  1.17k|  }
  729|  1.17k|  return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  730|  1.17k|}
archive_digest.c:__archive_sha256init:
  981|     12|{
  982|     12|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (982:7): [True: 0, False: 12]
  ------------------
  983|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  984|     12|  if (!EVP_DigestInit(*ctx, EVP_sha256()))
  ------------------
  |  Branch (984:7): [True: 0, False: 12]
  ------------------
  985|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  986|     12|  return (ARCHIVE_OK);
  ------------------
  |  |  234|     12|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  987|     12|}
archive_digest.c:__archive_sha256update:
  992|     94|{
  993|     94|  EVP_DigestUpdate(*ctx, indata, insize);
  994|     94|  return (ARCHIVE_OK);
  ------------------
  |  |  234|     94|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  995|     94|}
archive_digest.c:__archive_sha256final:
  999|     12|{
 1000|     12|  if (*ctx) {
  ------------------
  |  Branch (1000:7): [True: 12, False: 0]
  ------------------
 1001|     12|    EVP_DigestFinal(*ctx, md, NULL);
 1002|     12|    EVP_MD_CTX_free(*ctx);
 1003|     12|    *ctx = NULL;
 1004|     12|  }
 1005|     12|  return (ARCHIVE_OK);
  ------------------
  |  |  234|     12|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1006|     12|}
archive_digest.c:__archive_sha512init:
 1509|      7|{
 1510|      7|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (1510:7): [True: 0, False: 7]
  ------------------
 1511|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1512|      7|  if (!EVP_DigestInit(*ctx, EVP_sha512()))
  ------------------
  |  Branch (1512:7): [True: 0, False: 7]
  ------------------
 1513|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1514|      7|  return (ARCHIVE_OK);
  ------------------
  |  |  234|      7|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1515|      7|}
archive_digest.c:__archive_sha512update:
 1520|     73|{
 1521|     73|  EVP_DigestUpdate(*ctx, indata, insize);
 1522|     73|  return (ARCHIVE_OK);
  ------------------
  |  |  234|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1523|     73|}
archive_digest.c:__archive_sha512final:
 1527|      7|{
 1528|      7|  if (*ctx) {
  ------------------
  |  Branch (1528:7): [True: 7, False: 0]
  ------------------
 1529|      7|    EVP_DigestFinal(*ctx, md, NULL);
 1530|      7|    EVP_MD_CTX_free(*ctx);
 1531|      7|    *ctx = NULL;
 1532|      7|  }
 1533|      7|  return (ARCHIVE_OK);
  ------------------
  |  |  234|      7|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1534|      7|}

archive_read_support_filter_gzip.c:archive_le32dec:
  144|  2.01k|{
  145|  2.01k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  2.01k|	unsigned int p3 = p[3];
  151|  2.01k|	unsigned int p2 = p[2];
  152|  2.01k|	unsigned int p1 = p[1];
  153|  2.01k|	unsigned int p0 = p[0];
  154|       |
  155|  2.01k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  2.01k|}
archive_read_support_filter_gzip.c:archive_le16dec:
  115|     61|{
  116|     61|	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|     61|	unsigned int p1 = p[1];
  122|     61|	unsigned int p0 = p[0];
  123|       |
  124|     61|	return ((p1 << 8) | p0);
  125|     61|}
archive_read_support_filter_lz4.c:archive_le32dec:
  144|  35.3k|{
  145|  35.3k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  35.3k|	unsigned int p3 = p[3];
  151|  35.3k|	unsigned int p2 = p[2];
  152|  35.3k|	unsigned int p1 = p[1];
  153|  35.3k|	unsigned int p0 = p[0];
  154|       |
  155|  35.3k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  35.3k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   91|    574|{
   92|    574|	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|    574|	unsigned int p3 = p[3];
   98|    574|	unsigned int p2 = p[2];
   99|    574|	unsigned int p1 = p[1];
  100|    574|	unsigned int p0 = p[0];
  101|       |
  102|    574|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    574|}
archive_read_support_filter_xz.c:archive_le32enc:
  216|    135|{
  217|    135|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    135|	p[0] = u & 0xff;
  220|    135|	p[1] = (u >> 8) & 0xff;
  221|    135|	p[2] = (u >> 16) & 0xff;
  222|    135|	p[3] = (u >> 24) & 0xff;
  223|    135|}
archive_read_support_filter_xz.c:archive_le32dec:
  144|  67.5k|{
  145|  67.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|  67.5k|	unsigned int p3 = p[3];
  151|  67.5k|	unsigned int p2 = p[2];
  152|  67.5k|	unsigned int p1 = p[1];
  153|  67.5k|	unsigned int p0 = p[0];
  154|       |
  155|  67.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  67.5k|}
archive_read_support_filter_xz.c:archive_le64dec:
  160|  22.5k|{
  161|  22.5k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  22.5k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  22.5k|}
archive_read_support_filter_zstd.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_cab.c:archive_le32dec:
  144|   160k|{
  145|   160k|	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|   160k|	unsigned int p3 = p[3];
  151|   160k|	unsigned int p2 = p[2];
  152|   160k|	unsigned int p1 = p[1];
  153|   160k|	unsigned int p0 = p[0];
  154|       |
  155|   160k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   160k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  12.3k|{
  116|  12.3k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  12.3k|	unsigned int p1 = p[1];
  122|  12.3k|	unsigned int p0 = p[0];
  123|       |
  124|  12.3k|	return ((p1 << 8) | p0);
  125|  12.3k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|  3.07k|{
  198|  3.07k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  3.07k|	p[0] = u & 0xff;
  201|  3.07k|	p[1] = (u >> 8) & 0xff;
  202|  3.07k|}
archive_read_support_format_cab.c:archive_le32enc:
  216|  1.26k|{
  217|  1.26k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|  1.26k|	p[0] = u & 0xff;
  220|  1.26k|	p[1] = (u >> 8) & 0xff;
  221|  1.26k|	p[2] = (u >> 16) & 0xff;
  222|  1.26k|	p[3] = (u >> 24) & 0xff;
  223|  1.26k|}
archive_read_support_format_cpio.c:archive_be16dec:
   61|  38.1k|{
   62|  38.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|  38.1k|	unsigned int p1 = p[1];
   68|  38.1k|	unsigned int p0 = p[0];
   69|       |
   70|  38.1k|	return ((p0 << 8) | p1);
   71|  38.1k|}
archive_read_support_format_cpio.c:archive_le16dec:
  115|  25.4k|{
  116|  25.4k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  25.4k|	unsigned int p1 = p[1];
  122|  25.4k|	unsigned int p0 = p[0];
  123|       |
  124|  25.4k|	return ((p1 << 8) | p0);
  125|  25.4k|}
archive_read_support_format_iso9660.c:archive_le32dec:
  144|  3.92k|{
  145|  3.92k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  3.92k|	unsigned int p3 = p[3];
  151|  3.92k|	unsigned int p2 = p[2];
  152|  3.92k|	unsigned int p1 = p[1];
  153|  3.92k|	unsigned int p0 = p[0];
  154|       |
  155|  3.92k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  3.92k|}
archive_read_support_format_iso9660.c:archive_le16dec:
  115|    609|{
  116|    609|	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|    609|	unsigned int p1 = p[1];
  122|    609|	unsigned int p0 = p[0];
  123|       |
  124|    609|	return ((p1 << 8) | p0);
  125|    609|}
archive_read_support_format_iso9660.c:archive_be32dec:
   91|    487|{
   92|    487|	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|    487|	unsigned int p3 = p[3];
   98|    487|	unsigned int p2 = p[2];
   99|    487|	unsigned int p1 = p[1];
  100|    487|	unsigned int p0 = p[0];
  101|       |
  102|    487|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    487|}
archive_read_support_format_lha.c:archive_le32dec:
  144|  16.2k|{
  145|  16.2k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  16.2k|	unsigned int p3 = p[3];
  151|  16.2k|	unsigned int p2 = p[2];
  152|  16.2k|	unsigned int p1 = p[1];
  153|  16.2k|	unsigned int p0 = p[0];
  154|       |
  155|  16.2k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  16.2k|}
archive_read_support_format_lha.c:archive_le16dec:
  115|  35.5k|{
  116|  35.5k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  35.5k|	unsigned int p1 = p[1];
  122|  35.5k|	unsigned int p0 = p[0];
  123|       |
  124|  35.5k|	return ((p1 << 8) | p0);
  125|  35.5k|}
archive_read_support_format_lha.c:archive_be16dec:
   61|     43|{
   62|     43|	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|     43|	unsigned int p1 = p[1];
   68|     43|	unsigned int p0 = p[0];
   69|       |
   70|     43|	return ((p0 << 8) | p1);
   71|     43|}
archive_read_support_format_lha.c:archive_le64dec:
  160|    341|{
  161|    341|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    341|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    341|}
archive_read_support_format_rar.c:archive_le16dec:
  115|  58.1k|{
  116|  58.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|  58.1k|	unsigned int p1 = p[1];
  122|  58.1k|	unsigned int p0 = p[0];
  123|       |
  124|  58.1k|	return ((p1 << 8) | p0);
  125|  58.1k|}
archive_read_support_format_rar.c:archive_le64dec:
  160|  1.88k|{
  161|  1.88k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  1.88k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  1.88k|}
archive_read_support_format_rar.c:archive_le32dec:
  144|  58.6k|{
  145|  58.6k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  58.6k|	unsigned int p3 = p[3];
  151|  58.6k|	unsigned int p2 = p[2];
  152|  58.6k|	unsigned int p1 = p[1];
  153|  58.6k|	unsigned int p0 = p[0];
  154|       |
  155|  58.6k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  58.6k|}
archive_read_support_format_rar.c:archive_le32enc:
  216|   195k|{
  217|   195k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|   195k|	p[0] = u & 0xff;
  220|   195k|	p[1] = (u >> 8) & 0xff;
  221|   195k|	p[2] = (u >> 16) & 0xff;
  222|   195k|	p[3] = (u >> 24) & 0xff;
  223|   195k|}
archive_read_support_format_rar5.c:archive_le32dec:
  144|   186k|{
  145|   186k|	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|   186k|	unsigned int p3 = p[3];
  151|   186k|	unsigned int p2 = p[2];
  152|   186k|	unsigned int p1 = p[1];
  153|   186k|	unsigned int p0 = p[0];
  154|       |
  155|   186k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   186k|}
archive_read_support_format_rar5.c:archive_le64dec:
  160|  1.22k|{
  161|  1.22k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  1.22k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  1.22k|}
archive_read_support_format_rar5.c:archive_le16dec:
  115|    229|{
  116|    229|	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|    229|	unsigned int p1 = p[1];
  122|    229|	unsigned int p0 = p[0];
  123|       |
  124|    229|	return ((p1 << 8) | p0);
  125|    229|}
archive_read_support_format_rar5.c:archive_be24dec:
   75|   167M|{
   76|   167M|	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|   167M|	unsigned int p2 = p[2];
   82|   167M|	unsigned int p1 = p[1];
   83|   167M|	unsigned int p0 = p[0];
   84|       |
   85|   167M|	return ((p0 << 16) | (p1 << 8) | p2);
   86|   167M|}
archive_read_support_format_rar5.c:archive_be32dec:
   91|  16.2k|{
   92|  16.2k|	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|  16.2k|	unsigned int p3 = p[3];
   98|  16.2k|	unsigned int p2 = p[2];
   99|  16.2k|	unsigned int p1 = p[1];
  100|  16.2k|	unsigned int p0 = p[0];
  101|       |
  102|  16.2k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  16.2k|}
archive_read_support_format_rar5.c:archive_le32enc:
  216|  32.8k|{
  217|  32.8k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|  32.8k|	p[0] = u & 0xff;
  220|  32.8k|	p[1] = (u >> 8) & 0xff;
  221|  32.8k|	p[2] = (u >> 16) & 0xff;
  222|  32.8k|	p[3] = (u >> 24) & 0xff;
  223|  32.8k|}
archive_read_support_format_xar.c:archive_be32dec:
   91|  28.8k|{
   92|  28.8k|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|  28.8k|	unsigned int p3 = p[3];
   98|  28.8k|	unsigned int p2 = p[2];
   99|  28.8k|	unsigned int p1 = p[1];
  100|  28.8k|	unsigned int p0 = p[0];
  101|       |
  102|  28.8k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  28.8k|}
archive_read_support_format_xar.c:archive_be16dec:
   61|  3.93k|{
   62|  3.93k|	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.93k|	unsigned int p1 = p[1];
   68|  3.93k|	unsigned int p0 = p[0];
   69|       |
   70|  3.93k|	return ((p0 << 8) | p1);
   71|  3.93k|}
archive_read_support_format_xar.c:archive_be64dec:
  107|  2.60k|{
  108|  2.60k|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|  2.60k|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|  2.60k|}
archive_read_support_format_zip.c:archive_le16dec:
  115|   364k|{
  116|   364k|	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|   364k|	unsigned int p1 = p[1];
  122|   364k|	unsigned int p0 = p[0];
  123|       |
  124|   364k|	return ((p1 << 8) | p0);
  125|   364k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   532k|{
  145|   532k|	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|   532k|	unsigned int p3 = p[3];
  151|   532k|	unsigned int p2 = p[2];
  152|   532k|	unsigned int p1 = p[1];
  153|   532k|	unsigned int p0 = p[0];
  154|       |
  155|   532k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   532k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  53.2k|{
  161|  53.2k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  53.2k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  53.2k|}
archive_string.c:archive_be16enc:
  168|  19.6k|{
  169|  19.6k|	unsigned char *p = (unsigned char *)pp;
  170|       |
  171|  19.6k|	p[0] = (u >> 8) & 0xff;
  172|  19.6k|	p[1] = u & 0xff;
  173|  19.6k|}
archive_string.c:archive_le16enc:
  197|  8.71k|{
  198|  8.71k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  8.71k|	p[0] = u & 0xff;
  201|  8.71k|	p[1] = (u >> 8) & 0xff;
  202|  8.71k|}
archive_string.c:archive_be16dec:
   61|  57.9k|{
   62|  57.9k|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|  57.9k|	unsigned int p1 = p[1];
   68|  57.9k|	unsigned int p0 = p[0];
   69|       |
   70|  57.9k|	return ((p0 << 8) | p1);
   71|  57.9k|}
archive_string.c:archive_le16dec:
  115|  47.5k|{
  116|  47.5k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  47.5k|	unsigned int p1 = p[1];
  122|  47.5k|	unsigned int p0 = p[0];
  123|       |
  124|  47.5k|	return ((p1 << 8) | p0);
  125|  47.5k|}
archive_read_support_format_7zip.c:archive_le32dec:
  144|  92.0k|{
  145|  92.0k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  92.0k|	unsigned int p3 = p[3];
  151|  92.0k|	unsigned int p2 = p[2];
  152|  92.0k|	unsigned int p1 = p[1];
  153|  92.0k|	unsigned int p0 = p[0];
  154|       |
  155|  92.0k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  92.0k|}
archive_read_support_format_7zip.c:archive_le16dec:
  115|    808|{
  116|    808|	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|    808|	unsigned int p1 = p[1];
  122|    808|	unsigned int p0 = p[0];
  123|       |
  124|    808|	return ((p1 << 8) | p0);
  125|    808|}
archive_read_support_format_7zip.c:archive_be16dec:
   61|    582|{
   62|    582|	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|    582|	unsigned int p1 = p[1];
   68|    582|	unsigned int p0 = p[0];
   69|       |
   70|    582|	return ((p0 << 8) | p1);
   71|    582|}
archive_read_support_format_7zip.c:archive_be32dec:
   91|  1.40k|{
   92|  1.40k|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|  1.40k|	unsigned int p3 = p[3];
   98|  1.40k|	unsigned int p2 = p[2];
   99|  1.40k|	unsigned int p1 = p[1];
  100|  1.40k|	unsigned int p0 = p[0];
  101|       |
  102|  1.40k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  1.40k|}
archive_read_support_format_7zip.c:archive_be64dec:
  107|    489|{
  108|    489|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|    489|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|    489|}
archive_read_support_format_7zip.c:archive_le64dec:
  160|  7.78k|{
  161|  7.78k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  7.78k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  7.78k|}
archive_read_support_format_7zip.c:archive_le32enc:
  216|    217|{
  217|    217|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    217|	p[0] = u & 0xff;
  220|    217|	p[1] = (u >> 8) & 0xff;
  221|    217|	p[2] = (u >> 16) & 0xff;
  222|    217|	p[3] = (u >> 24) & 0xff;
  223|    217|}
archive_read_support_format_7zip.c:archive_le24dec:
  129|     18|{
  130|     18|	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|     18|	unsigned int p2 = p[2];
  136|     18|	unsigned int p1 = p[1];
  137|     18|	unsigned int p0 = p[0];
  138|       |
  139|     18|	return ((p2 << 16) | (p1 << 8) | p0);
  140|     18|}
archive_read_support_format_7zip.c:archive_le24enc:
  206|     18|{
  207|     18|	unsigned char *p = (unsigned char *)pp;
  208|       |
  209|     18|	p[0] = u & 0xff;
  210|     18|	p[1] = (u >> 8) & 0xff;
  211|     18|	p[2] = (u >> 16) & 0xff;
  212|     18|}
archive_read_support_format_7zip.c:archive_be32enc:
  177|     65|{
  178|     65|	unsigned char *p = (unsigned char *)pp;
  179|       |
  180|     65|	p[0] = (u >> 24) & 0xff;
  181|     65|	p[1] = (u >> 16) & 0xff;
  182|     65|	p[2] = (u >> 8) & 0xff;
  183|     65|	p[3] = u & 0xff;
  184|     65|}

archive_entry_clear:
  146|  1.77M|{
  147|  1.77M|	if (entry == NULL)
  ------------------
  |  Branch (147:6): [True: 0, False: 1.77M]
  ------------------
  148|      0|		return (NULL);
  149|  1.77M|	archive_mstring_clean(&entry->ae_fflags_text);
  150|  1.77M|	archive_mstring_clean(&entry->ae_gname);
  151|  1.77M|	archive_mstring_clean(&entry->ae_linkname);
  152|  1.77M|	archive_mstring_clean(&entry->ae_pathname);
  153|  1.77M|	archive_mstring_clean(&entry->ae_sourcepath);
  154|  1.77M|	archive_mstring_clean(&entry->ae_uname);
  155|       |	archive_entry_copy_mac_metadata(entry, NULL, 0);
  156|  1.77M|	archive_acl_clear(&entry->acl);
  157|  1.77M|	archive_entry_xattr_clear(entry);
  158|  1.77M|	archive_entry_sparse_clear(entry);
  159|  1.77M|	free(entry->stat);
  160|  1.77M|	memset(entry, 0, sizeof(*entry));
  161|  1.77M|	return entry;
  162|  1.77M|}
archive_entry_free:
  244|  55.8k|{
  245|  55.8k|	archive_entry_clear(entry);
  246|  55.8k|	free(entry);
  247|  55.8k|}
archive_entry_new:
  251|  35.7k|{
  252|       |	return archive_entry_new2(NULL);
  253|  35.7k|}
archive_entry_new2:
  257|  55.8k|{
  258|  55.8k|	struct archive_entry *entry;
  259|       |
  260|  55.8k|	entry = calloc(1, sizeof(*entry));
  261|  55.8k|	if (entry == NULL)
  ------------------
  |  Branch (261:6): [True: 0, False: 55.8k]
  ------------------
  262|      0|		return (NULL);
  263|  55.8k|	entry->archive = a;
  264|  55.8k|	return (entry);
  265|  55.8k|}
archive_entry_atime:
  273|   593k|{
  274|   593k|	return (entry->ae_stat.aest_atime);
  275|   593k|}
archive_entry_atime_is_set:
  285|  3.61k|{
  286|  3.61k|	return (entry->ae_set & AE_SET_ATIME);
  ------------------
  |  |  141|  3.61k|#define	AE_SET_ATIME	4
  ------------------
  287|  3.61k|}
archive_entry_birthtime:
  291|   593k|{
  292|   593k|	return (entry->ae_stat.aest_birthtime);
  293|   593k|}
archive_entry_ctime:
  309|   593k|{
  310|   593k|	return (entry->ae_stat.aest_ctime);
  311|   593k|}
archive_entry_ctime_is_set:
  315|  3.61k|{
  316|  3.61k|	return (entry->ae_set & AE_SET_CTIME);
  ------------------
  |  |  142|  3.61k|#define	AE_SET_CTIME	8
  ------------------
  317|  3.61k|}
archive_entry_dev:
  327|   601k|{
  328|   601k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (328:6): [True: 14.3k, False: 587k]
  ------------------
  329|  14.3k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  14.3k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  330|   587k|		    entry->ae_stat.aest_devminor);
  331|   587k|	else
  332|   587k|		return (entry->ae_stat.aest_dev);
  333|   601k|}
archive_entry_filetype:
  361|  1.09M|{
  362|  1.09M|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|  1.09M|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  363|  1.09M|}
archive_entry_gid:
  420|   593k|{
  421|   593k|	return (entry->ae_stat.aest_gid);
  422|   593k|}
archive_entry_gid_is_set:
  426|   457k|{
  427|   457k|	return (entry->ae_set & AE_SET_GID);
  ------------------
  |  |  151|   457k|#define	AE_SET_GID	4096
  ------------------
  428|   457k|}
archive_entry_gname:
  432|  12.4k|{
  433|  12.4k|	const char *p;
  434|  12.4k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_gname, &p) == 0)
  ------------------
  |  Branch (434:6): [True: 12.4k, False: 0]
  ------------------
  435|  12.4k|		return (p);
  436|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (436:6): [True: 0, False: 0]
  ------------------
  437|      0|		__archive_errx(1, "No memory");
  438|      0|	return (NULL);
  439|      0|}
archive_entry_set_link_to_hardlink:
  473|  7.76k|{
  474|  7.76k|	if ((entry->ae_set & AE_SET_SYMLINK) != 0) {
  ------------------
  |  |  140|  7.76k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (474:6): [True: 0, False: 7.76k]
  ------------------
  475|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  476|      0|	}
  477|  7.76k|	entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  7.76k|#define	AE_SET_HARDLINK	1
  ------------------
  478|  7.76k|}
archive_entry_hardlink:
  482|  7.76k|{
  483|  7.76k|	const char *p;
  484|  7.76k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  7.76k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (484:6): [True: 0, False: 7.76k]
  ------------------
  485|      0|		return (NULL);
  486|  7.76k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (486:6): [True: 7.76k, False: 0]
  ------------------
  487|  7.76k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  488|  7.76k|		return (p);
  489|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (489:6): [True: 0, False: 0]
  ------------------
  490|      0|		__archive_errx(1, "No memory");
  491|      0|	return (NULL);
  492|      0|}
archive_entry_hardlink_w:
  510|  7.76k|{
  511|  7.76k|	const wchar_t *p;
  512|  7.76k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  7.76k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (512:6): [True: 0, False: 7.76k]
  ------------------
  513|      0|		return (NULL);
  514|  7.76k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (514:6): [True: 7.76k, False: 4]
  ------------------
  515|  7.76k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  516|  7.76k|		return (p);
  517|      4|	if (errno == ENOMEM)
  ------------------
  |  Branch (517:6): [True: 0, False: 4]
  ------------------
  518|      0|		__archive_errx(1, "No memory");
  519|      4|	return (NULL);
  520|      4|}
archive_entry_ino64:
  554|  8.54k|{
  555|  8.54k|	return (entry->ae_stat.aest_ino);
  556|  8.54k|}
archive_entry_mode:
  560|   593k|{
  561|   593k|	return (entry->acl.mode);
  562|   593k|}
archive_entry_mtime:
  566|   593k|{
  567|   593k|	return (entry->ae_stat.aest_mtime);
  568|   593k|}
archive_entry_mtime_is_set:
  578|   457k|{
  579|   457k|	return (entry->ae_set & AE_SET_MTIME);
  ------------------
  |  |  143|   457k|#define	AE_SET_MTIME	16
  ------------------
  580|   457k|}
archive_entry_nlink:
  584|  13.6k|{
  585|  13.6k|	return (entry->ae_stat.aest_nlink);
  586|  13.6k|}
archive_entry_pathname:
  597|  1.97M|{
  598|  1.97M|	const char *p;
  599|  1.97M|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (599:6): [True: 1.97M, False: 3.33k]
  ------------------
  600|  1.97M|	    entry->archive, &entry->ae_pathname, &p) == 0)
  601|  1.97M|		return (p);
  602|       |#if HAVE_EILSEQ  /*{*/
  603|  3.33k|    if (errno == EILSEQ) {
  ------------------
  |  Branch (603:9): [True: 3.33k, False: 0]
  ------------------
  604|  3.33k|	    if (archive_mstring_get_utf8(
  ------------------
  |  Branch (604:10): [True: 3.33k, False: 0]
  ------------------
  605|  3.33k|	        entry->archive, &entry->ae_pathname, &p) == 0)
  606|  3.33k|		    return (p);
  607|  3.33k|    }
  608|      0|#endif  /*}*/
  609|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (609:6): [True: 0, False: 0]
  ------------------
  610|      0|		__archive_errx(1, "No memory");
  611|      0|	return (NULL);
  612|      0|}
archive_entry_pathname_utf8:
  616|   622k|{
  617|   622k|	const char *p;
  618|   622k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (618:6): [True: 603k, False: 19.1k]
  ------------------
  619|   622k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  620|   603k|		return (p);
  621|  19.1k|	if (errno == ENOMEM)
  ------------------
  |  Branch (621:6): [True: 0, False: 19.1k]
  ------------------
  622|      0|		__archive_errx(1, "No memory");
  623|  19.1k|	return (NULL);
  624|  19.1k|}
archive_entry_pathname_w:
  628|  1.13M|{
  629|  1.13M|	const wchar_t *p;
  630|  1.13M|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (630:6): [True: 1.09M, False: 33.4k]
  ------------------
  631|  1.13M|	    entry->archive, &entry->ae_pathname, &p) == 0)
  632|  1.09M|		return (p);
  633|  33.4k|	if (errno == ENOMEM)
  ------------------
  |  Branch (633:6): [True: 0, False: 33.4k]
  ------------------
  634|      0|		__archive_errx(1, "No memory");
  635|  33.4k|	return (NULL);
  636|  33.4k|}
archive_entry_perm:
  647|    830|{
  648|    830|	return (~AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|    830|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  649|    830|}
archive_entry_perm_is_set:
  653|   457k|{
  654|   457k|	return (entry->ae_set & AE_SET_PERM);
  ------------------
  |  |  148|   457k|#define	AE_SET_PERM	512
  ------------------
  655|   457k|}
archive_entry_rdev_is_set:
  659|  3.16k|{
  660|  3.16k|	return (entry->ae_set & AE_SET_RDEV);
  ------------------
  |  |  152|  3.16k|#define	AE_SET_RDEV	8192
  ------------------
  661|  3.16k|}
archive_entry_size:
  705|  1.25M|{
  706|  1.25M|	return (entry->ae_stat.aest_size);
  707|  1.25M|}
archive_entry_size_is_set:
  711|   592k|{
  712|   592k|	return (entry->ae_set & AE_SET_SIZE);
  ------------------
  |  |  145|   592k|#define	AE_SET_SIZE	64
  ------------------
  713|   592k|}
archive_entry_symlink:
  751|  4.53k|{
  752|  4.53k|	const char *p;
  753|  4.53k|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|  4.53k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (753:6): [True: 3.84k, False: 696]
  ------------------
  754|  3.84k|		return (NULL);
  755|    696|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (755:6): [True: 696, False: 0]
  ------------------
  756|    696|	    entry->archive, &entry->ae_linkname, &p) == 0)
  757|    696|		return (p);
  758|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (758:6): [True: 0, False: 0]
  ------------------
  759|      0|		__archive_errx(1, "No memory");
  760|      0|	return (NULL);
  761|      0|}
archive_entry_set_link_to_symlink:
  765|    682|{
  766|    682|	if ((entry->ae_set & AE_SET_HARDLINK) != 0) {
  ------------------
  |  |  139|    682|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (766:6): [True: 20, False: 662]
  ------------------
  767|     20|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|     20|#define	AE_SET_HARDLINK	1
  ------------------
  768|     20|	}
  769|    682|	entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|    682|#define	AE_SET_SYMLINK	2
  ------------------
  770|    682|}
archive_entry_symlink_w:
  794|  1.11k|{
  795|  1.11k|	const wchar_t *p;
  796|  1.11k|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|  1.11k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (796:6): [True: 429, False: 682]
  ------------------
  797|    429|		return (NULL);
  798|    682|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (798:6): [True: 679, False: 3]
  ------------------
  799|    682|	    entry->archive, &entry->ae_linkname, &p) == 0)
  800|    679|		return (p);
  801|      3|	if (errno == ENOMEM)
  ------------------
  |  Branch (801:6): [True: 0, False: 3]
  ------------------
  802|      0|		__archive_errx(1, "No memory");
  803|      3|	return (NULL);
  804|      3|}
archive_entry_uid:
  820|   593k|{
  821|   593k|	return (entry->ae_stat.aest_uid);
  822|   593k|}
archive_entry_uid_is_set:
  826|   457k|{
  827|   457k|	return (entry->ae_set & AE_SET_UID);
  ------------------
  |  |  150|   457k|#define	AE_SET_UID	2048
  ------------------
  828|   457k|}
archive_entry_uname:
  832|  12.4k|{
  833|  12.4k|	const char *p;
  834|  12.4k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_uname, &p) == 0)
  ------------------
  |  Branch (834:6): [True: 12.4k, False: 0]
  ------------------
  835|  12.4k|		return (p);
  836|      0|	if (errno == ENOMEM)
  ------------------
  |  Branch (836:6): [True: 0, False: 0]
  ------------------
  837|      0|		__archive_errx(1, "No memory");
  838|      0|	return (NULL);
  839|      0|}
archive_entry_is_data_encrypted:
  872|   593k|{
  873|   593k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  170|   593k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  170|   593k|#define AE_ENCRYPTION_DATA 1
  ------------------
  874|   593k|}
archive_entry_is_metadata_encrypted:
  878|   593k|{
  879|   593k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  171|   593k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  171|   593k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  880|   593k|}
archive_entry_is_encrypted:
  884|   593k|{
  885|   593k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|   593k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  171|   593k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  886|   593k|}
archive_entry_set_filetype:
  894|   969k|{
  895|   969k|	entry->stat_valid = 0;
  896|   969k|	entry->acl.mode &= ~AE_IFMT;
  ------------------
  |  |  215|   969k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  897|   969k|	entry->acl.mode |= AE_IFMT & type;
  ------------------
  |  |  215|   969k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  898|   969k|	entry->ae_set |= AE_SET_FILETYPE;
  ------------------
  |  |  149|   969k|#define	AE_SET_FILETYPE	1024
  ------------------
  899|   969k|}
archive_entry_copy_fflags_text:
  913|  17.8k|{
  914|  17.8k|	return archive_entry_copy_fflags_text_len(entry, flags, strlen(flags));
  915|  17.8k|}
archive_entry_copy_fflags_text_len:
  920|  17.8k|{
  921|  17.8k|	archive_mstring_copy_mbs_len(&entry->ae_fflags_text, flags, flags_length);
  922|  17.8k|	return (ae_strtofflags(flags, flags_length,
  923|  17.8k|		    &entry->ae_fflags_set, &entry->ae_fflags_clear));
  924|  17.8k|}
archive_entry_set_gid:
  937|   530k|{
  938|   530k|	if (g < 0) {
  ------------------
  |  Branch (938:6): [True: 457, False: 530k]
  ------------------
  939|    457|		g = 0;
  940|    457|	}
  941|   530k|	entry->stat_valid = 0;
  942|   530k|	entry->ae_stat.aest_gid = g;
  943|   530k|	entry->ae_set |= AE_SET_GID;
  ------------------
  |  |  151|   530k|#define	AE_SET_GID	4096
  ------------------
  944|   530k|}
archive_entry_set_gname:
  948|    715|{
  949|    715|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  950|    715|}
archive_entry_copy_gname:
  960|    247|{
  961|    247|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  962|    247|}
__archive_entry_copy_gname_l:
  984|  12.4k|{
  985|  12.4k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_gname, name, len, sc));
  986|  12.4k|}
archive_entry_set_ino:
  990|  1.55M|{
  991|  1.55M|	if (ino < 0) {
  ------------------
  |  Branch (991:6): [True: 206, False: 1.55M]
  ------------------
  992|    206|		entry->stat_valid = 0;
  993|    206|		entry->ae_set &= ~AE_SET_INO;
  ------------------
  |  |  146|    206|#define	AE_SET_INO	128
  ------------------
  994|    206|		return;
  995|    206|	}
  996|  1.55M|	entry->stat_valid = 0;
  997|  1.55M|	entry->ae_set |= AE_SET_INO;
  ------------------
  |  |  146|  1.55M|#define	AE_SET_INO	128
  ------------------
  998|  1.55M|	entry->ae_stat.aest_ino = ino;
  999|  1.55M|}
archive_entry_set_hardlink:
 1016|     65|{
 1017|     65|	if (target == NULL) {
  ------------------
  |  Branch (1017:6): [True: 1, False: 64]
  ------------------
 1018|      1|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      1|#define	AE_SET_HARDLINK	1
  ------------------
 1019|      1|		if (entry->ae_set & AE_SET_SYMLINK) {
  ------------------
  |  |  140|      1|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1019:7): [True: 0, False: 1]
  ------------------
 1020|      0|			return;
 1021|      0|		}
 1022|     64|	} else {
 1023|     64|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|     64|#define	AE_SET_HARDLINK	1
  ------------------
 1024|     64|	}
 1025|     65|	entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|     65|#define	AE_SET_SYMLINK	2
  ------------------
 1026|     65|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1027|     65|}
archive_entry_copy_hardlink:
 1043|  5.66k|{
 1044|  5.66k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1044:6): [True: 0, False: 5.66k]
  |  Branch (1044:24): [True: 0, False: 0]
  ------------------
 1045|      0|		return;
 1046|  5.66k|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1047|  5.66k|	if (target != NULL)
  ------------------
  |  Branch (1047:6): [True: 5.66k, False: 0]
  ------------------
 1048|  5.66k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  5.66k|#define	AE_SET_HARDLINK	1
  ------------------
 1049|      0|	else
 1050|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1051|  5.66k|}
archive_entry_update_hardlink_utf8:
 1067|    740|{
 1068|    740|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1068:6): [True: 0, False: 740]
  |  Branch (1068:24): [True: 0, False: 0]
  ------------------
 1069|      0|		return (0);
 1070|    740|	if (target != NULL)
  ------------------
  |  Branch (1070:6): [True: 740, False: 0]
  ------------------
 1071|    740|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    740|#define	AE_SET_HARDLINK	1
  ------------------
 1072|      0|	else
 1073|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1074|    740|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1074:6): [True: 102, False: 638]
  ------------------
 1075|    740|	    &entry->ae_linkname, target) == 0)
 1076|    102|		return (1);
 1077|    638|	if (errno == ENOMEM)
  ------------------
  |  Branch (1077:6): [True: 0, False: 638]
  ------------------
 1078|      0|		__archive_errx(1, "No memory");
 1079|    638|	return (0);
 1080|    638|}
__archive_entry_copy_hardlink_l:
 1085|  7.75k|{
 1086|  7.75k|	int r;
 1087|       |
 1088|  7.75k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1088:6): [True: 0, False: 7.75k]
  |  Branch (1088:24): [True: 0, False: 0]
  ------------------
 1089|      0|		return (0);
 1090|  7.75k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1091|  7.75k|	    target, len, sc);
 1092|  7.75k|	if (target != NULL && r == 0)
  ------------------
  |  Branch (1092:6): [True: 7.75k, False: 0]
  |  Branch (1092:24): [True: 7.75k, False: 0]
  ------------------
 1093|  7.75k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  7.75k|#define	AE_SET_HARDLINK	1
  ------------------
 1094|      0|	else
 1095|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1096|  7.75k|	return (r);
 1097|  7.75k|}
archive_entry_set_atime:
 1101|  20.6k|{
 1102|  20.6k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  20.6k|	do {	\
  |  |  113|  20.6k|		t += ns / 1000000000; \
  |  |  114|  20.6k|		ns %= 1000000000; \
  |  |  115|  20.6k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 20.6k]
  |  |  ------------------
  |  |  116|  20.6k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 20.6k]
  |  |  ------------------
  ------------------
 1103|  20.6k|	entry->stat_valid = 0;
 1104|  20.6k|	entry->ae_set |= AE_SET_ATIME;
  ------------------
  |  |  141|  20.6k|#define	AE_SET_ATIME	4
  ------------------
 1105|  20.6k|	entry->ae_stat.aest_atime = t;
 1106|  20.6k|	entry->ae_stat.aest_atime_nsec = ns;
 1107|  20.6k|}
archive_entry_unset_atime:
 1111|  4.61k|{
 1112|  4.61k|	archive_entry_set_atime(entry, 0, 0);
 1113|  4.61k|	entry->ae_set &= ~AE_SET_ATIME;
  ------------------
  |  |  141|  4.61k|#define	AE_SET_ATIME	4
  ------------------
 1114|  4.61k|}
archive_entry_set_birthtime:
 1118|  4.91k|{
 1119|  4.91k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  4.91k|	do {	\
  |  |  113|  4.91k|		t += ns / 1000000000; \
  |  |  114|  4.91k|		ns %= 1000000000; \
  |  |  115|  4.91k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 4.91k]
  |  |  ------------------
  |  |  116|  4.91k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 4.91k]
  |  |  ------------------
  ------------------
 1120|  4.91k|	entry->stat_valid = 0;
 1121|  4.91k|	entry->ae_set |= AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  4.91k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1122|  4.91k|	entry->ae_stat.aest_birthtime = t;
 1123|  4.91k|	entry->ae_stat.aest_birthtime_nsec = ns;
 1124|  4.91k|}
archive_entry_unset_birthtime:
 1128|  4.88k|{
 1129|  4.88k|	archive_entry_set_birthtime(entry, 0, 0);
 1130|  4.88k|	entry->ae_set &= ~AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  4.88k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1131|  4.88k|}
archive_entry_set_ctime:
 1135|  24.2k|{
 1136|  24.2k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  24.2k|	do {	\
  |  |  113|  24.2k|		t += ns / 1000000000; \
  |  |  114|  24.2k|		ns %= 1000000000; \
  |  |  115|  24.2k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 24.2k]
  |  |  ------------------
  |  |  116|  24.2k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 24.2k]
  |  |  ------------------
  ------------------
 1137|  24.2k|	entry->stat_valid = 0;
 1138|  24.2k|	entry->ae_set |= AE_SET_CTIME;
  ------------------
  |  |  142|  24.2k|#define	AE_SET_CTIME	8
  ------------------
 1139|  24.2k|	entry->ae_stat.aest_ctime = t;
 1140|  24.2k|	entry->ae_stat.aest_ctime_nsec = ns;
 1141|  24.2k|}
archive_entry_unset_ctime:
 1145|  4.61k|{
 1146|  4.61k|	archive_entry_set_ctime(entry, 0, 0);
 1147|  4.61k|	entry->ae_set &= ~AE_SET_CTIME;
  ------------------
  |  |  142|  4.61k|#define	AE_SET_CTIME	8
  ------------------
 1148|  4.61k|}
archive_entry_set_dev:
 1152|  1.54M|{
 1153|  1.54M|	entry->stat_valid = 0;
 1154|  1.54M|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  1.54M|#define	AE_SET_DEV	256
  ------------------
 1155|  1.54M|	entry->ae_stat.aest_dev_is_broken_down = 0;
 1156|  1.54M|	entry->ae_stat.aest_dev = d;
 1157|  1.54M|}
archive_entry_set_devmajor:
 1161|  7.33k|{
 1162|  7.33k|	entry->stat_valid = 0;
 1163|  7.33k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  7.33k|#define	AE_SET_DEV	256
  ------------------
 1164|  7.33k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1165|  7.33k|	entry->ae_stat.aest_devmajor = m;
 1166|  7.33k|}
archive_entry_set_devminor:
 1170|  7.33k|{
 1171|  7.33k|	entry->stat_valid = 0;
 1172|  7.33k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  7.33k|#define	AE_SET_DEV	256
  ------------------
 1173|  7.33k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1174|  7.33k|	entry->ae_stat.aest_devminor = m;
 1175|  7.33k|}
archive_entry_set_link:
 1180|    370|{
 1181|    370|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1182|    370|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|    370|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1182:6): [True: 370, False: 0]
  ------------------
 1183|    370|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    370|#define	AE_SET_HARDLINK	1
  ------------------
 1184|    370|	}
 1185|    370|}
archive_entry_copy_link:
 1199|      2|{
 1200|      2|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1201|      2|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|      2|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1201:6): [True: 2, False: 0]
  ------------------
 1202|      2|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|      2|#define	AE_SET_HARDLINK	1
  ------------------
 1203|      2|	}
 1204|      2|}
__archive_entry_copy_link_l:
 1235|      3|{
 1236|      3|	int r;
 1237|       |
 1238|      3|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1239|      3|		    target, len, sc);
 1240|      3|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|      3|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1240:6): [True: 3, False: 0]
  ------------------
 1241|      3|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|      3|#define	AE_SET_HARDLINK	1
  ------------------
 1242|      3|	}
 1243|      3|	return (r);
 1244|      3|}
archive_entry_set_mode:
 1248|   112k|{
 1249|   112k|	entry->stat_valid = 0;
 1250|   112k|	entry->acl.mode = m;
 1251|   112k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|   112k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|   112k|#define	AE_SET_FILETYPE	1024
  ------------------
 1252|   112k|}
archive_entry_set_mtime:
 1256|   563k|{
 1257|   563k|	FIX_NS(t, ns);
  ------------------
  |  |  112|   563k|	do {	\
  |  |  113|   563k|		t += ns / 1000000000; \
  |  |  114|   563k|		ns %= 1000000000; \
  |  |  115|   563k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 563k]
  |  |  ------------------
  |  |  116|   563k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 563k]
  |  |  ------------------
  ------------------
 1258|   563k|	entry->stat_valid = 0;
 1259|   563k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|   563k|#define	AE_SET_MTIME	16
  ------------------
 1260|   563k|	entry->ae_stat.aest_mtime = t;
 1261|   563k|	entry->ae_stat.aest_mtime_nsec = ns;
 1262|   563k|}
archive_entry_unset_mtime:
 1266|    315|{
 1267|    315|	archive_entry_set_mtime(entry, 0, 0);
 1268|    315|	entry->ae_set &= ~AE_SET_MTIME;
  ------------------
  |  |  143|    315|#define	AE_SET_MTIME	16
  ------------------
 1269|    315|}
archive_entry_set_nlink:
 1273|  12.2k|{
 1274|  12.2k|	entry->stat_valid = 0;
 1275|  12.2k|	entry->ae_stat.aest_nlink = nlink;
 1276|  12.2k|}
archive_entry_set_pathname:
 1280|  5.62k|{
 1281|  5.62k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1282|  5.62k|}
archive_entry_copy_pathname:
 1292|  39.1k|{
 1293|  39.1k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1294|  39.1k|}
archive_entry_copy_pathname_w:
 1298|  5.69k|{
 1299|  5.69k|	archive_mstring_copy_wcs(&entry->ae_pathname, name);
 1300|  5.69k|}
archive_entry_update_pathname_utf8:
 1304|  53.7k|{
 1305|  53.7k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1305:6): [True: 19.4k, False: 34.2k]
  ------------------
 1306|  53.7k|	    &entry->ae_pathname, name) == 0)
 1307|  19.4k|		return (1);
 1308|  34.2k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1308:6): [True: 0, False: 34.2k]
  ------------------
 1309|      0|		__archive_errx(1, "No memory");
 1310|  34.2k|	return (0);
 1311|  34.2k|}
__archive_entry_copy_pathname_l:
 1316|   538k|{
 1317|   538k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_pathname,
 1318|   538k|	    name, len, sc));
 1319|   538k|}
archive_entry_set_perm:
 1323|   464k|{
 1324|   464k|	entry->stat_valid = 0;
 1325|   464k|	entry->acl.mode &= AE_IFMT;
  ------------------
  |  |  215|   464k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1326|   464k|	entry->acl.mode |= ~AE_IFMT & p;
  ------------------
  |  |  215|   464k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1327|   464k|	entry->ae_set |= AE_SET_PERM;
  ------------------
  |  |  148|   464k|#define	AE_SET_PERM	512
  ------------------
 1328|   464k|}
archive_entry_set_rdev:
 1332|  15.2k|{
 1333|  15.2k|	entry->stat_valid = 0;
 1334|  15.2k|	entry->ae_stat.aest_rdev = m;
 1335|  15.2k|	entry->ae_stat.aest_rdev_is_broken_down = 0;
 1336|  15.2k|	entry->ae_stat.aest_rdevmajor = 0;
 1337|  15.2k|	entry->ae_stat.aest_rdevminor = 0;
 1338|  15.2k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  15.2k|#define	AE_SET_RDEV	8192
  ------------------
 1339|  15.2k|}
archive_entry_set_rdevmajor:
 1343|  10.1k|{
 1344|  10.1k|	entry->stat_valid = 0;
 1345|  10.1k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1346|  10.1k|	entry->ae_stat.aest_rdev = 0;
 1347|  10.1k|	entry->ae_stat.aest_rdevmajor = m;
 1348|  10.1k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  10.1k|#define	AE_SET_RDEV	8192
  ------------------
 1349|  10.1k|}
archive_entry_set_rdevminor:
 1353|  10.5k|{
 1354|  10.5k|	entry->stat_valid = 0;
 1355|  10.5k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1356|  10.5k|	entry->ae_stat.aest_rdev = 0;
 1357|  10.5k|	entry->ae_stat.aest_rdevminor = m;
 1358|  10.5k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  10.5k|#define	AE_SET_RDEV	8192
  ------------------
 1359|  10.5k|}
archive_entry_set_size:
 1363|   602k|{
 1364|   602k|	if (s < 0) {
  ------------------
  |  Branch (1364:6): [True: 37, False: 602k]
  ------------------
 1365|     37|		s = 0;
 1366|     37|	}
 1367|   602k|	entry->stat_valid = 0;
 1368|   602k|	entry->ae_stat.aest_size = s;
 1369|   602k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|   602k|#define	AE_SET_SIZE	64
  ------------------
 1370|   602k|}
archive_entry_unset_size:
 1374|    525|{
 1375|    525|	archive_entry_set_size(entry, 0);
 1376|    525|	entry->ae_set &= ~AE_SET_SIZE;
  ------------------
  |  |  145|    525|#define	AE_SET_SIZE	64
  ------------------
 1377|    525|}
archive_entry_set_compressed_size:
 1381|  28.8k|{
 1382|  28.8k|	if (s < 0) {
  ------------------
  |  Branch (1382:6): [True: 0, False: 28.8k]
  ------------------
 1383|      0|		s = 0;
 1384|      0|	}
 1385|  28.8k|	entry->ae_compressed_size = s;
 1386|  28.8k|	entry->ae_set |= AE_SET_COMPRESSED_SIZE;
  ------------------
  |  |  153|  28.8k|#define	AE_SET_COMPRESSED_SIZE	16384
  ------------------
 1387|  28.8k|}
archive_entry_set_symlink:
 1410|  4.28k|{
 1411|  4.28k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|  4.28k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1411:6): [True: 4.28k, False: 0]
  |  Branch (1411:26): [True: 0, False: 4.28k]
  ------------------
 1412|      0|		return;
 1413|  4.28k|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1414|  4.28k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  4.28k|#define	AE_SET_HARDLINK	1
  ------------------
 1415|  4.28k|	if (linkname == NULL)
  ------------------
  |  Branch (1415:6): [True: 4.28k, False: 0]
  ------------------
 1416|  4.28k|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|  4.28k|#define	AE_SET_SYMLINK	2
  ------------------
 1417|      0|	else
 1418|      0|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1419|  4.28k|}
archive_entry_set_symlink_type:
 1423|  1.79k|{
 1424|  1.79k|	entry->ae_symlink_type = type;
 1425|  1.79k|}
archive_entry_copy_symlink:
 1442|    482|{
 1443|    482|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1443:6): [True: 0, False: 482]
  |  Branch (1443:26): [True: 0, False: 0]
  ------------------
 1444|      0|		return;
 1445|    482|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1446|    482|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|    482|#define	AE_SET_HARDLINK	1
  ------------------
 1447|    482|	if (linkname == NULL)
  ------------------
  |  Branch (1447:6): [True: 0, False: 482]
  ------------------
 1448|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1449|    482|	else
 1450|    482|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|    482|#define	AE_SET_SYMLINK	2
  ------------------
 1451|    482|}
archive_entry_copy_symlink_w:
 1455|     14|{
 1456|     14|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1456:6): [True: 0, False: 14]
  |  Branch (1456:26): [True: 0, False: 0]
  ------------------
 1457|      0|		return;
 1458|     14|	archive_mstring_copy_wcs(&entry->ae_linkname, linkname);
 1459|     14|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|     14|#define	AE_SET_HARDLINK	1
  ------------------
 1460|     14|	if (linkname == NULL)
  ------------------
  |  Branch (1460:6): [True: 0, False: 14]
  ------------------
 1461|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1462|     14|	else
 1463|     14|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|     14|#define	AE_SET_SYMLINK	2
  ------------------
 1464|     14|}
archive_entry_update_symlink_utf8:
 1468|  1.78k|{
 1469|  1.78k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1469:6): [True: 0, False: 1.78k]
  |  Branch (1469:26): [True: 0, False: 0]
  ------------------
 1470|      0|		return (0);
 1471|  1.78k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  1.78k|#define	AE_SET_HARDLINK	1
  ------------------
 1472|  1.78k|	if (linkname == NULL)
  ------------------
  |  Branch (1472:6): [True: 0, False: 1.78k]
  ------------------
 1473|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1474|  1.78k|	else
 1475|  1.78k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  1.78k|#define	AE_SET_SYMLINK	2
  ------------------
 1476|  1.78k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1476:6): [True: 1.01k, False: 775]
  ------------------
 1477|  1.78k|	    &entry->ae_linkname, linkname) == 0)
 1478|  1.01k|		return (1);
 1479|    775|	if (errno == ENOMEM)
  ------------------
  |  Branch (1479:6): [True: 0, False: 775]
  ------------------
 1480|      0|		__archive_errx(1, "No memory");
 1481|    775|	return (0);
 1482|    775|}
__archive_entry_copy_symlink_l:
 1487|  2.98k|{
 1488|  2.98k|	int r;
 1489|       |
 1490|  2.98k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1490:6): [True: 0, False: 2.98k]
  |  Branch (1490:26): [True: 0, False: 0]
  ------------------
 1491|      0|		return (0);
 1492|  2.98k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.98k|#define	AE_SET_HARDLINK	1
  ------------------
 1493|  2.98k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1494|  2.98k|	    linkname, len, sc);
 1495|  2.98k|	if (linkname == NULL || r != 0)
  ------------------
  |  Branch (1495:6): [True: 0, False: 2.98k]
  |  Branch (1495:26): [True: 360, False: 2.62k]
  ------------------
 1496|    360|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|    360|#define	AE_SET_SYMLINK	2
  ------------------
 1497|  2.62k|	else
 1498|  2.62k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  2.62k|#define	AE_SET_SYMLINK	2
  ------------------
 1499|  2.98k|	return (r);
 1500|  2.98k|}
archive_entry_set_uid:
 1504|   530k|{
 1505|   530k|	if (u < 0) {
  ------------------
  |  Branch (1505:6): [True: 843, False: 529k]
  ------------------
 1506|    843|		u = 0;
 1507|    843|	}
 1508|   530k|	entry->stat_valid = 0;
 1509|   530k|	entry->ae_stat.aest_uid = u;
 1510|   530k|	entry->ae_set |= AE_SET_UID;
  ------------------
  |  |  150|   530k|#define	AE_SET_UID	2048
  ------------------
 1511|   530k|}
archive_entry_set_uname:
 1515|    743|{
 1516|    743|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1517|    743|}
archive_entry_copy_uname:
 1527|     33|{
 1528|     33|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1529|     33|}
archive_entry_set_is_data_encrypted:
 1550|  20.1k|{
 1551|  20.1k|	if (is_encrypted) {
  ------------------
  |  Branch (1551:6): [True: 20.1k, False: 0]
  ------------------
 1552|  20.1k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  170|  20.1k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1553|  20.1k|	} else {
 1554|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  170|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1555|      0|	}
 1556|  20.1k|}
archive_entry_set_is_metadata_encrypted:
 1560|     32|{
 1561|     32|	if (is_encrypted) {
  ------------------
  |  Branch (1561:6): [True: 32, False: 0]
  ------------------
 1562|     32|		entry->encryption |= AE_ENCRYPTION_METADATA;
  ------------------
  |  |  171|     32|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1563|     32|	} else {
 1564|      0|		entry->encryption &= ~AE_ENCRYPTION_METADATA;
  ------------------
  |  |  171|      0|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1565|      0|	}
 1566|     32|}
__archive_entry_copy_uname_l:
 1571|  12.4k|{
 1572|  12.4k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_uname,
 1573|  12.4k|	    name, len, sc));
 1574|  12.4k|}
archive_entry_copy_mac_metadata:
 1586|  1.77M|{
 1587|  1.77M|	void *metadata;
 1588|       |
 1589|  1.77M|	if (p == NULL || s == 0) {
  ------------------
  |  Branch (1589:6): [True: 1.77M, False: 8]
  |  Branch (1589:19): [True: 7, False: 1]
  ------------------
 1590|  1.77M|		free(entry->mac_metadata);
 1591|  1.77M|		entry->mac_metadata = NULL;
 1592|  1.77M|		entry->mac_metadata_size = 0;
 1593|  1.77M|	} else {
 1594|      1|		metadata = malloc(s);
 1595|      1|		if (metadata == NULL)
  ------------------
  |  Branch (1595:7): [True: 0, False: 1]
  ------------------
 1596|      0|			abort();
 1597|      1|		memcpy(metadata, p, s);
 1598|      1|		free(entry->mac_metadata);
 1599|      1|		entry->mac_metadata = metadata;
 1600|      1|		entry->mac_metadata_size = s;
 1601|      1|	}
 1602|  1.77M|}
archive_entry_digest:
 1607|   593k|{
 1608|   593k|	switch (type) {
 1609|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  448|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1609:2): [True: 0, False: 593k]
  ------------------
 1610|      0|		return entry->digest.md5;
 1611|      0|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  449|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1611:2): [True: 0, False: 593k]
  ------------------
 1612|      0|		return entry->digest.rmd160;
 1613|   593k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  450|   593k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1613:2): [True: 593k, False: 0]
  ------------------
 1614|   593k|		return entry->digest.sha1;
 1615|      0|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  451|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1615:2): [True: 0, False: 593k]
  ------------------
 1616|      0|		return entry->digest.sha256;
 1617|      0|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  452|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1617:2): [True: 0, False: 593k]
  ------------------
 1618|      0|		return entry->digest.sha384;
 1619|      0|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  453|      0|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1619:2): [True: 0, False: 593k]
  ------------------
 1620|      0|		return entry->digest.sha512;
 1621|      0|	default:
  ------------------
  |  Branch (1621:2): [True: 0, False: 593k]
  ------------------
 1622|       |		return NULL;
 1623|   593k|	}
 1624|   593k|}
archive_entry_set_digest:
 1629|    827|{
 1630|    827|#define copy_digest(_e, _t, _d)\
 1631|    827|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
 1632|       |
 1633|    827|	switch (type) {
 1634|    246|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  448|    246|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1634:2): [True: 246, False: 581]
  ------------------
 1635|    246|		copy_digest(entry, md5, digest);
  ------------------
  |  | 1631|    246|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1636|    246|		entry->mset_digest |= AE_MSET_DIGEST_MD5;
  ------------------
  |  |  178|    246|#define AE_MSET_DIGEST_MD5	 1
  ------------------
 1637|    246|		break;
 1638|    199|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  449|    199|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1638:2): [True: 199, False: 628]
  ------------------
 1639|    199|		copy_digest(entry, rmd160, digest);
  ------------------
  |  | 1631|    199|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1640|    199|		entry->mset_digest |= AE_MSET_DIGEST_RMD160;
  ------------------
  |  |  179|    199|#define AE_MSET_DIGEST_RMD160	 2
  ------------------
 1641|    199|		break;
 1642|     87|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  450|     87|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1642:2): [True: 87, False: 740]
  ------------------
 1643|     87|		copy_digest(entry, sha1, digest);
  ------------------
  |  | 1631|     87|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1644|     87|		entry->mset_digest |= AE_MSET_DIGEST_SHA1;
  ------------------
  |  |  180|     87|#define AE_MSET_DIGEST_SHA1	 4
  ------------------
 1645|     87|		break;
 1646|    221|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  451|    221|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1646:2): [True: 221, False: 606]
  ------------------
 1647|    221|		copy_digest(entry, sha256, digest);
  ------------------
  |  | 1631|    221|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1648|    221|		entry->mset_digest |= AE_MSET_DIGEST_SHA256;
  ------------------
  |  |  181|    221|#define AE_MSET_DIGEST_SHA256	 8
  ------------------
 1649|    221|		break;
 1650|      0|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  452|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1650:2): [True: 0, False: 827]
  ------------------
 1651|      0|		copy_digest(entry, sha384, digest);
  ------------------
  |  | 1631|      0|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1652|      0|		entry->mset_digest |= AE_MSET_DIGEST_SHA384;
  ------------------
  |  |  182|      0|#define AE_MSET_DIGEST_SHA384	16
  ------------------
 1653|      0|		break;
 1654|     74|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  453|     74|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1654:2): [True: 74, False: 753]
  ------------------
 1655|     74|		copy_digest(entry, sha512, digest);
  ------------------
  |  | 1631|     74|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1656|     74|		entry->mset_digest |= AE_MSET_DIGEST_SHA512;
  ------------------
  |  |  183|     74|#define AE_MSET_DIGEST_SHA512	32
  ------------------
 1657|     74|		break;
 1658|      0|	default:
  ------------------
  |  Branch (1658:2): [True: 0, False: 827]
  ------------------
 1659|      0|		return ARCHIVE_WARN;
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1660|    827|	}
 1661|       |
 1662|    827|	return ARCHIVE_OK;
  ------------------
  |  |  234|    827|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1663|    827|#undef copy_digest
 1664|    827|}
archive_entry_set_compression:
 1674|  60.7k|int archive_entry_set_compression(struct archive_entry *entry, int type) {
 1675|  60.7k|	switch (type) {
 1676|  26.8k|	case ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED:
  ------------------
  |  |  461|  26.8k|#define ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED 0x00000000
  ------------------
  |  Branch (1676:2): [True: 26.8k, False: 33.9k]
  ------------------
 1677|  34.7k|	case ARCHIVE_ENTRY_COMPRESSION_STORE:
  ------------------
  |  |  462|  34.7k|#define ARCHIVE_ENTRY_COMPRESSION_STORE       0x00000001 /* Uncompressed */
  ------------------
  |  Branch (1677:2): [True: 7.91k, False: 52.8k]
  ------------------
 1678|  37.8k|	case ARCHIVE_ENTRY_COMPRESSION_DEFLATE:
  ------------------
  |  |  463|  37.8k|#define ARCHIVE_ENTRY_COMPRESSION_DEFLATE     0x00000002
  ------------------
  |  Branch (1678:2): [True: 3.11k, False: 57.6k]
  ------------------
 1679|  37.9k|	case ARCHIVE_ENTRY_COMPRESSION_BZIP2:
  ------------------
  |  |  464|  37.9k|#define ARCHIVE_ENTRY_COMPRESSION_BZIP2       0x00000003
  ------------------
  |  Branch (1679:2): [True: 117, False: 60.6k]
  ------------------
 1680|  39.1k|	case ARCHIVE_ENTRY_COMPRESSION_LZMA:
  ------------------
  |  |  465|  39.1k|#define ARCHIVE_ENTRY_COMPRESSION_LZMA        0x00000004
  ------------------
  |  Branch (1680:2): [True: 1.11k, False: 59.6k]
  ------------------
 1681|  39.1k|	case ARCHIVE_ENTRY_COMPRESSION_LZMA2:
  ------------------
  |  |  466|  39.1k|#define ARCHIVE_ENTRY_COMPRESSION_LZMA2       0x00000005
  ------------------
  |  Branch (1681:2): [True: 61, False: 60.7k]
  ------------------
 1682|  39.5k|	case ARCHIVE_ENTRY_COMPRESSION_XZ:
  ------------------
  |  |  467|  39.5k|#define ARCHIVE_ENTRY_COMPRESSION_XZ          0x00000006
  ------------------
  |  Branch (1682:2): [True: 349, False: 60.4k]
  ------------------
 1683|  40.0k|	case ARCHIVE_ENTRY_COMPRESSION_ZSTD:
  ------------------
  |  |  468|  40.0k|#define ARCHIVE_ENTRY_COMPRESSION_ZSTD        0x00000007
  ------------------
  |  Branch (1683:2): [True: 582, False: 60.1k]
  ------------------
 1684|  60.7k|	case ARCHIVE_ENTRY_COMPRESSION_PPMD:
  ------------------
  |  |  469|  60.7k|#define ARCHIVE_ENTRY_COMPRESSION_PPMD        0x00000008
  ------------------
  |  Branch (1684:2): [True: 20.6k, False: 40.0k]
  ------------------
 1685|  60.7k|		entry->ae_compression_type = type;
 1686|  60.7k|		return ARCHIVE_OK;
  ------------------
  |  |  234|  60.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1687|      0|	default:
  ------------------
  |  Branch (1687:2): [True: 0, False: 60.7k]
  ------------------
 1688|      0|		entry->ae_compression_type = ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED;
  ------------------
  |  |  461|      0|#define ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED 0x00000000
  ------------------
 1689|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1690|  60.7k|	}
 1691|  60.7k|}
archive_entry_acl:
 1704|    830|{
 1705|    830|	return &entry->acl;
 1706|    830|}
archive_entry.c:ae_strtofflags:
 2198|  17.8k|{
 2199|  17.8k|	const char *start, *end;
 2200|  17.8k|	const struct flag *flag;
 2201|  17.8k|	unsigned long set, clear;
 2202|  17.8k|	const char *failed;
 2203|       |
 2204|  17.8k|	set = clear = 0;
 2205|  17.8k|	start = s;
 2206|  17.8k|	failed = NULL;
 2207|       |	/* Find start of first token. */
 2208|  19.0k|	while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2208:9): [True: 18.7k, False: 216]
  |  Branch (2208:19): [True: 94, False: 18.6k]
  |  Branch (2208:39): [True: 82, False: 18.6k]
  |  Branch (2208:58): [True: 975, False: 17.6k]
  ------------------
 2209|  1.15k|		start++;
 2210|  1.15k|		l--;
 2211|  1.15k|	}
 2212|  55.8k|	while (l > 0) {
  ------------------
  |  Branch (2212:9): [True: 38.0k, False: 17.8k]
  ------------------
 2213|  38.0k|		size_t length;
 2214|       |		/* Locate end of token. */
 2215|  38.0k|		end = start;
 2216|   294k|		while (l > 0 && *end != '\t'  &&
  ------------------
  |  Branch (2216:10): [True: 277k, False: 17.2k]
  |  Branch (2216:19): [True: 277k, False: 54]
  ------------------
 2217|   277k|		    *end != ' '  &&  *end != ',') {
  ------------------
  |  Branch (2217:7): [True: 277k, False: 62]
  |  Branch (2217:24): [True: 256k, False: 20.7k]
  ------------------
 2218|   256k|			end++;
 2219|   256k|			l--;
 2220|   256k|		}
 2221|  38.0k|		length = end - start;
 2222|   759k|		for (flag = fileflags; flag->name != NULL; flag++) {
  ------------------
  |  Branch (2222:26): [True: 722k, False: 37.7k]
  ------------------
 2223|   722k|			size_t flag_length = strlen(flag->name);
 2224|   722k|			if (length == flag_length
  ------------------
  |  Branch (2224:8): [True: 146k, False: 575k]
  ------------------
 2225|   146k|			    && memcmp(start, flag->name, length) == 0) {
  ------------------
  |  Branch (2225:11): [True: 52, False: 146k]
  ------------------
 2226|       |				/* Matched "noXXXX", so reverse the sense. */
 2227|     52|				clear |= flag->set;
 2228|     52|				set |= flag->clear;
 2229|     52|				break;
 2230|   722k|			} else if (length == flag_length - 2
  ------------------
  |  Branch (2230:15): [True: 110k, False: 611k]
  ------------------
 2231|   110k|			    && memcmp(start, flag->name + 2, length) == 0) {
  ------------------
  |  Branch (2231:11): [True: 278, False: 110k]
  ------------------
 2232|       |				/* Matched "XXXX", so don't reverse. */
 2233|    278|				set |= flag->set;
 2234|    278|				clear |= flag->clear;
 2235|    278|				break;
 2236|    278|			}
 2237|   722k|		}
 2238|       |		/* Ignore unknown flag names. */
 2239|  38.0k|		if (flag->name == NULL  &&  failed == NULL)
  ------------------
  |  Branch (2239:7): [True: 37.7k, False: 330]
  |  Branch (2239:31): [True: 17.3k, False: 20.4k]
  ------------------
 2240|  17.3k|			failed = start;
 2241|       |
 2242|       |		/* Find start of next token. */
 2243|  38.0k|		start = end;
 2244|  59.0k|		while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2244:10): [True: 41.4k, False: 17.6k]
  |  Branch (2244:20): [True: 116, False: 41.2k]
  |  Branch (2244:40): [True: 162, False: 41.1k]
  |  Branch (2244:59): [True: 20.7k, False: 20.4k]
  ------------------
 2245|  21.0k|			start++;
 2246|  21.0k|			l--;
 2247|  21.0k|		}
 2248|       |
 2249|  38.0k|	}
 2250|       |
 2251|  17.8k|	if (setp)
  ------------------
  |  Branch (2251:6): [True: 17.8k, False: 0]
  ------------------
 2252|  17.8k|		*setp = set;
 2253|  17.8k|	if (clrp)
  ------------------
  |  Branch (2253:6): [True: 17.8k, False: 0]
  ------------------
 2254|  17.8k|		*clrp = clear;
 2255|       |
 2256|       |	/* Return location of first failure. */
 2257|  17.8k|	return (failed);
 2258|  17.8k|}

archive_entry_linkresolver_new:
  101|  1.20k|{
  102|  1.20k|	struct archive_entry_linkresolver *res;
  103|       |
  104|       |	/* Check for positive power-of-two */
  105|  1.20k|	if (links_cache_initial_size == 0 ||
  ------------------
  |  |   68|  1.20k|#define	links_cache_initial_size 1024
  ------------------
  |  Branch (105:6): [Folded, False: 0]
  ------------------
  106|      0|	    (links_cache_initial_size & (links_cache_initial_size - 1)) != 0)
  ------------------
  |  |   68|      0|#define	links_cache_initial_size 1024
  ------------------
              	    (links_cache_initial_size & (links_cache_initial_size - 1)) != 0)
  ------------------
  |  |   68|      0|#define	links_cache_initial_size 1024
  ------------------
  |  Branch (106:6): [Folded, False: 0]
  ------------------
  107|      0|		return (NULL);
  108|       |
  109|  1.20k|	res = calloc(1, sizeof(struct archive_entry_linkresolver));
  110|  1.20k|	if (res == NULL)
  ------------------
  |  Branch (110:6): [True: 0, False: 1.20k]
  ------------------
  111|      0|		return (NULL);
  112|  1.20k|	res->number_buckets = links_cache_initial_size;
  ------------------
  |  |   68|  1.20k|#define	links_cache_initial_size 1024
  ------------------
  113|  1.20k|	res->buckets = calloc(res->number_buckets, sizeof(res->buckets[0]));
  114|  1.20k|	if (res->buckets == NULL) {
  ------------------
  |  Branch (114:6): [True: 0, False: 1.20k]
  ------------------
  115|      0|		free(res);
  116|      0|		return (NULL);
  117|      0|	}
  118|  1.20k|	return (res);
  119|  1.20k|}
archive_entry_linkresolver_set_strategy:
  124|  1.20k|{
  125|  1.20k|	int fmtbase = fmt & ARCHIVE_FORMAT_BASE_MASK;
  ------------------
  |  |  359|  1.20k|#define	ARCHIVE_FORMAT_BASE_MASK		0xff0000
  ------------------
  126|       |
  127|  1.20k|	switch (fmtbase) {
  128|      0|	case ARCHIVE_FORMAT_7ZIP:
  ------------------
  |  |  390|      0|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  |  Branch (128:2): [True: 0, False: 1.20k]
  ------------------
  129|      0|	case ARCHIVE_FORMAT_AR:
  ------------------
  |  |  381|      0|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (129:2): [True: 0, False: 1.20k]
  ------------------
  130|      0|	case ARCHIVE_FORMAT_ZIP:
  ------------------
  |  |  379|      0|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
  |  Branch (130:2): [True: 0, False: 1.20k]
  ------------------
  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:
  ------------------
  |  |  360|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  ------------------
  |  Branch (133:2): [True: 0, False: 1.20k]
  ------------------
  134|      0|		switch (fmt) {
  135|      0|		case ARCHIVE_FORMAT_CPIO_SVR4_NOCRC:
  ------------------
  |  |  364|      0|#define	ARCHIVE_FORMAT_CPIO_SVR4_NOCRC		(ARCHIVE_FORMAT_CPIO | 4)
  |  |  ------------------
  |  |  |  |  360|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (135:3): [True: 0, False: 0]
  ------------------
  136|      0|		case ARCHIVE_FORMAT_CPIO_SVR4_CRC:
  ------------------
  |  |  365|      0|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC		(ARCHIVE_FORMAT_CPIO | 5)
  |  |  ------------------
  |  |  |  |  360|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (136:3): [True: 0, False: 0]
  ------------------
  137|      0|		case ARCHIVE_FORMAT_CPIO_SVR4_CRC_SWUPDATE:
  ------------------
  |  |  368|      0|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC_SWUPDATE	(ARCHIVE_FORMAT_CPIO | 8)
  |  |  ------------------
  |  |  |  |  360|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (137:3): [True: 0, False: 0]
  ------------------
  138|      0|			res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO;
  ------------------
  |  |   65|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO 3
  ------------------
  139|      0|			break;
  140|      0|		default:
  ------------------
  |  Branch (140:3): [True: 0, False: 0]
  ------------------
  141|      0|			res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   64|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  142|      0|			break;
  143|      0|		}
  144|      0|		break;
  145|  1.20k|	case ARCHIVE_FORMAT_MTREE:
  ------------------
  |  |  384|  1.20k|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
  |  Branch (145:2): [True: 1.20k, False: 0]
  ------------------
  146|  1.20k|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE;
  ------------------
  |  |   63|  1.20k|#define ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE 1
  ------------------
  147|  1.20k|		break;
  148|      0|	case ARCHIVE_FORMAT_ISO9660:
  ------------------
  |  |  377|      0|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
  |  Branch (148:2): [True: 0, False: 1.20k]
  ------------------
  149|      0|	case ARCHIVE_FORMAT_SHAR:
  ------------------
  |  |  369|      0|#define	ARCHIVE_FORMAT_SHAR			0x20000
  ------------------
  |  Branch (149:2): [True: 0, False: 1.20k]
  ------------------
  150|      0|	case ARCHIVE_FORMAT_TAR:
  ------------------
  |  |  372|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (150:2): [True: 0, False: 1.20k]
  ------------------
  151|      0|	case ARCHIVE_FORMAT_XAR:
  ------------------
  |  |  386|      0|#define	ARCHIVE_FORMAT_XAR			0xA0000
  ------------------
  |  Branch (151:2): [True: 0, False: 1.20k]
  ------------------
  152|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_TAR;
  ------------------
  |  |   62|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_TAR	0
  ------------------
  153|      0|		break;
  154|      0|	default:
  ------------------
  |  Branch (154:2): [True: 0, False: 1.20k]
  ------------------
  155|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   64|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  156|      0|		break;
  157|  1.20k|	}
  158|  1.20k|}
archive_entry_linkresolver_free:
  162|  20.1k|{
  163|  20.1k|	if (res == NULL)
  ------------------
  |  Branch (163:6): [True: 18.9k, False: 1.20k]
  ------------------
  164|  18.9k|		return;
  165|       |
  166|  1.20k|	while (next_entry(res, NEXT_ENTRY_ALL) != NULL) {
  ------------------
  |  |   89|  1.20k|#define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   87|  1.20k|#define	NEXT_ENTRY_DEFERRED	1
  |  |  ------------------
  |  |               #define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   88|  1.20k|#define	NEXT_ENTRY_PARTIAL	2
  |  |  ------------------
  ------------------
  |  Branch (166:9): [True: 0, False: 1.20k]
  ------------------
  167|       |		/* Actual freeing done by next_entry() */
  168|      0|	}
  169|  1.20k|	free(res->buckets);
  170|  1.20k|	free(res);
  171|  1.20k|}
archive_entry_link_resolver.c:next_entry:
  333|  1.20k|{
  334|  1.20k|	struct links_entry	*le;
  335|  1.20k|	size_t			 bucket;
  336|       |
  337|       |	/* Free a held entry. */
  338|  1.20k|	if (res->spare != NULL) {
  ------------------
  |  Branch (338:6): [True: 0, False: 1.20k]
  ------------------
  339|      0|		archive_entry_free(res->spare->canonical);
  340|      0|		archive_entry_free(res->spare->entry);
  341|      0|		free(res->spare);
  342|      0|		res->spare = NULL;
  343|      0|	}
  344|       |
  345|       |	/* Look for next non-empty bucket in the links cache. */
  346|  1.23M|	for (bucket = 0; bucket < res->number_buckets; bucket++) {
  ------------------
  |  Branch (346:19): [True: 1.23M, False: 1.20k]
  ------------------
  347|  1.23M|		for (le = res->buckets[bucket]; le != NULL; le = le->next) {
  ------------------
  |  Branch (347:35): [True: 0, False: 1.23M]
  ------------------
  348|      0|			if (le->entry != NULL &&
  ------------------
  |  Branch (348:8): [True: 0, False: 0]
  ------------------
  349|      0|			    (mode & NEXT_ENTRY_DEFERRED) == 0)
  ------------------
  |  |   87|      0|#define	NEXT_ENTRY_DEFERRED	1
  ------------------
  |  Branch (349:8): [True: 0, False: 0]
  ------------------
  350|      0|				continue;
  351|      0|			if (le->entry == NULL &&
  ------------------
  |  Branch (351:8): [True: 0, False: 0]
  ------------------
  352|      0|			    (mode & NEXT_ENTRY_PARTIAL) == 0)
  ------------------
  |  |   88|      0|#define	NEXT_ENTRY_PARTIAL	2
  ------------------
  |  Branch (352:8): [True: 0, False: 0]
  ------------------
  353|      0|				continue;
  354|       |			/* Remove it from this hash bucket. */
  355|      0|			if (le->next != NULL)
  ------------------
  |  Branch (355:8): [True: 0, False: 0]
  ------------------
  356|      0|				le->next->previous = le->previous;
  357|      0|			if (le->previous != NULL)
  ------------------
  |  Branch (357:8): [True: 0, False: 0]
  ------------------
  358|      0|				le->previous->next = le->next;
  359|      0|			else
  360|      0|				res->buckets[bucket] = le->next;
  361|      0|			res->number_entries--;
  362|       |			/* Defer freeing this entry. */
  363|      0|			res->spare = le;
  364|      0|			return (le);
  365|      0|		}
  366|  1.23M|	}
  367|  1.20k|	return (NULL);
  368|  1.20k|}

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

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

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

archive_read.c:archive_ckd_mul_size:
  187|  4.34k|{
  188|  4.34k|#if USE_STDCKDINT
  189|  4.34k|	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|  4.34k|}
archive_read.c:archive_ckd_add_i64:
   94|  15.8k|{
   95|  15.8k|#if USE_STDCKDINT
   96|  15.8k|	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.8k|}
archive_read_support_filter_lz4.c:archive_ckd_add_size:
  119|    220|{
  120|    220|#if USE_STDCKDINT
  121|    220|	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|    220|}
archive_read_support_filter_uu.c:archive_ckd_add_size:
  119|  98.2k|{
  120|  98.2k|#if USE_STDCKDINT
  121|  98.2k|	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|  98.2k|}
archive_read_support_filter_zstd.c:archive_ckd_add_size:
  119|    220|{
  120|    220|#if USE_STDCKDINT
  121|    220|	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|    220|}
archive_read_support_format_ar.c:archive_ckd_mul_u64:
  205|  9.63k|{
  206|  9.63k|#if USE_STDCKDINT
  207|  9.63k|	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|  9.63k|}
archive_read_support_format_ar.c:archive_ckd_add_u64:
  137|  9.63k|{
  138|  9.63k|#if USE_STDCKDINT
  139|  9.63k|	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|  9.63k|}
archive_read_support_format_iso9660.c:archive_ckd_add_size:
  119|    191|{
  120|    191|#if USE_STDCKDINT
  121|    191|	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|    191|}
archive_read_support_format_mtree.c:archive_ckd_mul_i64:
  160|  95.4k|{
  161|  95.4k|#if USE_STDCKDINT
  162|  95.4k|	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|  95.4k|}
archive_read_support_format_mtree.c:archive_ckd_sub_i64:
  228|  51.4k|{
  229|  51.4k|#if USE_STDCKDINT
  230|  51.4k|	return ckd_sub(result, a, b);
  231|       |#elif USE_BUILTIN
  232|       |	return __builtin_sub_overflow(a, b, result);
  233|       |#elif USE_INTSAFE
  234|       |	LONGLONG res;
  235|       |	int ret;
  236|       |
  237|       |	ret = LongLongSub(a, b, &res);
  238|       |	*result = (int64_t)res;
  239|       |	return ret;
  240|       |#else
  241|       |	if ((b > 0 && a < INT64_MIN + b) ||
  242|       |	    (b < 0 && a > INT64_MAX + b))
  243|       |		return 1;
  244|       |
  245|       |	*result = a - b;
  246|       |	return 0;
  247|       |#endif
  248|  51.4k|}
archive_read_support_format_mtree.c:archive_ckd_add_i64:
   94|  42.9k|{
   95|  42.9k|#if USE_STDCKDINT
   96|  42.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|  42.9k|}
archive_read_support_format_rar.c:archive_ckd_add_i64:
   94|     59|{
   95|     59|#if USE_STDCKDINT
   96|     59|	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|     59|}
archive_read_support_format_rar.c:archive_ckd_mul_size:
  187|  19.8k|{
  188|  19.8k|#if USE_STDCKDINT
  189|  19.8k|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|  19.8k|}
archive_read_support_format_rar5.c:archive_ckd_mul_u64:
  205|   624k|{
  206|   624k|#if USE_STDCKDINT
  207|   624k|	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|   624k|}
archive_read_support_format_rar5.c:archive_ckd_add_u64:
  137|   624k|{
  138|   624k|#if USE_STDCKDINT
  139|   624k|	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|   624k|}
archive_read_support_format_raw.c:archive_ckd_add_i64:
   94|  11.2k|{
   95|  11.2k|#if USE_STDCKDINT
   96|  11.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|  11.2k|}
archive_read_support_format_tar.c:archive_ckd_mul_i64:
  160|  23.0M|{
  161|  23.0M|#if USE_STDCKDINT
  162|  23.0M|	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|  23.0M|}
archive_read_support_format_tar.c:archive_ckd_add_i64:
   94|  23.0M|{
   95|  23.0M|#if USE_STDCKDINT
   96|  23.0M|	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.0M|}
archive_read_support_format_warc.c:archive_ckd_mul_i64:
  160|  29.5k|{
  161|  29.5k|#if USE_STDCKDINT
  162|  29.5k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  29.5k|}
archive_read_support_format_warc.c:archive_ckd_add_i64:
   94|  29.5k|{
   95|  29.5k|#if USE_STDCKDINT
   96|  29.5k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  29.5k|}
archive_read_support_format_xar.c:archive_ckd_mul_size:
  187|     17|{
  188|     17|#if USE_STDCKDINT
  189|     17|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|     17|}
archive_read_support_format_xar.c:archive_ckd_mul_u64:
  205|   114k|{
  206|   114k|#if USE_STDCKDINT
  207|   114k|	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|   114k|}
archive_read_support_format_xar.c:archive_ckd_add_u64:
  137|   114k|{
  138|   114k|#if USE_STDCKDINT
  139|   114k|	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|   114k|}
archive_string.c:archive_ckd_mul_size:
  187|  1.29M|{
  188|  1.29M|#if USE_STDCKDINT
  189|  1.29M|	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|  1.29M|}
archive_string.c:archive_ckd_add_size:
  119|  1.29M|{
  120|  1.29M|#if USE_STDCKDINT
  121|  1.29M|	return ckd_add(result, a, b);
  122|       |#elif USE_BUILTIN
  123|       |	return __builtin_add_overflow(a, b, result);
  124|       |#elif USE_INTSAFE
  125|       |	return SizeTAdd(a, b, result);
  126|       |#else
  127|       |	if (a > SIZE_MAX - b)
  128|       |		return 1;
  129|       |	*result = a + b;
  130|       |	return 0;
  131|       |#endif
  132|  1.29M|}
archive_read_support_format_7zip.c:archive_ckd_add_i64:
   94|  34.0k|{
   95|  34.0k|#if USE_STDCKDINT
   96|  34.0k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  34.0k|}
archive_read_support_format_7zip.c:archive_ckd_add_size:
  119|  8.72k|{
  120|  8.72k|#if USE_STDCKDINT
  121|  8.72k|	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.72k|}
archive_read_support_format_7zip.c:archive_ckd_mul_i64:
  160|  8.85k|{
  161|  8.85k|#if USE_STDCKDINT
  162|  8.85k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  8.85k|}

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

__archive_pack_find:
  320|  9.17k|{
  321|  9.17k|	const struct format	*format;
  322|       |
  323|  9.17k|	format = bsearch(name, formats,
  324|  9.17k|	    sizeof(formats)/sizeof(formats[0]),
  325|  9.17k|	    sizeof(formats[0]), compare_format);
  326|  9.17k|	if (format == 0)
  ------------------
  |  Branch (326:6): [True: 524, False: 8.65k]
  ------------------
  327|    524|		return (NULL);
  328|  8.65k|	return (format->pack);
  329|  9.17k|}
archive_pack_dev.c:pack_8_8:
  167|  1.03k|{
  168|  1.03k|	dev_t dev = 0;
  169|       |
  170|  1.03k|	if (n == 2) {
  ------------------
  |  Branch (170:6): [True: 705, False: 332]
  ------------------
  171|    705|		dev = makedev_8_8(numbers[0], numbers[1]);
  ------------------
  |  |  162|    705|#define	makedev_8_8(x,y)	((dev_t)((((x) << 8) & 0x0000ff00) | \
  |  |  163|    705|					 (((y) << 0) & 0x000000ff)))
  ------------------
  172|    705|		if ((unsigned long)major_8_8(dev) != numbers[0])
  ------------------
  |  |  160|    705|#define	major_8_8(x)		((int32_t)(((x) & 0x0000ff00) >> 8))
  ------------------
  |  Branch (172:7): [True: 544, False: 161]
  ------------------
  173|    544|			*error = iMajorError;
  174|    705|		if ((unsigned long)minor_8_8(dev) != numbers[1])
  ------------------
  |  |  161|    705|#define	minor_8_8(x)		((int32_t)(((x) & 0x000000ff) >> 0))
  ------------------
  |  Branch (174:7): [True: 239, False: 466]
  ------------------
  175|    239|			*error = iMinorError;
  176|    705|	} else
  177|    332|		*error = tooManyFields;
  178|  1.03k|	return (dev);
  179|  1.03k|}
archive_pack_dev.c:pack_bsdos:
  257|  1.48k|{
  258|  1.48k|	dev_t dev = 0;
  259|       |
  260|  1.48k|	if (n == 2) {
  ------------------
  |  Branch (260:6): [True: 1.25k, False: 238]
  ------------------
  261|  1.25k|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  184|  1.25k|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  185|  1.25k|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  262|  1.25k|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  182|  1.25k|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (262:7): [True: 873, False: 378]
  ------------------
  263|    873|			*error = iMajorError;
  264|  1.25k|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  183|  1.25k|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (264:7): [True: 694, False: 557]
  ------------------
  265|    694|			*error = iMinorError;
  266|  1.25k|	} else if (n == 3) {
  ------------------
  |  Branch (266:13): [True: 238, False: 0]
  ------------------
  267|    238|		dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]);
  ------------------
  |  |  251|    238|#define	makedev_12_12_8(x,y,z)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  252|    238|					 (((y) <<  8) & 0x000fff00) | \
  |  |  253|    238|					 (((z) <<  0) & 0x000000ff)))
  ------------------
  268|    238|		if ((unsigned long)major_12_12_8(dev) != numbers[0])
  ------------------
  |  |  248|    238|#define	major_12_12_8(x)	((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (268:7): [True: 173, False: 65]
  ------------------
  269|    173|			*error = iMajorError;
  270|    238|		if ((unsigned long)unit_12_12_8(dev) != numbers[1])
  ------------------
  |  |  249|    238|#define	unit_12_12_8(x)		((int32_t)(((x) & 0x000fff00) >>  8))
  ------------------
  |  Branch (270:7): [True: 121, False: 117]
  ------------------
  271|    121|			*error = "invalid unit number";
  272|    238|		if ((unsigned long)subunit_12_12_8(dev) != numbers[2])
  ------------------
  |  |  250|    238|#define	subunit_12_12_8(x)	((int32_t)(((x) & 0x000000ff) >>  0))
  ------------------
  |  Branch (272:7): [True: 132, False: 106]
  ------------------
  273|    132|			*error = "invalid subunit number";
  274|    238|	} else
  275|      0|		*error = tooManyFields;
  276|  1.48k|	return (dev);
  277|  1.48k|}
archive_pack_dev.c:pack_8_24:
  233|    826|{
  234|    826|	dev_t dev = 0;
  235|       |
  236|    826|	if (n == 2) {
  ------------------
  |  Branch (236:6): [True: 566, False: 260]
  ------------------
  237|    566|		dev = makedev_8_24(numbers[0], numbers[1]);
  ------------------
  |  |  228|    566|#define	makedev_8_24(x,y)	((dev_t)((((x) << 24) & 0xff000000) | \
  |  |  229|    566|					 (((y) <<  0) & 0x00ffffff)))
  ------------------
  238|    566|		if ((unsigned long)major_8_24(dev) != numbers[0])
  ------------------
  |  |  226|    566|#define	major_8_24(x)		((int32_t)(((x) & 0xff000000) >> 24))
  ------------------
  |  Branch (238:7): [True: 67, False: 499]
  ------------------
  239|     67|			*error = iMajorError;
  240|    566|		if ((unsigned long)minor_8_24(dev) != numbers[1])
  ------------------
  |  |  227|    566|#define	minor_8_24(x)		((int32_t)(((x) & 0x00ffffff) >>  0))
  ------------------
  |  Branch (240:7): [True: 52, False: 514]
  ------------------
  241|     52|			*error = iMinorError;
  242|    566|	} else
  243|    260|		*error = tooManyFields;
  244|    826|	return (dev);
  245|    826|}
archive_pack_dev.c:pack_native:
  106|    808|{
  107|    808|	dev_t dev = 0;
  108|       |
  109|    808|	if (n == 2) {
  ------------------
  |  Branch (109:6): [True: 743, False: 65]
  ------------------
  110|    743|		dev = apd_makedev(numbers[0], numbers[1]);
  ------------------
  |  |   95|    743|#define apd_makedev(maj, min) makedev((maj), (min))
  ------------------
  111|    743|		if ((unsigned long)major(dev) != numbers[0])
  ------------------
  |  Branch (111:7): [True: 353, False: 390]
  ------------------
  112|    353|			*error = iMajorError;
  113|    390|		else if ((unsigned long)minor(dev) != numbers[1])
  ------------------
  |  Branch (113:12): [True: 202, False: 188]
  ------------------
  114|    202|			*error = iMinorError;
  115|    743|	} else
  116|     65|		*error = tooManyFields;
  117|    808|	return (dev);
  118|    808|}
archive_pack_dev.c:pack_netbsd:
  123|  1.17k|{
  124|  1.17k|	dev_t dev = 0;
  125|       |
  126|  1.17k|	if (n == 2) {
  ------------------
  |  Branch (126:6): [True: 825, False: 354]
  ------------------
  127|    825|		dev = makedev_netbsd(numbers[0], numbers[1]);
  ------------------
  |  |   44|    825|#define	makedev_netbsd(x,y)	((dev_t)((((x) <<  8) & 0x000fff00) | \
  |  |   45|    825|					 (((y) << 12) & 0xfff00000) | \
  |  |   46|    825|					 (((y) <<  0) & 0x000000ff)))
  ------------------
  128|    825|		if ((unsigned long)major_netbsd(dev) != numbers[0])
  ------------------
  |  |   41|    825|#define	major_netbsd(x)		((int32_t)((((x) & 0x000fff00) >>  8)))
  ------------------
  |  Branch (128:7): [True: 313, False: 512]
  ------------------
  129|    313|			*error = iMajorError;
  130|    512|		else if ((unsigned long)minor_netbsd(dev) != numbers[1])
  ------------------
  |  |   42|    512|#define	minor_netbsd(x)		((int32_t)((((x) & 0xfff00000) >> 12) | \
  |  |   43|    512|					   (((x) & 0x000000ff) >>  0)))
  ------------------
  |  Branch (130:12): [True: 219, False: 293]
  ------------------
  131|    219|			*error = iMinorError;
  132|    825|	} else
  133|    354|		*error = tooManyFields;
  134|  1.17k|	return (dev);
  135|  1.17k|}
archive_pack_dev.c:pack_12_20:
  189|    768|{
  190|    768|	dev_t dev = 0;
  191|       |
  192|    768|	if (n == 2) {
  ------------------
  |  Branch (192:6): [True: 699, False: 69]
  ------------------
  193|    699|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  184|    699|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  185|    699|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  194|    699|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  182|    699|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (194:7): [True: 130, False: 569]
  ------------------
  195|    130|			*error = iMajorError;
  196|    699|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  183|    699|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (196:7): [True: 365, False: 334]
  ------------------
  197|    365|			*error = iMinorError;
  198|    699|	} else
  199|     69|		*error = tooManyFields;
  200|    768|	return (dev);
  201|    768|}
archive_pack_dev.c:pack_14_18:
  211|  1.07k|{
  212|  1.07k|	dev_t dev = 0;
  213|       |
  214|  1.07k|	if (n == 2) {
  ------------------
  |  Branch (214:6): [True: 832, False: 244]
  ------------------
  215|    832|		dev = makedev_14_18(numbers[0], numbers[1]);
  ------------------
  |  |  206|    832|#define	makedev_14_18(x,y)	((dev_t)((((x) << 18) & 0xfffc0000) | \
  |  |  207|    832|					 (((y) <<  0) & 0x0003ffff)))
  ------------------
  216|    832|		if ((unsigned long)major_14_18(dev) != numbers[0])
  ------------------
  |  |  204|    832|#define	major_14_18(x)		((int32_t)(((x) & 0xfffc0000) >> 18))
  ------------------
  |  Branch (216:7): [True: 469, False: 363]
  ------------------
  217|    469|			*error = iMajorError;
  218|    832|		if ((unsigned long)minor_14_18(dev) != numbers[1])
  ------------------
  |  |  205|    832|#define	minor_14_18(x)		((int32_t)(((x) & 0x0003ffff) >>  0))
  ------------------
  |  Branch (218:7): [True: 230, False: 602]
  ------------------
  219|    230|			*error = iMinorError;
  220|    832|	} else
  221|    244|		*error = tooManyFields;
  222|  1.07k|	return (dev);
  223|  1.07k|}
archive_pack_dev.c:compare_format:
  307|  27.8k|{
  308|  27.8k|	const char		*name;
  309|  27.8k|	const struct format	*format;
  310|       |
  311|  27.8k|	name = key;
  312|  27.8k|	format = element;
  313|       |
  314|  27.8k|	return (strcmp(name, format->name));
  315|  27.8k|}

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

archive_ppmd8.c:Ppmd8_Construct:
   65|  21.3k|{
   66|  21.3k|  unsigned i, k, m;
   67|       |
   68|  21.3k|  p->Base = 0;
   69|       |
   70|   830k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   830k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   830k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   830k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   830k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   830k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   830k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   830k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   830k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 809k, False: 21.3k]
  ------------------
   71|   809k|  {
   72|   809k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 553k, False: 255k]
  ------------------
   73|  2.72M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.91M, False: 809k]
  ------------------
   74|   809k|    p->Indx2Units[i] = (Byte)k;
   75|   809k|  }
   76|       |
   77|  21.3k|  p->NS2BSIndx[0] = (0 << 1);
   78|  21.3k|  p->NS2BSIndx[1] = (1 << 1);
   79|  21.3k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  21.3k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|   127k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 106k, False: 21.3k]
  ------------------
   83|   106k|    p->NS2Indx[i] = (Byte)i;
   84|  5.45M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 5.43M, False: 21.3k]
  ------------------
   85|  5.43M|  {
   86|  5.43M|    p->NS2Indx[i] = (Byte)m;
   87|  5.43M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 468k, False: 4.96M]
  ------------------
   88|   468k|      k = (++m) - 4;
   89|  5.43M|  }
   90|  21.3k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  15.3k|{
  101|  15.3k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 15.3k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  15.3k|  {
  103|  15.3k|    Ppmd8_Free(p);
  104|  15.3k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  15.3k|        4 - (size & 3);
  109|  15.3k|      #endif
  110|  15.3k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 15.3k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  15.3k|    p->Size = size;
  113|  15.3k|  }
  114|  15.3k|  return True;
  ------------------
  |  |   55|  15.3k|#define True 1
  ------------------
  115|  15.3k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  30.6k|{
   94|  30.6k|  free(p->Base);
   95|  30.6k|  p->Size = 0;
   96|  30.6k|  p->Base = 0;
   97|  30.6k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  15.3k|{
  412|  15.3k|  p->MaxOrder = maxOrder;
  413|  15.3k|  p->RestoreMethod = restoreMethod;
  414|  15.3k|  RestartModel(p);
  415|  15.3k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  15.3k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  15.3k|  p->DummySee.Summ = 0; /* unused */
  417|  15.3k|  p->DummySee.Count = 64; /* unused */
  418|  15.3k|}
archive_ppmd8.c:RestartModel:
  354|  15.4k|{
  355|  15.4k|  unsigned i, k, m, r;
  356|       |
  357|  15.4k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  15.4k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  15.4k|  RESET_TEXT(0);
  ------------------
  |  |  349|  15.4k|#define RESET_TEXT(offs) do {						\
  |  |  350|  15.4k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  15.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 15.4k]
  |  |  ------------------
  ------------------
  360|  15.4k|  p->HiUnit = p->Text + p->Size;
  361|  15.4k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  15.4k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  15.4k|#define UNIT_SIZE 12
  ------------------
  362|  15.4k|  p->GlueCount = 0;
  363|       |
  364|  15.4k|  p->OrderFall = p->MaxOrder;
  365|  15.4k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 6.88k, False: 8.53k]
  ------------------
  366|  15.4k|  p->PrevSuccess = 0;
  367|       |
  368|  15.4k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  15.4k|#define UNIT_SIZE 12
  ------------------
  369|  15.4k|  p->MinContext->Suffix = 0;
  370|  15.4k|  p->MinContext->NumStats = 255;
  371|  15.4k|  p->MinContext->Flags = 0;
  372|  15.4k|  p->MinContext->SummFreq = 256 + 1;
  373|  15.4k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  15.4k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  15.4k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  15.4k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  15.4k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  15.4k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  3.96M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 3.94M, False: 15.4k]
  ------------------
  377|  3.94M|  {
  378|  3.94M|    CPpmd_State *s = &p->FoundState[i];
  379|  3.94M|    s->Symbol = (Byte)i;
  380|  3.94M|    s->Freq = 1;
  381|  3.94M|    SetSuccessor(s, 0);
  382|  3.94M|  }
  383|       |
  384|   400k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 385k, False: 15.4k]
  ------------------
  385|   385k|  {
  386|  3.69M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 3.31M, False: 385k]
  ------------------
  387|  3.31M|      i++;
  388|  3.46M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 3.08M, False: 385k]
  ------------------
  389|  3.08M|    {
  390|  3.08M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  3.08M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  3.08M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  3.08M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  3.08M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  27.7M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 24.6M, False: 3.08M]
  ------------------
  393|  24.6M|        dest[r] = val;
  394|  3.08M|    }
  395|   385k|  }
  396|       |
  397|   385k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 369k, False: 15.4k]
  ------------------
  398|   369k|  {
  399|  4.30M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 3.93M, False: 369k]
  ------------------
  400|  3.93M|      i++;
  401|  12.2M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 11.8M, False: 369k]
  ------------------
  402|  11.8M|    {
  403|  11.8M|      CPpmd_See *s = &p->See[m][k];
  404|  11.8M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  11.8M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  11.8M|      s->Count = 7;
  406|  11.8M|    }
  407|   369k|  }
  408|  15.4k|}
archive_ppmd8.c:SetSuccessor:
  344|   350M|{
  345|   350M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  346|   350M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  347|   350M|}
archive_ppmd8.c:Ppmd8_RangeDec_Init:
 1131|  15.3k|{
 1132|  15.3k|  unsigned i;
 1133|  15.3k|  p->Low = 0;
 1134|  15.3k|  p->Range = 0xFFFFFFFF;
 1135|  15.3k|  p->Code = 0;
 1136|  76.6k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 61.2k, False: 15.3k]
  ------------------
 1137|  61.2k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  15.3k|  return (p->Code < 0xFFFFFFFF);
 1139|  15.3k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|   103M|{
 1166|   103M|  size_t charMask[256 / sizeof(size_t)];
 1167|   103M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 16.7M, False: 86.4M]
  ------------------
 1168|  16.7M|  {
 1169|  16.7M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  16.7M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  16.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1170|  16.7M|    unsigned i;
 1171|  16.7M|    UInt32 count, hiCnt;
 1172|  16.7M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1172:9): [True: 6.28M, False: 10.4M]
  ------------------
 1173|  6.28M|    {
 1174|  6.28M|      Byte symbol;
 1175|  6.28M|      RangeDec_Decode(p, 0, s->Freq);
 1176|  6.28M|      p->FoundState = s;
 1177|  6.28M|      symbol = s->Symbol;
 1178|  6.28M|      Ppmd8_Update1_0(p);
 1179|  6.28M|      return symbol;
 1180|  6.28M|    }
 1181|  10.4M|    p->PrevSuccess = 0;
 1182|  10.4M|    i = p->MinContext->NumStats;
 1183|  10.4M|    do
 1184|  91.4M|    {
 1185|  91.4M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 6.01M, False: 85.4M]
  ------------------
 1186|  6.01M|      {
 1187|  6.01M|        Byte symbol;
 1188|  6.01M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  6.01M|        p->FoundState = s;
 1190|  6.01M|        symbol = s->Symbol;
 1191|  6.01M|        Ppmd8_Update1(p);
 1192|  6.01M|        return symbol;
 1193|  6.01M|      }
 1194|  91.4M|    }
 1195|  85.4M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 81.0M, False: 4.41M]
  ------------------
 1196|  4.41M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 4.99k, False: 4.40M]
  ------------------
 1197|  4.99k|      return -2;
 1198|  4.40M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1199|  4.40M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  4.40M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  4.40M|	unsigned j;							\
  |  |  153|  22.0M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 17.6M, False: 4.40M]
  |  |  ------------------
  |  |  154|  17.6M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  17.6M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  17.6M|	}								\
  |  |  157|  4.40M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 4.40M]
  |  |  ------------------
  ------------------
 1200|  4.40M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1162|  4.40M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1201|  4.40M|    i = p->MinContext->NumStats;
 1202|  12.7M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  | 1162|  12.7M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1202:44): [True: 8.32M, False: 4.40M]
  ------------------
 1203|  4.40M|  }
 1204|  86.4M|  else
 1205|  86.4M|  {
 1206|  86.4M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|  86.4M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|  86.4M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|  86.4M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|  86.4M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  86.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  86.4M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|  86.4M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 78.9M, False: 7.45M]
  ------------------
 1208|  78.9M|    {
 1209|  78.9M|      Byte symbol;
 1210|  78.9M|      RangeDec_Decode(p, 0, *prob);
 1211|  78.9M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  78.9M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  78.9M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  78.9M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  78.9M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|  78.9M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|  78.9M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|  78.9M|      Ppmd8_UpdateBin(p);
 1214|  78.9M|      return symbol;
 1215|  78.9M|    }
 1216|  7.45M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1217|  7.45M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  7.45M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  7.45M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  7.45M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  7.45M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1219|  7.45M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  7.45M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  7.45M|	unsigned j;							\
  |  |  153|  37.2M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 29.8M, False: 7.45M]
  |  |  ------------------
  |  |  154|  29.8M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  29.8M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  29.8M|	}								\
  |  |  157|  7.45M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 7.45M]
  |  |  ------------------
  ------------------
 1220|  7.45M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1162|  7.45M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1221|  7.45M|    p->PrevSuccess = 0;
 1222|  7.45M|  }
 1223|  11.8M|  for (;;)
 1224|  16.7M|  {
 1225|  16.7M|    CPpmd_State *ps[256], *s;
 1226|  16.7M|    UInt32 freqSum, count, hiCnt;
 1227|  16.7M|    CPpmd_See *see;
 1228|  16.7M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1229|  16.7M|    do
 1230|  47.1M|    {
 1231|  47.1M|      p->OrderFall++;
 1232|  47.1M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1232:11): [True: 1.86k, False: 47.1M]
  ------------------
 1233|  1.86k|        return -1;
 1234|  47.1M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   97|  47.1M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   96|  47.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1235|  47.1M|    }
 1236|  47.1M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1236:12): [True: 30.3M, False: 16.7M]
  ------------------
 1237|  16.7M|    hiCnt = 0;
 1238|  16.7M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  16.7M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  16.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1239|  16.7M|    i = 0;
 1240|  16.7M|    num = p->MinContext->NumStats - numMasked;
 1241|  16.7M|    do
 1242|   738M|    {
 1243|   738M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1162|   738M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1244|   738M|      hiCnt += (s->Freq & k);
 1245|   738M|      ps[i] = s++;
 1246|   738M|      i -= k;
 1247|   738M|    }
 1248|   738M|    while (i != num);
  ------------------
  |  Branch (1248:12): [True: 721M, False: 16.7M]
  ------------------
 1249|       |    
 1250|  16.7M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1251|  16.7M|    freqSum += hiCnt;
 1252|  16.7M|    count = RangeDec_GetThreshold(p, freqSum);
 1253|       |    
 1254|  16.7M|    if (count < hiCnt)
  ------------------
  |  Branch (1254:9): [True: 11.8M, False: 4.92M]
  ------------------
 1255|  11.8M|    {
 1256|  11.8M|      Byte symbol;
 1257|  11.8M|      CPpmd_State **pps = ps;
 1258|   211M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1258:23): [True: 199M, False: 11.8M]
  ------------------
 1259|  11.8M|      s = *pps;
 1260|  11.8M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1261|  11.8M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  11.8M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  11.8M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  23.7M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 7.45M, False: 4.39M]
  |  |  |  Branch (113:39): [True: 233k, False: 7.22M]
  |  |  ------------------
  |  |  114|   233k|		(p)->Summ <<= 1;					\
  |  |  115|   233k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|   233k|    	}								\
  |  |  117|  11.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 11.8M]
  |  |  ------------------
  ------------------
 1262|  11.8M|      p->FoundState = s;
 1263|  11.8M|      symbol = s->Symbol;
 1264|  11.8M|      Ppmd8_Update2(p);
 1265|  11.8M|      return symbol;
 1266|  11.8M|    }
 1267|  4.92M|    if (count >= freqSum)
  ------------------
  |  Branch (1267:9): [True: 7.94k, False: 4.91M]
  ------------------
 1268|  7.94k|      return -2;
 1269|  4.91M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1270|  4.91M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1271|  14.9M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1162|  14.9M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1271:46): [True: 10.0M, False: 4.91M]
  ------------------
 1272|  4.91M|  }
 1273|  11.8M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1142|  33.4M|{
 1143|  33.4M|  return p->Code / (p->Range /= total);
 1144|  33.4M|}
archive_ppmd8.c:RangeDec_Decode:
 1147|   119M|{
 1148|   119M|  start *= p->Range;
 1149|   119M|  p->Low += start;
 1150|   119M|  p->Code -= start;
 1151|   119M|  p->Range *= size;
 1152|       |
 1153|   132M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   264M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 12.3M, False: 119M]
  ------------------
 1154|   119M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   239M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  14.8k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 14.8k, False: 119M]
  |  Branch (1154:27): [True: 14.8k, False: 0]
  ------------------
 1155|  12.4M|  {
 1156|  12.4M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1157|  12.4M|    p->Range <<= 8;
 1158|  12.4M|    p->Low <<= 8;
 1159|  12.4M|  }
 1160|   119M|}
archive_ppmd8.c:Ppmd8_Update1_0:
 1097|  6.28M|{
 1098|  6.28M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1099|  6.28M|  p->RunLength += p->PrevSuccess;
 1100|  6.28M|  p->MinContext->SummFreq += 4;
 1101|  6.28M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  6.28M|#define MAX_FREQ 124
  ------------------
  |  Branch (1101:7): [True: 42.0k, False: 6.23M]
  ------------------
 1102|  42.0k|    Rescale(p);
 1103|  6.28M|  NextContext(p);
 1104|  6.28M|}
archive_ppmd8.c:Rescale:
  975|  58.0k|{
  976|  58.0k|  unsigned i, adder, sumFreq, escFreq;
  977|  58.0k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|  58.0k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  58.0k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  58.0k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  58.0k|  CPpmd_State *s = p->FoundState;
  979|  58.0k|  {
  980|  58.0k|    CPpmd_State tmp = *s;
  981|   219k|    for (; s != stats; s--)
  ------------------
  |  Branch (981:12): [True: 161k, False: 58.0k]
  ------------------
  982|   161k|      s[0] = s[-1];
  983|  58.0k|    *s = tmp;
  984|  58.0k|  }
  985|  58.0k|  escFreq = p->MinContext->SummFreq - s->Freq;
  986|  58.0k|  s->Freq += 4;
  987|  58.0k|  adder = (p->OrderFall != 0
  988|       |      #ifdef PPMD8_FREEZE_SUPPORT
  989|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  990|       |      #endif
  991|  58.0k|      );
  992|  58.0k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  58.0k|  sumFreq = s->Freq;
  994|       |  
  995|  58.0k|  i = p->MinContext->NumStats;
  996|  58.0k|  do
  997|  2.67M|  {
  998|  2.67M|    escFreq -= (++s)->Freq;
  999|  2.67M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
 1000|  2.67M|    sumFreq += s->Freq;
 1001|  2.67M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1001:9): [True: 804k, False: 1.87M]
  ------------------
 1002|   804k|    {
 1003|   804k|      CPpmd_State *s1 = s;
 1004|   804k|      CPpmd_State tmp = *s1;
 1005|   804k|      do
 1006|  39.2M|        s1[0] = s1[-1];
 1007|  39.2M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1007:14): [True: 39.2M, False: 0]
  |  Branch (1007:31): [True: 38.4M, False: 804k]
  ------------------
 1008|   804k|      *s1 = tmp;
 1009|   804k|    }
 1010|  2.67M|  }
 1011|  2.67M|  while (--i);
  ------------------
  |  Branch (1011:10): [True: 2.61M, False: 58.0k]
  ------------------
 1012|       |  
 1013|  58.0k|  if (s->Freq == 0)
  ------------------
  |  Branch (1013:7): [True: 10.8k, False: 47.2k]
  ------------------
 1014|  10.8k|  {
 1015|  10.8k|    unsigned numStats = p->MinContext->NumStats;
 1016|  10.8k|    unsigned n0, n1;
 1017|  13.6k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1017:24): [True: 2.74k, False: 10.8k]
  ------------------
 1018|  10.8k|    escFreq += i;
 1019|  10.8k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1020|  10.8k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1020:9): [True: 4.86k, False: 6.01k]
  ------------------
 1021|  4.86k|    {
 1022|  4.86k|      CPpmd_State tmp = *stats;
 1023|  4.86k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  4.86k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  4.86k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 4.58k, False: 282]
  ------------------
 1025|  4.58k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  4.58k|#define MAX_FREQ 124
  ------------------
 1026|  4.86k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  4.86k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  4.86k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  4.86k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  4.86k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.86k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  4.86k|      return;
 1030|  4.86k|    }
 1031|  6.01k|    n0 = (numStats + 2) >> 1;
 1032|  6.01k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1033|  6.01k|    if (n0 != n1)
  ------------------
  |  Branch (1033:9): [True: 4.79k, False: 1.22k]
  ------------------
 1034|  4.79k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  4.79k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  4.79k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1035|  6.01k|    p->MinContext->Flags &= ~0x08;
 1036|  6.01k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  6.01k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  6.01k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  6.01k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1037|  6.01k|    i = p->MinContext->NumStats;
 1038|  15.2k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1038:73): [True: 9.19k, False: 6.01k]
  ------------------
 1039|  6.01k|  }
 1040|  53.2k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1041|  53.2k|  p->MinContext->Flags |= 0x4;
 1042|  53.2k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|  53.2k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  53.2k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  53.2k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  53.2k|}
archive_ppmd8.c:InsertNode:
  118|  87.7M|{
  119|  87.7M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|  87.7M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|  87.7M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|  87.7M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|  87.7M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|  87.7M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|  87.7M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|  87.7M|  p->Stamps[indx]++;
  124|  87.7M|}
archive_ppmd8.c:ShrinkUnits:
  255|  3.39M|{
  256|  3.39M|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  3.39M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  257|  3.39M|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  3.39M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  258|  3.39M|  if (i0 == i1)
  ------------------
  |  Branch (258:7): [True: 555k, False: 2.83M]
  ------------------
  259|   555k|    return oldPtr;
  260|  2.83M|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (260:7): [True: 2.83M, False: 4.73k]
  ------------------
  261|  2.83M|  {
  262|  2.83M|    void *ptr = RemoveNode(p, i1);
  263|  2.83M|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  245|  2.83M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  2.83M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  2.83M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  2.83M|	UInt32 n = num;							\
  |  |  249|  4.26M|	do {								\
  |  |  250|  4.26M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  4.26M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 1.43M, False: 2.83M]
  |  |  ------------------
  |  |  252|  2.83M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 2.83M]
  |  |  ------------------
  ------------------
  264|  2.83M|    InsertNode(p, oldPtr, i0);
  265|  2.83M|    return ptr;
  266|  2.83M|  }
  267|  4.73k|  SplitBlock(p, oldPtr, i0, i1);
  268|  4.73k|  return oldPtr;
  269|  2.83M|}
archive_ppmd8.c:RemoveNode:
  127|  44.2M|{
  128|  44.2M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  44.2M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  44.2M|  p->FreeList[indx] = node->Next;
  130|  44.2M|  p->Stamps[indx]--;
  131|  44.2M|  return node;
  132|  44.2M|}
archive_ppmd8.c:SplitBlock:
  135|  5.74M|{
  136|  5.74M|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  5.74M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  5.74M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|  5.74M|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|  5.74M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  5.74M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|  5.74M|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  5.74M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 507k, False: 5.23M]
  ------------------
  139|   507k|  {
  140|   507k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|   507k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|   507k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|   507k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   507k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|   507k|  }
  143|  5.74M|  InsertNode(p, ptr, i);
  144|  5.74M|}
archive_ppmd8.c:NextContext:
 1070|  91.2M|{
 1071|  91.2M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|  91.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  91.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  91.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|  91.2M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 51.9M, False: 39.3M]
  |  Branch (1072:28): [True: 42.7M, False: 9.19M]
  ------------------
 1073|  42.7M|    p->MinContext = p->MaxContext = c;
 1074|  48.5M|  else
 1075|  48.5M|  {
 1076|  48.5M|    UpdateModel(p);
 1077|  48.5M|    p->MinContext = p->MaxContext;
 1078|  48.5M|  }
 1079|  91.2M|}
archive_ppmd8.c:UpdateModel:
  806|  60.3M|{
  807|  60.3M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  60.3M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  60.3M|  CTX_PTR c;
  809|  60.3M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  60.3M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  60.3M|  CPpmd_State *s = NULL;
  812|       |  
  813|  60.3M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  60.3M|#define MAX_FREQ 124
  ------------------
  |  Branch (813:7): [True: 56.5M, False: 3.86M]
  |  Branch (813:45): [True: 54.5M, False: 1.94M]
  ------------------
  814|  54.5M|  {
  815|  54.5M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  54.5M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  54.5M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  54.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  54.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|       |    
  817|  54.5M|    if (c->NumStats == 0)
  ------------------
  |  Branch (817:9): [True: 32.9M, False: 21.6M]
  ------------------
  818|  32.9M|    {
  819|  32.9M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  32.9M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  32.9M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  820|  32.9M|      if (s->Freq < 32)
  ------------------
  |  Branch (820:11): [True: 32.9M, False: 1.31k]
  ------------------
  821|  32.9M|        s->Freq++;
  822|  32.9M|    }
  823|  21.6M|    else
  824|  21.6M|    {
  825|  21.6M|      s = STATS(c);
  ------------------
  |  |   30|  21.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  21.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  21.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|  21.6M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (826:11): [True: 13.4M, False: 8.24M]
  ------------------
  827|  13.4M|      {
  828|   185M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (828:28): [True: 172M, False: 13.4M]
  ------------------
  829|  13.4M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (829:13): [True: 5.67M, False: 7.73M]
  ------------------
  830|  5.67M|        {
  831|  5.67M|          SwapStates(&s[0], &s[-1]);
  832|  5.67M|          s--;
  833|  5.67M|        }
  834|  13.4M|      }
  835|  21.6M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  21.6M|#define MAX_FREQ 124
  ------------------
  |  Branch (835:11): [True: 21.4M, False: 194k]
  ------------------
  836|  21.4M|      {
  837|  21.4M|        s->Freq += 2;
  838|  21.4M|        c->SummFreq += 2;
  839|  21.4M|      }
  840|  21.6M|    }
  841|  54.5M|  }
  842|       |  
  843|  60.3M|  c = p->MaxContext;
  844|  60.3M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (844:7): [True: 9.19M, False: 51.1M]
  |  Branch (844:28): [True: 9.04M, False: 154k]
  ------------------
  845|  9.04M|  {
  846|  9.04M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  9.04M|#define True 1
  ------------------
  847|  9.04M|    if (cs == 0)
  ------------------
  |  Branch (847:9): [True: 389, False: 9.04M]
  ------------------
  848|    389|    {
  849|    389|      SetSuccessor(p->FoundState, 0);
  850|    389|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    389|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  851|    389|    }
  852|  9.04M|    else
  853|  9.04M|    {
  854|  9.04M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  9.04M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  9.04M|      p->MaxContext = cs;
  856|  9.04M|    }
  857|  9.04M|    return;
  858|  9.04M|  }
  859|       |  
  860|  51.3M|  *p->Text++ = p->FoundState->Symbol;
  861|  51.3M|  successor = REF(p->Text);
  ------------------
  |  |   24|  51.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  862|  51.3M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (862:7): [True: 45, False: 51.3M]
  ------------------
  863|     45|  {
  864|     45|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  554|     45|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  865|     45|    return;
  866|     45|  }
  867|       |  
  868|  51.3M|  if (!fSuccessor)
  ------------------
  |  Branch (868:7): [True: 2.72M, False: 48.6M]
  ------------------
  869|  2.72M|  {
  870|  2.72M|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  871|  2.72M|    if (cs == NULL)
  ------------------
  |  Branch (871:9): [True: 21, False: 2.72M]
  ------------------
  872|     21|    {
  873|     21|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|     21|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  874|     21|      return;
  875|     21|    }
  876|  2.72M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  2.72M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  877|  2.72M|  }
  878|  48.6M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |   96|  48.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (878:12): [True: 17.3M, False: 31.2M]
  ------------------
  879|  17.3M|  {
  880|  17.3M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  17.3M|#define False 0
  ------------------
  881|  17.3M|    if (cs == NULL)
  ------------------
  |  Branch (881:9): [True: 184, False: 17.3M]
  ------------------
  882|    184|    {
  883|    184|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|    184|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  884|    184|      return;
  885|    184|    }
  886|  17.3M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  17.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  887|  17.3M|  }
  888|       |  
  889|  51.3M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (889:7): [True: 1.81M, False: 49.5M]
  ------------------
  890|  1.81M|  {
  891|  1.81M|    successor = fSuccessor;
  892|  1.81M|    p->Text -= (p->MaxContext != p->MinContext);
  893|  1.81M|  }
  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|  51.3M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  904|  51.3M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  905|       |  
  906|  98.4M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  47.1M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  47.1M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  47.1M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  47.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (906:10): [True: 47.1M, False: 51.3M]
  ------------------
  907|  47.1M|  {
  908|  47.1M|    unsigned ns1;
  909|  47.1M|    UInt32 cf, sf;
  910|  47.1M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (910:9): [True: 18.0M, False: 29.0M]
  ------------------
  911|  18.0M|    {
  912|  18.0M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (912:11): [True: 12.1M, False: 5.86M]
  ------------------
  913|  12.1M|      {
  914|       |        /* Expand for one UNIT */
  915|  12.1M|        unsigned oldNU = (ns1 + 1) >> 1;
  916|  12.1M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  12.1M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  917|  12.1M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  12.1M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (917:13): [True: 11.8M, False: 337k]
  ------------------
  918|  11.8M|        {
  919|  11.8M|          void *ptr = AllocUnits(p, i + 1);
  920|  11.8M|          void *oldPtr;
  921|  11.8M|          if (!ptr)
  ------------------
  |  Branch (921:15): [True: 422, False: 11.8M]
  ------------------
  922|    422|          {
  923|    422|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    422|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  924|    422|            return;
  925|    422|          }
  926|  11.8M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  11.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  11.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  11.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  11.8M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  245|  11.8M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  11.8M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  11.8M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  11.8M|	UInt32 n = num;							\
  |  |  249|  17.6M|	do {								\
  |  |  250|  17.6M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  17.6M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 5.75M, False: 11.8M]
  |  |  ------------------
  |  |  252|  11.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 11.8M]
  |  |  ------------------
  ------------------
  928|  11.8M|          InsertNode(p, oldPtr, i);
  929|  11.8M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  11.8M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  11.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  930|  11.8M|        }
  931|  12.1M|      }
  932|  18.0M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  933|  18.0M|    }
  934|  29.0M|    else
  935|  29.0M|    {
  936|  29.0M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  937|  29.0M|      if (!s2)
  ------------------
  |  Branch (937:11): [True: 677, False: 29.0M]
  ------------------
  938|    677|      {
  939|    677|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    677|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  940|    677|        return;
  941|    677|      }
  942|  29.0M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  29.0M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  29.0M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  943|  29.0M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  29.0M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  944|  29.0M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  29.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (944:11): [True: 29.0M, False: 12.0k]
  ------------------
  945|  29.0M|        s2->Freq <<= 1;
  946|  12.0k|      else
  947|  12.0k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  12.0k|#define MAX_FREQ 124
  ------------------
  948|  29.0M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  949|  29.0M|    }
  950|  47.1M|    cf = 2 * fFreq * (c->SummFreq + 6);
  951|  47.1M|    sf = (UInt32)s0 + c->SummFreq;
  952|  47.1M|    if (cf < 6 * sf)
  ------------------
  |  Branch (952:9): [True: 24.0M, False: 23.1M]
  ------------------
  953|  24.0M|    {
  954|  24.0M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  955|  24.0M|      c->SummFreq += 4;
  956|  24.0M|    }
  957|  23.1M|    else
  958|  23.1M|    {
  959|  23.1M|      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
  960|  23.1M|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  961|  23.1M|    }
  962|  47.1M|    {
  963|  47.1M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  47.1M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  47.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  47.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  47.1M|      SetSuccessor(s2, successor);
  965|  47.1M|      s2->Symbol = fSymbol;
  966|  47.1M|      s2->Freq = (Byte)cf;
  967|  47.1M|      c->Flags |= flag;
  968|  47.1M|      c->NumStats = (Byte)(ns1 + 1);
  969|  47.1M|    }
  970|  47.1M|  }
  971|  51.3M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  51.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  51.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  51.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  51.3M|}
archive_ppmd8.c:SwapStates:
  444|  37.1M|{
  445|  37.1M|  CPpmd_State tmp = *t1;
  446|  37.1M|  *t1 = *t2;
  447|  37.1M|  *t2 = tmp;
  448|  37.1M|}
archive_ppmd8.c:CreateSuccessors:
  619|  26.4M|{
  620|  26.4M|  CPpmd_State upState;
  621|  26.4M|  Byte flags;
  622|  26.4M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  26.4M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  623|       |  /* fixed over Shkarin's code. Maybe it could work without + 1 too. */
  624|  26.4M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  625|  26.4M|  unsigned numPs = 0;
  626|       |  
  627|  26.4M|  if (!skip)
  ------------------
  |  Branch (627:7): [True: 17.3M, False: 9.04M]
  ------------------
  628|  17.3M|    ps[numPs++] = p->FoundState;
  629|       |  
  630|   126M|  while (c->Suffix)
  ------------------
  |  Branch (630:10): [True: 126M, False: 453k]
  ------------------
  631|   126M|  {
  632|   126M|    CPpmd_Void_Ref successor;
  633|   126M|    CPpmd_State *s;
  634|   126M|    c = SUFFIX(c);
  ------------------
  |  |   32|   126M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|   126M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|   126M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   126M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|   126M|    if (s1)
  ------------------
  |  Branch (635:9): [True: 26.1M, False: 100M]
  ------------------
  636|  26.1M|    {
  637|  26.1M|      s = s1;
  638|  26.1M|      s1 = NULL;
  639|  26.1M|    }
  640|   100M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (640:14): [True: 25.7M, False: 74.5M]
  ------------------
  641|  25.7M|    {
  642|   144M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  25.7M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  25.7M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  25.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (642:26): [True: 118M, False: 25.7M]
  ------------------
  643|  25.7M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  25.7M|#define MAX_FREQ 124
  ------------------
  |  Branch (643:11): [True: 25.6M, False: 44.8k]
  ------------------
  644|  25.6M|      {
  645|  25.6M|        s->Freq++;
  646|  25.6M|        c->SummFreq++;
  647|  25.6M|      }
  648|  25.7M|    }
  649|  74.5M|    else
  650|  74.5M|    {
  651|  74.5M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  74.5M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  74.5M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  652|  74.5M|      s->Freq = (Byte)(s->Freq + (!SUFFIX(c)->NumStats & (s->Freq < 24)));
  ------------------
  |  |   32|  74.5M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  74.5M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  74.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  74.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  653|  74.5M|    }
  654|   126M|    successor = SUCCESSOR(s);
  ------------------
  |  |  341|   126M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  655|   126M|    if (successor != upBranch)
  ------------------
  |  Branch (655:9): [True: 25.9M, False: 100M]
  ------------------
  656|  25.9M|    {
  657|  25.9M|      c = CTX(successor);
  ------------------
  |  |   29|  25.9M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  25.9M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  25.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|  25.9M|      if (numPs == 0)
  ------------------
  |  Branch (658:11): [True: 659k, False: 25.2M]
  ------------------
  659|   659k|        return c;
  660|  25.2M|      break;
  661|  25.9M|    }
  662|   100M|    ps[numPs++] = s;
  663|   100M|  }
  664|       |  
  665|  25.7M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |   96|  25.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  666|  25.7M|  SetSuccessor(&upState, upBranch + 1);
  667|  25.7M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  668|       |
  669|  25.7M|  if (c->NumStats == 0)
  ------------------
  |  Branch (669:7): [True: 13.4M, False: 12.2M]
  ------------------
  670|  13.4M|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   31|  13.4M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  13.4M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  671|  12.2M|  else
  672|  12.2M|  {
  673|  12.2M|    UInt32 cf, s0;
  674|  12.2M|    CPpmd_State *s;
  675|  70.2M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  12.2M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  12.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  12.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:24): [True: 57.9M, False: 12.2M]
  ------------------
  676|  12.2M|    cf = s->Freq - 1;
  677|  12.2M|    s0 = c->SummFreq - c->NumStats - cf;
  678|  12.2M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (678:32): [True: 7.87M, False: 4.39M]
  ------------------
  679|  12.2M|  }
  680|       |
  681|   143M|  while (numPs != 0)
  ------------------
  |  Branch (681:10): [True: 117M, False: 25.7M]
  ------------------
  682|   117M|  {
  683|       |    /* Create Child */
  684|   117M|    CTX_PTR c1; /* = AllocContext(p); */
  685|   117M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (685:9): [True: 87.2M, False: 30.6M]
  ------------------
  686|  87.2M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  87.2M|#define UNIT_SIZE 12
  ------------------
  687|  30.6M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (687:14): [True: 18.8M, False: 11.7M]
  ------------------
  688|  18.8M|      c1 = (CTX_PTR)RemoveNode(p, 0);
  689|  11.7M|    else
  690|  11.7M|    {
  691|  11.7M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  692|  11.7M|      if (!c1)
  ------------------
  |  Branch (692:11): [True: 594, False: 11.7M]
  ------------------
  693|    594|        return NULL;
  694|  11.7M|    }
  695|   117M|    c1->NumStats = 0;
  696|   117M|    c1->Flags = flags;
  697|   117M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|   117M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   117M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  698|   117M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|   117M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  699|   117M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|   117M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  700|   117M|    c = c1;
  701|   117M|  }
  702|       |
  703|  25.7M|  return c;
  704|  25.7M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  15.0M|{
  206|  15.0M|  unsigned i;
  207|  15.0M|  void *retVal;
  208|  15.0M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 2.49k, False: 15.0M]
  ------------------
  209|  2.49k|  {
  210|  2.49k|    GlueFreeBlocks(p);
  211|  2.49k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 1.08k, False: 1.40k]
  ------------------
  212|  1.08k|      return RemoveNode(p, indx);
  213|  2.49k|  }
  214|  15.0M|  i = indx;
  215|  15.0M|  do
  216|   365M|  {
  217|   365M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   365M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   365M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   365M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   365M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   365M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   365M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   365M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   365M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 9.34M, False: 355M]
  ------------------
  218|  9.34M|    {
  219|  9.34M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  9.34M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  9.34M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  9.34M|      p->GlueCount--;
  221|  9.34M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 9.34M, False: 1.69k]
  ------------------
  222|  9.34M|    }
  223|   365M|  }
  224|   355M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 349M, False: 5.73M]
  ------------------
  225|  5.73M|  retVal = RemoveNode(p, i);
  226|  5.73M|  SplitBlock(p, retVal, i, indx);
  227|  5.73M|  return retVal;
  228|  15.0M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|  2.49k|{
  148|  2.49k|  CPpmd8_Node_Ref head = 0;
  149|  2.49k|  CPpmd8_Node_Ref *prev = &head;
  150|  2.49k|  unsigned i;
  151|       |
  152|  2.49k|  p->GlueCount = 1 << 13;
  153|  2.49k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  154|       |  
  155|       |  /* Order-0 context is always at top UNIT, so we don't need guard NODE at the end.
  156|       |     All blocks up to p->LoUnit can be free, so we need guard NODE at LoUnit. */
  157|  2.49k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 150, False: 2.34k]
  ------------------
  158|    150|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|  97.2k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  97.2k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  97.2k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  97.2k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  97.2k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  97.2k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  97.2k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  97.2k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  97.2k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 94.7k, False: 2.49k]
  ------------------
  162|  94.7k|  {
  163|  94.7k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|  94.7k|    p->FreeList[i] = 0;
  165|  19.5M|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 19.4M, False: 94.7k]
  ------------------
  166|  19.4M|    {
  167|  19.4M|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  19.4M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  19.4M|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 12.3M, False: 7.03M]
  ------------------
  169|  12.3M|      {
  170|  12.3M|        CPpmd8_Node *node2;
  171|  12.3M|        *prev = next;
  172|  12.3M|        prev = &(node->Next);
  173|  22.9M|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  22.9M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 10.5M, False: 12.3M]
  ------------------
  174|  10.5M|        {
  175|  10.5M|          node->NU += node2->NU;
  176|  10.5M|          node2->NU = 0;
  177|  10.5M|        }
  178|  12.3M|      }
  179|  19.4M|      next = node->Next;
  180|  19.4M|    }
  181|  94.7k|  }
  182|  2.49k|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  12.3M|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 12.3M, False: 2.49k]
  ------------------
  186|  12.3M|  {
  187|  12.3M|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  12.3M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  12.3M|    unsigned nu;
  189|  12.3M|    head = node->Next;
  190|  12.3M|    nu = node->NU;
  191|  12.3M|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 3.55M, False: 8.81M]
  ------------------
  192|  3.55M|      continue;
  193|  8.81M|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 24, False: 8.81M]
  ------------------
  194|     24|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|     24|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|     24|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|     24|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|     24|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|     24|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|     24|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     24|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     24|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  8.81M|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  8.81M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 477k, False: 8.34M]
  ------------------
  196|   477k|    {
  197|   477k|      unsigned k = I2U(--i);
  ------------------
  |  |   19|   477k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|   477k|      InsertNode(p, node + k, nu - k - 1);
  199|   477k|    }
  200|  8.81M|    InsertNode(p, node, i);
  201|  8.81M|  }
  202|  2.49k|}
archive_ppmd8.c:RestoreModel:
  562|  1.73k|{
  563|  1.73k|  CTX_PTR c;
  564|  1.73k|  CPpmd_State *s;
  565|  1.73k|  RESET_TEXT(0);
  ------------------
  |  |  349|  1.73k|#define RESET_TEXT(offs) do {						\
  |  |  350|  1.73k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  1.73k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 1.73k]
  |  |  ------------------
  ------------------
  566|  6.61k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|  4.87k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  4.87k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  4.87k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.87k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:27): [True: 4.87k, False: 1.73k]
  ------------------
  567|  4.87k|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (567:9): [True: 3.32k, False: 1.55k]
  ------------------
  568|  3.32k|    {
  569|  3.32k|      s = STATS(c);
  ------------------
  |  |   30|  3.32k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  3.32k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  3.32k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  3.32k|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  571|  3.32k|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|  3.32k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.32k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  572|  3.32k|      SpecialFreeUnit(p, s);
  573|  3.32k|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  3.32k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.32k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  3.32k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.32k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|  3.32k|    }
  575|  1.55k|    else
  576|  1.55k|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  577|       | 
  578|  8.70k|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  6.96k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  6.96k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  6.96k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  6.96k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:10): [True: 6.96k, False: 1.73k]
  ------------------
  579|  6.96k|    if (!c->NumStats)
  ------------------
  |  Branch (579:9): [True: 4.54k, False: 2.42k]
  ------------------
  580|  4.54k|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  4.54k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.54k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  4.54k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.54k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  4.54k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.54k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  581|  2.42k|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (581:14): [True: 64, False: 2.35k]
  ------------------
  582|     64|      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.73k|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (601:7): [True: 95, False: 1.64k]
  |  Branch (601:59): [True: 0, False: 1.64k]
  ------------------
  602|     95|    RestartModel(p);
  603|  1.64k|  else
  604|  1.64k|  {
  605|  22.8k|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (605:12): [True: 21.1k, False: 1.64k]
  ------------------
  606|  21.1k|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|  21.1k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  21.1k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  21.1k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  21.1k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.64k|    do
  608|  1.64k|    {
  609|  1.64k|      CutOff(p, p->MaxContext, 0);
  610|  1.64k|      ExpandTextArea(p);
  611|  1.64k|    }
  612|  1.64k|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (612:12): [True: 0, False: 1.64k]
  ------------------
  613|  1.64k|    p->GlueCount = 0;
  614|  1.64k|    p->OrderFall = p->MaxOrder;
  615|  1.64k|  }
  616|  1.73k|}
archive_ppmd8.c:SpecialFreeUnit:
  277|  42.9M|{
  278|  42.9M|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (278:7): [True: 42.9M, False: 2.04k]
  ------------------
  279|  42.9M|    InsertNode(p, ptr, 0);
  280|  2.04k|  else
  281|  2.04k|  {
  282|       |    #ifdef PPMD8_FREEZE_SUPPORT
  283|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  284|       |    #endif
  285|  2.04k|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|  2.04k|#define UNIT_SIZE 12
  ------------------
  286|  2.04k|  }
  287|  42.9M|}
archive_ppmd8.c:Refresh:
  421|  3.38M|{
  422|  3.38M|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  423|  3.38M|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|  3.38M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  3.38M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  3.38M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  3.38M|  ctx->Stats = REF(s);
  ------------------
  |  |   24|  3.38M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  425|       |  #ifdef PPMD8_FREEZE_SUPPORT
  426|       |  /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */
  427|       |  scale |= (ctx->SummFreq >= ((UInt32)1 << 15));
  428|       |  #endif
  429|  3.38M|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  430|  3.38M|  escFreq = ctx->SummFreq - s->Freq;
  431|  3.38M|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  432|  3.38M|  do
  433|  7.30M|  {
  434|  7.30M|    escFreq -= (++s)->Freq;
  435|  7.30M|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  436|  7.30M|    flags |= 0x08 * (s->Symbol >= 0x40);
  437|  7.30M|  }
  438|  7.30M|  while (--i);
  ------------------
  |  Branch (438:10): [True: 3.91M, False: 3.38M]
  ------------------
  439|  3.38M|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  440|  3.38M|  ctx->Flags = (Byte)flags;
  441|  3.38M|}
archive_ppmd8.c:GetUsedMemory:
  543|  3.28k|{
  544|  3.28k|  UInt32 v = 0;
  545|  3.28k|  unsigned i;
  546|   128k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   128k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   128k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   128k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   128k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   128k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   128k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   128k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   128k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (546:15): [True: 124k, False: 3.28k]
  ------------------
  547|   124k|    v += p->Stamps[i] * I2U(i);
  ------------------
  |  |   19|   124k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  548|  3.28k|  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
  ------------------
  |  |   17|  3.28k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  3.28k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  549|  3.28k|}
archive_ppmd8.c:CutOff:
  451|   107M|{
  452|   107M|  int i;
  453|   107M|  unsigned tmp;
  454|   107M|  CPpmd_State *s;
  455|       |  
  456|   107M|  if (!ctx->NumStats)
  ------------------
  |  Branch (456:7): [True: 85.0M, False: 22.8M]
  ------------------
  457|  85.0M|  {
  458|  85.0M|    s = ONE_STATE(ctx);
  ------------------
  |  |   31|  85.0M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  85.0M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  459|  85.0M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
  ------------------
  |  |   96|  85.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (459:9): [True: 81.7M, False: 3.33M]
  ------------------
  460|  81.7M|    {
  461|  81.7M|      if (order < p->MaxOrder)
  ------------------
  |  Branch (461:11): [True: 75.6M, False: 6.06M]
  ------------------
  462|  75.6M|        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  75.6M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  75.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  75.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  6.06M|      else
  464|  6.06M|        SetSuccessor(s, 0);
  465|  81.7M|      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
  ------------------
  |  |  341|   163M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 39.1M, False: 42.6M]
  |  |  ------------------
  ------------------
  |  Branch (465:27): [True: 8.23M, False: 34.3M]
  ------------------
  466|  47.3M|        return REF(ctx);
  ------------------
  |  |   24|  47.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  467|  81.7M|    }
  468|  37.7M|    SpecialFreeUnit(p, ctx);
  469|  37.7M|    return 0;
  470|  85.0M|  }
  471|       |
  472|  22.8M|  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
  ------------------
  |  |   27|  22.8M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  22.8M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  473|       |
  474|  83.1M|  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  22.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  22.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  22.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  83.1M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  83.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  83.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:46): [True: 60.3M, False: 22.8M]
  ------------------
  475|  60.3M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
  ------------------
  |  |   96|  60.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (475:9): [True: 27.4M, False: 32.8M]
  ------------------
  476|  27.4M|    {
  477|  27.4M|      CPpmd_State *s2 = STATS(ctx) + (i--);
  ------------------
  |  |   30|  27.4M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  27.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  27.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  27.4M|      SetSuccessor(s, 0);
  479|  27.4M|      SwapStates(s, s2);
  480|  27.4M|    }
  481|  32.8M|    else if (order < p->MaxOrder)
  ------------------
  |  Branch (481:14): [True: 32.2M, False: 633k]
  ------------------
  482|  32.2M|      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  32.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  32.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  32.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   633k|    else
  484|   633k|      SetSuccessor(s, 0);
  485|       |    
  486|  22.8M|  if (i != ctx->NumStats && order)
  ------------------
  |  Branch (486:7): [True: 17.5M, False: 5.28M]
  |  Branch (486:29): [True: 17.5M, False: 1.64k]
  ------------------
  487|  17.5M|  {
  488|  17.5M|    ctx->NumStats = (Byte)i;
  489|  17.5M|    s = STATS(ctx);
  ------------------
  |  |   30|  17.5M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  17.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  17.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  17.5M|    if (i < 0)
  ------------------
  |  Branch (490:9): [True: 5.27M, False: 12.2M]
  ------------------
  491|  5.27M|    {
  492|  5.27M|      FreeUnits(p, s, tmp);
  493|  5.27M|      SpecialFreeUnit(p, ctx);
  494|  5.27M|      return 0;
  495|  5.27M|    }
  496|  12.2M|    if (i == 0)
  ------------------
  |  Branch (496:9): [True: 8.90M, False: 3.38M]
  ------------------
  497|  8.90M|    {
  498|  8.90M|      ctx->Flags = (Byte)((ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  499|  8.90M|      *ONE_STATE(ctx) = *s;
  ------------------
  |  |   31|  8.90M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  8.90M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  500|  8.90M|      FreeUnits(p, s, tmp);
  501|       |      /* 9.31: the code was fixed. It's was not BUG, if Freq <= MAX_FREQ = 124 */
  502|  8.90M|      ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  8.90M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  8.90M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  8.90M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  8.90M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  503|  8.90M|    }
  504|  3.38M|    else
  505|  3.38M|      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
  506|  12.2M|  }
  507|  17.5M|  return REF(ctx);
  ------------------
  |  |   24|  17.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  508|  22.8M|}
archive_ppmd8.c:MoveUnitsUp:
  290|  22.8M|{
  291|  22.8M|  unsigned indx = U2I(nu);
  ------------------
  |  |   18|  22.8M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  292|  22.8M|  void *ptr;
  293|  22.8M|  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
  ------------------
  |  |   24|   402k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  |  Branch (293:7): [True: 22.4M, False: 402k]
  |  Branch (293:53): [True: 4.02k, False: 398k]
  ------------------
  294|  22.4M|    return oldPtr;
  295|   398k|  ptr = RemoveNode(p, indx);
  296|   398k|  MyMem12Cpy(ptr, oldPtr, nu);
  ------------------
  |  |  245|   398k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|   398k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|   398k|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|   398k|	UInt32 n = num;							\
  |  |  249|   561k|	do {								\
  |  |  250|   561k|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|   561k|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 162k, False: 398k]
  |  |  ------------------
  |  |  252|   398k|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 398k]
  |  |  ------------------
  ------------------
  297|   398k|  if ((Byte*)oldPtr != p->UnitsStart)
  ------------------
  |  Branch (297:7): [True: 397k, False: 623]
  ------------------
  298|   397k|    InsertNode(p, oldPtr, indx);
  299|    623|  else
  300|    623|    p->UnitsStart += U2B(I2U(indx));
  ------------------
  |  |   17|    623|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|    623|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  301|   398k|  return ptr;
  302|  22.8M|}
archive_ppmd8.c:FreeUnits:
  272|  14.1M|{
  273|  14.1M|  InsertNode(p, ptr, U2I(nu));
  ------------------
  |  |   18|  14.1M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  274|  14.1M|}
archive_ppmd8.c:ExpandTextArea:
  305|  1.64k|{
  306|  1.64k|  UInt32 count[PPMD_NUM_INDEXES];
  307|  1.64k|  unsigned i;
  308|  1.64k|  memset(count, 0, sizeof(count));
  309|  1.64k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (309:7): [True: 0, False: 1.64k]
  ------------------
  310|      0|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  311|       |  
  312|  1.64k|  {
  313|  1.64k|    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
  314|  47.4k|    for (; node->Stamp == EMPTY_NODE; node += node->NU)
  ------------------
  |  |   62|  47.4k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (314:12): [True: 45.7k, False: 1.64k]
  ------------------
  315|  45.7k|    {
  316|  45.7k|      node->Stamp = 0;
  317|  45.7k|      count[U2I(node->NU)]++;
  ------------------
  |  |   18|  45.7k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  318|  45.7k|    }
  319|  1.64k|    p->UnitsStart = (Byte *)node;
  320|  1.64k|  }
  321|       |  
  322|  64.0k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  64.0k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  64.0k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  64.0k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  64.0k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  64.0k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  64.0k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  64.0k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  64.0k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:15): [True: 62.4k, False: 1.64k]
  ------------------
  323|  62.4k|  {
  324|  62.4k|    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
  325|  47.4M|    while (count[i] != 0)
  ------------------
  |  Branch (325:12): [True: 47.3M, False: 62.4k]
  ------------------
  326|  47.3M|    {
  327|  47.3M|      CPpmd8_Node *node = NODE(*next);
  ------------------
  |  |   59|  47.3M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  328|  47.4M|      while (node->Stamp == 0)
  ------------------
  |  Branch (328:14): [True: 45.7k, False: 47.3M]
  ------------------
  329|  45.7k|      {
  330|  45.7k|        *next = node->Next;
  331|  45.7k|        node = NODE(*next);
  ------------------
  |  |   59|  45.7k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  332|  45.7k|        p->Stamps[i]--;
  333|  45.7k|        if (--count[i] == 0)
  ------------------
  |  Branch (333:13): [True: 2.46k, False: 43.3k]
  ------------------
  334|  2.46k|          break;
  335|  45.7k|      }
  336|  47.3M|      next = &node->Next;
  337|  47.3M|    }
  338|  62.4k|  }
  339|  1.64k|}
archive_ppmd8.c:ReduceOrder:
  707|  2.72M|{
  708|  2.72M|  CPpmd_State *s = NULL;
  709|  2.72M|  CTX_PTR c1 = c;
  710|  2.72M|  CPpmd_Void_Ref upBranch = REF(p->Text);
  ------------------
  |  |   24|  2.72M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  711|       |  
  712|       |  #ifdef PPMD8_FREEZE_SUPPORT
  713|       |  /* The BUG in Shkarin's code was fixed: ps could overflow in CUT_OFF mode. */
  714|       |  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  715|       |  unsigned numPs = 0;
  716|       |  ps[numPs++] = p->FoundState;
  717|       |  #endif
  718|       |
  719|  2.72M|  SetSuccessor(p->FoundState, upBranch);
  720|  2.72M|  p->OrderFall++;
  721|       |
  722|  2.72M|  for (;;)
  723|  4.18M|  {
  724|  4.18M|    if (s1)
  ------------------
  |  Branch (724:9): [True: 2.10M, False: 2.07M]
  ------------------
  725|  2.10M|    {
  726|  2.10M|      c = SUFFIX(c);
  ------------------
  |  |   32|  2.10M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  2.10M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  2.10M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.10M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  727|  2.10M|      s = s1;
  728|  2.10M|      s1 = NULL;
  729|  2.10M|    }
  730|  2.07M|    else
  731|  2.07M|    {
  732|  2.07M|      if (!c->Suffix)
  ------------------
  |  Branch (732:11): [True: 610k, False: 1.46M]
  ------------------
  733|   610k|      {
  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|   610k|        return c;
  743|   610k|      }
  744|  1.46M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.46M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.46M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.46M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.46M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  1.46M|      if (c->NumStats)
  ------------------
  |  Branch (745:11): [True: 711k, False: 754k]
  ------------------
  746|   711k|      {
  747|   711k|        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
  ------------------
  |  |   30|   711k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|   711k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   711k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (747:13): [True: 426k, False: 284k]
  ------------------
  748|  1.15M|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (748:30): [True: 727k, False: 426k]
  ------------------
  749|   711k|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|   711k|#define MAX_FREQ 124
  ------------------
  |  Branch (749:13): [True: 710k, False: 1.10k]
  ------------------
  750|   710k|        {
  751|   710k|          s->Freq += 2;
  752|   710k|          c->SummFreq += 2;
  753|   710k|        }
  754|   711k|      }
  755|   754k|      else
  756|   754k|      {
  757|   754k|        s = ONE_STATE(c);
  ------------------
  |  |   31|   754k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   754k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  758|   754k|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  759|   754k|      }
  760|  1.46M|    }
  761|  3.57M|    if (SUCCESSOR(s))
  ------------------
  |  |  341|  3.57M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 2.11M, False: 1.45M]
  |  |  ------------------
  ------------------
  762|  2.11M|      break;
  763|       |    #ifdef PPMD8_FREEZE_SUPPORT
  764|       |    ps[numPs++] = s;
  765|       |    #endif
  766|  1.45M|    SetSuccessor(s, upBranch);
  767|  1.45M|    p->OrderFall++;
  768|  1.45M|  }
  769|       |  
  770|       |  #ifdef PPMD8_FREEZE_SUPPORT
  771|       |  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)
  772|       |  {
  773|       |    c = CTX(SUCCESSOR(s));
  774|       |    do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);
  775|       |    RESET_TEXT(1);
  776|       |    p->OrderFall = 1;
  777|       |    return c;
  778|       |  }
  779|       |  else
  780|       |  #endif
  781|  2.11M|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  341|  2.11M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (781:7): [True: 30.1k, False: 2.08M]
  ------------------
  782|  30.1k|  {
  783|  30.1k|    CTX_PTR successor;
  784|  30.1k|    CPpmd_State *s2 = p->FoundState;
  785|  30.1k|    p->FoundState = s;
  786|       |
  787|  30.1k|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|  30.1k|#define False 0
  ------------------
  788|  30.1k|    if (successor == NULL)
  ------------------
  |  Branch (788:9): [True: 21, False: 30.0k]
  ------------------
  789|     21|      SetSuccessor(s, 0);
  790|  30.0k|    else
  791|  30.0k|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|  30.0k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  792|  30.1k|    p->FoundState = s2;
  793|  30.1k|  }
  794|       |  
  795|  2.11M|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (795:7): [True: 28.7k, False: 2.08M]
  |  Branch (795:28): [True: 28.7k, False: 0]
  ------------------
  796|  28.7k|  {
  797|  28.7k|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  341|  28.7k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  798|  28.7k|    p->Text--;
  799|  28.7k|  }
  800|  2.11M|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  341|  2.11M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (800:7): [True: 21, False: 2.11M]
  ------------------
  801|     21|    return NULL;
  802|  2.11M|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|  2.11M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  2.11M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.11M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  2.11M|}
archive_ppmd8.c:AllocUnits:
  231|  40.9M|{
  232|  40.9M|  UInt32 numBytes;
  233|  40.9M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 16.4M, False: 24.5M]
  ------------------
  234|  16.4M|    return RemoveNode(p, indx);
  235|  24.5M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  24.5M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  24.5M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  24.5M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 21.1M, False: 3.33M]
  ------------------
  237|  21.1M|  {
  238|  21.1M|    void *retVal = p->LoUnit;
  239|  21.1M|    p->LoUnit += numBytes;
  240|  21.1M|    return retVal;
  241|  21.1M|  }
  242|  3.33M|  return AllocUnitsRare(p, indx);
  243|  24.5M|}
archive_ppmd8.c:Ppmd8_Update1:
 1082|  6.01M|{
 1083|  6.01M|  CPpmd_State *s = p->FoundState;
 1084|  6.01M|  s->Freq += 4;
 1085|  6.01M|  p->MinContext->SummFreq += 4;
 1086|  6.01M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1086:7): [True: 4.02M, False: 1.98M]
  ------------------
 1087|  4.02M|  {
 1088|  4.02M|    SwapStates(&s[0], &s[-1]);
 1089|  4.02M|    p->FoundState = --s;
 1090|  4.02M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  4.02M|#define MAX_FREQ 124
  ------------------
  |  Branch (1090:9): [True: 690, False: 4.02M]
  ------------------
 1091|    690|      Rescale(p);
 1092|  4.02M|  }
 1093|  6.01M|  NextContext(p);
 1094|  6.01M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|  78.9M|{
 1108|  78.9M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|  78.9M|  p->PrevSuccess = 1;
 1110|  78.9M|  p->RunLength++;
 1111|  78.9M|  NextContext(p);
 1112|  78.9M|}
archive_ppmd8.c:Ppmd8_MakeEscFreq:
 1046|  16.7M|{
 1047|  16.7M|  CPpmd_See *see;
 1048|  16.7M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1048:7): [True: 14.3M, False: 2.47M]
  ------------------
 1049|  14.3M|  {
 1050|  14.3M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1051|  14.3M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1052|  14.3M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1053|  14.3M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  14.3M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  14.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  14.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  14.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  14.3M|        p->MinContext->Flags;
 1055|  14.3M|    {
 1056|  14.3M|      unsigned r = (see->Summ >> see->Shift);
 1057|  14.3M|      see->Summ = (UInt16)(see->Summ - r);
 1058|  14.3M|      *escFreq = r + (r == 0);
 1059|  14.3M|    }
 1060|  14.3M|  }
 1061|  2.47M|  else
 1062|  2.47M|  {
 1063|  2.47M|    see = &p->DummySee;
 1064|  2.47M|    *escFreq = 1;
 1065|  2.47M|  }
 1066|  16.7M|  return see;
 1067|  16.7M|}
archive_ppmd8.c:Ppmd8_Update2:
 1115|  11.8M|{
 1116|  11.8M|  p->MinContext->SummFreq += 4;
 1117|  11.8M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  11.8M|#define MAX_FREQ 124
  ------------------
  |  Branch (1117:7): [True: 15.3k, False: 11.8M]
  ------------------
 1118|  15.3k|    Rescale(p);
 1119|  11.8M|  p->RunLength = p->InitRL;
 1120|  11.8M|  UpdateModel(p);
 1121|  11.8M|  p->MinContext = p->MaxContext;
 1122|  11.8M|}

__archive_rb_tree_init:
   97|  20.5k|{
   98|  20.5k|	rbt->rbt_ops = ops;
   99|       |	*((struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE;
  ------------------
  |  |   89|  20.5k|#define	RB_SENTINEL_NODE	NULL
  ------------------
  100|  20.5k|}
__archive_rb_tree_find_node:
  104|  5.68k|{
  105|  5.68k|	archive_rbto_compare_key_fn compare_key = rbt->rbt_ops->rbto_compare_key;
  106|  5.68k|	struct archive_rb_node *parent = rbt->rbt_root;
  107|       |
  108|  15.4k|	while (!RB_SENTINEL_P(parent)) {
  ------------------
  |  |   53|  15.4k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (108:9): [True: 15.4k, False: 0]
  ------------------
  109|  15.4k|		const signed int diff = (*compare_key)(parent, key);
  110|  15.4k|		if (diff == 0)
  ------------------
  |  Branch (110:7): [True: 5.68k, False: 9.71k]
  ------------------
  111|  5.68k|			return parent;
  112|  9.71k|		parent = parent->rb_nodes[diff > 0];
  113|  9.71k|	}
  114|       |
  115|      0|	return NULL;
  116|  5.68k|}
__archive_rb_tree_insert_node:
  159|  7.68k|{
  160|  7.68k|	archive_rbto_compare_nodes_fn compare_nodes = rbt->rbt_ops->rbto_compare_nodes;
  161|  7.68k|	struct archive_rb_node *parent, *tmp;
  162|  7.68k|	unsigned int position;
  163|  7.68k|	int rebalance;
  164|       |
  165|  7.68k|	tmp = rbt->rbt_root;
  166|       |	/*
  167|       |	 * This is a hack.  Because rbt->rbt_root is just a
  168|       |	 * struct archive_rb_node *, just like rb_node->rb_nodes[RB_DIR_LEFT],
  169|       |	 * we can use this fact to avoid a lot of tests for root and know
  170|       |	 * that even at root, updating
  171|       |	 * RB_FATHER(rb_node)->rb_nodes[RB_POSITION(rb_node)] will
  172|       |	 * update rbt->rbt_root.
  173|       |	 */
  174|  7.68k|	parent = (struct archive_rb_node *)(void *)&rbt->rbt_root;
  175|  7.68k|	position = RB_DIR_LEFT;
  ------------------
  |  |   39|  7.68k|#define	RB_DIR_LEFT		0
  ------------------
  176|       |
  177|       |	/*
  178|       |	 * Find out where to place this new leaf.
  179|       |	 */
  180|  26.1k|	while (!RB_SENTINEL_P(tmp)) {
  ------------------
  |  |   53|  26.1k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (180:9): [True: 22.2k, False: 3.85k]
  ------------------
  181|  22.2k|		const signed int diff = (*compare_nodes)(tmp, self);
  182|  22.2k|		if (diff == 0) {
  ------------------
  |  Branch (182:7): [True: 3.83k, False: 18.4k]
  ------------------
  183|       |			/*
  184|       |			 * Node already exists; don't insert.
  185|       |			 */
  186|  3.83k|			return F;
  ------------------
  |  |   92|  3.83k|#define	F	0
  ------------------
  187|  3.83k|		}
  188|  18.4k|		parent = tmp;
  189|  18.4k|		position = (diff > 0);
  190|  18.4k|		tmp = parent->rb_nodes[position];
  191|  18.4k|	}
  192|       |
  193|       |	/*
  194|       |	 * Initialize the node and insert as a leaf into the tree.
  195|       |	 */
  196|  3.85k|	RB_SET_FATHER(self, parent);
  ------------------
  |  |   51|  3.85k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  3.85k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  3.85k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  3.85k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  3.85k|	RB_SET_POSITION(self, position);
  ------------------
  |  |   73|  3.85k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|  1.91k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 1.91k, False: 1.94k]
  |  |  ------------------
  |  |   74|  3.85k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|  1.94k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  198|  3.85k|	if (parent == (struct archive_rb_node *)(void *)&rbt->rbt_root) {
  ------------------
  |  Branch (198:6): [True: 557, False: 3.30k]
  ------------------
  199|    557|		RB_MARK_BLACK(self);		/* root is always black */
  ------------------
  |  |   69|    557|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    557|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  200|    557|		rebalance = F;
  ------------------
  |  |   92|    557|#define	F	0
  ------------------
  201|  3.30k|	} else {
  202|       |		/*
  203|       |		 * All new nodes are colored red.  We only need to rebalance
  204|       |		 * if our parent is also red.
  205|       |		 */
  206|  3.30k|		RB_MARK_RED(self);
  ------------------
  |  |   68|  3.30k|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  3.30k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  207|  3.30k|		rebalance = RB_RED_P(parent);
  ------------------
  |  |   66|  3.30k|#define	RB_RED_P(rb) 		(!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0)
  |  |  ------------------
  |  |  |  |   53|  6.60k|#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.30k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (66:25): [True: 3.30k, False: 0]
  |  |  |  Branch (66:47): [True: 2.28k, False: 1.01k]
  |  |  ------------------
  ------------------
  208|  3.30k|	}
  209|  3.85k|	self->rb_left = parent->rb_nodes[position];
  ------------------
  |  |   42|  3.85k|#define	rb_left			rb_nodes[RB_DIR_LEFT]
  |  |  ------------------
  |  |  |  |   39|  3.85k|#define	RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
  210|  3.85k|	self->rb_right = parent->rb_nodes[position];
  ------------------
  |  |   43|  3.85k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  3.85k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  211|  3.85k|	parent->rb_nodes[position] = self;
  212|       |
  213|       |	/*
  214|       |	 * Rebalance tree after insertion
  215|       |	 */
  216|  3.85k|	if (rebalance)
  ------------------
  |  Branch (216:6): [True: 2.28k, False: 1.56k]
  ------------------
  217|  2.28k|		__archive_rb_tree_insert_rebalance(rbt, self);
  218|       |
  219|  3.85k|	return T;
  ------------------
  |  |   91|  3.85k|#define T	1
  ------------------
  220|  7.68k|}
__archive_rb_tree_iterate:
  677|    434|{
  678|    434|	const unsigned int other = direction ^ RB_DIR_OTHER;
  ------------------
  |  |   41|    434|#define	RB_DIR_OTHER		1
  ------------------
  679|       |
  680|    434|	if (self == NULL) {
  ------------------
  |  Branch (680:6): [True: 146, False: 288]
  ------------------
  681|    146|		self = rbt->rbt_root;
  682|    146|		if (RB_SENTINEL_P(self))
  ------------------
  |  |   53|    146|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 46, False: 100]
  |  |  ------------------
  ------------------
  683|     46|			return NULL;
  684|    166|		while (!RB_SENTINEL_P(self->rb_nodes[direction]))
  ------------------
  |  |   53|    166|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (684:10): [True: 66, False: 100]
  ------------------
  685|     66|			self = self->rb_nodes[direction];
  686|    100|		return self;
  687|    146|	}
  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|    288|	if (RB_SENTINEL_P(self->rb_nodes[direction])) {
  ------------------
  |  |   53|    288|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 169, False: 119]
  |  |  ------------------
  ------------------
  693|    266|		while (!RB_ROOT_P(rbt, self)) {
  ------------------
  |  |   71|    266|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  ------------------
  |  Branch (693:10): [True: 213, False: 53]
  ------------------
  694|    213|			if (other == (unsigned int)RB_POSITION(self))
  ------------------
  |  |   63|    213|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|    213|#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|    116|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 97, False: 116]
  |  |  ------------------
  ------------------
  |  Branch (694:8): [True: 116, False: 97]
  ------------------
  695|    116|				return RB_FATHER(self);
  ------------------
  |  |   49|    116|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|    116|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    116|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    116|#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|     53|		return NULL;
  699|    169|	}
  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|    197|	while (!RB_SENTINEL_P(self->rb_nodes[other]))
  ------------------
  |  |   53|    197|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (706:9): [True: 78, False: 119]
  ------------------
  707|     78|		self = self->rb_nodes[other];
  708|    119|	return self;
  709|    288|}
archive_rb.c:__archive_rb_tree_insert_rebalance:
  275|  2.28k|{
  276|  2.28k|	struct archive_rb_node * father = RB_FATHER(self);
  ------------------
  |  |   49|  2.28k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  2.28k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.28k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.28k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|  2.28k|	struct archive_rb_node * grandpa;
  278|  2.28k|	struct archive_rb_node * uncle;
  279|  2.28k|	unsigned int which;
  280|  2.28k|	unsigned int other;
  281|       |
  282|  3.24k|	for (;;) {
  283|       |		/*
  284|       |		 * We are red and our parent is red, therefore we must have a
  285|       |		 * grandfather and he must be black.
  286|       |		 */
  287|  3.24k|		grandpa = RB_FATHER(father);
  ------------------
  |  |   49|  3.24k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  3.24k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  3.24k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  3.24k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  3.24k|		which = (father == grandpa->rb_right);
  ------------------
  |  |   43|  3.24k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  3.24k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  289|  3.24k|		other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  3.24k|#define	RB_DIR_OTHER		1
  ------------------
  290|  3.24k|		uncle = grandpa->rb_nodes[other];
  291|       |
  292|  3.24k|		if (RB_BLACK_P(uncle))
  ------------------
  |  |   67|  3.24k|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  6.48k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 1.12k, False: 2.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|  2.11k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 491, False: 1.62k]
  |  |  ------------------
  ------------------
  293|  1.61k|			break;
  294|       |
  295|       |		/*
  296|       |		 * Case 1: our uncle is red
  297|       |		 *   Simply invert the colors of our parent and
  298|       |		 *   uncle and make our grandparent red.  And
  299|       |		 *   then solve the problem up at his level.
  300|       |		 */
  301|  1.62k|		RB_MARK_BLACK(uncle);
  ------------------
  |  |   69|  1.62k|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.62k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  302|  1.62k|		RB_MARK_BLACK(father);
  ------------------
  |  |   69|  1.62k|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.62k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  303|  1.62k|		if (RB_ROOT_P(rbt, grandpa)) {
  ------------------
  |  |   71|  1.62k|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  |  |  ------------------
  |  |  |  Branch (71:28): [True: 312, False: 1.30k]
  |  |  ------------------
  ------------------
  304|       |			/*
  305|       |			 * If our grandpa is root, don't bother
  306|       |			 * setting him to red, just return.
  307|       |			 */
  308|    312|			return;
  309|    312|		}
  310|  1.30k|		RB_MARK_RED(grandpa);
  ------------------
  |  |   68|  1.30k|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.30k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  311|  1.30k|		self = grandpa;
  312|  1.30k|		father = RB_FATHER(self);
  ------------------
  |  |   49|  1.30k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  1.30k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.30k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  1.30k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|  1.30k|		if (RB_BLACK_P(father)) {
  ------------------
  |  |   67|  1.30k|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  2.61k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 0, False: 1.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|  1.30k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 358, False: 951]
  |  |  ------------------
  ------------------
  314|       |			/*
  315|       |			 * If our great-grandpa is black, we're done.
  316|       |			 */
  317|    358|			return;
  318|    358|		}
  319|  1.30k|	}
  320|       |
  321|       |	/*
  322|       |	 * Case 2&3: our uncle is black.
  323|       |	 */
  324|  1.61k|	if (self == father->rb_nodes[other]) {
  ------------------
  |  Branch (324:6): [True: 696, False: 923]
  ------------------
  325|       |		/*
  326|       |		 * Case 2: we are on the same side as our uncle
  327|       |		 *   Swap ourselves with our parent so this case
  328|       |		 *   becomes case 3.  Basically our parent becomes our
  329|       |		 *   child.
  330|       |		 */
  331|    696|		__archive_rb_tree_reparent_nodes(father, other);
  332|    696|	}
  333|       |	/*
  334|       |	 * Case 3: we are opposite a child of a black uncle.
  335|       |	 *   Swap our parent and grandparent.  Since our grandfather
  336|       |	 *   is black, our father will become black and our new sibling
  337|       |	 *   (former grandparent) will become red.
  338|       |	 */
  339|  1.61k|	__archive_rb_tree_reparent_nodes(grandpa, which);
  340|       |
  341|       |	/*
  342|       |	 * Final step: Set the root to black.
  343|       |	 */
  344|  1.61k|	RB_MARK_BLACK(rbt->rbt_root);
  ------------------
  |  |   69|  1.61k|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.61k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  345|  1.61k|}
archive_rb.c:__archive_rb_tree_reparent_nodes:
  233|  2.31k|{
  234|  2.31k|	const unsigned int other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  2.31k|#define	RB_DIR_OTHER		1
  ------------------
  235|  2.31k|	struct archive_rb_node * const grandpa = RB_FATHER(old_father);
  ------------------
  |  |   49|  2.31k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  2.31k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.31k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.31k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  2.31k|	struct archive_rb_node * const old_child = old_father->rb_nodes[which];
  237|  2.31k|	struct archive_rb_node * const new_father = old_child;
  238|  2.31k|	struct archive_rb_node * const new_child = old_father;
  239|       |
  240|  2.31k|	if (new_father == NULL)
  ------------------
  |  Branch (240:6): [True: 0, False: 2.31k]
  ------------------
  241|      0|		return;
  242|       |	/*
  243|       |	 * Exchange descendant linkages.
  244|       |	 */
  245|  2.31k|	grandpa->rb_nodes[RB_POSITION(old_father)] = new_father;
  ------------------
  |  |   63|  2.31k|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|  2.31k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   40|  1.14k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   39|  1.17k|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 1.14k, False: 1.17k]
  |  |  ------------------
  ------------------
  246|  2.31k|	new_child->rb_nodes[which] = old_child->rb_nodes[other];
  247|  2.31k|	new_father->rb_nodes[other] = new_child;
  248|       |
  249|       |	/*
  250|       |	 * Update ancestor linkages
  251|       |	 */
  252|  2.31k|	RB_SET_FATHER(new_father, grandpa);
  ------------------
  |  |   51|  2.31k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  2.31k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.31k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.31k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  2.31k|	RB_SET_FATHER(new_child, new_father);
  ------------------
  |  |   51|  2.31k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  2.31k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.31k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.31k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|       |
  255|       |	/*
  256|       |	 * Exchange properties between new_father and new_child.  The only
  257|       |	 * change is that new_child's position is now on the other side.
  258|       |	 */
  259|  2.31k|	RB_SWAP_PROPERTIES(new_father, new_child);
  ------------------
  |  |   78|  2.31k|#define RB_SWAP_PROPERTIES(a, b) do { \
  |  |   79|  2.31k|    uintptr_t xorinfo = ((a)->rb_info ^ (b)->rb_info) & RB_FLAG_MASK; \
  |  |  ------------------
  |  |  |  |   47|  2.31k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.31k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.31k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|  2.31k|    (a)->rb_info ^= xorinfo; \
  |  |   81|  2.31k|    (b)->rb_info ^= xorinfo; \
  |  |   82|  2.31k|  } while (/*CONSTCOND*/ 0)
  |  |  ------------------
  |  |  |  Branch (82:26): [Folded, False: 2.31k]
  |  |  ------------------
  ------------------
  260|  2.31k|	RB_SET_POSITION(new_child, other);
  ------------------
  |  |   73|  2.31k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    909|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 909, False: 1.40k]
  |  |  ------------------
  |  |   74|  2.31k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|  1.40k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  261|       |
  262|       |	/*
  263|       |	 * Make sure to reparent the new child to ourself.
  264|       |	 */
  265|  2.31k|	if (!RB_SENTINEL_P(new_child->rb_nodes[which])) {
  ------------------
  |  |   53|  2.31k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (265:6): [True: 670, False: 1.64k]
  ------------------
  266|    670|		RB_SET_FATHER(new_child->rb_nodes[which], new_child);
  ------------------
  |  |   51|    670|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|    670|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    670|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    670|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|    670|		RB_SET_POSITION(new_child->rb_nodes[which], which);
  ------------------
  |  |   73|    670|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    452|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 452, False: 218]
  |  |  ------------------
  |  |   74|    670|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|    218|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  268|    670|	}
  269|       |
  270|  2.31k|}

archive_read_new:
   97|  20.1k|{
   98|  20.1k|	struct archive_read *a;
   99|       |
  100|  20.1k|	a = calloc(1, sizeof(*a));
  101|  20.1k|	if (a == NULL)
  ------------------
  |  Branch (101:6): [True: 0, False: 20.1k]
  ------------------
  102|      0|		return (NULL);
  103|  20.1k|	a->archive.magic = ARCHIVE_READ_MAGIC;
  ------------------
  |  |   59|  20.1k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  104|       |
  105|  20.1k|	a->archive.state = ARCHIVE_STATE_NEW;
  ------------------
  |  |   76|  20.1k|#define	ARCHIVE_STATE_NEW	0x01U
  ------------------
  106|  20.1k|	a->entry = archive_entry_new2(&a->archive);
  107|  20.1k|	if (a->entry == NULL) {
  ------------------
  |  Branch (107:6): [True: 0, False: 20.1k]
  ------------------
  108|      0|		free(a);
  109|      0|		return (NULL);
  110|      0|	}
  111|  20.1k|	a->archive.vtable = &archive_read_vtable;
  112|  20.1k|	a->entry_bytes_declared = -1;
  113|       |
  114|  20.1k|	a->passphrases.last = &a->passphrases.first;
  115|       |
  116|  20.1k|	return (&a->archive);
  117|  20.1k|}
archive_read_set_open_callback:
  284|  20.1k|{
  285|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  286|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  287|  20.1k|	    "archive_read_set_open_callback");
  288|  20.1k|	a->client.opener = client_opener;
  289|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  290|  20.1k|}
archive_read_set_read_callback:
  295|  20.1k|{
  296|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  297|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  298|  20.1k|	    "archive_read_set_read_callback");
  299|  20.1k|	a->client.reader = client_reader;
  300|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  301|  20.1k|}
archive_read_set_skip_callback:
  306|  20.1k|{
  307|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  308|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  309|  20.1k|	    "archive_read_set_skip_callback");
  310|  20.1k|	a->client.skipper = client_skipper;
  311|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  312|  20.1k|}
archive_read_set_seek_callback:
  317|  20.1k|{
  318|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  319|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  320|  20.1k|	    "archive_read_set_seek_callback");
  321|  20.1k|	a->client.seeker = client_seeker;
  322|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  323|  20.1k|}
archive_read_set_close_callback:
  328|  20.1k|{
  329|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  330|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  331|  20.1k|	    "archive_read_set_close_callback");
  332|  20.1k|	a->client.closer = client_closer;
  333|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  334|  20.1k|}
archive_read_set_callback_data:
  349|  20.1k|{
  350|  20.1k|	return archive_read_set_callback_data2(_a, client_data, 0);
  351|  20.1k|}
archive_read_set_callback_data2:
  356|  20.1k|{
  357|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  358|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  359|  20.1k|	    "archive_read_set_callback_data2");
  360|       |
  361|  20.1k|	if (a->client.nodes == 0)
  ------------------
  |  Branch (361:6): [True: 20.1k, False: 0]
  ------------------
  362|  20.1k|	{
  363|  20.1k|		a->client.dataset = (struct archive_read_data_node *)
  364|  20.1k|		    calloc(1, sizeof(*a->client.dataset));
  365|  20.1k|		if (a->client.dataset == NULL)
  ------------------
  |  Branch (365:7): [True: 0, False: 20.1k]
  ------------------
  366|      0|		{
  367|      0|			archive_set_error(&a->archive, ENOMEM,
  368|      0|				"No memory");
  369|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  370|      0|		}
  371|  20.1k|		a->client.nodes = 1;
  372|  20.1k|	}
  373|       |
  374|  20.1k|	if (iindex > a->client.nodes - 1)
  ------------------
  |  Branch (374:6): [True: 0, False: 20.1k]
  ------------------
  375|      0|	{
  376|      0|		archive_set_error(&a->archive, EINVAL,
  377|      0|			"Invalid index specified");
  378|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  379|      0|	}
  380|  20.1k|	a->client.dataset[iindex].data = client_data;
  381|  20.1k|	a->client.dataset[iindex].begin_position = 0;
  382|  20.1k|	a->client.dataset[iindex].total_size = -1;
  383|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  384|  20.1k|}
archive_read_open1:
  455|  20.1k|{
  456|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  457|  20.1k|	struct archive_read_filter *f;
  458|  20.1k|	int slot, e = ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  459|       |
  460|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  461|  20.1k|	    "archive_read_open");
  462|  20.1k|	archive_clear_error(&a->archive);
  463|       |
  464|  20.1k|	if (a->client.reader == NULL) {
  ------------------
  |  Branch (464:6): [True: 0, False: 20.1k]
  ------------------
  465|      0|		archive_set_error(&a->archive, EINVAL,
  466|      0|		    "No reader function provided to archive_read_open");
  467|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  468|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|      0|	}
  470|       |
  471|  20.1k|	a->archive.state = ARCHIVE_STATE_OPEN;
  ------------------
  |  |   78|  20.1k|#define	ARCHIVE_STATE_OPEN	0x02U
  ------------------
  472|       |
  473|  20.1k|	f = calloc(1, sizeof(*f));
  474|  20.1k|	if (f == NULL) {
  ------------------
  |  Branch (474:6): [True: 0, False: 20.1k]
  ------------------
  475|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  476|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  477|      0|	}
  478|  20.1k|	f->bidder = NULL;
  479|  20.1k|	f->upstream = NULL;
  480|  20.1k|	f->archive = a;
  481|  20.1k|	f->data = a->client.dataset[0].data;
  482|  20.1k|	f->vtable = &none_reader_vtable;
  483|  20.1k|	f->name = "none";
  484|  20.1k|	f->code = ARCHIVE_FILTER_NONE;
  ------------------
  |  |  311|  20.1k|#define	ARCHIVE_FILTER_NONE	0
  ------------------
  485|  20.1k|	f->can_skip = a->client.skipper != NULL;
  486|  20.1k|	f->can_seek = a->client.seeker != NULL;
  487|       |
  488|       |	/* Open data source. */
  489|  20.1k|	if (a->client.opener != NULL) {
  ------------------
  |  Branch (489:6): [True: 20.1k, False: 0]
  ------------------
  490|  20.1k|		e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
  491|  20.1k|		if (e != ARCHIVE_OK) {
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (491:7): [True: 0, False: 20.1k]
  ------------------
  492|       |			/* If the open failed, call the closer to clean up. */
  493|      0|			client_close_proxy(f);
  494|      0|			free(f);
  495|      0|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  496|      0|			return (e);
  497|      0|		}
  498|  20.1k|	}
  499|       |
  500|  20.1k|	a->client.dataset[0].begin_position = 0;
  501|  20.1k|	if (!a->filter || !a->bypass_filter_bidding)
  ------------------
  |  Branch (501:6): [True: 20.1k, False: 0]
  |  Branch (501:20): [True: 0, False: 0]
  ------------------
  502|  20.1k|	{
  503|  20.1k|		a->filter = f;
  504|       |		/* Build out the input pipeline. */
  505|  20.1k|		e = choose_filters(a);
  506|  20.1k|		if (e < ARCHIVE_WARN) {
  ------------------
  |  |  236|  20.1k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (506:7): [True: 293, False: 19.8k]
  ------------------
  507|    293|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|    293|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  508|    293|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    293|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  509|    293|		}
  510|  20.1k|	}
  511|      0|	else
  512|      0|	{
  513|      0|		size_t count;
  514|      0|		struct archive_read_filter *f2;
  515|       |
  516|       |		/* Need to add "NONE" type filter at the end of the filter chain */
  517|      0|		count = 1;
  518|      0|		for (f2 = a->filter; f2->upstream != NULL; f2 = f2->upstream)
  ------------------
  |  Branch (518:24): [True: 0, False: 0]
  ------------------
  519|      0|			count++;
  520|      0|		f2->upstream = f;
  521|       |
  522|      0|		while (count-- > 0) {
  ------------------
  |  Branch (522:10): [True: 0, False: 0]
  ------------------
  523|      0|			struct archive_read_filter_bidder *bidder;
  524|      0|			size_t i;
  525|      0|			int r;
  526|       |
  527|      0|			f2 = a->filter;
  528|      0|			for (i = 0; i < count; i++)
  ------------------
  |  Branch (528:16): [True: 0, False: 0]
  ------------------
  529|      0|				f2 = f2->upstream;
  530|      0|			bidder = f2->bidder;
  531|       |
  532|      0|			r = (bidder->vtable->bid)(bidder, f2->upstream);
  533|      0|			if (r < 0) {
  ------------------
  |  Branch (533:8): [True: 0, False: 0]
  ------------------
  534|      0|				archive_set_error(&a->archive,
  535|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  536|      0|				    "Registered filter does not match");
  537|      0|				close_filters(a);
  538|      0|				a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  539|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  540|      0|			}
  541|      0|			r = (bidder->vtable->init)(f2);
  542|      0|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (542:8): [True: 0, False: 0]
  ------------------
  543|      0|				close_filters(a);
  544|      0|				a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  545|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  546|      0|			}
  547|      0|		}
  548|      0|	}
  549|       |
  550|  19.8k|	if (!a->format)
  ------------------
  |  Branch (550:6): [True: 19.8k, False: 0]
  ------------------
  551|  19.8k|	{
  552|  19.8k|		slot = choose_format(a);
  553|  19.8k|		if (slot < 0) {
  ------------------
  |  Branch (553:7): [True: 159, False: 19.6k]
  ------------------
  554|    159|			close_filters(a);
  555|    159|			a->format = NULL;
  556|    159|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|    159|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  557|    159|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    159|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  558|    159|		}
  559|  19.6k|		a->format = &(a->formats[slot]);
  560|  19.6k|	}
  561|      0|	else if (a->format->bid != NULL)
  ------------------
  |  Branch (561:11): [True: 0, False: 0]
  ------------------
  562|      0|	{
  563|      0|		if (bid_format(a, -1) < 0) {
  ------------------
  |  Branch (563:7): [True: 0, False: 0]
  ------------------
  564|      0|			archive_set_error(&a->archive,
  565|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  566|      0|			    "Registered format does not match");
  567|      0|			close_filters(a);
  568|      0|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  569|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  570|      0|		}
  571|      0|	}
  572|       |
  573|  19.6k|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   80|  19.6k|#define	ARCHIVE_STATE_HEADER	0x04U
  ------------------
  574|       |
  575|  19.6k|	return (e);
  576|  19.8k|}
__archive_read_header:
  644|  1.00k|{
  645|  1.00k|	if (!a->filter->vtable->read_header)
  ------------------
  |  Branch (645:6): [True: 827, False: 177]
  ------------------
  646|    827|		return (ARCHIVE_OK);
  ------------------
  |  |  234|    827|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  647|    177|	return a->filter->vtable->read_header(a->filter, entry);
  648|  1.00k|}
archive_read_has_encrypted_entries:
  851|  19.6k|{
  852|  19.6k|	struct archive_read *a = (struct archive_read *)_a;
  853|  19.6k|	int format_supports_encryption = archive_read_format_capabilities(_a)
  854|  19.6k|			& (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  403|  19.6k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
              			& (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  404|  19.6k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  855|       |
  856|  19.6k|	if (!_a || !format_supports_encryption) {
  ------------------
  |  Branch (856:6): [True: 0, False: 19.6k]
  |  Branch (856:13): [True: 9.80k, False: 9.88k]
  ------------------
  857|       |		/* Format in general doesn't support encryption */
  858|  9.80k|		return ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED;
  ------------------
  |  |  415|  9.80k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
  ------------------
  859|  9.80k|	}
  860|       |
  861|       |	/* A reader potentially has read enough data now. */
  862|  9.88k|	if (a->format && a->format->has_encrypted_entries) {
  ------------------
  |  Branch (862:6): [True: 9.88k, False: 0]
  |  Branch (862:19): [True: 9.88k, False: 0]
  ------------------
  863|  9.88k|		return (a->format->has_encrypted_entries)(a);
  864|  9.88k|	}
  865|       |
  866|       |	/* For any other reason we cannot say how many entries are there. */
  867|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  868|  9.88k|}
archive_read_format_capabilities:
  876|  39.3k|{
  877|  39.3k|	struct archive_read *a = (struct archive_read *)_a;
  878|  39.3k|	if (a && a->format && a->format->format_capabilties) {
  ------------------
  |  Branch (878:6): [True: 39.3k, False: 0]
  |  Branch (878:11): [True: 39.3k, False: 0]
  |  Branch (878:24): [True: 19.7k, False: 19.6k]
  ------------------
  879|  19.7k|		return (a->format->format_capabilties)(a);
  880|  19.7k|	}
  881|  19.6k|	return ARCHIVE_READ_FORMAT_CAPS_NONE;
  ------------------
  |  |  402|  19.6k|#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
  ------------------
  882|  39.3k|}
archive_read_data:
  897|  1.25G|{
  898|  1.25G|	struct archive *a = (struct archive *)_a;
  899|  1.25G|	char	*dest;
  900|  1.25G|	const void *read_buf;
  901|  1.25G|	size_t	 bytes_read;
  902|  1.25G|	size_t	 len;
  903|  1.25G|	int	 r;
  904|       |
  905|  1.25G|	bytes_read = 0;
  906|  1.25G|	dest = (char *)buff;
  907|       |
  908|  2.51G|	while (s > 0) {
  ------------------
  |  Branch (908:9): [True: 1.25G, False: 1.25G]
  ------------------
  909|  1.25G|		if (a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (909:7): [True: 1.40M, False: 1.25G]
  ------------------
  910|  1.40M|		    a->read_data_remaining == 0) {
  ------------------
  |  Branch (910:7): [True: 724k, False: 676k]
  ------------------
  911|   724k|			read_buf = a->read_data_block;
  912|   724k|			a->read_data_is_posix_read = 1;
  913|   724k|			a->read_data_requested = s;
  914|   724k|			r = archive_read_data_block(a, &read_buf,
  915|   724k|			    &a->read_data_remaining, &a->read_data_offset);
  916|   724k|			a->read_data_block = read_buf;
  917|   724k|			if (r == ARCHIVE_EOF &&
  ------------------
  |  |  233|  1.44M|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (917:8): [True: 577k, False: 146k]
  ------------------
  918|   577k|			    a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (918:8): [True: 563k, False: 13.8k]
  ------------------
  919|   563k|			    a->read_data_remaining == 0)
  ------------------
  |  Branch (919:8): [True: 563k, False: 0]
  ------------------
  920|   563k|				return (bytes_read);
  921|       |			/*
  922|       |			 * Error codes are all negative, so the status
  923|       |			 * return here cannot be confused with a valid
  924|       |			 * byte count.  (ARCHIVE_OK is zero.)
  925|       |			 */
  926|   160k|			if (r < ARCHIVE_OK)
  ------------------
  |  |  234|   160k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (926:8): [True: 57.1k, False: 103k]
  ------------------
  927|  57.1k|				return (r);
  928|   160k|		}
  929|       |
  930|  1.25G|		if (a->read_data_offset < a->read_data_output_offset) {
  ------------------
  |  Branch (930:7): [True: 2.61k, False: 1.25G]
  ------------------
  931|  2.61k|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  2.61k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  932|  2.61k|			    "Encountered out-of-order sparse blocks");
  933|  2.61k|			return (ARCHIVE_RETRY);
  ------------------
  |  |  235|  2.61k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  934|  2.61k|		}
  935|       |
  936|       |		/* Compute the amount of zero padding needed. */
  937|  1.25G|		if (a->read_data_output_offset + (int64_t)s <
  ------------------
  |  Branch (937:7): [True: 1.25G, False: 777k]
  ------------------
  938|  1.25G|		    a->read_data_offset) {
  939|  1.25G|			len = s;
  940|  1.25G|		} else if (a->read_data_output_offset <
  ------------------
  |  Branch (940:14): [True: 11.9k, False: 765k]
  ------------------
  941|   777k|		    a->read_data_offset) {
  942|  11.9k|			len = (size_t)(a->read_data_offset -
  943|  11.9k|			    a->read_data_output_offset);
  944|  11.9k|		} else
  945|   765k|			len = 0;
  946|       |
  947|       |		/* Add zeroes. */
  948|  1.25G|		memset(dest, 0, len);
  949|  1.25G|		s -= len;
  950|  1.25G|		a->read_data_output_offset += len;
  951|  1.25G|		dest += len;
  952|  1.25G|		bytes_read += len;
  953|       |
  954|       |		/* Copy data if there is any space left. */
  955|  1.25G|		if (s > 0) {
  ------------------
  |  Branch (955:7): [True: 776k, False: 1.25G]
  ------------------
  956|   776k|			len = a->read_data_remaining;
  957|   776k|			if (len > s)
  ------------------
  |  Branch (957:8): [True: 676k, False: 99.9k]
  ------------------
  958|   676k|				len = s;
  959|   776k|			if (len) {
  ------------------
  |  Branch (959:8): [True: 751k, False: 25.3k]
  ------------------
  960|   751k|				memcpy(dest, a->read_data_block, len);
  961|   751k|				s -= len;
  962|   751k|				a->read_data_block += len;
  963|   751k|				a->read_data_remaining -= len;
  964|   751k|				a->read_data_output_offset += len;
  965|   751k|				a->read_data_offset += len;
  966|   751k|				dest += len;
  967|   751k|				bytes_read += len;
  968|   751k|			}
  969|   776k|		}
  970|  1.25G|	}
  971|  1.25G|	a->read_data_is_posix_read = 0;
  972|  1.25G|	a->read_data_requested = 0;
  973|  1.25G|	return (bytes_read);
  974|  1.25G|}
__archive_reset_read_data:
  980|  1.68M|{
  981|  1.68M|	a->read_data_output_offset = 0;
  982|  1.68M|	a->read_data_remaining = 0;
  983|  1.68M|	a->read_data_is_posix_read = 0;
  984|  1.68M|	a->read_data_requested = 0;
  985|       |
  986|       |   /* extra resets, from rar.c */
  987|       |   a->read_data_block = NULL;
  988|  1.68M|   a->read_data_offset = 0;
  989|  1.68M|}
archive_read_data_skip:
  996|   590k|{
  997|   590k|	struct archive_read *a = (struct archive_read *)_a;
  998|   590k|	int r;
  999|   590k|	const void *buff;
 1000|   590k|	size_t size;
 1001|   590k|	int64_t offset;
 1002|       |
 1003|   590k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|   590k|	do { \
  |  |  180|   590k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   590k|			(allowed_states), (function_name)); \
  |  |  182|   590k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|   590k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 590k]
  |  |  ------------------
  |  |  183|   590k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   590k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 590k]
  |  |  ------------------
  ------------------
 1004|   590k|	    ARCHIVE_STATE_DATA | ARCHIVE_STATE_DATA_RECOVERY,
 1005|   590k|	    "archive_read_data_skip");
 1006|       |
 1007|   590k|	if (a->format->read_data_skip != NULL)
  ------------------
  |  Branch (1007:6): [True: 590k, False: 0]
  ------------------
 1008|   590k|		r = (a->format->read_data_skip)(a);
 1009|      0|	else {
 1010|      0|		while ((r = archive_read_data_block(&a->archive,
  ------------------
  |  Branch (1010:10): [True: 0, False: 0]
  ------------------
 1011|      0|			    &buff, &size, &offset))
 1012|      0|		    == ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1013|      0|			;
 1014|      0|	}
 1015|       |
 1016|   590k|	if (r == ARCHIVE_EOF)
  ------------------
  |  |  233|   590k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1016:6): [True: 248, False: 589k]
  ------------------
 1017|    248|		r = ARCHIVE_OK;
  ------------------
  |  |  234|    248|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1018|       |
 1019|   590k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  240|   590k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1019:6): [True: 2.28k, False: 587k]
  ------------------
 1020|  2.28k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  2.28k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1021|   587k|	else
 1022|   587k|		a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   80|   587k|#define	ARCHIVE_STATE_HEADER	0x04U
  ------------------
 1023|   590k|	return (r);
 1024|   590k|}
archive_seek_data:
 1028|  19.6k|{
 1029|  19.6k|	struct archive_read *a = (struct archive_read *)_a;
 1030|  19.6k|	la_int64_t r;
 1031|       |
 1032|  19.6k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  179|  19.6k|	do { \
  |  |  180|  19.6k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  19.6k|			(allowed_states), (function_name)); \
  |  |  182|  19.6k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  19.6k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 19.6k, False: 0]
  |  |  ------------------
  |  |  183|  19.6k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|  19.6k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  19.6k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1033|  19.6k|	    "archive_seek_data_block");
 1034|       |
 1035|      0|	if (a->format->seek_data == NULL) {
  ------------------
  |  Branch (1035:6): [True: 0, False: 0]
  ------------------
 1036|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1037|      0|		    "Cannot seek data with this format");
 1038|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1039|      0|	}
 1040|       |
 1041|      0|	r = (a->format->seek_data)(a, offset, whence);
 1042|      0|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1042:6): [True: 0, False: 0]
  ------------------
 1043|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1044|      0|	return (r);
 1045|      0|}
__archive_read_free_filters:
 1102|  20.4k|{
 1103|       |	/* Make sure filters are closed and their buffers are freed */
 1104|  20.4k|	close_filters(a);
 1105|       |
 1106|  43.4k|	while (a->filter != NULL) {
  ------------------
  |  Branch (1106:9): [True: 23.0k, False: 20.4k]
  ------------------
 1107|  23.0k|		struct archive_read_filter *t = a->filter->upstream;
 1108|  23.0k|		free(a->filter);
 1109|  23.0k|		a->filter = t;
 1110|  23.0k|	}
 1111|  20.4k|}
__archive_read_register_format:
 1283|   362k|{
 1284|   362k|	int i, number_slots;
 1285|       |
 1286|   362k|	archive_check_magic(&a->archive,
  ------------------
  |  |  179|   362k|	do { \
  |  |  180|   362k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   362k|			(allowed_states), (function_name)); \
  |  |  182|   362k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|   362k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 362k]
  |  |  ------------------
  |  |  183|   362k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   362k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 362k]
  |  |  ------------------
  ------------------
 1287|   362k|	    ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
 1288|   362k|	    "__archive_read_register_format");
 1289|       |
 1290|   362k|	number_slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1291|       |
 1292|  2.92M|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1292:14): [True: 2.92M, False: 0]
  ------------------
 1293|  2.92M|		if (a->formats[i].bid == bid)
  ------------------
  |  Branch (1293:7): [True: 40.2k, False: 2.88M]
  ------------------
 1294|  40.2k|			return (ARCHIVE_WARN); /* We've already installed */
  ------------------
  |  |  236|  40.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1295|  2.88M|		if (a->formats[i].bid == NULL) {
  ------------------
  |  Branch (1295:7): [True: 322k, False: 2.55M]
  ------------------
 1296|   322k|			a->formats[i].bid = bid;
 1297|   322k|			a->formats[i].options = options;
 1298|   322k|			a->formats[i].read_header = read_header;
 1299|   322k|			a->formats[i].read_data = read_data;
 1300|   322k|			a->formats[i].read_data_skip = read_data_skip;
 1301|   322k|			a->formats[i].seek_data = seek_data;
 1302|   322k|			a->formats[i].cleanup = cleanup;
 1303|   322k|			a->formats[i].data = format_data;
 1304|   322k|			a->formats[i].name = name;
 1305|   322k|			a->formats[i].format_capabilties = format_capabilities;
 1306|   322k|			a->formats[i].has_encrypted_entries = has_encrypted_entries;
 1307|   322k|			return (ARCHIVE_OK);
  ------------------
  |  |  234|   322k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1308|   322k|		}
 1309|  2.88M|	}
 1310|       |
 1311|      0|	archive_set_error(&a->archive, ENOMEM,
 1312|      0|	    "Not enough slots for format registration");
 1313|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1314|   362k|}
__archive_read_register_bidder:
 1324|   261k|{
 1325|   261k|	struct archive_read_filter_bidder *bidder;
 1326|   261k|	int i, number_slots;
 1327|       |
 1328|   261k|	archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|   261k|	do { \
  |  |  180|   261k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   261k|			(allowed_states), (function_name)); \
  |  |  182|   261k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|   261k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 261k]
  |  |  ------------------
  |  |  183|   261k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   261k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 261k]
  |  |  ------------------
  ------------------
 1329|   261k|	    ARCHIVE_STATE_NEW, "__archive_read_register_bidder");
 1330|       |
 1331|   261k|	number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
 1332|       |
 1333|  1.83M|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1333:14): [True: 1.83M, False: 0]
  ------------------
 1334|  1.83M|		if (a->bidders[i].vtable != NULL)
  ------------------
  |  Branch (1334:7): [True: 1.57M, False: 261k]
  ------------------
 1335|  1.57M|			continue;
 1336|   261k|		memset(a->bidders + i, 0, sizeof(a->bidders[0]));
 1337|   261k|		bidder = (a->bidders + i);
 1338|   261k|		bidder->data = bidder_data;
 1339|   261k|		bidder->vtable = vtable;
 1340|   261k|		if (bidder->vtable->bid == NULL || bidder->vtable->init == NULL) {
  ------------------
  |  Branch (1340:7): [True: 0, False: 261k]
  |  Branch (1340:38): [True: 0, False: 261k]
  ------------------
 1341|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1342|      0|					"Internal error: "
 1343|      0|					"no bid/init for filter bidder");
 1344|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1345|      0|		}
 1346|       |
 1347|   261k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|   261k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1348|   261k|	}
 1349|       |
 1350|      0|	archive_set_error(&a->archive, ENOMEM,
 1351|      0|	    "Not enough slots for filter registration");
 1352|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1353|   261k|}
__archive_read_ahead:
 1440|  25.0M|{
 1441|  25.0M|	return (__archive_read_filter_ahead(a->filter, min, avail));
 1442|  25.0M|}
__archive_read_filter_ahead:
 1447|  32.5M|{
 1448|  32.5M|	ssize_t bytes_read;
 1449|  32.5M|	size_t min, tocopy;
 1450|       |
 1451|  32.5M|	if (f->fatal) {
  ------------------
  |  Branch (1451:6): [True: 4.31k, False: 32.5M]
  ------------------
 1452|  4.31k|		if (avail)
  ------------------
  |  Branch (1452:7): [True: 1.51k, False: 2.79k]
  ------------------
 1453|  1.51k|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  240|  1.51k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1454|  4.31k|		return (NULL);
 1455|  4.31k|	}
 1456|       |	/* request == 0 is perfectly well-defined.*/
 1457|  32.5M|	min = request == 0 ? 1 : request;
  ------------------
  |  Branch (1457:8): [True: 72.5k, False: 32.4M]
  ------------------
 1458|       |
 1459|       |	/*
 1460|       |	 * Keep pulling more data until we can satisfy the request.
 1461|       |	 */
 1462|  38.2M|	for (;;) {
 1463|       |
 1464|       |		/*
 1465|       |		 * We can satisfy directly from client buffer if everything
 1466|       |		 * currently in the copy buffer is still in the client buffer.
 1467|       |		 */
 1468|  38.2M|		if (f->client_total >= f->client_avail + f->avail
  ------------------
  |  Branch (1468:7): [True: 18.8M, False: 19.4M]
  ------------------
 1469|  18.8M|		    && f->client_avail + f->avail >= min) {
  ------------------
  |  Branch (1469:10): [True: 18.7M, False: 111k]
  ------------------
 1470|       |			/* "Roll back" to client buffer. */
 1471|  18.7M|			f->client_avail += f->avail;
 1472|  18.7M|			f->client_next -= f->avail;
 1473|       |			/* Copy buffer is now empty. */
 1474|  18.7M|			f->avail = 0;
 1475|  18.7M|			f->next = f->buffer;
 1476|       |			/* Return data from client buffer. */
 1477|  18.7M|			if (avail != NULL)
  ------------------
  |  Branch (1477:8): [True: 4.33M, False: 14.3M]
  ------------------
 1478|  4.33M|				*avail = f->client_avail;
 1479|  18.7M|			return (f->client_next);
 1480|  18.7M|		}
 1481|       |
 1482|       |		/* If we can satisfy from the copy buffer, we're done. */
 1483|  19.5M|		if (f->avail >= min) {
  ------------------
  |  Branch (1483:7): [True: 13.7M, False: 5.83M]
  ------------------
 1484|  13.7M|			if (avail != NULL)
  ------------------
  |  Branch (1484:8): [True: 13.2M, False: 459k]
  ------------------
 1485|  13.2M|				*avail = f->avail;
 1486|  13.7M|			return (f->next);
 1487|  13.7M|		}
 1488|       |
 1489|       |		/* If we've used up the client data, get more. */
 1490|  5.83M|		if (f->client_avail <= 0) {
  ------------------
  |  Branch (1490:7): [True: 144k, False: 5.68M]
  ------------------
 1491|   144k|			bytes_read = read_client_data(f);
 1492|   144k|			if (bytes_read < 0) {
  ------------------
  |  Branch (1492:8): [True: 898, False: 143k]
  ------------------
 1493|       |				/* Read error. */
 1494|    898|				if (avail != NULL)
  ------------------
  |  Branch (1494:9): [True: 615, False: 283]
  ------------------
 1495|    615|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  240|    615|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1496|    898|				return (NULL);
 1497|    898|			}
 1498|   143k|			if (bytes_read == 0) {
  ------------------
  |  Branch (1498:8): [True: 66.9k, False: 76.2k]
  ------------------
 1499|  66.9k|				static const char *empty = "";
 1500|  66.9k|				const char *eof;
 1501|       |
 1502|       |				/* Premature end-of-file.
 1503|       |				 * Return whatever we do have. */
 1504|  66.9k|				if (avail != NULL)
  ------------------
  |  Branch (1504:9): [True: 49.3k, False: 17.5k]
  ------------------
 1505|  49.3k|					*avail = f->avail;
 1506|  66.9k|				if (request == 0)
  ------------------
  |  Branch (1506:9): [True: 37, False: 66.8k]
  ------------------
 1507|     37|					eof = f->avail == 0 ? empty : f->next;
  ------------------
  |  Branch (1507:12): [True: 37, False: 0]
  ------------------
 1508|  66.8k|				else
 1509|  66.8k|				 	eof = NULL;
 1510|  66.9k|				return (eof);
 1511|  66.9k|			}
 1512|  5.68M|		} else {
 1513|       |			/*
 1514|       |			 * We can't satisfy the request from the copy
 1515|       |			 * buffer or the existing client data, so we
 1516|       |			 * need to copy more client data over to the
 1517|       |			 * copy buffer.
 1518|       |			 */
 1519|       |
 1520|       |			/* Ensure the buffer is big enough. */
 1521|  5.68M|			if (min > f->buffer_size) {
  ------------------
  |  Branch (1521:8): [True: 18.7k, False: 5.66M]
  ------------------
 1522|  18.7k|				size_t s;
 1523|  18.7k|				char *p;
 1524|       |
 1525|       |				/* Double the buffer; watch for overflow. */
 1526|  18.7k|				s = f->buffer_size;
 1527|  18.7k|				if (s == 0)
  ------------------
  |  Branch (1527:9): [True: 17.0k, False: 1.67k]
  ------------------
 1528|  17.0k|					s = min;
 1529|  23.1k|				while (s < min) {
  ------------------
  |  Branch (1529:12): [True: 4.34k, False: 18.7k]
  ------------------
 1530|  4.34k|					if (archive_ckd_mul_size(&s, s, 2)) {
  ------------------
  |  Branch (1530:10): [True: 0, False: 4.34k]
  ------------------
 1531|       |						/* Integer overflow! */
 1532|      0|						archive_set_error(
 1533|      0|						    &f->archive->archive,
 1534|      0|						    ENOMEM,
 1535|      0|						    "Unable to allocate copy"
 1536|      0|						    " buffer");
 1537|      0|						f->fatal = 1;
 1538|      0|						if (avail != NULL)
  ------------------
  |  Branch (1538:11): [True: 0, False: 0]
  ------------------
 1539|      0|							*avail = ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1540|      0|						return (NULL);
 1541|      0|					}
 1542|  4.34k|				}
 1543|       |				/* Now s >= min, so allocate a new buffer. */
 1544|  18.7k|				p = malloc(s);
 1545|  18.7k|				if (p == NULL) {
  ------------------
  |  Branch (1545:9): [True: 6, False: 18.7k]
  ------------------
 1546|      6|					archive_set_error(
 1547|      6|						&f->archive->archive,
 1548|      6|						ENOMEM,
 1549|      6|					    "Unable to allocate copy buffer");
 1550|      6|					f->fatal = 1;
 1551|      6|					if (avail != NULL)
  ------------------
  |  Branch (1551:10): [True: 0, False: 6]
  ------------------
 1552|      0|						*avail = ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1553|      6|					return (NULL);
 1554|      6|				}
 1555|       |				/* Move data into newly-enlarged buffer. */
 1556|  18.7k|				if (f->avail > 0)
  ------------------
  |  Branch (1556:9): [True: 1.12k, False: 17.6k]
  ------------------
 1557|  1.12k|					memcpy(p, f->next, f->avail);
 1558|  18.7k|				free(f->buffer);
 1559|  18.7k|				f->next = f->buffer = p;
 1560|  18.7k|				f->buffer_size = s;
 1561|  5.66M|			} else if (f->next > f->buffer &&
  ------------------
  |  Branch (1561:15): [True: 16.6k, False: 5.65M]
  ------------------
 1562|  16.6k|			    min > f->buffer_size - (f->next - f->buffer)) {
  ------------------
  |  Branch (1562:8): [True: 12.6k, False: 4.03k]
  ------------------
 1563|       |				/* Move data forward in copy buffer
 1564|       |				 * if necessary. */
 1565|  12.6k|				if (f->avail > 0)
  ------------------
  |  Branch (1565:9): [True: 12.5k, False: 32]
  ------------------
 1566|  12.5k|					memmove(f->buffer, f->next,
 1567|  12.5k|					    f->avail);
 1568|  12.6k|				f->next = f->buffer;
 1569|  12.6k|			}
 1570|       |
 1571|       |			/* We can add client data to copy buffer. */
 1572|       |			/* Don't waste time buffering more than we need to. */
 1573|  5.68M|			tocopy = min - f->avail;
 1574|       |			/* Don't copy more than is available. */
 1575|  5.68M|			if (tocopy > f->client_avail)
  ------------------
  |  Branch (1575:8): [True: 35.0k, False: 5.65M]
  ------------------
 1576|  35.0k|				tocopy = f->client_avail;
 1577|       |
 1578|  5.68M|			memcpy(f->next + f->avail,
 1579|  5.68M|			    f->client_next, tocopy);
 1580|       |			/* Remove this data from client buffer. */
 1581|  5.68M|			f->client_next += tocopy;
 1582|  5.68M|			f->client_avail -= tocopy;
 1583|       |			/* add it to copy buffer. */
 1584|  5.68M|			f->avail += tocopy;
 1585|  5.68M|		}
 1586|  5.83M|	}
 1587|  32.5M|}
__archive_read_consume:
 1594|  25.6M|{
 1595|  25.6M|	return (__archive_read_filter_consume(a->filter, request));
 1596|  25.6M|}
__archive_read_filter_consume:
 1601|  25.7M|{
 1602|  25.7M|	int64_t skipped;
 1603|       |
 1604|  25.7M|	if (request < 0)
  ------------------
  |  Branch (1604:6): [True: 11, False: 25.7M]
  ------------------
 1605|     11|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1606|  25.7M|	if (request == 0)
  ------------------
  |  Branch (1606:6): [True: 1.22M, False: 24.5M]
  ------------------
 1607|  1.22M|		return 0;
 1608|       |
 1609|  24.5M|	skipped = advance_file_pointer(f, request);
 1610|  24.5M|	if (skipped == request)
  ------------------
  |  Branch (1610:6): [True: 24.5M, False: 4.76k]
  ------------------
 1611|  24.5M|		return (skipped);
 1612|       |	/* We hit EOF before we satisfied the skip request. */
 1613|  4.76k|	if (skipped < 0)  /* Map error code to 0 for error message below. */
  ------------------
  |  Branch (1613:6): [True: 122, False: 4.64k]
  ------------------
 1614|    122|		skipped = 0;
 1615|  4.76k|	archive_set_error(&f->archive->archive,
 1616|  4.76k|	    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  4.76k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1617|  4.76k|	    "Truncated input file (needed %jd bytes, only %jd available)",
 1618|  4.76k|	    (intmax_t)request, (intmax_t)skipped);
 1619|  4.76k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|  4.76k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1620|  24.5M|}
__archive_read_seek:
 1767|  18.6k|{
 1768|  18.6k|	return __archive_read_filter_seek(a->filter, offset, whence);
 1769|  18.6k|}
__archive_read_filter_seek:
 1774|  18.6k|{
 1775|  18.6k|	struct archive_read_client *client;
 1776|  18.6k|	int64_t old_position, r;
 1777|  18.6k|	unsigned int cursor, old_cursor;
 1778|       |
 1779|  18.6k|	if (f->closed || f->fatal)
  ------------------
  |  Branch (1779:6): [True: 0, False: 18.6k]
  |  Branch (1779:19): [True: 191, False: 18.4k]
  ------------------
 1780|    191|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    191|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1781|  18.4k|	if (f->can_seek == 0)
  ------------------
  |  Branch (1781:6): [True: 552, False: 17.9k]
  ------------------
 1782|    552|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|    552|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1783|       |
 1784|  17.9k|	client = &(f->archive->client);
 1785|  17.9k|	old_cursor = client->cursor;
 1786|  17.9k|	old_position = f->position;
 1787|       |
 1788|  17.9k|	switch (whence) {
 1789|      0|	case SEEK_CUR:
  ------------------
  |  Branch (1789:2): [True: 0, False: 17.9k]
  ------------------
 1790|       |		/* Adjust the offset and use SEEK_SET instead */
 1791|      0|		offset += f->position;
 1792|      0|		__LA_FALLTHROUGH;
 1793|  2.11k|	case SEEK_SET:
  ------------------
  |  Branch (1793:2): [True: 2.11k, False: 15.8k]
  ------------------
 1794|  2.11k|		cursor = 0;
 1795|  2.11k|		while (1)
  ------------------
  |  Branch (1795:10): [True: 2.11k, Folded]
  ------------------
 1796|  2.11k|		{
 1797|  2.11k|			if (client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1797:8): [True: 792, False: 1.32k]
  ------------------
 1798|  1.32k|			    client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1798:8): [True: 1.30k, False: 18]
  ------------------
 1799|  1.32k|			      client->dataset[cursor].total_size > offset ||
 1800|     18|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1800:8): [True: 18, False: 0]
  ------------------
 1801|  2.11k|				break;
 1802|      0|			r = client->dataset[cursor].begin_position +
 1803|      0|				client->dataset[cursor].total_size;
 1804|      0|			client->dataset[++cursor].begin_position = r;
 1805|      0|		}
 1806|  2.11k|		while (1) {
  ------------------
  |  Branch (1806:10): [True: 2.11k, Folded]
  ------------------
 1807|  2.11k|			r = client_switch_proxy(f, cursor);
 1808|  2.11k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  2.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1808:8): [True: 0, False: 2.11k]
  ------------------
 1809|      0|				goto clear_buffer;
 1810|  2.11k|			if (client->dataset[cursor].total_size < 0) {
  ------------------
  |  Branch (1810:8): [True: 792, False: 1.32k]
  ------------------
 1811|    792|				if ((r = client_seek_proxy(f,
  ------------------
  |  Branch (1811:9): [True: 0, False: 792]
  ------------------
 1812|    792|				    0, SEEK_END)) < 0)
 1813|      0|					goto clear_buffer;
 1814|    792|				client->dataset[cursor].total_size = r;
 1815|    792|				f->position = r +
 1816|    792|				    client->dataset[cursor].begin_position;
 1817|    792|			}
 1818|  2.11k|			if (client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1818:8): [True: 2.05k, False: 57]
  ------------------
 1819|  2.11k|			    client->dataset[cursor].total_size > offset ||
 1820|     57|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1820:8): [True: 57, False: 0]
  ------------------
 1821|  2.11k|				break;
 1822|      0|			r = client->dataset[cursor].begin_position +
 1823|      0|				client->dataset[cursor].total_size;
 1824|      0|			client->dataset[++cursor].begin_position = r;
 1825|      0|		}
 1826|  2.11k|		offset -= client->dataset[cursor].begin_position;
 1827|  2.11k|		if (offset < 0
  ------------------
  |  Branch (1827:7): [True: 35, False: 2.07k]
  ------------------
 1828|  2.07k|		    || offset > client->dataset[cursor].total_size) {
  ------------------
  |  Branch (1828:10): [True: 56, False: 2.02k]
  ------------------
 1829|     91|			archive_set_error(&f->archive->archive,
 1830|     91|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     91|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1831|     91|			    "Seek position is outside the input");
 1832|     91|			r = ARCHIVE_FATAL;
  ------------------
  |  |  240|     91|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1833|     91|			goto clear_buffer;
 1834|     91|		}
 1835|  2.02k|		if ((r = client_seek_proxy(f, offset, SEEK_SET)) < 0)
  ------------------
  |  Branch (1835:7): [True: 0, False: 2.02k]
  ------------------
 1836|      0|			goto clear_buffer;
 1837|  2.02k|		break;
 1838|       |
 1839|  15.8k|	case SEEK_END:
  ------------------
  |  Branch (1839:2): [True: 15.8k, False: 2.11k]
  ------------------
 1840|  15.8k|		r = get_archive_size(f);
 1841|  15.8k|		if (r < 0)
  ------------------
  |  Branch (1841:7): [True: 0, False: 15.8k]
  ------------------
 1842|      0|			goto clear_buffer;
 1843|  15.8k|		cursor = client->nodes - 1;
 1844|  15.8k|		while (1) {
  ------------------
  |  Branch (1844:10): [True: 15.8k, Folded]
  ------------------
 1845|  15.8k|			if (r + offset >=
  ------------------
  |  Branch (1845:8): [True: 15.8k, False: 0]
  ------------------
 1846|  15.8k|			    client->dataset[cursor].begin_position)
 1847|  15.8k|				break;
 1848|      0|			offset += client->dataset[cursor].total_size;
 1849|      0|			if (cursor == 0)
  ------------------
  |  Branch (1849:8): [True: 0, False: 0]
  ------------------
 1850|      0|				break;
 1851|      0|			cursor--;
 1852|      0|			r = client->dataset[cursor].begin_position +
 1853|      0|				client->dataset[cursor].total_size;
 1854|      0|		}
 1855|  15.8k|		offset = (r + offset) - client->dataset[cursor].begin_position;
 1856|  15.8k|		if ((r = client_switch_proxy(f, cursor)) != ARCHIVE_OK)
  ------------------
  |  |  234|  15.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1856:7): [True: 0, False: 15.8k]
  ------------------
 1857|      0|			goto clear_buffer;
 1858|  15.8k|		r = client_seek_proxy(f, offset, SEEK_SET);
 1859|  15.8k|		if (r < ARCHIVE_OK)
  ------------------
  |  |  234|  15.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1859:7): [True: 0, False: 15.8k]
  ------------------
 1860|      0|			goto clear_buffer;
 1861|  15.8k|		break;
 1862|       |
 1863|  15.8k|	default:
  ------------------
  |  Branch (1863:2): [True: 0, False: 17.9k]
  ------------------
 1864|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1865|  17.9k|	}
 1866|  17.8k|	r += client->dataset[cursor].begin_position;
 1867|  17.8k|	f->position = r;
 1868|       |
 1869|  17.9k|clear_buffer:
 1870|  17.9k|	if (r == ARCHIVE_FAILED &&
  ------------------
  |  |  238|  35.8k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1870:6): [True: 0, False: 17.9k]
  ------------------
 1871|      0|	    old_cursor == client->cursor && old_position == f->position) {
  ------------------
  |  Branch (1871:6): [True: 0, False: 0]
  |  Branch (1871:38): [True: 0, False: 0]
  ------------------
 1872|       |		/* Seek failed without moving position: keep buffer */
 1873|      0|		return (r);
 1874|      0|	}
 1875|       |
 1876|       |	/*
 1877|       |	 * Ouch.  Clearing the buffer like this hurts, especially
 1878|       |	 * at bid time.  A lot of our efficiency at bid time comes
 1879|       |	 * from having bidders reuse the data we've already read.
 1880|       |	 *
 1881|       |	 * TODO: If the seek request is in data we already
 1882|       |	 * have, then don't call the seek callback.
 1883|       |	 *
 1884|       |	 * TODO: Zip seeks to end-of-file at bid time.  If
 1885|       |	 * other formats also start doing this, we may need to
 1886|       |	 * find a way for clients to fudge the seek offset to
 1887|       |	 * a block boundary.
 1888|       |	 *
 1889|       |	 * Hmmm... If whence was SEEK_END, we know the file
 1890|       |	 * size is (r - offset).  Can we use that to simplify
 1891|       |	 * the TODO items above?
 1892|       |	*/
 1893|  17.9k|	f->avail = f->client_avail = 0;
 1894|  17.9k|	f->next = f->buffer;
 1895|  17.9k|	if (r >= 0)
  ------------------
  |  Branch (1895:6): [True: 17.8k, False: 91]
  ------------------
 1896|  17.8k|		f->end_of_file = 0;
 1897|     91|	else {
 1898|     91|		f->position = -1;
 1899|     91|		f->fatal = 1;
 1900|     91|	}
 1901|       |
 1902|  17.9k|	return r;
 1903|  17.9k|}
archive_read.c:_archive_read_free:
 1160|  20.1k|{
 1161|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
 1162|  20.1k|	struct archive_read_passphrase *p;
 1163|  20.1k|	int i, n;
 1164|  20.1k|	int slots;
 1165|  20.1k|	int r = ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1166|       |
 1167|  20.1k|	if (_a == NULL)
  ------------------
  |  Branch (1167:6): [True: 0, False: 20.1k]
  ------------------
 1168|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1169|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
 1170|  20.1k|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_free");
 1171|  20.1k|	if (a->archive.state != ARCHIVE_STATE_CLOSED
  ------------------
  |  |   93|  40.2k|#define	ARCHIVE_STATE_CLOSED	0x40U
  ------------------
  |  Branch (1171:6): [True: 20.1k, False: 0]
  ------------------
 1172|  20.1k|	    && a->archive.state != ARCHIVE_STATE_FATAL)
  ------------------
  |  |   96|  20.1k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (1172:9): [True: 0, False: 20.1k]
  ------------------
 1173|      0|		r = archive_read_close(&a->archive);
 1174|       |
 1175|       |	/* Call cleanup functions registered by optional components. */
 1176|  20.1k|	if (a->cleanup_archive_extract != NULL)
  ------------------
  |  Branch (1176:6): [True: 0, False: 20.1k]
  ------------------
 1177|      0|		r = (a->cleanup_archive_extract)(a);
 1178|       |
 1179|       |	/* Cleanup format-specific data. */
 1180|  20.1k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1181|   342k|	for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (1181:14): [True: 322k, False: 20.1k]
  ------------------
 1182|   322k|		a->format = &(a->formats[i]);
 1183|   322k|		if (a->formats[i].cleanup)
  ------------------
  |  Branch (1183:7): [True: 302k, False: 20.1k]
  ------------------
 1184|   302k|			(a->formats[i].cleanup)(a);
 1185|   322k|	}
 1186|       |
 1187|       |	/* Free the filters */
 1188|  20.1k|	__archive_read_free_filters(a);
 1189|       |
 1190|       |	/* Release the bidder objects. */
 1191|  20.1k|	n = sizeof(a->bidders)/sizeof(a->bidders[0]);
 1192|   342k|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1192:14): [True: 322k, False: 20.1k]
  ------------------
 1193|   322k|		if (a->bidders[i].vtable == NULL ||
  ------------------
  |  Branch (1193:7): [True: 60.4k, False: 261k]
  ------------------
 1194|   261k|		    a->bidders[i].vtable->free == NULL)
  ------------------
  |  Branch (1194:7): [True: 241k, False: 20.1k]
  ------------------
 1195|   302k|			continue;
 1196|  20.1k|		(a->bidders[i].vtable->free)(&a->bidders[i]);
 1197|  20.1k|	}
 1198|       |
 1199|       |	/* Release passphrase list. */
 1200|  20.1k|	p = a->passphrases.first;
 1201|  40.2k|	while (p != NULL) {
  ------------------
  |  Branch (1201:9): [True: 20.1k, False: 20.1k]
  ------------------
 1202|  20.1k|		struct archive_read_passphrase *np = p->next;
 1203|       |
 1204|       |		/* A passphrase should be cleaned. */
 1205|  20.1k|		memset(p->passphrase, 0, strlen(p->passphrase));
 1206|  20.1k|		free(p->passphrase);
 1207|  20.1k|		free(p);
 1208|  20.1k|		p = np;
 1209|  20.1k|	}
 1210|       |
 1211|  20.1k|	archive_string_free(&a->archive.error_string);
 1212|  20.1k|	archive_entry_free(a->entry);
 1213|  20.1k|	a->archive.magic = 0;
 1214|  20.1k|	__archive_clean(&a->archive);
 1215|  20.1k|	free(a->client.dataset);
 1216|  20.1k|	free(a);
 1217|  20.1k|	return (r);
 1218|  20.1k|}
archive_read.c:_archive_read_next_header:
  741|  1.69M|{
  742|  1.69M|	int ret;
  743|  1.69M|	struct archive_read *a = (struct archive_read *)_a;
  744|       |	*entryp = NULL;
  745|  1.69M|	ret = _archive_read_next_header2(_a, a->entry);
  746|  1.69M|	*entryp = a->entry;
  747|  1.69M|	return ret;
  748|  1.69M|}
archive_read.c:_archive_read_next_header2:
  655|  1.69M|{
  656|  1.69M|	struct archive_read *a = (struct archive_read *)_a;
  657|  1.69M|	int r1 = ARCHIVE_OK, r2;
  ------------------
  |  |  234|  1.69M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  658|       |
  659|  1.69M|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  1.69M|	do { \
  |  |  180|  1.69M|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  1.69M|			(allowed_states), (function_name)); \
  |  |  182|  1.69M|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  1.69M|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 1.69M]
  |  |  ------------------
  |  |  183|  1.69M|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  1.69M|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 1.69M]
  |  |  ------------------
  ------------------
  660|  1.69M|	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA |
  661|  1.69M|	    ARCHIVE_STATE_DATA_RECOVERY,
  662|  1.69M|	    "archive_read_next_header");
  663|       |
  664|  1.69M|	archive_entry_clear(entry);
  665|  1.69M|	archive_clear_error(&a->archive);
  666|       |
  667|       |	/*
  668|       |	 * If client didn't consume entire data, skip any remainder
  669|       |	 * (This is especially important for GNU incremental directories.)
  670|       |	 * A header that failed to parse (DATA_RECOVERY) still needs the
  671|       |	 * same treatment: whatever of its body the format reader left
  672|       |	 * unconsumed must be skipped before we can read the next header.
  673|       |	 */
  674|  1.69M|	if (a->archive.state == ARCHIVE_STATE_DATA ||
  ------------------
  |  |   84|  3.38M|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  |  Branch (674:6): [True: 590k, False: 1.10M]
  ------------------
  675|  1.10M|	    a->archive.state == ARCHIVE_STATE_DATA_RECOVERY) {
  ------------------
  |  |   88|  1.10M|#define	ARCHIVE_STATE_DATA_RECOVERY	0x10U
  ------------------
  |  Branch (675:6): [True: 0, False: 1.10M]
  ------------------
  676|   590k|		r1 = archive_read_data_skip(&a->archive);
  677|   590k|		if (r1 == ARCHIVE_EOF)
  ------------------
  |  |  233|   590k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (677:7): [True: 0, False: 590k]
  ------------------
  678|      0|			archive_set_error(&a->archive, EIO,
  679|      0|			    "Premature end-of-file");
  680|   590k|		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  233|  1.18M|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  240|   590k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (680:7): [True: 0, False: 590k]
  |  Branch (680:28): [True: 2.28k, False: 587k]
  ------------------
  681|  2.28k|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  2.28k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  682|  2.28k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|  2.28k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  683|  2.28k|		}
  684|   590k|	}
  685|       |
  686|       |	/* Record start-of-header offset in uncompressed stream. */
  687|  1.68M|	a->header_position = a->filter->position;
  688|       |
  689|  1.68M|	++_a->file_count;
  690|  1.68M|	r2 = (a->format->read_header)(a, entry);
  691|       |
  692|       |	/*
  693|       |	 * EOF and FATAL are persistent at this layer.  By
  694|       |	 * modifying the state, we guarantee that future calls to
  695|       |	 * read a header or read data will fail.
  696|       |	 */
  697|  1.68M|	switch (r2) {
  ------------------
  |  Branch (697:10): [True: 1.68M, False: 0]
  ------------------
  698|  3.52k|	case ARCHIVE_EOF:
  ------------------
  |  |  233|  3.52k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (698:2): [True: 3.52k, False: 1.68M]
  ------------------
  699|  3.52k|		a->archive.state = ARCHIVE_STATE_EOF;
  ------------------
  |  |   91|  3.52k|#define	ARCHIVE_STATE_EOF	0x20U
  ------------------
  700|  3.52k|		--_a->file_count;/* Revert a file counter. */
  701|  3.52k|		break;
  702|   547k|	case ARCHIVE_OK:
  ------------------
  |  |  234|   547k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (702:2): [True: 547k, False: 1.14M]
  ------------------
  703|   547k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   84|   547k|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  704|   547k|		break;
  705|  45.7k|	case ARCHIVE_WARN:
  ------------------
  |  |  236|  45.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (705:2): [True: 45.7k, False: 1.64M]
  ------------------
  706|  45.7k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   84|  45.7k|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  707|  45.7k|		break;
  708|  1.08M|	case ARCHIVE_RETRY:
  ------------------
  |  |  235|  1.08M|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (708:2): [True: 1.08M, False: 607k]
  ------------------
  709|  1.08M|		break;
  710|  10.9k|	case ARCHIVE_FATAL:
  ------------------
  |  |  240|  10.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (710:2): [True: 10.9k, False: 1.67M]
  ------------------
  711|  10.9k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  10.9k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  712|  10.9k|		break;
  713|    100|	case ARCHIVE_FAILED:
  ------------------
  |  |  238|    100|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (713:2): [True: 100, False: 1.68M]
  ------------------
  714|       |		/*
  715|       |		 * This entry's header could not be parsed, so its metadata
  716|       |		 * cannot be trusted.  ARCHIVE_STATE_DATA_RECOVERY still
  717|       |		 * permits skipping past it (the format reader is
  718|       |		 * responsible for ensuring that's actually possible), but
  719|       |		 * blocks archive_read_data() and friends, which all check
  720|       |		 * for ARCHIVE_STATE_DATA specifically and would otherwise
  721|       |		 * return content for an entry we don't actually understand.
  722|       |		 */
  723|    100|		a->archive.state = ARCHIVE_STATE_DATA_RECOVERY;
  ------------------
  |  |   88|    100|#define	ARCHIVE_STATE_DATA_RECOVERY	0x10U
  ------------------
  724|    100|		break;
  725|  1.68M|	}
  726|       |
  727|  1.68M|	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  234|  3.37M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  236|  1.14M|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (727:6): [True: 547k, False: 1.14M]
  |  Branch (727:26): [True: 45.7k, False: 1.09M]
  ------------------
  728|   592k|		a->entry_bytes_declared = archive_entry_size_is_set(entry)
  ------------------
  |  Branch (728:29): [True: 579k, False: 13.1k]
  ------------------
  729|   592k|		    ? archive_entry_size(entry) : -1;
  730|  1.09M|	else
  731|  1.09M|		a->entry_bytes_declared = -1;
  732|       |
  733|  1.68M|	__archive_reset_read_data(&a->archive);
  734|       |
  735|       |	/* EOF always wins; otherwise return the worst error. */
  736|  1.68M|	return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1;
  ------------------
  |  |  233|   552k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (736:10): [True: 1.13M, False: 552k]
  |  Branch (736:21): [True: 3.52k, False: 548k]
  ------------------
  737|  1.68M|}
archive_read.c:_archive_read_data_block:
 1058|   724k|{
 1059|   724k|	struct archive_read *a = (struct archive_read *)_a;
 1060|   724k|	int r;
 1061|       |
 1062|   724k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  179|   724k|	do { \
  |  |  180|   724k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   724k|			(allowed_states), (function_name)); \
  |  |  182|   724k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|   724k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 100, False: 724k]
  |  |  ------------------
  |  |  183|   724k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|    100|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   724k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 724k]
  |  |  ------------------
  ------------------
 1063|   724k|	    "archive_read_data_block");
 1064|       |
 1065|   724k|	if (a->format->read_data == NULL) {
  ------------------
  |  Branch (1065:6): [True: 0, False: 724k]
  ------------------
 1066|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1067|      0|		    "Internal error: "
 1068|      0|		    "No format->read_data function registered");
 1069|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1070|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1071|      0|	}
 1072|       |
 1073|   724k|	r = (a->format->read_data)(a, buff, size, offset);
 1074|   724k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  240|   724k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1074:6): [True: 2.84k, False: 721k]
  ------------------
 1075|  2.84k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  2.84k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1076|   724k|	return (r);
 1077|   724k|}
archive_read.c:_archive_filter_bytes:
 1261|    550|{
 1262|    550|	struct archive_read_filter *f = get_filter(_a, n);
 1263|    550|	return f == NULL ? -1 : f->position;
  ------------------
  |  Branch (1263:9): [True: 0, False: 550]
  ------------------
 1264|    550|}
archive_read.c:get_filter:
 1222|    550|{
 1223|    550|	struct archive_read *a = (struct archive_read *)_a;
 1224|    550|	struct archive_read_filter *f = a->filter;
 1225|       |	/* We use n == -1 for 'the last filter', which is always the
 1226|       |	 * client proxy. */
 1227|    550|	if (n == -1 && f != NULL) {
  ------------------
  |  Branch (1227:6): [True: 0, False: 550]
  |  Branch (1227:17): [True: 0, False: 0]
  ------------------
 1228|      0|		struct archive_read_filter *last = f;
 1229|      0|		f = f->upstream;
 1230|      0|		while (f != NULL) {
  ------------------
  |  Branch (1230:10): [True: 0, False: 0]
  ------------------
 1231|      0|			last = f;
 1232|      0|			f = f->upstream;
 1233|      0|		}
 1234|      0|		return (last);
 1235|      0|	}
 1236|    550|	if (n < 0)
  ------------------
  |  Branch (1236:6): [True: 0, False: 550]
  ------------------
 1237|      0|		return NULL;
 1238|    550|	while (n > 0 && f != NULL) {
  ------------------
  |  Branch (1238:9): [True: 0, False: 550]
  |  Branch (1238:18): [True: 0, False: 0]
  ------------------
 1239|      0|		f = f->upstream;
 1240|      0|		--n;
 1241|      0|	}
 1242|    550|	return (f);
 1243|    550|}
archive_read.c:client_read_proxy:
  223|  54.6k|{
  224|  54.6k|	ssize_t bytes_read = 0;
  225|       |
  226|  54.6k|	for (;;) {
  227|  54.6k|		bytes_read = (f->archive->client.reader)(&f->archive->archive,
  228|  54.6k|		    f->data, buff);
  229|  54.6k|		if (bytes_read == 0) {
  ------------------
  |  Branch (229:7): [True: 24.5k, False: 30.0k]
  ------------------
  230|  24.5k|			unsigned int cursor = f->archive->client.cursor;
  231|       |
  232|       |			/* Continue with next client object if available. */
  233|  24.5k|			if (cursor != f->archive->client.nodes - 1 &&
  ------------------
  |  Branch (233:8): [True: 0, False: 24.5k]
  ------------------
  234|      0|			    client_switch_proxy(f, cursor + 1) == ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (234:8): [True: 0, False: 0]
  ------------------
  235|      0|				continue;
  236|  24.5k|		}
  237|  54.6k|		break;
  238|  54.6k|	}
  239|       |
  240|  54.6k|	return (bytes_read);
  241|  54.6k|}
archive_read.c:client_close_proxy:
  264|  20.1k|{
  265|  20.1k|	struct archive_read *a = f->archive;
  266|  20.1k|	int r = ARCHIVE_OK, r2;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  267|  20.1k|	unsigned int i;
  268|       |
  269|  20.1k|	if (a->client.closer == NULL)
  ------------------
  |  Branch (269:6): [True: 0, False: 20.1k]
  ------------------
  270|      0|		return (r);
  271|  40.2k|	for (i = 0; i < a->client.nodes; i++)
  ------------------
  |  Branch (271:14): [True: 20.1k, False: 20.1k]
  ------------------
  272|  20.1k|	{
  273|  20.1k|		r2 = (a->client.closer)
  274|  20.1k|			((struct archive *)a, a->client.dataset[i].data);
  275|  20.1k|		if (r > r2)
  ------------------
  |  Branch (275:7): [True: 0, False: 20.1k]
  ------------------
  276|      0|			r = r2;
  277|  20.1k|	}
  278|  20.1k|	return (r);
  279|  20.1k|}
archive_read.c:choose_filters:
  589|  20.1k|{
  590|  20.1k|	int number_bidders, i, bid, best_bid, number_filters;
  591|  20.1k|	struct archive_read_filter_bidder *bidder, *best_bidder;
  592|  20.1k|	struct archive_read_filter *f;
  593|  20.1k|	ssize_t avail;
  594|  20.1k|	int r;
  595|       |
  596|  23.0k|	for (number_filters = 0; number_filters < MAX_NUMBER_FILTERS; ++number_filters) {
  ------------------
  |  |  585|  23.0k|#define MAX_NUMBER_FILTERS 25
  ------------------
  |  Branch (596:27): [True: 23.0k, False: 1]
  ------------------
  597|  23.0k|		number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
  598|       |
  599|  23.0k|		best_bid = 0;
  600|  23.0k|		best_bidder = NULL;
  601|       |
  602|  23.0k|		bidder = a->bidders;
  603|   391k|		for (i = 0; i < number_bidders; i++, bidder++) {
  ------------------
  |  Branch (603:15): [True: 368k, False: 23.0k]
  ------------------
  604|   368k|			if (bidder->vtable == NULL)
  ------------------
  |  Branch (604:8): [True: 69.0k, False: 299k]
  ------------------
  605|  69.0k|				continue;
  606|   299k|			bid = (bidder->vtable->bid)(bidder, a->filter);
  607|   299k|			if (bid > best_bid) {
  ------------------
  |  Branch (607:8): [True: 2.86k, False: 296k]
  ------------------
  608|  2.86k|				best_bid = bid;
  609|  2.86k|				best_bidder = bidder;
  610|  2.86k|			}
  611|   299k|		}
  612|       |
  613|       |		/* If no bidder, we're done. */
  614|  23.0k|		if (best_bidder == NULL) {
  ------------------
  |  Branch (614:7): [True: 20.1k, False: 2.86k]
  ------------------
  615|       |			/* Verify the filter by asking it for some data. */
  616|  20.1k|			__archive_read_filter_ahead(a->filter, 1, &avail);
  617|  20.1k|			if (avail < 0) {
  ------------------
  |  Branch (617:8): [True: 292, False: 19.8k]
  ------------------
  618|    292|				__archive_read_free_filters(a);
  619|    292|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    292|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  620|    292|			}
  621|  19.8k|			return (ARCHIVE_OK);
  ------------------
  |  |  234|  19.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  622|  20.1k|		}
  623|       |
  624|  2.86k|		f = calloc(1, sizeof(*f));
  625|  2.86k|		if (f == NULL)
  ------------------
  |  Branch (625:7): [True: 0, False: 2.86k]
  ------------------
  626|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  627|  2.86k|		f->bidder = best_bidder;
  628|  2.86k|		f->archive = a;
  629|  2.86k|		f->upstream = a->filter;
  630|  2.86k|		a->filter = f;
  631|  2.86k|		r = (best_bidder->vtable->init)(a->filter);
  632|  2.86k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.86k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (632:7): [True: 0, False: 2.86k]
  ------------------
  633|      0|			__archive_read_free_filters(a);
  634|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  635|      0|		}
  636|  2.86k|	}
  637|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  638|      1|	    "Input requires too many filters for decoding");
  639|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  640|  20.1k|}
archive_read.c:bid_format:
  752|   317k|{
  753|   317k|	int bid;
  754|       |
  755|   317k|	bid = (a->format->bid)(a, best_bid);
  756|   317k|	if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  240|   317k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (756:6): [True: 0, False: 317k]
  ------------------
  757|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  758|   317k|	if (a->filter->position != 0 &&
  ------------------
  |  Branch (758:6): [True: 618, False: 316k]
  ------------------
  759|    618|	    __archive_read_seek(a, 0, SEEK_SET) < 0)
  ------------------
  |  Branch (759:6): [True: 79, False: 539]
  ------------------
  760|     79|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     79|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  761|       |
  762|   317k|	return (bid);
  763|   317k|}
archive_read.c:choose_format:
  771|  19.8k|{
  772|  19.8k|	int slots;
  773|  19.8k|	int i;
  774|  19.8k|	int bid, best_bid;
  775|  19.8k|	int best_bid_slot;
  776|       |
  777|  19.8k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
  778|  19.8k|	best_bid = -1;
  779|  19.8k|	best_bid_slot = -1;
  780|       |
  781|       |	/* Set up a->format for convenience of bidders. */
  782|  19.8k|	a->format = &(a->formats[0]);
  783|   337k|	for (i = 0; i < slots; i++, a->format++) {
  ------------------
  |  Branch (783:14): [True: 317k, False: 19.7k]
  ------------------
  784|   317k|		if (a->format->bid) {
  ------------------
  |  Branch (784:7): [True: 317k, False: 0]
  ------------------
  785|   317k|			bid = bid_format(a, best_bid);
  786|   317k|			if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  240|   317k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (786:8): [True: 79, False: 317k]
  ------------------
  787|     79|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     79|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  788|   317k|			if ((bid > best_bid) || (best_bid_slot < 0)) {
  ------------------
  |  Branch (788:8): [True: 38.0k, False: 279k]
  |  Branch (788:28): [True: 19.6k, False: 259k]
  ------------------
  789|  57.6k|				best_bid = bid;
  790|  57.6k|				best_bid_slot = i;
  791|  57.6k|			}
  792|   317k|		}
  793|   317k|	}
  794|       |
  795|       |	/*
  796|       |	 * There were no bidders; this is a serious programmer error
  797|       |	 * and demands a quick and definitive abort.
  798|       |	 */
  799|  19.7k|	if (best_bid_slot < 0) {
  ------------------
  |  Branch (799:6): [True: 0, False: 19.7k]
  ------------------
  800|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  801|      0|		    "No formats registered");
  802|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  803|      0|	}
  804|       |
  805|       |	/*
  806|       |	 * There were bidders, but no non-zero bids; this means we
  807|       |	 * can't support this stream.
  808|       |	 */
  809|  19.7k|	if (best_bid < 1) {
  ------------------
  |  Branch (809:6): [True: 80, False: 19.6k]
  ------------------
  810|     80|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     80|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  811|     80|		    "Unrecognized archive format");
  812|     80|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     80|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  813|     80|	}
  814|       |
  815|  19.6k|	return (best_bid_slot);
  816|  19.7k|}
archive_read.c:close_filters:
 1081|  20.5k|{
 1082|  20.5k|	struct archive_read_filter *f = a->filter;
 1083|  20.5k|	int r = ARCHIVE_OK;
  ------------------
  |  |  234|  20.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1084|       |	/* Close each filter in the pipeline. */
 1085|  43.9k|	while (f != NULL) {
  ------------------
  |  Branch (1085:9): [True: 23.3k, False: 20.5k]
  ------------------
 1086|  23.3k|		struct archive_read_filter *t = f->upstream;
 1087|  23.3k|		if (!f->closed && f->vtable != NULL) {
  ------------------
  |  Branch (1087:7): [True: 23.0k, False: 312]
  |  Branch (1087:21): [True: 23.0k, False: 0]
  ------------------
 1088|  23.0k|			int r1 = (f->vtable->close)(f);
 1089|  23.0k|			f->closed = 1;
 1090|  23.0k|			if (r1 < r)
  ------------------
  |  Branch (1090:8): [True: 2, False: 23.0k]
  ------------------
 1091|      2|				r = r1;
 1092|  23.0k|		}
 1093|  23.3k|		free(f->buffer);
 1094|       |		f->buffer = NULL;
 1095|  23.3k|		f = t;
 1096|  23.3k|	}
 1097|  20.5k|	return r;
 1098|  20.5k|}
archive_read.c:read_client_data:
 1397|   150k|{
 1398|   150k|	ssize_t bytes_read;
 1399|       |
 1400|   150k|	if (f->end_of_file)
  ------------------
  |  Branch (1400:6): [True: 45.4k, False: 104k]
  ------------------
 1401|  45.4k|		return (0);
 1402|       |
 1403|   104k|	bytes_read = (f->vtable->read)(f, &f->client_buff);
 1404|   104k|	if (bytes_read < 0) {
  ------------------
  |  Branch (1404:6): [True: 995, False: 103k]
  ------------------
 1405|    995|		f->client_total = f->client_avail = 0;
 1406|    995|		f->client_next = f->client_buff = NULL;
 1407|    995|		f->fatal = 1;
 1408|   103k|	} else if (bytes_read == 0) {
  ------------------
  |  Branch (1408:13): [True: 26.1k, False: 77.4k]
  ------------------
 1409|  26.1k|		f->client_total = f->client_avail = 0;
 1410|  26.1k|		f->client_next = f->client_buff = NULL;
 1411|  26.1k|		f->end_of_file = 1;
 1412|  77.4k|	} else {
 1413|  77.4k|		f->client_total = bytes_read;
 1414|  77.4k|		f->client_avail = f->client_total;
 1415|  77.4k|		f->client_next = f->client_buff;
 1416|  77.4k|	}
 1417|       |
 1418|   104k|	return (bytes_read);
 1419|   150k|}
archive_read.c:advance_file_pointer:
 1630|  24.5M|{
 1631|  24.5M|	int64_t total_bytes_skipped = 0;
 1632|       |
 1633|  24.5M|	if (f->fatal)
  ------------------
  |  Branch (1633:6): [True: 25, False: 24.5M]
  ------------------
 1634|     25|		return (-1);
 1635|       |
 1636|       |	/* Use up the copy buffer first. */
 1637|  24.5M|	if (f->avail > 0) {
  ------------------
  |  Branch (1637:6): [True: 7.86M, False: 16.6M]
  ------------------
 1638|  7.86M|		size_t min = (size_t)minimum(request, (int64_t)f->avail);
  ------------------
  |  |   59|  7.86M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 7.86M, False: 3.35k]
  |  |  ------------------
  ------------------
 1639|  7.86M|		f->next += min;
 1640|  7.86M|		f->avail -= min;
 1641|  7.86M|		request -= min;
 1642|  7.86M|		f->position += min;
 1643|  7.86M|		total_bytes_skipped += min;
 1644|  7.86M|	}
 1645|       |
 1646|       |	/* Then use up the client buffer. */
 1647|  24.5M|	if (f->client_avail > 0) {
  ------------------
  |  Branch (1647:6): [True: 16.8M, False: 7.68M]
  ------------------
 1648|  16.8M|		size_t min = (size_t)minimum(request, (int64_t)f->client_avail);
  ------------------
  |  |   59|  16.8M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 16.8M, False: 35.3k]
  |  |  ------------------
  ------------------
 1649|  16.8M|		f->client_next += min;
 1650|  16.8M|		f->client_avail -= min;
 1651|  16.8M|		request -= min;
 1652|  16.8M|		f->position += min;
 1653|  16.8M|		total_bytes_skipped += min;
 1654|  16.8M|	}
 1655|  24.5M|	if (request == 0)
  ------------------
  |  Branch (1655:6): [True: 24.5M, False: 5.09k]
  ------------------
 1656|  24.5M|		return (total_bytes_skipped);
 1657|       |
 1658|       |	/* If there's an optimized skip function, use it. */
 1659|  5.09k|	if (f->can_skip != 0) {
  ------------------
  |  Branch (1659:6): [True: 4.56k, False: 525]
  ------------------
 1660|  4.56k|		while (request > 0) {
  ------------------
  |  Branch (1660:10): [True: 4.56k, False: 0]
  ------------------
 1661|  4.56k|			int64_t get = client_skip_proxy(f, request);
 1662|  4.56k|			if (get < 0 || get > request) {
  ------------------
  |  Branch (1662:8): [True: 0, False: 4.56k]
  |  Branch (1662:19): [True: 0, False: 4.56k]
  ------------------
 1663|      0|				f->fatal = 1;
 1664|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1665|      0|			}
 1666|  4.56k|			if (get == 0)
  ------------------
  |  Branch (1666:8): [True: 4.56k, False: 0]
  ------------------
 1667|  4.56k|				break;
 1668|      0|			f->position += get;
 1669|      0|			total_bytes_skipped += get;
 1670|      0|			request -= get;
 1671|      0|		}
 1672|  4.56k|		if (request == 0)
  ------------------
  |  Branch (1672:7): [True: 0, False: 4.56k]
  ------------------
 1673|      0|			return (total_bytes_skipped);
 1674|  4.56k|	} else if (f->can_seek != 0 && request > 64 * 1024) {
  ------------------
  |  Branch (1674:13): [True: 0, False: 525]
  |  Branch (1674:33): [True: 0, False: 0]
  ------------------
 1675|       |		/* If the client provided a seeker but not a skipper,
 1676|       |		 * we can use the seeker to skip forward.
 1677|       |		 *
 1678|       |		 * Note: This isn't always a good idea.  The client
 1679|       |		 * skipper is allowed to skip by less than requested
 1680|       |		 * if it needs to maintain block alignment.  The
 1681|       |		 * seeker is not allowed to play such games, so using
 1682|       |		 * the seeker here may be a performance loss compared
 1683|       |		 * to just reading and discarding.  That's why we
 1684|       |		 * only do this for skips of over 64k.
 1685|       |		 */
 1686|      0|		int64_t bytes_skipped;
 1687|      0|		int64_t before = f->position;
 1688|      0|		int64_t after = __archive_read_filter_seek(f,
 1689|      0|		    request, SEEK_CUR);
 1690|      0|		if (after != before + request) {
  ------------------
  |  Branch (1690:7): [True: 0, False: 0]
  ------------------
 1691|      0|			f->fatal = 1;
 1692|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1693|      0|		}
 1694|      0|		bytes_skipped = after - before;
 1695|      0|		total_bytes_skipped += bytes_skipped;
 1696|      0|		request -= bytes_skipped;
 1697|      0|		if (request == 0)
  ------------------
  |  Branch (1697:7): [True: 0, False: 0]
  ------------------
 1698|      0|			return (total_bytes_skipped);
 1699|      0|	}
 1700|       |
 1701|       |	/* Use ordinary reads as necessary to complete the request. */
 1702|  5.92k|	for (;;) {
 1703|  5.92k|		ssize_t bytes_read = read_client_data(f);
 1704|  5.92k|		if (bytes_read < 0)
  ------------------
  |  Branch (1704:7): [True: 97, False: 5.82k]
  ------------------
 1705|     97|			return (bytes_read);
 1706|       |
 1707|  5.82k|		if (bytes_read == 0)
  ------------------
  |  Branch (1707:7): [True: 4.64k, False: 1.18k]
  ------------------
 1708|  4.64k|			return (total_bytes_skipped);
 1709|       |
 1710|  1.18k|		if (bytes_read >= request) {
  ------------------
  |  Branch (1710:7): [True: 355, False: 831]
  ------------------
 1711|    355|			f->client_next += request;
 1712|    355|			f->client_avail -= request;
 1713|    355|			total_bytes_skipped += request;
 1714|    355|			f->position += request;
 1715|    355|			return (total_bytes_skipped);
 1716|    355|		}
 1717|       |
 1718|    831|		f->position += bytes_read;
 1719|    831|		total_bytes_skipped += bytes_read;
 1720|    831|		request -= bytes_read;
 1721|    831|	}
 1722|  5.09k|}
archive_read.c:client_skip_proxy:
  245|  4.56k|{
  246|  4.56k|	return (f->archive->client.skipper)(&f->archive->archive,
  247|  4.56k|	    f->data, request);
  248|  4.56k|}
archive_read.c:client_switch_proxy:
  181|  25.6k|{
  182|  25.6k|	struct archive_read *a;
  183|  25.6k|	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  234|  25.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  234|  25.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  184|  25.6k|	void *data2;
  185|       |
  186|  25.6k|	a = f->archive;
  187|       |
  188|       |	/* Don't do anything if already in the specified data node */
  189|  25.6k|	if (a->client.cursor == iindex)
  ------------------
  |  Branch (189:6): [True: 25.6k, False: 0]
  ------------------
  190|  25.6k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  25.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  191|       |
  192|      0|	a->client.cursor = iindex;
  193|      0|	data2 = a->client.dataset[a->client.cursor].data;
  194|      0|	if (a->client.switcher != NULL)
  ------------------
  |  Branch (194:6): [True: 0, False: 0]
  ------------------
  195|      0|	{
  196|      0|		r1 = r2 = (a->client.switcher)
  197|      0|			((struct archive *)a, f->data, data2);
  198|      0|		f->data = data2;
  199|      0|	}
  200|      0|	else
  201|      0|	{
  202|       |		/* Attempt to call close and open instead */
  203|      0|		if (a->client.closer != NULL)
  ------------------
  |  Branch (203:7): [True: 0, False: 0]
  ------------------
  204|      0|			r1 = (a->client.closer)
  205|      0|				((struct archive *)a, f->data);
  206|      0|		f->data = data2;
  207|      0|		if (a->client.opener != NULL)
  ------------------
  |  Branch (207:7): [True: 0, False: 0]
  ------------------
  208|      0|			r2 = (a->client.opener)
  209|      0|				((struct archive *)a, f->data);
  210|      0|	}
  211|      0|	f->client_total = f->client_avail = 0;
  212|      0|	return (r1 < r2) ? r1 : r2;
  ------------------
  |  Branch (212:9): [True: 0, False: 0]
  ------------------
  213|  25.6k|}
archive_read.c:client_seek_proxy:
  252|  26.3k|{
  253|       |	/* DO NOT use the skipper here!  If we transparently handled
  254|       |	 * forward seek here by using the skipper, that will break
  255|       |	 * other libarchive code that assumes a successful forward
  256|       |	 * seek means it can also seek backwards.
  257|       |	 */
  258|  26.3k|	return (f->archive->client.seeker)(&f->archive->archive,
  259|  26.3k|	    f->data, offset, whence);
  260|  26.3k|}
archive_read.c:get_archive_size:
 1726|  15.8k|{
 1727|  15.8k|	struct archive_read_client *client = &(f->archive->client);
 1728|  15.8k|	int64_t size;
 1729|  15.8k|	unsigned int cursor;
 1730|       |
 1731|       |	/* Try to calculate size without switching client objects. */
 1732|  15.8k|	size = 0;
 1733|  23.9k|	for (cursor = 0; cursor < client->nodes; cursor++) {
  ------------------
  |  Branch (1733:19): [True: 15.8k, False: 8.12k]
  ------------------
 1734|  15.8k|		int64_t total_size = client->dataset[cursor].total_size;
 1735|       |
 1736|  15.8k|		if (total_size < 0)
  ------------------
  |  Branch (1736:7): [True: 7.69k, False: 8.12k]
  ------------------
 1737|  7.69k|			break;
 1738|  8.12k|		if (archive_ckd_add_i64(&size, size, total_size))
  ------------------
  |  Branch (1738:7): [True: 0, False: 8.12k]
  ------------------
 1739|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1740|  8.12k|	}
 1741|       |
 1742|       |	/* Seek through remaining client objects to calculate size. */
 1743|  23.5k|	for (; cursor < client->nodes; cursor++) {
  ------------------
  |  Branch (1743:9): [True: 7.69k, False: 15.8k]
  ------------------
 1744|  7.69k|		int64_t r;
 1745|       |
 1746|  7.69k|		client->dataset[cursor].begin_position = size;
 1747|  7.69k|		r = client_switch_proxy(f, cursor);
 1748|  7.69k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  7.69k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1748:7): [True: 0, False: 7.69k]
  ------------------
 1749|      0|			return (r);
 1750|  7.69k|		r = client_seek_proxy(f, 0, SEEK_END);
 1751|  7.69k|		if (r < 0)
  ------------------
  |  Branch (1751:7): [True: 0, False: 7.69k]
  ------------------
 1752|      0|			return (r);
 1753|  7.69k|		client->dataset[cursor].total_size = r;
 1754|  7.69k|		if (archive_ckd_add_i64(&size, size, r))
  ------------------
  |  Branch (1754:7): [True: 0, False: 7.69k]
  ------------------
 1755|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1756|  7.69k|		f->position = size;
 1757|  7.69k|	}
 1758|       |
 1759|  15.8k|	return (size);
 1760|  15.8k|}

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

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

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

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

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

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

archive_read_support_filter_grzip:
   62|  20.1k|{
   63|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
   64|       |
   65|  20.1k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (65:6): [True: 0, False: 20.1k]
  ------------------
   66|  20.1k|				&grzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   67|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   68|       |
   69|       |	/* This filter always uses an external program. */
   70|  20.1k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  20.1k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   71|  20.1k|	    "Using external grzip program for grzip decompression");
   72|  20.1k|	return (ARCHIVE_WARN);
  ------------------
  |  |  236|  20.1k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   73|  20.1k|}
archive_read_support_filter_grzip.c:grzip_bidder_bid:
   81|  23.0k|{
   82|  23.0k|	const unsigned char *p;
   83|       |
   84|  23.0k|	(void)b; /* UNUSED */
   85|       |
   86|  23.0k|	p = __archive_read_filter_ahead(f, sizeof(grzip_magic), NULL);
   87|  23.0k|	if (p == NULL)
  ------------------
  |  Branch (87:6): [True: 350, False: 22.6k]
  ------------------
   88|    350|		return (0);
   89|       |
   90|  22.6k|	if (memcmp(p, grzip_magic, sizeof(grzip_magic)))
  ------------------
  |  Branch (90:6): [True: 22.6k, False: 2]
  ------------------
   91|  22.6k|		return (0);
   92|       |
   93|      2|	return (sizeof(grzip_magic) * 8);
   94|  22.6k|}
archive_read_support_filter_grzip.c:grzip_bidder_init:
   98|      2|{
   99|      2|	int r;
  100|       |
  101|      2|	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|      2|	f->code = ARCHIVE_FILTER_GRZIP;
  ------------------
  |  |  323|      2|#define	ARCHIVE_FILTER_GRZIP	12
  ------------------
  106|      2|	f->name = "grzip";
  107|      2|	return (r);
  108|      2|}

archive_read_support_filter_gzip:
   96|  20.1k|{
   97|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
   98|       |
   99|  20.1k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (99:6): [True: 0, False: 20.1k]
  ------------------
  100|  20.1k|				&gzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  101|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  102|       |
  103|       |	/* Signal the extent of gzip support with the return value here. */
  104|  20.1k|#if HAVE_ZLIB_H
  105|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#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|  20.1k|}
archive_read_support_filter_gzip.c:gzip_bidder_bid:
  241|  23.0k|{
  242|  23.0k|	int bits_checked;
  243|       |
  244|  23.0k|	(void)b; /* UNUSED */
  245|       |
  246|  23.0k|	if (peek_at_header(f, &bits_checked, NULL))
  ------------------
  |  Branch (246:6): [True: 1.52k, False: 21.4k]
  ------------------
  247|  1.52k|		return (bits_checked);
  248|  21.4k|	return (0);
  249|  23.0k|}
archive_read_support_filter_gzip.c:peek_at_header:
  130|  26.2k|{
  131|  26.2k|	const unsigned char *p;
  132|  26.2k|	ssize_t avail, len;
  133|  26.2k|	int bits = 0;
  134|  26.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|  26.2k|	len = 10;
  142|  26.2k|	p = __archive_read_filter_ahead(f, len, &avail);
  143|  26.2k|	if (p == NULL)
  ------------------
  |  Branch (143:6): [True: 984, False: 25.2k]
  ------------------
  144|    984|		return (0);
  145|       |	/* We only support deflation- third byte must be 0x08. */
  146|  25.2k|	if (memcmp(p, "\x1F\x8B\x08", 3) != 0)
  ------------------
  |  Branch (146:6): [True: 21.6k, False: 3.57k]
  ------------------
  147|  21.6k|		return (0);
  148|  3.57k|	bits += 24;
  149|  3.57k|	if ((p[3] & 0xE0)!= 0)	/* No reserved flags set. */
  ------------------
  |  Branch (149:6): [True: 24, False: 3.55k]
  ------------------
  150|     24|		return (0);
  151|  3.55k|	bits += 3;
  152|  3.55k|	header_flags = p[3];
  153|       |	/* Bytes 4-7 are mod time in little endian. */
  154|  3.55k|#ifdef HAVE_ZLIB_H
  155|  3.55k|	if (gzip)
  ------------------
  |  Branch (155:6): [True: 2.01k, False: 1.53k]
  ------------------
  156|  2.01k|		gzip->mtime = archive_le32dec(p + 4);
  157|  3.55k|#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.55k|	if (header_flags & 4) {
  ------------------
  |  Branch (164:6): [True: 61, False: 3.49k]
  ------------------
  165|     61|		p = __archive_read_filter_ahead(f, len + 2, &avail);
  166|     61|		if (p == NULL)
  ------------------
  |  Branch (166:7): [True: 0, False: 61]
  ------------------
  167|      0|			return (0);
  168|     61|		len += archive_le16dec(p + len);
  169|     61|		len += 2;
  170|     61|	}
  171|       |
  172|       |	/* Null-terminated optional filename. */
  173|  3.55k|	if (header_flags & 8) {
  ------------------
  |  Branch (173:6): [True: 728, False: 2.82k]
  ------------------
  174|    728|#ifdef HAVE_ZLIB_H
  175|    728|		ssize_t file_start = len;
  176|    728|#endif
  177|  1.84M|		do {
  178|  1.84M|			++len;
  179|  1.84M|			if (avail < len) {
  ------------------
  |  Branch (179:8): [True: 1.70M, False: 142k]
  ------------------
  180|  1.70M|				if (avail > MAX_FILENAME_LENGTH) {
  ------------------
  |  |  120|  1.70M|#define MAX_FILENAME_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (180:9): [True: 1, False: 1.70M]
  ------------------
  181|      1|					return (0);
  182|      1|				}
  183|  1.70M|				p = __archive_read_filter_ahead(f,
  184|  1.70M|				    len, &avail);
  185|  1.70M|			}
  186|  1.84M|			if (p == NULL)
  ------------------
  |  Branch (186:8): [True: 17, False: 1.84M]
  ------------------
  187|     17|				return (0);
  188|  1.84M|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (188:12): [True: 1.84M, False: 710]
  ------------------
  189|       |
  190|    710|#ifdef HAVE_ZLIB_H
  191|    710|		if (gzip) {
  ------------------
  |  Branch (191:7): [True: 470, False: 240]
  ------------------
  192|       |			/* Reset the name in case of repeat header reads. */
  193|    470|			free(gzip->name);
  194|    470|			gzip->name = strdup((const char *)&p[file_start]);
  195|    470|		}
  196|    710|#endif
  197|    710|	}
  198|       |
  199|       |	/* Null-terminated optional comment. */
  200|  3.53k|	if (header_flags & 16) {
  ------------------
  |  Branch (200:6): [True: 856, False: 2.68k]
  ------------------
  201|  2.07M|		do {
  202|  2.07M|			++len;
  203|  2.07M|			if (avail < len) {
  ------------------
  |  Branch (203:8): [True: 1.96M, False: 109k]
  ------------------
  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.07M|			if (p == NULL)
  ------------------
  |  Branch (210:8): [True: 5, False: 2.07M]
  ------------------
  211|      5|				return (0);
  212|  2.07M|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (212:12): [True: 2.07M, False: 849]
  ------------------
  213|    856|	}
  214|       |
  215|       |	/* Optional header CRC */
  216|  3.52k|	if ((header_flags & 2)) {
  ------------------
  |  Branch (216:6): [True: 162, False: 3.36k]
  ------------------
  217|    162|		p = __archive_read_filter_ahead(f, len + 2, &avail);
  218|    162|		if (p == NULL)
  ------------------
  |  Branch (218:7): [True: 6, False: 156]
  ------------------
  219|      6|			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|    156|		len += 2;
  228|    156|	}
  229|       |
  230|  3.52k|	if (pbits != NULL)
  ------------------
  |  Branch (230:6): [True: 1.52k, False: 1.99k]
  ------------------
  231|  1.52k|		*pbits = bits;
  232|  3.52k|	return (len);
  233|  3.52k|}
archive_read_support_filter_gzip.c:gzip_bidder_init:
  304|  1.52k|{
  305|  1.52k|	struct gzip *gzip;
  306|  1.52k|	static const size_t out_block_size = 64 * 1024;
  307|  1.52k|	void *out_block;
  308|       |
  309|  1.52k|	f->code = ARCHIVE_FILTER_GZIP;
  ------------------
  |  |  312|  1.52k|#define	ARCHIVE_FILTER_GZIP	1
  ------------------
  310|  1.52k|	f->name = "gzip";
  311|       |
  312|  1.52k|	gzip = calloc(1, sizeof(*gzip));
  313|  1.52k|	out_block = malloc(out_block_size);
  314|  1.52k|	if (gzip == NULL || out_block == NULL) {
  ------------------
  |  Branch (314:6): [True: 0, False: 1.52k]
  |  Branch (314:22): [True: 0, False: 1.52k]
  ------------------
  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);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  320|      0|	}
  321|       |
  322|  1.52k|	f->data = gzip;
  323|  1.52k|	gzip->out_block_size = out_block_size;
  324|  1.52k|	gzip->out_block = out_block;
  325|  1.52k|	f->vtable = &gzip_reader_vtable;
  326|       |
  327|  1.52k|	gzip->in_stream = 0; /* We're not actually within a stream yet. */
  328|       |
  329|  1.52k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  330|  1.52k|}
archive_read_support_filter_gzip.c:gzip_filter_read:
  436|  26.7k|{
  437|  26.7k|	struct gzip *gzip = f->data;
  438|  26.7k|	size_t decompressed;
  439|  26.7k|	ssize_t avail_in, max_in;
  440|  26.7k|	int ret;
  441|       |
  442|       |	/* Empty our output buffer. */
  443|  26.7k|	gzip->stream.next_out = gzip->out_block;
  444|  26.7k|	gzip->stream.avail_out = (uInt)gzip->out_block_size;
  445|       |
  446|       |	/* Try to fill the output buffer. */
  447|  53.6k|	while (gzip->stream.avail_out > 0 && !gzip->eof) {
  ------------------
  |  Branch (447:9): [True: 29.4k, False: 24.2k]
  |  Branch (447:39): [True: 28.4k, False: 1.00k]
  ------------------
  448|       |		/* If we're not in a stream, read a header
  449|       |		 * and initialize the decompression library. */
  450|  28.4k|		if (!gzip->in_stream) {
  ------------------
  |  Branch (450:7): [True: 3.22k, False: 25.1k]
  ------------------
  451|  3.22k|			ret = consume_header(f);
  452|  3.22k|			if (ret == ARCHIVE_EOF) {
  ------------------
  |  |  233|  3.22k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (452:8): [True: 1.22k, False: 1.99k]
  ------------------
  453|  1.22k|				gzip->eof = 1;
  454|  1.22k|				break;
  455|  1.22k|			}
  456|  1.99k|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  234|  1.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (456:8): [True: 0, False: 1.99k]
  ------------------
  457|      0|				return (ret);
  458|  1.99k|		}
  459|       |
  460|       |		/* Peek at the next available data. */
  461|       |		/* ZLib treats stream.next_in as const but doesn't declare
  462|       |		 * it so, hence this ugly cast. */
  463|  27.1k|		gzip->stream.next_in = (unsigned char *)(uintptr_t)
  464|  27.1k|		    __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  465|  27.1k|		if (gzip->stream.next_in == NULL) {
  ------------------
  |  Branch (465:7): [True: 231, False: 26.9k]
  ------------------
  466|    231|			archive_set_error(&f->archive->archive,
  467|    231|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    231|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  468|    231|			    "truncated gzip input");
  469|    231|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    231|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  470|    231|		}
  471|  26.9k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (471:7): [Folded, False: 26.9k]
  ------------------
  472|      0|			max_in = SSIZE_MAX;
  473|  26.9k|		else
  474|  26.9k|			max_in = UINT_MAX;
  475|  26.9k|		if (avail_in > max_in)
  ------------------
  |  Branch (475:7): [True: 0, False: 26.9k]
  ------------------
  476|      0|			avail_in = max_in;
  477|  26.9k|		gzip->stream.avail_in = (uInt)avail_in;
  478|       |
  479|       |		/* Decompress and consume some of that data. */
  480|  26.9k|		ret = inflate(&(gzip->stream), 0);
  481|  26.9k|		switch (ret) {
  482|  25.2k|		case Z_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (482:3): [True: 25.2k, False: 1.71k]
  ------------------
  483|  25.2k|			__archive_read_filter_consume(f->upstream,
  484|  25.2k|			    avail_in - gzip->stream.avail_in);
  485|  25.2k|			break;
  486|  1.69k|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (486:3): [True: 1.69k, False: 25.2k]
  ------------------
  487|  1.69k|			__archive_read_filter_consume(f->upstream,
  488|  1.69k|			    avail_in - gzip->stream.avail_in);
  489|       |			/* Consume the stream trailer; release the
  490|       |			 * decompression library. */
  491|  1.69k|			ret = consume_trailer(f);
  492|  1.69k|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  234|  1.69k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (492:8): [True: 1, False: 1.69k]
  ------------------
  493|      1|				return (ret);
  494|  1.69k|			break;
  495|  1.69k|		default:
  ------------------
  |  Branch (495:3): [True: 18, False: 26.9k]
  ------------------
  496|       |			/* Return an error. */
  497|     18|			archive_set_error(&f->archive->archive,
  498|     18|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     18|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  499|     18|			    "gzip decompression failed");
  500|     18|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  501|  26.9k|		}
  502|  26.9k|	}
  503|       |
  504|       |	/* We've read as much as we can. */
  505|  26.4k|	decompressed = gzip->stream.next_out - gzip->out_block;
  506|  26.4k|	if (decompressed == 0)
  ------------------
  |  Branch (506:6): [True: 1.01k, False: 25.4k]
  ------------------
  507|  1.01k|		*p = NULL;
  508|  25.4k|	else
  509|  25.4k|		*p = gzip->out_block;
  510|  26.4k|	return (decompressed);
  511|  26.7k|}
archive_read_support_filter_gzip.c:consume_header:
  334|  3.22k|{
  335|  3.22k|	struct gzip *gzip = f->data;
  336|  3.22k|	ssize_t avail, max_in;
  337|  3.22k|	size_t len;
  338|  3.22k|	int ret;
  339|       |
  340|       |	/* If this is a real header, consume it. */
  341|  3.22k|	len = peek_at_header(f->upstream, NULL, gzip);
  342|  3.22k|	if (len == 0)
  ------------------
  |  Branch (342:6): [True: 1.22k, False: 1.99k]
  ------------------
  343|  1.22k|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|  1.22k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  344|  1.99k|	__archive_read_filter_consume(f->upstream, len);
  345|       |
  346|       |	/* Initialize CRC accumulator. */
  347|  1.99k|	gzip->crc = __archive_crc32(0L, NULL, 0);
  348|       |
  349|       |	/* Initialize compression library. */
  350|  1.99k|	gzip->stream.next_in = (unsigned char *)(uintptr_t)
  351|  1.99k|	    __archive_read_filter_ahead(f->upstream, 1, &avail);
  352|  1.99k|	if (avail < 0) {
  ------------------
  |  Branch (352:6): [True: 0, False: 1.99k]
  ------------------
  353|      0|		archive_set_error(&f->archive->archive,
  354|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  355|      0|		    "Failed to read gzip input");
  356|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  357|      0|	}
  358|  1.99k|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (358:6): [Folded, False: 1.99k]
  ------------------
  359|      0|		max_in = SSIZE_MAX;
  360|  1.99k|	else
  361|  1.99k|		max_in = UINT_MAX;
  362|  1.99k|	if (avail > max_in)
  ------------------
  |  Branch (362:6): [True: 0, False: 1.99k]
  ------------------
  363|      0|		avail = max_in;
  364|  1.99k|	gzip->stream.avail_in = (uInt)avail;
  365|  1.99k|	ret = inflateInit2(&(gzip->stream),
  366|  1.99k|	    -15 /* Don't check for zlib header */);
  367|       |
  368|       |	/* Decipher the error code. */
  369|  1.99k|	switch (ret) {
  370|  1.99k|	case Z_OK:
  ------------------
  |  Branch (370:2): [True: 1.99k, False: 0]
  ------------------
  371|  1.99k|		gzip->in_stream = 1;
  372|  1.99k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  373|      0|	case Z_STREAM_ERROR:
  ------------------
  |  Branch (373:2): [True: 0, False: 1.99k]
  ------------------
  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.99k]
  ------------------
  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.99k]
  ------------------
  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.99k]
  ------------------
  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.99k|	}
  397|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  398|  1.99k|}
archive_read_support_filter_gzip.c:consume_trailer:
  402|  1.69k|{
  403|  1.69k|	struct gzip *gzip = f->data;
  404|  1.69k|	const unsigned char *p;
  405|       |
  406|  1.69k|	gzip->in_stream = 0;
  407|  1.69k|	switch (inflateEnd(&(gzip->stream))) {
  408|  1.69k|	case Z_OK:
  ------------------
  |  Branch (408:2): [True: 1.69k, False: 0]
  ------------------
  409|  1.69k|		break;
  410|      0|	default:
  ------------------
  |  Branch (410:2): [True: 0, False: 1.69k]
  ------------------
  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);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  415|  1.69k|	}
  416|       |
  417|       |	/* GZip trailer is a fixed 8 byte structure. */
  418|  1.69k|	p = __archive_read_filter_ahead(f->upstream, 8, NULL);
  419|  1.69k|	if (p == NULL) {
  ------------------
  |  Branch (419:6): [True: 1, False: 1.69k]
  ------------------
  420|      1|		archive_set_error(&f->archive->archive,
  421|      1|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  422|      1|		    "Truncated gzip input");
  423|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  424|      1|	}
  425|       |
  426|       |	/* XXX TODO: Verify the length and CRC. */
  427|       |
  428|       |	/* We've verified the trailer, so consume it now. */
  429|  1.69k|	__archive_read_filter_consume(f->upstream, 8);
  430|       |
  431|  1.69k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.69k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  432|  1.69k|}
archive_read_support_filter_gzip.c:gzip_filter_close:
  518|  1.52k|{
  519|  1.52k|	struct gzip *gzip = f->data;
  520|  1.52k|	int ret;
  521|       |
  522|  1.52k|	ret = ARCHIVE_OK;
  ------------------
  |  |  234|  1.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  523|       |
  524|  1.52k|	if (gzip->in_stream) {
  ------------------
  |  Branch (524:6): [True: 301, False: 1.22k]
  ------------------
  525|    301|		switch (inflateEnd(&(gzip->stream))) {
  526|    301|		case Z_OK:
  ------------------
  |  Branch (526:3): [True: 301, False: 0]
  ------------------
  527|    301|			break;
  528|      0|		default:
  ------------------
  |  Branch (528:3): [True: 0, False: 301]
  ------------------
  529|      0|			archive_set_error(&(f->archive->archive),
  530|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  531|      0|			    "Failed to clean up gzip compressor");
  532|      0|			ret = ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  533|    301|		}
  534|    301|	}
  535|       |
  536|  1.52k|	free(gzip->name);
  537|  1.52k|	free(gzip->out_block);
  538|  1.52k|	free(gzip);
  539|  1.52k|	return (ret);
  540|  1.52k|}
archive_read_support_filter_gzip.c:gzip_read_header:
  276|    176|{
  277|    176|	struct gzip *gzip = f->data;
  278|       |
  279|       |	/* An mtime of 0 is considered invalid/missing. */
  280|    176|	if (gzip->mtime != 0)
  ------------------
  |  Branch (280:6): [True: 176, False: 0]
  ------------------
  281|    176|		archive_entry_set_mtime(entry, gzip->mtime, 0);
  282|       |
  283|       |	/* If the name is available, extract it. */
  284|    176|	if (gzip->name)
  ------------------
  |  Branch (284:6): [True: 16, False: 160]
  ------------------
  285|     16|		archive_entry_set_pathname(entry, gzip->name);
  286|       |
  287|    176|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    176|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  288|    176|}

archive_read_support_filter_lrzip:
   61|  20.1k|{
   62|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
   63|       |
   64|  20.1k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (64:6): [True: 0, False: 20.1k]
  ------------------
   65|  20.1k|				&lrzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   66|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   67|       |
   68|       |	/* This filter always uses an external program. */
   69|  20.1k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  20.1k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   70|  20.1k|	    "Using external lrzip program for lrzip decompression");
   71|  20.1k|	return (ARCHIVE_WARN);
  ------------------
  |  |  236|  20.1k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   72|  20.1k|}
archive_read_support_filter_lrzip.c:lrzip_bidder_bid:
   80|  23.0k|{
   81|  23.0k|	const unsigned char *p;
   82|  23.0k|	int i;
   83|       |
   84|  23.0k|	(void)b; /* UNUSED */
   85|       |	/* Start by looking at the first six bytes of the header, which
   86|       |	 * is all fixed layout. */
   87|  23.0k|	p = __archive_read_filter_ahead(f, 6, NULL);
   88|  23.0k|	if (p == NULL)
  ------------------
  |  Branch (88:6): [True: 334, False: 22.6k]
  ------------------
   89|    334|		return (0);
   90|       |
   91|  22.6k|	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   45|  22.6k|#define LRZIP_HEADER_MAGIC "LRZI"
  ------------------
              	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   46|  22.6k|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (91:6): [True: 22.6k, False: 21]
  ------------------
   92|  22.6k|		return (0);
   93|       |
   94|       |	/* current major version is always 0, verify this */
   95|     21|	if (p[LRZIP_HEADER_MAGIC_LEN])
  ------------------
  |  |   46|     21|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (95:6): [True: 21, False: 0]
  ------------------
   96|     21|		return 0;
   97|       |	/* support only v0.6+ lrzip for sanity */
   98|      0|	i = p[LRZIP_HEADER_MAGIC_LEN + 1];
  ------------------
  |  |   46|      0|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
   99|      0|	if ((i < 6) || (i > 10))
  ------------------
  |  Branch (99:6): [True: 0, False: 0]
  |  Branch (99:17): [True: 0, False: 0]
  ------------------
  100|      0|		return 0;
  101|       |
  102|      0|	return (48);
  103|      0|}

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

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

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

archive_read_support_filter_rpm:
   71|  20.1k|{
   72|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
   73|       |
   74|       |	return __archive_read_register_bidder(a, NULL,
   75|  20.1k|			&rpm_bidder_vtable);
   76|  20.1k|}
archive_read_support_filter_rpm.c:rpm_bidder_bid:
   81|  23.0k|{
   82|  23.0k|	const unsigned char *p;
   83|  23.0k|	int bits_checked;
   84|       |
   85|  23.0k|	(void)b; /* UNUSED */
   86|       |
   87|  23.0k|	p = __archive_read_filter_ahead(f, 8, NULL);
   88|  23.0k|	if (p == NULL)
  ------------------
  |  Branch (88:6): [True: 335, False: 22.6k]
  ------------------
   89|    335|		return (0);
   90|       |
   91|  22.6k|	bits_checked = 0;
   92|       |	/*
   93|       |	 * Verify Header Magic Bytes : 0XED 0XAB 0XEE 0XDB
   94|       |	 */
   95|  22.6k|	if (memcmp(p, "\xED\xAB\xEE\xDB", 4) != 0)
  ------------------
  |  Branch (95:6): [True: 22.3k, False: 305]
  ------------------
   96|  22.3k|		return (0);
   97|    305|	bits_checked += 32;
   98|       |	/*
   99|       |	 * Check major version.
  100|       |	 */
  101|    305|	if (p[4] != 3 && p[4] != 4)
  ------------------
  |  Branch (101:6): [True: 73, False: 232]
  |  Branch (101:19): [True: 7, False: 66]
  ------------------
  102|      7|		return (0);
  103|    298|	bits_checked += 8;
  104|       |	/*
  105|       |	 * Check package type; binary or source.
  106|       |	 */
  107|    298|	if (p[6] != 0)
  ------------------
  |  Branch (107:6): [True: 4, False: 294]
  ------------------
  108|      4|		return (0);
  109|    294|	bits_checked += 8;
  110|    294|	if (p[7] != 0 && p[7] != 1)
  ------------------
  |  Branch (110:6): [True: 1, False: 293]
  |  Branch (110:19): [True: 1, False: 0]
  ------------------
  111|      1|		return (0);
  112|    293|	bits_checked += 8;
  113|       |
  114|    293|	return (bits_checked);
  115|    294|}
archive_read_support_filter_rpm.c:rpm_bidder_init:
  125|    293|{
  126|    293|	struct rpm   *rpm;
  127|       |
  128|    293|	f->code = ARCHIVE_FILTER_RPM;
  ------------------
  |  |  319|    293|#define	ARCHIVE_FILTER_RPM	8
  ------------------
  129|    293|	f->name = "rpm";
  130|       |
  131|    293|	rpm = calloc(1, sizeof(*rpm));
  132|    293|	if (rpm == NULL) {
  ------------------
  |  Branch (132:6): [True: 0, False: 293]
  ------------------
  133|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  134|      0|		    "Can't allocate data for rpm");
  135|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  136|      0|	}
  137|       |
  138|    293|	f->data = rpm;
  139|    293|	rpm->data_reached = 0;
  140|    293|	f->vtable = &rpm_reader_vtable;
  141|       |
  142|    293|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    293|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  143|    293|}
archive_read_support_filter_rpm.c:rpm_filter_read:
  230|  3.74k|{
  231|  3.74k|	struct rpm *rpm = f->data;
  232|  3.74k|	ssize_t r;
  233|       |
  234|  3.74k|	if (!rpm->data_reached) {
  ------------------
  |  Branch (234:6): [True: 292, False: 3.45k]
  ------------------
  235|    292|		r = skip_prologue(f);
  236|    292|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    292|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (236:7): [True: 38, False: 254]
  ------------------
  237|     38|			return (r);
  238|    254|		rpm->data_reached = 1;
  239|    254|	}
  240|       |
  241|  3.70k|	*buff = __archive_read_filter_ahead(f->upstream, 1, &r);
  242|  3.70k|	if (r > 0)
  ------------------
  |  Branch (242:6): [True: 3.46k, False: 240]
  ------------------
  243|  3.46k|		__archive_read_filter_consume(f->upstream, r);
  244|       |
  245|  3.70k|	return r;
  246|  3.74k|}
archive_read_support_filter_rpm.c:skip_prologue:
  171|    292|{
  172|    292|	const unsigned char *h;
  173|    292|	ssize_t r;
  174|    292|	int header, seen_header = 0;
  175|       |
  176|       |	/* Skip lead size. */
  177|    292|	r = __archive_read_filter_consume(f->upstream, RPM_LEAD_SIZE);
  ------------------
  |  |   43|    292|#define RPM_LEAD_SIZE		96	/* Size of 'Lead' section. */
  ------------------
  178|    292|	if (r < 0)
  ------------------
  |  Branch (178:6): [True: 3, False: 289]
  ------------------
  179|      3|		return (r);
  180|       |
  181|    550|	do {
  182|       |		/* Read header intro. */
  183|    550|		h = __archive_read_filter_ahead(f->upstream,
  184|    550|		    RPM_MIN_HEAD_SIZE, NULL);
  ------------------
  |  |   44|    550|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  185|    550|		if (h == NULL) {
  ------------------
  |  Branch (185:7): [True: 5, False: 545]
  ------------------
  186|      5|			archive_set_error(&f->archive->archive,
  187|      5|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  188|      5|			    "Truncated rpm file");
  189|      5|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  190|      5|		}
  191|       |
  192|    545|		header = (memcmp(h, "\x8E\xAD\xE8\x01", 4) == 0);
  193|    545|		if (header) {
  ------------------
  |  Branch (193:7): [True: 287, False: 258]
  ------------------
  194|    287|			int64_t bytes, length, section;
  195|       |
  196|    287|			seen_header = 1;
  197|       |
  198|       |			/* Calculate header length. */
  199|    287|			section = archive_be32dec(h + 8);
  200|    287|			bytes = archive_be32dec(h + 12);
  201|    287|			length = RPM_MIN_HEAD_SIZE + section * 16 + bytes;
  ------------------
  |  |   44|    287|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  202|       |
  203|       |			/* Skip header. */
  204|    287|			r = __archive_read_filter_consume(f->upstream,
  205|    287|			     length);
  206|    287|			if (r < 0)
  ------------------
  |  Branch (206:8): [True: 17, False: 270]
  ------------------
  207|     17|				return (r);
  208|       |
  209|       |			/* Skip padding. */
  210|    270|			r = skip_padding(f);
  211|    270|			if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    270|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (211:8): [True: 9, False: 261]
  ------------------
  212|      9|				return (r);
  213|    270|		}
  214|    545|	} while (header);
  ------------------
  |  Branch (214:11): [True: 261, False: 258]
  ------------------
  215|       |
  216|       |	/* At least one header must have been encountered. */
  217|    258|	if (!seen_header) {
  ------------------
  |  Branch (217:6): [True: 4, False: 254]
  ------------------
  218|      4|		archive_set_error(
  219|      4|		    &f->archive->archive,
  220|      4|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  221|      4|		    "Unrecognized rpm header");
  222|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  223|      4|	}
  224|       |
  225|    254|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    254|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  226|    258|}
archive_read_support_filter_rpm.c:skip_padding:
  147|    270|{
  148|    270|	const unsigned char *h;
  149|    270|	ssize_t avail, count, r;
  150|       |
  151|    413|	do {
  152|    413|		h = __archive_read_filter_ahead(f->upstream, 1, &avail);
  153|    413|		if (h == NULL) {
  ------------------
  |  Branch (153:7): [True: 9, False: 404]
  ------------------
  154|      9|			archive_set_error(&f->archive->archive,
  155|      9|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  156|      9|			    "Truncated rpm file");
  157|      9|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  158|      9|		}
  159|  2.25k|		for (count = 0; count < avail && *h++ == '\0'; count++)
  ------------------
  |  Branch (159:19): [True: 2.11k, False: 143]
  |  Branch (159:36): [True: 1.84k, False: 261]
  ------------------
  160|  1.84k|			;
  161|    404|		r = __archive_read_filter_consume(f->upstream, count);
  162|    404|		if (r < 0)
  ------------------
  |  Branch (162:7): [True: 0, False: 404]
  ------------------
  163|      0|			return (r);
  164|    404|	} while (count == avail);
  ------------------
  |  Branch (164:11): [True: 143, False: 261]
  ------------------
  165|       |
  166|    261|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    261|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  167|    270|}
archive_read_support_filter_rpm.c:rpm_filter_close:
  250|    293|{
  251|    293|	struct rpm *rpm = f->data;
  252|       |
  253|    293|	free(rpm);
  254|       |
  255|    293|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    293|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  256|    293|}

archive_read_support_filter_uu:
   95|  20.1k|{
   96|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
   97|  20.1k|	struct uu_bidder *data;
   98|       |
   99|  20.1k|	data = calloc(1, sizeof(*data));
  100|  20.1k|	if (data == NULL) {
  ------------------
  |  Branch (100:6): [True: 0, False: 20.1k]
  ------------------
  101|      0|		archive_set_error(_a, ENOMEM, "Can't allocate memory");
  102|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  103|      0|	}
  104|       |
  105|  20.1k|	if (__archive_read_register_bidder(a, data,
  ------------------
  |  Branch (105:6): [True: 0, False: 20.1k]
  ------------------
  106|  20.1k|			&uudecode_bidder_vtable) != ARCHIVE_OK) {
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  107|      0|		free(data);
  108|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  109|      0|	}
  110|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  111|  20.1k|}
archive_read_support_filter_uu.c:uudecode_bidder_bid:
  356|  23.0k|{
  357|  23.0k|	struct uu_bidder *data = b->data;
  358|  23.0k|	const unsigned char *p;
  359|  23.0k|	size_t l;
  360|  23.0k|	int firstline, state;
  361|  23.0k|	size_t len, offset;
  362|  23.0k|	ssize_t unconsumed;
  363|       |
  364|  23.0k|	(void)b; /* UNUSED */
  365|       |
  366|  23.0k|	offset = 0;
  367|  23.0k|	firstline = 20;
  368|  3.35M|	for (;;) {
  369|  3.35M|		p = read_line_ahead(f, 0, offset, &len, &unconsumed);
  370|  3.35M|		if (p == NULL)
  ------------------
  |  Branch (370:7): [True: 22.9k, False: 3.33M]
  ------------------
  371|  22.9k|			return (0); /* No match found. */
  372|  3.33M|		offset += unconsumed;
  373|       |
  374|  3.33M|		state = parse_header(p, len, NULL, NULL, NULL);
  375|  3.33M|		if (state != 0)
  ------------------
  |  Branch (375:7): [True: 90, False: 3.33M]
  ------------------
  376|     90|			break;
  377|  3.33M|		firstline = 0;
  378|  3.33M|	}
  379|     90|	p = read_line_ahead(f, 0, offset, &len, &unconsumed);
  380|     90|	if (p == NULL)
  ------------------
  |  Branch (380:6): [True: 1, False: 89]
  ------------------
  381|      1|		return (0); /* No match found. */
  382|       |
  383|     89|	if (state == ST_READ_UU) {
  ------------------
  |  |   57|     89|#define ST_READ_UU	1
  ------------------
  |  Branch (383:6): [True: 32, False: 57]
  ------------------
  384|       |		/* "begin " */
  385|     32|		if (!uuchar[*p])
  ------------------
  |  Branch (385:7): [True: 0, False: 32]
  ------------------
  386|      0|			return (0);
  387|       |		/* Get a length of decoded bytes. */
  388|     32|		l = UUDECODE(*p++); len--;
  ------------------
  |  |  260|     32|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  389|     32|		if (l == 0)
  ------------------
  |  Branch (389:7): [True: 18, False: 14]
  ------------------
  390|       |			/* empty encoded file */
  391|     18|			return (firstline+30);
  392|     14|		if (l > 45)
  ------------------
  |  Branch (392:7): [True: 0, False: 14]
  ------------------
  393|       |			/* Normally, maximum length is 45(character 'M'). */
  394|      0|			return (0);
  395|     14|		if (l > len)
  ------------------
  |  Branch (395:7): [True: 0, False: 14]
  ------------------
  396|      0|			return (0); /* Line too short. */
  397|    144|		while (l) {
  ------------------
  |  Branch (397:10): [True: 132, False: 12]
  ------------------
  398|    132|			if (!uuchar[*p++])
  ------------------
  |  Branch (398:8): [True: 2, False: 130]
  ------------------
  399|      2|				return (0);
  400|    130|			--len;
  401|    130|			--l;
  402|    130|		}
  403|     12|		if (len == 1 &&
  ------------------
  |  Branch (403:7): [True: 0, False: 12]
  ------------------
  404|      0|		    (uuchar[*p] ||		 /* Check sum. */
  ------------------
  |  Branch (404:8): [True: 0, False: 0]
  ------------------
  405|      0|		     (*p >= 'a' && *p <= 'z'))) {/* Padding data(MINIX). */
  ------------------
  |  Branch (405:9): [True: 0, False: 0]
  |  Branch (405:22): [True: 0, False: 0]
  ------------------
  406|      0|			++p;
  407|      0|			--len;
  408|      0|		}
  409|     12|		offset += unconsumed;
  410|     12|		p = read_line_ahead(f, 0, offset, &len, &unconsumed);
  411|     12|		if (p != NULL && uuchar[*p]) {
  ------------------
  |  Branch (411:7): [True: 12, False: 0]
  |  Branch (411:20): [True: 12, False: 0]
  ------------------
  412|     12|			data->code = ARCHIVE_FILTER_UU;
  ------------------
  |  |  318|     12|#define	ARCHIVE_FILTER_UU	7
  ------------------
  413|     12|			data->name = "uu";
  414|     12|			return (firstline+30);
  415|     12|		}
  416|     57|	} else if (state == ST_READ_BASE64) {
  ------------------
  |  |   59|     57|#define ST_READ_BASE64	3
  ------------------
  |  Branch (416:13): [True: 57, False: 0]
  ------------------
  417|     57|		int bid = 0;
  418|       |
  419|       |		/* "begin-base64 " */
  420|    536|		while (len > 0) {
  ------------------
  |  Branch (420:10): [True: 481, False: 55]
  ------------------
  421|    481|			if (!base64[*p++])
  ------------------
  |  Branch (421:8): [True: 2, False: 479]
  ------------------
  422|      2|				return (0);
  423|    479|			len--;
  424|    479|		}
  425|     55|		if (len == 0)
  ------------------
  |  Branch (425:7): [True: 55, False: 0]
  ------------------
  426|     55|			bid = firstline + 30;
  427|     55|		if (len == 4 && memcmp(p, "====", 4) == 0)
  ------------------
  |  Branch (427:7): [True: 0, False: 55]
  |  Branch (427:19): [True: 0, False: 0]
  ------------------
  428|      0|			bid = firstline + 40;
  429|     55|		if (bid > 0) {
  ------------------
  |  Branch (429:7): [True: 55, False: 0]
  ------------------
  430|     55|#if ARCHIVE_VERSION_NUMBER < 4000000
  431|     55|			data->code = ARCHIVE_FILTER_UU;
  ------------------
  |  |  318|     55|#define	ARCHIVE_FILTER_UU	7
  ------------------
  432|     55|			data->name = "uu";
  433|       |#else
  434|       |			data->code = ARCHIVE_FILTER_B64;
  435|       |			data->name = "b64";
  436|       |#endif
  437|     55|			return (bid);
  438|     55|		}
  439|     55|	}
  440|       |
  441|      0|	return (0);
  442|     89|}
archive_read_support_filter_uu.c:read_line_ahead:
  186|  3.36M|{
  187|       |	/* Read approximately two new lines each iteration. */
  188|  3.36M|	size_t step = 160;
  189|  3.36M|	const unsigned char *line;
  190|  3.36M|	ssize_t avail;
  191|  3.36M|	size_t request, start;
  192|       |
  193|  3.36M|	start = offset;
  194|  3.36M|	line = NULL;
  195|  3.36M|	*len = 0;
  196|  3.36M|	*unconsumed = 0;
  197|  3.36M|	request = offset == 0 ? 1 : offset + step;
  ------------------
  |  Branch (197:12): [True: 31.4k, False: 3.33M]
  ------------------
  198|  3.46M|	do {
  199|  3.46M|		size_t remaining, nl = 1;
  200|  3.46M|		const unsigned char *b, *p;
  201|       |
  202|       |		/* Read bytes from upstream filter. */
  203|  3.46M|		b = __archive_read_filter_ahead(f, request, &avail);
  204|  3.46M|		if (avail > MAX_LINE_LENGTH)
  ------------------
  |  |   45|  3.46M|#define MAX_LINE_LENGTH 128*1024 /* in bytes */
  ------------------
  |  Branch (204:7): [True: 4.68k, False: 3.45M]
  ------------------
  205|  4.68k|			avail = MAX_LINE_LENGTH;
  ------------------
  |  |   45|  4.68k|#define MAX_LINE_LENGTH 128*1024 /* in bytes */
  ------------------
  206|  3.46M|		*unconsumed = avail;
  207|  3.46M|		if (b == NULL) {
  ------------------
  |  Branch (207:7): [True: 19.4k, False: 3.44M]
  ------------------
  208|  19.4k|			if (avail > 0 && (size_t)avail > offset)
  ------------------
  |  Branch (208:8): [True: 19.1k, False: 335]
  |  Branch (208:21): [True: 12.9k, False: 6.21k]
  ------------------
  209|  12.9k|				b = __archive_read_filter_ahead(f, avail,
  210|  12.9k|				    &avail);
  211|  19.4k|			if (b == NULL)
  ------------------
  |  Branch (211:8): [True: 6.54k, False: 12.9k]
  ------------------
  212|  6.54k|				break;
  213|  19.4k|		}
  214|  3.45M|		remaining = avail - offset;
  215|       |		/* Locate end of line (\r, \n, \r\n). */
  216|  3.45M|		p = memchr(b + offset, '\n', remaining);
  217|  3.45M|		if (p == NULL) {
  ------------------
  |  Branch (217:7): [True: 1.74M, False: 1.70M]
  ------------------
  218|  1.74M|			p = memchr(b + offset, '\r', remaining);
  219|  1.74M|			if (p == b + avail - 1 && step > 1) {
  ------------------
  |  Branch (219:8): [True: 161, False: 1.74M]
  |  Branch (219:30): [True: 94, False: 67]
  ------------------
  220|       |				/* Is it \r or \r\n, missing one byte? */
  221|     94|				p = NULL;
  222|     94|				step = 1;
  223|     94|			}
  224|  1.74M|		} else if (p > b + start && p[-1] == '\r') {
  ------------------
  |  Branch (224:14): [True: 97.8k, False: 1.61M]
  |  Branch (224:31): [True: 2.68k, False: 95.1k]
  ------------------
  225|       |			/* "\r\n" takes two bytes. */
  226|  2.68k|			nl++;
  227|  2.68k|			--p;
  228|  2.68k|		}
  229|       |
  230|       |		/* Return line or prepare to read more bytes. */
  231|  3.45M|		if (p != NULL) {
  ------------------
  |  Branch (231:7): [True: 3.35M, False: 98.2k]
  ------------------
  232|  3.35M|			line = b + start;
  233|  3.35M|			*len = p - line;
  234|  3.35M|			*unconsumed = *len + nl;
  235|       |
  236|       |			/* Only ASCII lines are valid. */
  237|  7.82M|			while (p > line) {
  ------------------
  |  Branch (237:11): [True: 4.48M, False: 3.33M]
  ------------------
  238|  4.48M|				unsigned char c = *--p;
  239|       |
  240|  4.48M|				if (c < 0x20 || c > 0x7F) {
  ------------------
  |  Branch (240:9): [True: 9.32k, False: 4.47M]
  |  Branch (240:21): [True: 6.85k, False: 4.47M]
  ------------------
  241|  16.1k|					*len = 0;
  242|  16.1k|					*unconsumed = 0;
  243|  16.1k|					return (NULL);
  244|  16.1k|				}
  245|  4.48M|			}
  246|  3.35M|		} else {
  247|       |			/* Keep offset for check of possibly missing \n in \r\n. */
  248|  98.2k|			if (step != 1)
  ------------------
  |  Branch (248:8): [True: 98.1k, False: 94]
  ------------------
  249|  98.1k|				offset = avail;
  250|  98.2k|			if (archive_ckd_add_size(&request, avail, step))
  ------------------
  |  Branch (250:8): [True: 0, False: 98.2k]
  ------------------
  251|      0|				break;
  252|  98.2k|			if (request > MAX_LINE_LENGTH)
  ------------------
  |  |   45|  98.2k|#define MAX_LINE_LENGTH 128*1024 /* in bytes */
  ------------------
  |  Branch (252:8): [True: 461, False: 97.7k]
  ------------------
  253|    461|				request = MAX_LINE_LENGTH;
  ------------------
  |  |   45|    461|#define MAX_LINE_LENGTH 128*1024 /* in bytes */
  ------------------
  254|  98.2k|		}
  255|  3.45M|	} while (line == NULL && avail < MAX_LINE_LENGTH && !parsed);
  ------------------
  |  |   45|  3.53M|#define MAX_LINE_LENGTH 128*1024 /* in bytes */
  ------------------
  |  Branch (255:11): [True: 98.2k, False: 3.33M]
  |  Branch (255:27): [True: 97.9k, False: 257]
  |  Branch (255:54): [True: 97.9k, False: 57]
  ------------------
  256|       |
  257|  3.34M|	return line;
  258|  3.36M|}
archive_read_support_filter_uu.c:parse_header:
  277|  3.33M|{
  278|  3.33M|	size_t i, l;
  279|  3.33M|	mode_t m;
  280|  3.33M|	int state = ST_READ_UU;
  ------------------
  |  |   57|  3.33M|#define ST_READ_UU	1
  ------------------
  281|  3.33M|	int encoded = 0;
  282|       |
  283|  3.33M|	if (len < 6 || memcmp(p, "begin", 5) != 0)
  ------------------
  |  Branch (283:6): [True: 3.32M, False: 11.3k]
  |  Branch (283:17): [True: 9.02k, False: 2.32k]
  ------------------
  284|  3.33M|		return (0);
  285|  2.32k|	l = 5;
  286|  2.32k|	if (len - l >= 7 && memcmp(p + l, "-base64", 7) == 0) {
  ------------------
  |  Branch (286:6): [True: 1.31k, False: 1.00k]
  |  Branch (286:22): [True: 324, False: 995]
  ------------------
  287|    324|		state = ST_READ_BASE64;
  ------------------
  |  |   59|    324|#define ST_READ_BASE64	3
  ------------------
  288|    324|		l += 7;
  289|    324|	}
  290|  2.32k|	if (len - l >= 8 && memcmp(p + l, "-encoded", 8) == 0) {
  ------------------
  |  Branch (290:6): [True: 1.00k, False: 1.31k]
  |  Branch (290:22): [True: 10, False: 992]
  ------------------
  291|     10|		encoded = 1;
  292|     10|		l += 8;
  293|     10|	}
  294|  2.32k|	if (l >= len || p[l] != ' ')
  ------------------
  |  Branch (294:6): [True: 9, False: 2.31k]
  |  Branch (294:18): [True: 380, False: 1.93k]
  ------------------
  295|    389|		return (0);
  296|  1.93k|	++l;
  297|       |
  298|  1.93k|	m = 0;
  299|  7.36k|	for (i = l; i < len && p[i] >= '0' && p[i] <= '7'; i++)
  ------------------
  |  Branch (299:14): [True: 6.74k, False: 617]
  |  Branch (299:25): [True: 6.29k, False: 448]
  |  Branch (299:40): [True: 5.43k, False: 867]
  ------------------
  300|  5.43k|		m = ((m << 3) | (p[i] - '0')) & 0777;
  301|       |	/*
  302|       |	 * Need at least three digits, as too lenient a check would have
  303|       |	 * the bidder take other kinds of data for a header. Then a space and
  304|       |	 * a one character name.
  305|       |	 */
  306|  1.93k|	if (i - l < 3 || i + 1 >= len || p[i] != ' ')
  ------------------
  |  Branch (306:6): [True: 760, False: 1.17k]
  |  Branch (306:19): [True: 333, False: 839]
  |  Branch (306:35): [True: 664, False: 175]
  ------------------
  307|  1.75k|		return (0);
  308|       |
  309|    175|	if (mode != NULL)
  ------------------
  |  Branch (309:6): [True: 85, False: 90]
  ------------------
  310|     85|		*mode = m;
  311|    175|	if (name_offset != NULL)
  ------------------
  |  Branch (311:6): [True: 85, False: 90]
  ------------------
  312|     85|		*name_offset = i + 1;
  313|    175|	if (encoded_name != NULL)
  ------------------
  |  Branch (313:6): [True: 85, False: 90]
  ------------------
  314|     85|		*encoded_name = encoded;
  315|    175|	return (state);
  316|  1.93k|}
archive_read_support_filter_uu.c:uudecode_bidder_init:
  453|     85|{
  454|     85|	struct uu_bidder *data = f->bidder->data;
  455|     85|	struct uu *uu;
  456|     85|	void *out_buff;
  457|       |
  458|     85|	f->code = data->code;
  459|     85|	f->name = data->name;
  460|       |
  461|     85|	uu = calloc(1, sizeof(*uu));
  462|     85|	out_buff = malloc(OUT_BUFF_SIZE);
  ------------------
  |  |   54|     85|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  463|     85|	if (uu == NULL || out_buff == NULL) {
  ------------------
  |  Branch (463:6): [True: 0, False: 85]
  |  Branch (463:20): [True: 0, False: 85]
  ------------------
  464|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  465|      0|		    "Can't allocate data for uudecode");
  466|      0|		free(uu);
  467|      0|		free(out_buff);
  468|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|      0|	}
  470|       |
  471|     85|	f->data = uu;
  472|     85|	uu->out_buff = out_buff;
  473|     85|	uu->state = ST_FIND_HEAD;
  ------------------
  |  |   56|     85|#define ST_FIND_HEAD	0
  ------------------
  474|     85|	uu->mode_set = 0;
  475|     85|	uu->name = NULL;
  476|     85|	f->vtable = &uudecode_reader_vtable;
  477|       |
  478|     85|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     85|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  479|     85|}
archive_read_support_filter_uu.c:uudecode_filter_read:
  504|    150|{
  505|    150|	struct uu *uu = f->data;
  506|    150|	unsigned char *out;
  507|    150|	ssize_t total;
  508|       |
  509|    150|	out = uu->out_buff;
  510|    150|	total = 0;
  511|       |
  512|  8.48k|	while (uu->state != ST_IGNORE) {
  ------------------
  |  |   60|  8.48k|#define ST_IGNORE	4
  ------------------
  |  Branch (512:9): [True: 8.48k, False: 0]
  ------------------
  513|  8.48k|		const unsigned char *b;
  514|  8.48k|		ssize_t unconsumed;
  515|  8.48k|		ssize_t l, body;
  516|  8.48k|		ssize_t namelen;
  517|  8.48k|		size_t len, name_offset;
  518|  8.48k|		mode_t mode;
  519|  8.48k|		int state, encoded_name;
  520|       |
  521|  8.48k|		b = read_line_ahead(f->upstream, total, 0,
  522|  8.48k|		    &len, &unconsumed);
  523|  8.48k|		if (b == NULL) {
  ------------------
  |  Branch (523:7): [True: 126, False: 8.35k]
  ------------------
  524|    126|			if (unconsumed < 0)
  ------------------
  |  Branch (524:8): [True: 4, False: 122]
  ------------------
  525|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  526|    122|			if (unconsumed == MAX_LINE_LENGTH) {
  ------------------
  |  |   45|    122|#define MAX_LINE_LENGTH 128*1024 /* in bytes */
  ------------------
  |  Branch (526:8): [True: 1, False: 121]
  ------------------
  527|      1|				archive_set_error(&f->archive->archive,
  528|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  529|      1|				    "Invalid format data");
  530|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  531|      1|			}
  532|    121|			if (total != 0)
  ------------------
  |  Branch (532:8): [True: 64, False: 57]
  ------------------
  533|     64|				break;
  534|     57|			if (uu->state != ST_FIND_HEAD) {
  ------------------
  |  |   56|     57|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (534:8): [True: 57, False: 0]
  ------------------
  535|     57|				archive_set_error(&f->archive->archive,
  536|     57|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     57|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  537|     57|				    "Insufficient compressed data");
  538|     57|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     57|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  539|     57|			}
  540|       |			/* Non-ascii character or end of stream is found. */
  541|      0|			uu->state = ST_IGNORE;
  ------------------
  |  |   60|      0|#define ST_IGNORE	4
  ------------------
  542|      0|		}
  543|       |
  544|  8.35k|		switch (uu->state) {
  545|      0|		case ST_IGNORE:
  ------------------
  |  |   60|      0|#define ST_IGNORE	4
  ------------------
  |  Branch (545:3): [True: 0, False: 8.35k]
  ------------------
  546|      0|		default:
  ------------------
  |  Branch (546:3): [True: 0, False: 8.35k]
  ------------------
  547|      0|			break;
  548|  1.63k|		case ST_FIND_HEAD:
  ------------------
  |  |   56|  1.63k|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (548:3): [True: 1.63k, False: 6.72k]
  ------------------
  549|  1.63k|			state = parse_header(b, len, &mode, &name_offset,
  550|  1.63k|			    &encoded_name);
  551|  1.63k|			if (state != 0) {
  ------------------
  |  Branch (551:8): [True: 85, False: 1.55k]
  ------------------
  552|     85|				uu->state = state;
  553|     85|				uu->mode = mode;
  554|     85|				uu->mode_set = 1;
  555|     85|				namelen = len - name_offset;
  556|     85|				if (namelen > 0) {
  ------------------
  |  Branch (556:9): [True: 85, False: 0]
  ------------------
  557|     85|					free(uu->name);
  558|     85|					uu->name = malloc(namelen + 1);
  559|     85|					if (uu->name == NULL) {
  ------------------
  |  Branch (559:10): [True: 0, False: 85]
  ------------------
  560|      0|						archive_set_error(
  561|      0|						    &f->archive->archive,
  562|      0|						    ENOMEM,
  563|      0|						    "Can't allocate data for uudecode");
  564|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  565|      0|					}
  566|     85|					strncpy(uu->name,
  567|     85|					    (const char *)(b + name_offset),
  568|     85|					    namelen);
  569|     85|					uu->name[namelen] = '\0';
  570|     85|					if (encoded_name &&
  ------------------
  |  Branch (570:10): [True: 0, False: 85]
  ------------------
  571|      0|					    !decode_name(uu->name, namelen)) {
  ------------------
  |  Branch (571:10): [True: 0, False: 0]
  ------------------
  572|      0|						archive_set_error(
  573|      0|						    &f->archive->archive,
  574|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  575|      0|						    "Invalid base64-encoded filename");
  576|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  577|      0|					}
  578|     85|				}
  579|     85|			}
  580|  1.63k|			break;
  581|  1.63k|		case ST_READ_UU:
  ------------------
  |  |   57|    118|#define ST_READ_UU	1
  ------------------
  |  Branch (581:3): [True: 118, False: 8.24k]
  ------------------
  582|    118|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   54|    118|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (582:8): [True: 4, False: 114]
  ------------------
  583|      4|				goto finish;
  584|    114|			body = len;
  585|    114|			if (!uuchar[*b] || body <= 0) {
  ------------------
  |  Branch (585:8): [True: 2, False: 112]
  |  Branch (585:23): [True: 0, False: 112]
  ------------------
  586|      2|				archive_set_error(&f->archive->archive,
  587|      2|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  588|      2|				    "Insufficient compressed data");
  589|      2|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  590|      2|			}
  591|       |			/* Get length of undecoded bytes of current line. */
  592|    112|			l = UUDECODE(*b++);
  ------------------
  |  |  260|    112|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  593|    112|			body--;
  594|    112|			if (l > body) {
  ------------------
  |  Branch (594:8): [True: 2, False: 110]
  ------------------
  595|      2|				archive_set_error(&f->archive->archive,
  596|      2|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  597|      2|				    "Insufficient compressed data");
  598|      2|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  599|      2|			}
  600|    110|			if (l == 0) {
  ------------------
  |  Branch (600:8): [True: 18, False: 92]
  ------------------
  601|     18|				uu->state = ST_UUEND;
  ------------------
  |  |   58|     18|#define ST_UUEND	2
  ------------------
  602|     18|				break;
  603|     18|			}
  604|    372|			while (l > 0) {
  ------------------
  |  Branch (604:11): [True: 281, False: 91]
  ------------------
  605|    281|				int n = 0;
  606|       |
  607|    281|				if (!uuchar[b[0]] || !uuchar[b[1]])
  ------------------
  |  Branch (607:9): [True: 0, False: 281]
  |  Branch (607:26): [True: 1, False: 280]
  ------------------
  608|      1|					break;
  609|    280|				n = UUDECODE(*b++) << 18;
  ------------------
  |  |  260|    280|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  610|    280|				n |= UUDECODE(*b++) << 12;
  ------------------
  |  |  260|    280|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  611|    280|				*out++ = n >> 16; total++;
  612|    280|				--l;
  613|       |
  614|    280|				if (l > 0) {
  ------------------
  |  Branch (614:9): [True: 207, False: 73]
  ------------------
  615|    207|					if (!uuchar[b[0]])
  ------------------
  |  Branch (615:10): [True: 0, False: 207]
  ------------------
  616|      0|						break;
  617|    207|					n |= UUDECODE(*b++) << 6;
  ------------------
  |  |  260|    207|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  618|    207|					*out++ = (n >> 8) & 0xFF; total++;
  619|    207|					--l;
  620|    207|				}
  621|    280|				if (l > 0) {
  ------------------
  |  Branch (621:9): [True: 189, False: 91]
  ------------------
  622|    189|					if (!uuchar[b[0]])
  ------------------
  |  Branch (622:10): [True: 0, False: 189]
  ------------------
  623|      0|						break;
  624|    189|					n |= UUDECODE(*b++);
  ------------------
  |  |  260|    189|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  625|    189|					*out++ = n & 0xFF; total++;
  626|    189|					--l;
  627|    189|				}
  628|    280|			}
  629|     92|			if (l) {
  ------------------
  |  Branch (629:8): [True: 1, False: 91]
  ------------------
  630|      1|				archive_set_error(&f->archive->archive,
  631|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  632|      1|				    "Insufficient compressed data");
  633|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  634|      1|			}
  635|     91|			break;
  636|     91|		case ST_UUEND:
  ------------------
  |  |   58|      8|#define ST_UUEND	2
  ------------------
  |  Branch (636:3): [True: 8, False: 8.35k]
  ------------------
  637|      8|			if (len == 3 && memcmp(b, "end", 3) == 0)
  ------------------
  |  Branch (637:8): [True: 3, False: 5]
  |  Branch (637:20): [True: 0, False: 3]
  ------------------
  638|      0|				uu->state = ST_IGNORE;
  ------------------
  |  |   60|      0|#define ST_IGNORE	4
  ------------------
  639|      8|			else {
  640|      8|				archive_set_error(&f->archive->archive,
  641|      8|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  642|      8|				    "Insufficient compressed data");
  643|      8|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  644|      8|			}
  645|      0|			break;
  646|  6.59k|		case ST_READ_BASE64:
  ------------------
  |  |   59|  6.59k|#define ST_READ_BASE64	3
  ------------------
  |  Branch (646:3): [True: 6.59k, False: 1.76k]
  ------------------
  647|  6.59k|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   54|  6.59k|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (647:8): [True: 0, False: 6.59k]
  ------------------
  648|      0|				goto finish;
  649|  6.59k|			l = len;
  650|  6.59k|			if (l >= 3 && b[0] == '=' && b[1] == '=' &&
  ------------------
  |  Branch (650:8): [True: 4.19k, False: 2.40k]
  |  Branch (650:18): [True: 3.87k, False: 323]
  |  Branch (650:33): [True: 895, False: 2.97k]
  ------------------
  651|    895|			    b[2] == '=') {
  ------------------
  |  Branch (651:8): [True: 0, False: 895]
  ------------------
  652|      0|				uu->state = ST_IGNORE;
  ------------------
  |  |   60|      0|#define ST_IGNORE	4
  ------------------
  653|      0|				break;
  654|      0|			}
  655|  10.2k|			while (l > 0) {
  ------------------
  |  Branch (655:11): [True: 8.64k, False: 1.57k]
  ------------------
  656|  8.64k|				int n = 0;
  657|       |
  658|  8.64k|				if (!base64[b[0]] || !base64[b[1]])
  ------------------
  |  Branch (658:9): [True: 1, False: 8.64k]
  |  Branch (658:26): [True: 1.24k, False: 7.39k]
  ------------------
  659|  1.24k|					break;
  660|  7.39k|				n = base64num[*b++] << 18;
  661|  7.39k|				n |= base64num[*b++] << 12;
  662|  7.39k|				*out++ = n >> 16; total++;
  663|  7.39k|				l -= 2;
  664|       |
  665|  7.39k|				if (l > 0) {
  ------------------
  |  Branch (665:9): [True: 6.28k, False: 1.11k]
  ------------------
  666|  6.28k|					if (*b == '=')
  ------------------
  |  Branch (666:10): [True: 2.09k, False: 4.19k]
  ------------------
  667|  2.09k|						break;
  668|  4.19k|					if (!base64[*b])
  ------------------
  |  Branch (668:10): [True: 2, False: 4.19k]
  ------------------
  669|      2|						break;
  670|  4.19k|					n |= base64num[*b++] << 6;
  671|  4.19k|					*out++ = (n >> 8) & 0xFF; total++;
  672|  4.19k|					--l;
  673|  4.19k|				}
  674|  5.30k|				if (l > 0) {
  ------------------
  |  Branch (674:9): [True: 4.06k, False: 1.23k]
  ------------------
  675|  4.06k|					if (*b == '=')
  ------------------
  |  Branch (675:10): [True: 1.68k, False: 2.38k]
  ------------------
  676|  1.68k|						break;
  677|  2.38k|					if (!base64[*b])
  ------------------
  |  Branch (677:10): [True: 2, False: 2.37k]
  ------------------
  678|      2|						break;
  679|  2.37k|					n |= base64num[*b++];
  680|  2.37k|					*out++ = n & 0xFF; total++;
  681|  2.37k|					--l;
  682|  2.37k|				}
  683|  5.30k|			}
  684|  6.59k|			if (l && *b != '=') {
  ------------------
  |  Branch (684:8): [True: 5.02k, False: 1.57k]
  |  Branch (684:13): [True: 7, False: 5.01k]
  ------------------
  685|      7|				archive_set_error(&f->archive->archive,
  686|      7|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  687|      7|				    "Insufficient compressed data");
  688|      7|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  689|      7|			}
  690|  6.58k|			break;
  691|  8.35k|		}
  692|  8.33k|		__archive_read_filter_consume(f->upstream, unconsumed);
  693|  8.33k|	}
  694|     68|finish:
  695|     68|	*buff = uu->out_buff;
  696|     68|	return (total);
  697|    150|}
archive_read_support_filter_uu.c:uudecode_filter_close:
  701|     85|{
  702|     85|	struct uu *uu = f->data;
  703|       |
  704|     85|	free(uu->out_buff);
  705|     85|	free(uu->name);
  706|     85|	free(uu);
  707|       |
  708|     85|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     85|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  709|     85|}
archive_read_support_filter_uu.c:uudecode_read_header:
  490|      1|{
  491|      1|	struct uu *uu = f->data;
  492|       |
  493|      1|	if (uu->mode_set != 0)
  ------------------
  |  Branch (493:6): [True: 1, False: 0]
  ------------------
  494|      1|		archive_entry_set_mode(entry, S_IFREG | uu->mode);
  495|       |
  496|      1|	if (uu->name != NULL)
  ------------------
  |  Branch (496:6): [True: 1, False: 0]
  ------------------
  497|      1|		archive_entry_set_pathname(entry, uu->name);
  498|       |
  499|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  234|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  500|      1|}
archive_read_support_filter_uu.c:uudecode_bidder_free:
  483|  20.1k|{
  484|  20.1k|	free(b->data);
  485|       |	b->data = NULL;
  486|  20.1k|}

archive_read_support_filter_xz:
  115|  20.1k|{
  116|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  117|       |
  118|  20.1k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (118:6): [True: 0, False: 20.1k]
  ------------------
  119|  20.1k|				&xz_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  120|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  121|       |
  122|  20.1k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  123|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#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|  20.1k|}
archive_read_support_filter_lzma:
  147|  20.1k|{
  148|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  149|       |
  150|  20.1k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (150:6): [True: 0, False: 20.1k]
  ------------------
  151|  20.1k|				&lzma_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  152|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  153|       |
  154|  20.1k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  155|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#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|  20.1k|}
archive_read_support_filter_lzip:
  180|  20.1k|{
  181|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  182|       |
  183|  20.1k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (183:6): [True: 0, False: 20.1k]
  ------------------
  184|  20.1k|				&lzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  185|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  186|       |
  187|  20.1k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  188|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#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|  20.1k|}
archive_read_support_filter_xz.c:xz_bidder_bid:
  202|  23.0k|{
  203|  23.0k|	const unsigned char *buffer;
  204|       |
  205|  23.0k|	(void)b; /* UNUSED */
  206|       |
  207|  23.0k|	buffer = __archive_read_filter_ahead(f, 6, NULL);
  208|  23.0k|	if (buffer == NULL)
  ------------------
  |  Branch (208:6): [True: 258, False: 22.7k]
  ------------------
  209|    258|		return (0);
  210|       |
  211|       |	/*
  212|       |	 * Verify Header Magic Bytes : FD 37 7A 58 5A 00
  213|       |	 */
  214|  22.7k|	if (memcmp(buffer, "\xFD\x37\x7A\x58\x5A\x00", 6) != 0)
  ------------------
  |  Branch (214:6): [True: 22.7k, False: 1]
  ------------------
  215|  22.7k|		return (0);
  216|       |
  217|      1|	return (48);
  218|  22.7k|}
archive_read_support_filter_xz.c:xz_bidder_init:
  387|      1|{
  388|      1|	f->code = ARCHIVE_FILTER_XZ;
  ------------------
  |  |  317|      1|#define	ARCHIVE_FILTER_XZ	6
  ------------------
  389|      1|	f->name = "xz";
  390|      1|	return (xz_lzma_bidder_init(f));
  391|      1|}
archive_read_support_filter_xz.c:xz_lzma_bidder_init:
  468|    100|{
  469|    100|	static const size_t out_block_size = 64 * 1024;
  470|    100|	void *out_block;
  471|    100|	struct xz *xz;
  472|    100|	int ret;
  473|       |
  474|    100|	xz = calloc(1, sizeof(*xz));
  475|    100|	out_block = malloc(out_block_size);
  476|    100|	if (xz == NULL || out_block == NULL) {
  ------------------
  |  Branch (476:6): [True: 0, False: 100]
  |  Branch (476:20): [True: 0, False: 100]
  ------------------
  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);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  482|      0|	}
  483|       |
  484|    100|	f->data = xz;
  485|    100|	xz->out_block_size = out_block_size;
  486|    100|	xz->out_block = out_block;
  487|    100|	f->vtable = &xz_lzma_reader_vtable;
  488|       |
  489|    100|	xz->stream.avail_in = 0;
  490|       |
  491|    100|	xz->stream.next_out = xz->out_block;
  492|    100|	xz->stream.avail_out = xz->out_block_size;
  493|       |
  494|    100|	xz->crc32 = 0;
  495|    100|	if (f->code == ARCHIVE_FILTER_LZIP) {
  ------------------
  |  |  320|    100|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (495:6): [True: 73, False: 27]
  ------------------
  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|     73|		xz->in_stream = 0;
  502|     73|		return (ARCHIVE_OK);
  ------------------
  |  |  234|     73|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  503|     73|	} else
  504|     27|		xz->in_stream = 1;
  505|       |
  506|       |	/* Initialize compression library. */
  507|     27|	if (f->code == ARCHIVE_FILTER_XZ)
  ------------------
  |  |  317|     27|#define	ARCHIVE_FILTER_XZ	6
  ------------------
  |  Branch (507:6): [True: 1, False: 26]
  ------------------
  508|      1|		ret = lzma_stream_decoder(&(xz->stream),
  509|      1|		    LZMA_MEMLIMIT,/* memlimit */
  ------------------
  |  |   69|      1|#define LZMA_MEMLIMIT	UINT64_MAX
  ------------------
  510|      1|		    LZMA_CONCATENATED);
  511|     26|	else
  512|     26|		ret = lzma_alone_decoder(&(xz->stream),
  513|     26|		    LZMA_MEMLIMIT);/* memlimit */
  ------------------
  |  |   69|     26|#define LZMA_MEMLIMIT	UINT64_MAX
  ------------------
  514|       |
  515|     27|	if (ret == LZMA_OK)
  ------------------
  |  Branch (515:6): [True: 27, False: 0]
  ------------------
  516|     27|		return (ARCHIVE_OK);
  ------------------
  |  |  234|     27|#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);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  526|     27|}
archive_read_support_filter_xz.c:xz_filter_read:
  646|  6.03k|{
  647|  6.03k|	struct xz *xz = f->data;
  648|  6.03k|	size_t decompressed;
  649|  6.03k|	ssize_t avail_in;
  650|  6.03k|	int64_t member_in;
  651|  6.03k|	int ret;
  652|       |
  653|  6.03k|	redo:
  654|       |	/* Empty our output buffer. */
  655|  6.03k|	xz->stream.next_out = xz->out_block;
  656|  6.03k|	xz->stream.avail_out = xz->out_block_size;
  657|  6.03k|	member_in = xz->member_in;
  658|       |
  659|       |	/* Try to fill the output buffer. */
  660|  12.0k|	while (xz->stream.avail_out > 0 && !xz->eof) {
  ------------------
  |  Branch (660:9): [True: 6.22k, False: 5.85k]
  |  Branch (660:37): [True: 6.09k, False: 126]
  ------------------
  661|  6.09k|		if (!xz->in_stream) {
  ------------------
  |  Branch (661:7): [True: 135, False: 5.96k]
  ------------------
  662|       |			/*
  663|       |			 * Initialize liblzma for lzip
  664|       |			 */
  665|    135|			ret = lzip_init(f);
  666|    135|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (666:8): [True: 0, False: 135]
  ------------------
  667|      0|				return (ret);
  668|    135|			xz->in_stream = 1;
  669|    135|		}
  670|  6.09k|		xz->stream.next_in =
  671|  6.09k|		    __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  672|  6.09k|		if (xz->stream.next_in == NULL && avail_in < 0) {
  ------------------
  |  Branch (672:7): [True: 76, False: 6.02k]
  |  Branch (672:37): [True: 1, False: 75]
  ------------------
  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);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  677|      1|		}
  678|  6.09k|		xz->stream.avail_in = avail_in;
  679|       |
  680|       |		/* Decompress as much as we can in one pass. */
  681|  6.09k|		ret = lzma_code(&(xz->stream),
  682|  6.09k|		    (xz->stream.avail_in == 0)? LZMA_FINISH: LZMA_RUN);
  ------------------
  |  Branch (682:7): [True: 75, False: 6.02k]
  ------------------
  683|  6.09k|		switch (ret) {
  684|    117|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (684:3): [True: 117, False: 5.97k]
  ------------------
  685|    117|			xz->eof = 1;
  686|       |			/* FALL THROUGH */
  687|  6.05k|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (687:3): [True: 5.93k, False: 161]
  ------------------
  688|  6.05k|			__archive_read_filter_consume(f->upstream,
  689|  6.05k|			    avail_in - xz->stream.avail_in);
  690|  6.05k|			xz->member_in +=
  691|  6.05k|			    avail_in - xz->stream.avail_in;
  692|  6.05k|			break;
  693|     44|		default:
  ------------------
  |  Branch (693:3): [True: 44, False: 6.05k]
  ------------------
  694|     44|			set_error(f, ret);
  695|     44|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     44|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  696|  6.09k|		}
  697|  6.09k|	}
  698|       |
  699|  5.98k|	decompressed = xz->stream.next_out - xz->out_block;
  700|  5.98k|	xz->member_out += decompressed;
  701|  5.98k|	if (decompressed == 0) {
  ------------------
  |  Branch (701:6): [True: 10, False: 5.97k]
  ------------------
  702|     10|		if (member_in != xz->member_in &&
  ------------------
  |  Branch (702:7): [True: 1, False: 9]
  ------------------
  703|      1|		    f->code == ARCHIVE_FILTER_LZIP &&
  ------------------
  |  |  320|     11|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (703:7): [True: 0, False: 1]
  ------------------
  704|      0|		    xz->eof) {
  ------------------
  |  Branch (704:7): [True: 0, False: 0]
  ------------------
  705|      0|			ret = lzip_tail(f);
  706|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|      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|     10|		*p = NULL;
  712|  5.97k|	} else {
  713|  5.97k|		*p = xz->out_block;
  714|  5.97k|		if (f->code == ARCHIVE_FILTER_LZIP) {
  ------------------
  |  |  320|  5.97k|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (714:7): [True: 4.73k, False: 1.23k]
  ------------------
  715|  4.73k|			xz->crc32 = lzma_crc32(xz->out_block,
  716|  4.73k|			    decompressed, xz->crc32);
  717|  4.73k|			if (xz->eof) {
  ------------------
  |  Branch (717:8): [True: 112, False: 4.62k]
  ------------------
  718|    112|				ret = lzip_tail(f);
  719|    112|				if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|    112|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (719:9): [True: 45, False: 67]
  ------------------
  720|     45|					return (ret);
  721|    112|			}
  722|  4.73k|		}
  723|  5.97k|	}
  724|  5.94k|	return (decompressed);
  725|  5.98k|}
archive_read_support_filter_xz.c:lzip_init:
  530|    135|{
  531|    135|	struct xz *xz = f->data;
  532|    135|	const unsigned char *h;
  533|    135|	lzma_filter filters[2];
  534|    135|	unsigned char props[5];
  535|    135|	uint32_t dicsize;
  536|    135|	int log2dic, ret;
  537|       |
  538|    135|	h = __archive_read_filter_ahead(f->upstream, 6, NULL);
  539|    135|	if (h == NULL)
  ------------------
  |  Branch (539:6): [True: 0, False: 135]
  ------------------
  540|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  541|       |
  542|       |	/* Get a version number. */
  543|    135|	xz->lzip_ver = h[4];
  544|       |
  545|       |	/*
  546|       |	 * Setup lzma property.
  547|       |	 */
  548|    135|	props[0] = 0x5d;
  549|       |
  550|       |	/* Get dictionary size. */
  551|    135|	log2dic = h[5] & 0x1f;
  552|    135|	if (log2dic < 12 || log2dic > 29)
  ------------------
  |  Branch (552:6): [True: 0, False: 135]
  |  Branch (552:22): [True: 0, False: 135]
  ------------------
  553|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  554|    135|	dicsize = 1U << log2dic;
  555|    135|	if (log2dic > 12)
  ------------------
  |  Branch (555:6): [True: 121, False: 14]
  ------------------
  556|    121|		dicsize -= (dicsize / 16) * (h[5] >> 5);
  557|    135|	archive_le32enc(props+1, dicsize);
  558|       |
  559|       |	/* Consume lzip header. */
  560|    135|	__archive_read_filter_consume(f->upstream, 6);
  561|    135|	xz->member_in = 6;
  562|       |
  563|    135|	filters[0].id = LZMA_FILTER_LZMA1;
  564|    135|	filters[0].options = NULL;
  565|    135|	filters[1].id = LZMA_VLI_UNKNOWN;
  566|    135|	filters[1].options = NULL;
  567|       |
  568|    135|	ret = lzma_properties_decode(&filters[0], NULL, props, sizeof(props));
  569|    135|	if (ret != LZMA_OK) {
  ------------------
  |  Branch (569:6): [True: 0, False: 135]
  ------------------
  570|      0|		set_error(f, ret);
  571|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  572|      0|	}
  573|    135|	ret = lzma_raw_decoder(&(xz->stream), filters);
  574|    135|	free(filters[0].options);
  575|    135|	if (ret != LZMA_OK) {
  ------------------
  |  Branch (575:6): [True: 0, False: 135]
  ------------------
  576|      0|		set_error(f, ret);
  577|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  578|      0|	}
  579|    135|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  580|    135|}
archive_read_support_filter_xz.c:lzip_tail:
  584|    112|{
  585|    112|	struct xz *xz = f->data;
  586|    112|	const unsigned char *p;
  587|    112|	ssize_t avail_in;
  588|    112|	int tail;
  589|       |
  590|    112|	if (xz->lzip_ver == 0)
  ------------------
  |  Branch (590:6): [True: 43, False: 69]
  ------------------
  591|     43|		tail = 12;
  592|     69|	else
  593|     69|		tail = 20;
  594|    112|	p = __archive_read_filter_ahead(f->upstream, tail, &avail_in);
  595|    112|	if (p == NULL && avail_in < 0)
  ------------------
  |  Branch (595:6): [True: 6, False: 106]
  |  Branch (595:19): [True: 0, False: 6]
  ------------------
  596|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  597|    112|	if (p == NULL || avail_in < tail) {
  ------------------
  |  Branch (597:6): [True: 6, False: 106]
  |  Branch (597:19): [True: 0, False: 106]
  ------------------
  598|      6|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  599|      6|		    "Lzip: Remaining data is less bytes");
  600|      6|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  601|      6|	}
  602|       |
  603|       |	/* Check the crc32 value of the uncompressed data of the current
  604|       |	 * member */
  605|    106|	if (xz->crc32 != archive_le32dec(p)) {
  ------------------
  |  Branch (605:6): [True: 106, False: 0]
  ------------------
  606|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  607|       |		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  608|       |		    "Lzip: CRC32 error");
  609|       |		return (ARCHIVE_FAILED);
  610|       |#endif
  611|    106|	}
  612|       |
  613|       |	/* Check the uncompressed size of the current member */
  614|    106|	if ((uint64_t)xz->member_out != archive_le64dec(p + 4)) {
  ------------------
  |  Branch (614:6): [True: 28, False: 78]
  ------------------
  615|     28|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     28|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  616|     28|		    "Lzip: Uncompressed size error");
  617|     28|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     28|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  618|     28|	}
  619|       |
  620|       |	/* Check the total size of the current member */
  621|     78|	if (xz->lzip_ver == 1 &&
  ------------------
  |  Branch (621:6): [True: 47, False: 31]
  ------------------
  622|     47|	    (uint64_t)xz->member_in + tail != archive_le64dec(p + 12)) {
  ------------------
  |  Branch (622:6): [True: 11, False: 36]
  ------------------
  623|     11|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  624|     11|		    "Lzip: Member size error");
  625|     11|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     11|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  626|     11|	}
  627|     67|	__archive_read_filter_consume(f->upstream, tail);
  628|       |
  629|       |	/* If current lzip data consists of multi member, try decompressing
  630|       |	 * a next member. */
  631|     67|	if (lzip_has_member(f->upstream) != 0) {
  ------------------
  |  Branch (631:6): [True: 62, False: 5]
  ------------------
  632|     62|		xz->in_stream = 0;
  633|     62|		xz->crc32 = 0;
  634|     62|		xz->member_out = 0;
  635|     62|		xz->member_in = 0;
  636|     62|		xz->eof = 0;
  637|     62|	}
  638|     67|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     67|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  639|     78|}
archive_read_support_filter_xz.c:lzip_has_member:
  340|  23.0k|{
  341|  23.0k|	const unsigned char *buffer;
  342|  23.0k|	int bits_checked;
  343|  23.0k|	int log2dic;
  344|       |
  345|  23.0k|	buffer = __archive_read_filter_ahead(f, 6, NULL);
  346|  23.0k|	if (buffer == NULL)
  ------------------
  |  Branch (346:6): [True: 260, False: 22.8k]
  ------------------
  347|    260|		return (0);
  348|       |
  349|       |	/*
  350|       |	 * Verify Header Magic Bytes : 4C 5A 49 50 (`LZIP')
  351|       |	 */
  352|  22.8k|	bits_checked = 0;
  353|  22.8k|	if (memcmp(buffer, "LZIP", 4) != 0)
  ------------------
  |  Branch (353:6): [True: 22.6k, False: 152]
  ------------------
  354|  22.6k|		return (0);
  355|    152|	bits_checked += 32;
  356|       |
  357|       |	/* A version number must be 0 or 1 */
  358|    152|	if (buffer[4] != 0 && buffer[4] != 1)
  ------------------
  |  Branch (358:6): [True: 91, False: 61]
  |  Branch (358:24): [True: 16, False: 75]
  ------------------
  359|     16|		return (0);
  360|    136|	bits_checked += 8;
  361|       |
  362|       |	/* Dictionary size. */
  363|    136|	log2dic = buffer[5] & 0x1f;
  364|    136|	if (log2dic < 12 || log2dic > 29)
  ------------------
  |  Branch (364:6): [True: 0, False: 136]
  |  Branch (364:22): [True: 1, False: 135]
  ------------------
  365|      1|		return (0);
  366|    135|	bits_checked += 8;
  367|       |
  368|    135|	return (bits_checked);
  369|    136|}
archive_read_support_filter_xz.c:xz_filter_close:
  732|    100|{
  733|    100|	struct xz *xz = f->data;
  734|       |
  735|    100|	lzma_end(&(xz->stream));
  736|    100|	free(xz->out_block);
  737|    100|	free(xz);
  738|    100|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  739|    100|}
archive_read_support_filter_xz.c:set_error:
  414|     44|{
  415|       |
  416|     44|	switch (ret) {
  417|      0|	case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (417:2): [True: 0, False: 44]
  ------------------
  418|      0|	case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (418:2): [True: 0, False: 44]
  ------------------
  419|      0|		break;
  420|      0|	case LZMA_MEM_ERROR:
  ------------------
  |  Branch (420:2): [True: 0, False: 44]
  ------------------
  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: 44]
  ------------------
  425|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  426|      0|		    "Lzma library error: Out of memory");
  427|      0|		break;
  428|      0|	case LZMA_FORMAT_ERROR:
  ------------------
  |  Branch (428:2): [True: 0, False: 44]
  ------------------
  429|      0|		archive_set_error(&f->archive->archive,
  430|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  431|      0|		    "Lzma library error: format not recognized");
  432|      0|		break;
  433|      0|	case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (433:2): [True: 0, False: 44]
  ------------------
  434|      0|		archive_set_error(&f->archive->archive,
  435|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  436|      0|		    "Lzma library error: Invalid options");
  437|      0|		break;
  438|     12|	case LZMA_DATA_ERROR:
  ------------------
  |  Branch (438:2): [True: 12, False: 32]
  ------------------
  439|     12|		archive_set_error(&f->archive->archive,
  440|     12|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  441|     12|		    "Lzma library error: Corrupted input data");
  442|     12|		break;
  443|     32|	case LZMA_BUF_ERROR:
  ------------------
  |  Branch (443:2): [True: 32, False: 12]
  ------------------
  444|     32|		archive_set_error(&f->archive->archive,
  445|     32|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     32|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  446|     32|		    "Lzma library error:  No progress is possible");
  447|     32|		break;
  448|      0|	default:
  ------------------
  |  Branch (448:2): [True: 0, False: 44]
  ------------------
  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|     44|	}
  455|     44|}
archive_read_support_filter_xz.c:lzma_bidder_bid:
  235|  23.0k|{
  236|  23.0k|	const unsigned char *buffer;
  237|  23.0k|	uint32_t dicsize;
  238|  23.0k|	uint64_t uncompressed_size;
  239|  23.0k|	int bits_checked;
  240|       |
  241|  23.0k|	(void)b; /* UNUSED */
  242|       |
  243|  23.0k|	buffer = __archive_read_filter_ahead(f, 14, NULL);
  244|  23.0k|	if (buffer == NULL)
  ------------------
  |  Branch (244:6): [True: 276, False: 22.7k]
  ------------------
  245|    276|		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|  22.7k|	bits_checked = 0;
  264|  22.7k|	if (buffer[0] > (4 * 5 + 4) * 9 + 8)
  ------------------
  |  Branch (264:6): [True: 364, False: 22.3k]
  ------------------
  265|    364|		return (0);
  266|       |	/* Most likely value in the first byte of LZMA stream. */
  267|  22.3k|	if (buffer[0] == 0x5d || buffer[0] == 0x5e)
  ------------------
  |  Branch (267:6): [True: 13, False: 22.3k]
  |  Branch (267:27): [True: 1, False: 22.3k]
  ------------------
  268|     14|		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|  22.3k|	uncompressed_size = archive_le64dec(buffer+5);
  275|  22.3k|	if (uncompressed_size == (uint64_t)ARCHIVE_LITERAL_LL(-1))
  ------------------
  |  |  207|  22.3k|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  ------------------
  |  Branch (275:6): [True: 63, False: 22.3k]
  ------------------
  276|     63|		bits_checked += 64;
  277|       |
  278|       |	/* Second through fifth bytes are dictionary size, stored in
  279|       |	 * little-endian order. The minimum dictionary size is
  280|       |	 * 1 << 12(4KiB) which the lzma of LZMA SDK uses with option
  281|       |	 * -d12 and the maximum dictionary size is 1 << 29(512MiB)
  282|       |	 * which the one uses with option -d29.
  283|       |	 * NOTE: A comment of LZMA SDK source code says this dictionary
  284|       |	 * range is from 1 << 12 to 1 << 30. */
  285|  22.3k|	dicsize = archive_le32dec(buffer+1);
  286|  22.3k|	switch (dicsize) {
  287|      0|	case 0x00001000:/* lzma of LZMA SDK option -d12. */
  ------------------
  |  Branch (287:2): [True: 0, False: 22.3k]
  ------------------
  288|      0|	case 0x00002000:/* lzma of LZMA SDK option -d13. */
  ------------------
  |  Branch (288:2): [True: 0, False: 22.3k]
  ------------------
  289|      0|	case 0x00004000:/* lzma of LZMA SDK option -d14. */
  ------------------
  |  Branch (289:2): [True: 0, False: 22.3k]
  ------------------
  290|      1|	case 0x00008000:/* lzma of LZMA SDK option -d15. */
  ------------------
  |  Branch (290:2): [True: 1, False: 22.3k]
  ------------------
  291|     10|	case 0x00010000:/* lzma of XZ Utils option -0 and -1.
  ------------------
  |  Branch (291:2): [True: 9, False: 22.3k]
  ------------------
  292|       |			 * lzma of LZMA SDK option -d16. */
  293|     11|	case 0x00020000:/* lzma of LZMA SDK option -d17. */
  ------------------
  |  Branch (293:2): [True: 1, False: 22.3k]
  ------------------
  294|     11|	case 0x00040000:/* lzma of LZMA SDK option -d18. */
  ------------------
  |  Branch (294:2): [True: 0, False: 22.3k]
  ------------------
  295|     11|	case 0x00080000:/* lzma of XZ Utils option -2.
  ------------------
  |  Branch (295:2): [True: 0, False: 22.3k]
  ------------------
  296|       |			 * lzma of LZMA SDK option -d19. */
  297|     11|	case 0x00100000:/* lzma of XZ Utils option -3.
  ------------------
  |  Branch (297:2): [True: 0, False: 22.3k]
  ------------------
  298|       |			 * lzma of LZMA SDK option -d20. */
  299|     11|	case 0x00200000:/* lzma of XZ Utils option -4.
  ------------------
  |  Branch (299:2): [True: 0, False: 22.3k]
  ------------------
  300|       |			 * lzma of LZMA SDK option -d21. */
  301|     11|	case 0x00400000:/* lzma of XZ Utils option -5.
  ------------------
  |  Branch (301:2): [True: 0, False: 22.3k]
  ------------------
  302|       |			 * lzma of LZMA SDK option -d22. */
  303|     23|	case 0x00800000:/* lzma of XZ Utils option -6.
  ------------------
  |  Branch (303:2): [True: 12, False: 22.3k]
  ------------------
  304|       |			 * lzma of LZMA SDK option -d23. */
  305|     23|	case 0x01000000:/* lzma of XZ Utils option -7.
  ------------------
  |  Branch (305:2): [True: 0, False: 22.3k]
  ------------------
  306|       |			 * lzma of LZMA SDK option -d24. */
  307|     23|	case 0x02000000:/* lzma of XZ Utils option -8.
  ------------------
  |  Branch (307:2): [True: 0, False: 22.3k]
  ------------------
  308|       |			 * lzma of LZMA SDK option -d25. */
  309|     26|	case 0x04000000:/* lzma of XZ Utils option -9.
  ------------------
  |  Branch (309:2): [True: 3, False: 22.3k]
  ------------------
  310|       |			 * lzma of LZMA SDK option -d26. */
  311|     26|	case 0x08000000:/* lzma of LZMA SDK option -d27. */
  ------------------
  |  Branch (311:2): [True: 0, False: 22.3k]
  ------------------
  312|     26|		bits_checked += 32;
  313|     26|		break;
  314|  22.3k|	default:
  ------------------
  |  Branch (314:2): [True: 22.3k, False: 26]
  ------------------
  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|  22.3k|		if (dicsize <= 0x03F00000 && dicsize >= 0x00300000 &&
  ------------------
  |  Branch (320:7): [True: 3.95k, False: 18.3k]
  |  Branch (320:32): [True: 1.58k, False: 2.36k]
  ------------------
  321|  1.58k|		    (dicsize & ((1 << 20)-1)) == 0 &&
  ------------------
  |  Branch (321:7): [True: 1, False: 1.58k]
  ------------------
  322|      1|		    bits_checked == 8 + 64) {
  ------------------
  |  Branch (322:7): [True: 0, False: 1]
  ------------------
  323|      0|			bits_checked += 32;
  324|      0|			break;
  325|      0|		}
  326|       |		/* Otherwise dictionary size is unlikely. But it is
  327|       |		 * possible that someone makes lzma stream with
  328|       |		 * liblzma/LZMA SDK in one's dictionary size. */
  329|  22.3k|		return (0);
  330|  22.3k|	}
  331|       |
  332|       |	/* TODO: The above test is still very weak.  It would be
  333|       |	 * good to do better. */
  334|       |
  335|     26|	return (bits_checked);
  336|  22.3k|}
archive_read_support_filter_xz.c:lzma_bidder_init:
  395|     26|{
  396|     26|	f->code = ARCHIVE_FILTER_LZMA;
  ------------------
  |  |  316|     26|#define	ARCHIVE_FILTER_LZMA	5
  ------------------
  397|     26|	f->name = "lzma";
  398|     26|	return (xz_lzma_bidder_init(f));
  399|     26|}
archive_read_support_filter_xz.c:lzip_bidder_bid:
  374|  23.0k|{
  375|       |
  376|  23.0k|	(void)b; /* UNUSED */
  377|  23.0k|	return (lzip_has_member(f));
  378|  23.0k|}
archive_read_support_filter_xz.c:lzip_bidder_init:
  403|     73|{
  404|     73|	f->code = ARCHIVE_FILTER_LZIP;
  ------------------
  |  |  320|     73|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  405|     73|	f->name = "lzip";
  406|     73|	return (xz_lzma_bidder_init(f));
  407|     73|}

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

archive_read_support_format_7zip:
  487|  20.1k|{
  488|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  489|  20.1k|	struct _7zip *zip;
  490|  20.1k|	int r;
  491|       |
  492|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  493|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_7zip");
  494|       |
  495|  20.1k|	zip = calloc(1, sizeof(*zip));
  496|  20.1k|	if (zip == NULL) {
  ------------------
  |  Branch (496:6): [True: 0, False: 20.1k]
  ------------------
  497|      0|		archive_set_error(_a, ENOMEM, "Can't allocate 7zip data");
  498|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  499|      0|	}
  500|       |
  501|       |	/*
  502|       |	 * Until enough data has been read, we cannot tell about
  503|       |	 * any encrypted entries yet.
  504|       |	 */
  505|  20.1k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|  20.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  506|       |
  507|  20.1k|	r = __archive_read_register_format(a,
  508|  20.1k|	    zip,
  509|  20.1k|	    "7zip",
  510|  20.1k|	    archive_read_format_7zip_bid,
  511|  20.1k|	    NULL,
  512|  20.1k|	    archive_read_format_7zip_read_header,
  513|  20.1k|	    archive_read_format_7zip_read_data,
  514|  20.1k|	    archive_read_format_7zip_read_data_skip,
  515|  20.1k|	    NULL,
  516|  20.1k|	    archive_read_format_7zip_cleanup,
  517|  20.1k|	    archive_read_support_format_7zip_capabilities,
  518|  20.1k|	    archive_read_format_7zip_has_encrypted_entries);
  519|       |
  520|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (520:6): [True: 0, False: 20.1k]
  ------------------
  521|      0|		free(zip);
  522|  20.1k|	return (r);
  523|  20.1k|}
archive_read_support_format_7zip.c:archive_read_support_format_7zip_capabilities:
  527|  4.46k|{
  528|  4.46k|	(void)a; /* UNUSED */
  529|  4.46k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  403|  4.46k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  530|  4.46k|			ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  404|  4.46k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  531|  4.46k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_has_encrypted_entries:
  535|  2.23k|{
  536|  2.23k|	if (a && a->format) {
  ------------------
  |  Branch (536:6): [True: 2.23k, False: 0]
  |  Branch (536:11): [True: 2.23k, False: 0]
  ------------------
  537|  2.23k|		struct _7zip *zip = a->format->data;
  538|  2.23k|		if (zip) {
  ------------------
  |  Branch (538:7): [True: 2.23k, False: 0]
  ------------------
  539|  2.23k|			return zip->has_encrypted_entries;
  540|  2.23k|		}
  541|  2.23k|	}
  542|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  543|  2.23k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_bid:
  616|  19.8k|{
  617|  19.8k|	int64_t data_offset;
  618|       |
  619|       |	/* If someone has already bid more than 48, then avoid
  620|       |	   trashing the look-ahead buffers with a seek. */
  621|  19.8k|	if (best_bid > 48)
  ------------------
  |  Branch (621:6): [True: 4.92k, False: 14.9k]
  ------------------
  622|  4.92k|		return (-1);
  623|       |
  624|  14.9k|	if (get_data_offset(a, &data_offset, 0) < 0)
  ------------------
  |  Branch (624:6): [True: 12.6k, False: 2.23k]
  ------------------
  625|  12.6k|		return (0);
  626|       |
  627|  2.23k|	return (48);
  628|  14.9k|}
archive_read_support_format_7zip.c:get_data_offset:
  547|  17.1k|{
  548|  17.1k|	const unsigned char *h;
  549|  17.1k|	int64_t offset, sfx_offset;
  550|  17.1k|	int r, window;
  551|       |
  552|  17.1k|	if ((h = __archive_read_ahead(a, 6, NULL)) == NULL) {
  ------------------
  |  Branch (552:6): [True: 110, False: 17.0k]
  ------------------
  553|    110|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    110|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  554|    110|		    "Truncated 7-Zip file body");
  555|    110|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    110|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  556|    110|	}
  557|       |
  558|       |	/* If first six bytes are the 7-Zip signature,
  559|       |	 * return the offset right now. */
  560|  17.0k|	if (memcmp(h, _7ZIP_SIGNATURE, 6) == 0) {
  ------------------
  |  |   65|  17.0k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (560:6): [True: 4.44k, False: 12.6k]
  ------------------
  561|  4.44k|		*data_offset = 0;
  562|  4.44k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  4.44k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  563|  4.44k|	}
  564|       |
  565|       |	/*
  566|       |	 * It may be a 7-Zip SFX archive file. If first two bytes are
  567|       |	 * 'M' and 'Z' (PE, Windows) or first four bytes are
  568|       |	 * "\x7F\x45LF" (ELF, Posix-like systems), seek the 7-Zip
  569|       |	 * signature. While get_pe_sfx_offset can be performed without
  570|       |	 * performing a seek, get_elf_sfx_offset requires one,
  571|       |	 * thus a performance difference between the two is expected. 
  572|       |	 */
  573|  12.6k|	if ((h[0] == 'M' && h[1] == 'Z'))
  ------------------
  |  Branch (573:7): [True: 1.27k, False: 11.3k]
  |  Branch (573:22): [True: 633, False: 646]
  ------------------
  574|    633|		r = get_pe_sfx_offset(a, &sfx_offset);
  575|  11.9k|	else if (memcmp(h, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (575:11): [True: 324, False: 11.6k]
  ------------------
  576|    324|		r = get_elf_sfx_offset(a, &sfx_offset, compat);
  577|  11.6k|	else
  578|  11.6k|		r = ARCHIVE_FATAL;
  ------------------
  |  |  240|  11.6k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  579|  12.6k|	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |  236|  25.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |   69|    242|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (579:6): [True: 12.3k, False: 242]
  |  Branch (579:26): [True: 27, False: 215]
  ------------------
  580|  12.3k|		goto fail;
  581|       |
  582|    215|	offset = sfx_offset;
  583|    215|	window = 4096;
  584|    215|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  585|    741|	while (offset + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  584|    741|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  |  |  ------------------
  |  |  |  |   68|    741|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|    741|#define SFX_MAX_ADDR	0x80000
  |  |  |  |  ------------------
  |  |  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|    741|#define SFX_MIN_ADDR	0x27000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (585:9): [True: 731, False: 10]
  ------------------
  586|    731|		ssize_t bytes_avail;
  587|       |
  588|    731|		h = __archive_read_ahead(a, offset + window, &bytes_avail);
  589|    731|		if (h == NULL) {
  ------------------
  |  Branch (589:7): [True: 262, False: 469]
  ------------------
  590|    262|			if (bytes_avail >= offset + 32) {
  ------------------
  |  Branch (590:8): [True: 81, False: 181]
  ------------------
  591|       |				/* Remaining bytes are less than window. */
  592|     81|				window = bytes_avail - offset;
  593|     81|				continue;
  594|     81|			}
  595|    181|			goto fail;
  596|    262|		}
  597|    469|		if (bytes_avail > SFX_MAX_READAHEAD)
  ------------------
  |  |  584|    469|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  |  |  ------------------
  |  |  |  |   68|    469|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|    469|#define SFX_MAX_ADDR	0x80000
  |  |  |  |  ------------------
  |  |  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|    469|#define SFX_MIN_ADDR	0x27000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (597:7): [True: 15, False: 454]
  ------------------
  598|     15|			bytes_avail = SFX_MAX_READAHEAD;
  ------------------
  |  |  584|     15|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  |  |  ------------------
  |  |  |  |   68|     15|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|     15|#define SFX_MAX_ADDR	0x80000
  |  |  |  |  ------------------
  |  |  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|     15|#define SFX_MIN_ADDR	0x27000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|  1.21M|		while (offset <= bytes_avail - 32) {
  ------------------
  |  Branch (599:10): [True: 1.21M, False: 445]
  ------------------
  600|  1.21M|			size_t step = check_7zip_header_in_sfx(h + offset);
  601|  1.21M|			if (step == 0) {
  ------------------
  |  Branch (601:8): [True: 24, False: 1.21M]
  ------------------
  602|     24|				*data_offset = offset;
  603|     24|				return (ARCHIVE_OK);
  ------------------
  |  |  234|     24|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  604|     24|			}
  605|  1.21M|			offset += step;
  606|  1.21M|		}
  607|    469|	}
  608|  12.5k|fail:
  609|  12.5k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  12.5k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  610|  12.5k|	    "Couldn't find out 7-Zip header");
  611|  12.5k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|  12.5k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  612|    215|}
archive_read_support_format_7zip.c:get_pe_sfx_offset:
  657|    633|{
  658|    633|	const char *h;
  659|    633|	int64_t max_offset, offset;
  660|    633|	ssize_t bytes;
  661|    633|	uint16_t opt_hdr_sz, sec_cnt;
  662|       |
  663|       |	/*
  664|       |	 * If encounter any weirdness, revert to old brute-force style search
  665|       |	 */
  666|    633|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   66|    633|#define SFX_MIN_ADDR	0x27000
  ------------------
  667|       |
  668|    633|	for (;;) {
  669|       |		/*
  670|       |		 * Read Dos header to find e_lfanew
  671|       |		 */
  672|    633|		h = __archive_read_ahead(a, PE_DOS_HDR_LEN, &bytes);
  ------------------
  |  |   77|    633|#define PE_DOS_HDR_LEN			0x40
  ------------------
  673|    633|		if (h == NULL) {
  ------------------
  |  Branch (673:7): [True: 5, False: 628]
  ------------------
  674|      5|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  675|      5|		}
  676|    628|		if (h[0] != 'M' || h[1] != 'Z') {
  ------------------
  |  Branch (676:7): [True: 0, False: 628]
  |  Branch (676:22): [True: 0, False: 628]
  ------------------
  677|      0|			break;
  678|      0|		}
  679|    628|		offset = archive_le32dec(h + PE_DOS_HDR_ELFANEW_OFFSET);
  ------------------
  |  |   78|    628|#define PE_DOS_HDR_ELFANEW_OFFSET	0x3c
  ------------------
  680|    628|		if (offset > SFX_MAX_SEEK) {
  ------------------
  |  |   69|    628|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (680:7): [True: 360, False: 268]
  ------------------
  681|    360|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    360|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  682|    360|		}
  683|       |
  684|       |		/*
  685|       |		 * Read COFF header to find opt header size and sec cnt
  686|       |		 */
  687|    268|		if (bytes < offset + PE_COFF_HDR_LEN) {
  ------------------
  |  |   79|    268|#define PE_COFF_HDR_LEN			0x18
  ------------------
  |  Branch (687:7): [True: 59, False: 209]
  ------------------
  688|     59|			h = __archive_read_ahead(a, offset + PE_COFF_HDR_LEN,
  ------------------
  |  |   79|     59|#define PE_COFF_HDR_LEN			0x18
  ------------------
  689|     59|			    &bytes);
  690|     59|			if (h == NULL) {
  ------------------
  |  Branch (690:8): [True: 50, False: 9]
  ------------------
  691|     50|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     50|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  692|     50|			}
  693|      9|			if (h[offset] != 'P' || h[offset + 1] != 'E') {
  ------------------
  |  Branch (693:8): [True: 7, False: 2]
  |  Branch (693:28): [True: 2, False: 0]
  ------------------
  694|      9|				break;
  695|      9|			}
  696|      9|		}
  697|    209|		sec_cnt = archive_le16dec(
  698|    209|		    h + offset + PE_COFF_HDR_SEC_CNT_OFFSET);
  ------------------
  |  |   80|    209|#define PE_COFF_HDR_SEC_CNT_OFFSET	0x6
  ------------------
  699|    209|		opt_hdr_sz = archive_le16dec(
  700|    209|		    h + offset + PE_COFF_HDR_OPT_SZ_OFFSET);
  ------------------
  |  |   81|    209|#define PE_COFF_HDR_OPT_SZ_OFFSET	0x14
  ------------------
  701|       |
  702|       |		/*
  703|       |		 * Skip optional header
  704|       |		 */
  705|    209|		if (opt_hdr_sz != 0) {
  ------------------
  |  Branch (705:7): [True: 173, False: 36]
  ------------------
  706|    173|			offset += PE_COFF_HDR_LEN + opt_hdr_sz;
  ------------------
  |  |   79|    173|#define PE_COFF_HDR_LEN			0x18
  ------------------
  707|    173|		} else {
  708|     36|			break;
  709|     36|		}
  710|       |
  711|    173|		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   82|    173|#define PE_SEC_HDR_LEN 			0x28
  ------------------
              		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   69|    173|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (711:7): [True: 0, False: 173]
  ------------------
  712|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  713|      0|		}
  714|       |
  715|       |		/*
  716|       |		 * Traverse sec table to find max raw offset (i.e., overlay)
  717|       |		 */
  718|    173|		if (bytes < offset + sec_cnt * PE_SEC_HDR_LEN) {
  ------------------
  |  |   82|    173|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  |  Branch (718:7): [True: 45, False: 128]
  ------------------
  719|     45|			h = __archive_read_ahead(a,
  720|     45|			    offset + sec_cnt * PE_SEC_HDR_LEN, NULL);
  ------------------
  |  |   82|     45|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  721|     45|			if (h == NULL) {
  ------------------
  |  Branch (721:8): [True: 43, False: 2]
  ------------------
  722|     43|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     43|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  723|     43|			}
  724|     45|		}
  725|    130|		max_offset = offset;
  726|  32.1k|		while (sec_cnt > 0) {
  ------------------
  |  Branch (726:10): [True: 32.0k, False: 130]
  ------------------
  727|  32.0k|			int64_t sec_end;
  728|       |
  729|  32.0k|			sec_end = (int64_t)archive_le32dec(
  730|  32.0k|				      h + offset + PE_SEC_HDR_RAW_SZ_OFFSET) +
  ------------------
  |  |   84|  32.0k|#define PE_SEC_HDR_RAW_SZ_OFFSET	0x10
  ------------------
  731|  32.0k|			    archive_le32dec(
  732|  32.0k|				h + offset + PE_SEC_HDR_RAW_ADDR_OFFSET);
  ------------------
  |  |   83|  32.0k|#define PE_SEC_HDR_RAW_ADDR_OFFSET	0x14
  ------------------
  733|  32.0k|			if (sec_end > max_offset) {
  ------------------
  |  Branch (733:8): [True: 9.57k, False: 22.4k]
  ------------------
  734|  9.57k|				max_offset = sec_end;
  735|  9.57k|			}
  736|  32.0k|			offset += PE_SEC_HDR_LEN;
  ------------------
  |  |   82|  32.0k|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  737|  32.0k|			sec_cnt--;
  738|  32.0k|		}
  739|    130|		*sfx_offset = max_offset;
  740|    130|		break;
  741|    173|	}
  742|       |
  743|    175|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    175|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  744|    633|}
archive_read_support_format_7zip.c:get_elf_sfx_offset:
  748|    324|{
  749|    324|	int64_t r;
  750|    324|	const char *h;
  751|    324|	char big_endian, format_64;
  752|    324|	size_t request;
  753|    324|	uint64_t e_shoff, strtab_offset, strtab_size;
  754|    324|	uint16_t e_shentsize, e_shnum, e_shstrndx;
  755|    324|	uint16_t (*dec16)(const void *);
  756|    324|	uint32_t (*dec32)(const void *);
  757|    324|	uint64_t (*dec64)(const void *);
  758|       |
  759|       |	/*
  760|       |	 * If encounter any weirdness, revert to old brute-force style search
  761|       |	 */
  762|    324|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   66|    324|#define SFX_MIN_ADDR	0x27000
  ------------------
  763|       |
  764|    324|	for (;;) {
  765|       |		/*
  766|       |		 * Read Elf header to find bitness & endianness
  767|       |		 */
  768|    324|		h = __archive_read_ahead(a, ELF_HDR_MIN_LEN, NULL);
  ------------------
  |  |   89|    324|#define ELF_HDR_MIN_LEN 0x40 /* sizeof(Elf64_Ehdr) */
  ------------------
  769|    324|		if (h == NULL) {
  ------------------
  |  Branch (769:7): [True: 0, False: 324]
  ------------------
  770|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  771|      0|		}
  772|    324|		if (memcmp(h, "\x7F\x45LF", 4) != 0) {
  ------------------
  |  Branch (772:7): [True: 0, False: 324]
  ------------------
  773|      0|			break;
  774|      0|		}
  775|    324|		format_64 = h[ELF_HDR_EI_CLASS_OFFSET] == 0x2;
  ------------------
  |  |   90|    324|#define ELF_HDR_EI_CLASS_OFFSET 0x04
  ------------------
  776|    324|		big_endian = h[ELF_HDR_EI_DATA_OFFSET] == 0x2;
  ------------------
  |  |   91|    324|#define ELF_HDR_EI_DATA_OFFSET 0x05
  ------------------
  777|    324|		if (big_endian) {
  ------------------
  |  Branch (777:7): [True: 194, False: 130]
  ------------------
  778|    194|			dec16 = &archive_be16dec;
  779|    194|			dec32 = &archive_be32dec;
  780|    194|			dec64 = &archive_be64dec;
  781|    194|		} else {
  782|    130|			dec16 = &archive_le16dec;
  783|    130|			dec32 = &archive_le32dec;
  784|    130|			dec64 = &archive_le64dec;
  785|    130|		}
  786|       |
  787|       |		/*
  788|       |		 * Read section header table info
  789|       |		 */
  790|    324|		if (format_64) {
  ------------------
  |  Branch (790:7): [True: 238, False: 86]
  ------------------
  791|    238|			e_shoff = (*dec64)(h + 0x28);
  792|    238|			e_shentsize = (*dec16)(h + 0x3A);
  793|    238|			e_shnum = (*dec16)(h + 0x3C);
  794|    238|			e_shstrndx = (*dec16)(h + 0x3E);
  795|    238|			if (e_shnum <= e_shstrndx || e_shentsize < 0x28)
  ------------------
  |  Branch (795:8): [True: 7, False: 231]
  |  Branch (795:33): [True: 5, False: 226]
  ------------------
  796|     12|				break;
  797|       |
  798|    238|		} else {
  799|     86|			e_shoff = (*dec32)(h + 0x20);
  800|     86|			e_shentsize = (*dec16)(h + 0x2E);
  801|     86|			e_shnum = (*dec16)(h + 0x30);
  802|     86|			e_shstrndx = (*dec16)(h + 0x32);
  803|     86|			if (e_shnum <= e_shstrndx || e_shentsize < 0x18)
  ------------------
  |  Branch (803:8): [True: 30, False: 56]
  |  Branch (803:33): [True: 2, False: 54]
  ------------------
  804|     32|				break;
  805|     86|		}
  806|       |
  807|    280|		if ((int64_t)e_shoff < 0) {
  ------------------
  |  Branch (807:7): [True: 53, False: 227]
  ------------------
  808|     53|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     53|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  809|     53|		}
  810|       |
  811|       |		/*
  812|       |		 * Reading the section table to find strtab section
  813|       |		 */
  814|    227|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (814:7): [True: 35, False: 192]
  ------------------
  815|     35|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|     35|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  816|     35|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     35|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  817|     35|		}
  818|    192|		if (format_64) {
  ------------------
  |  Branch (818:7): [True: 153, False: 39]
  ------------------
  819|    153|			request = (size_t)e_shnum * e_shentsize + 0x28;
  820|    153|		} else {
  821|     39|			request = (size_t)e_shnum * e_shentsize + 0x18;
  822|     39|		}
  823|    192|		if (request > SFX_MAX_SEEK) {
  ------------------
  |  |   69|    192|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (823:7): [True: 10, False: 182]
  ------------------
  824|     10|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  825|     10|		}
  826|    182|		h = __archive_read_ahead(a, request, NULL);
  827|    182|		if (h == NULL) {
  ------------------
  |  Branch (827:7): [True: 10, False: 172]
  ------------------
  828|     10|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  829|     10|		}
  830|    172|		if (format_64) {
  ------------------
  |  Branch (830:7): [True: 148, False: 24]
  ------------------
  831|    148|			strtab_offset = (*dec64)(
  832|    148|			    h + e_shstrndx * e_shentsize + 0x18);
  833|    148|			strtab_size = (*dec64)(
  834|    148|			    h + e_shstrndx * e_shentsize + 0x20);
  835|    148|		} else {
  836|     24|			strtab_offset = (*dec32)(
  837|     24|			    h + e_shstrndx * e_shentsize + 0x10);
  838|     24|			strtab_size = (*dec32)(
  839|     24|			    h + e_shstrndx * e_shentsize + 0x14);
  840|     24|		}
  841|    172|		if ((int64_t)strtab_offset < 0 || strtab_size < 6 ||
  ------------------
  |  Branch (841:7): [True: 55, False: 117]
  |  Branch (841:37): [True: 1, False: 116]
  ------------------
  842|    116|		    strtab_size > SFX_MAX_SEEK)
  ------------------
  |  |   69|    116|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (842:7): [True: 74, False: 42]
  ------------------
  843|    130|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    130|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  844|       |
  845|       |		/*
  846|       |		 * Read the STRTAB section to find the .data offset
  847|       |		 */
  848|     42|		if (seek_compat(a, strtab_offset, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (848:7): [True: 10, False: 32]
  ------------------
  849|     10|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  850|     10|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  851|     10|		}
  852|     32|		h = __archive_read_ahead(a, strtab_size, NULL);
  853|     32|		if (h == NULL) {
  ------------------
  |  Branch (853:7): [True: 1, False: 31]
  ------------------
  854|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  855|      1|		}
  856|     31|		size_t data_sym_offset = strtab_size;
  857|  11.2k|		for (size_t offset = 0; offset + 6 <= strtab_size; offset++) {
  ------------------
  |  Branch (857:27): [True: 11.2k, False: 5]
  ------------------
  858|  11.2k|			if (memcmp(h + offset, ".data\00", 6) == 0) {
  ------------------
  |  Branch (858:8): [True: 26, False: 11.2k]
  ------------------
  859|     26|				data_sym_offset = offset;
  860|     26|				break;
  861|     26|			}
  862|  11.2k|		}
  863|     31|		if (data_sym_offset == strtab_size) {
  ------------------
  |  Branch (863:7): [True: 5, False: 26]
  ------------------
  864|      5|			break;
  865|      5|		}
  866|       |
  867|       |		/*
  868|       |		 * Find the section with the .data name
  869|       |		 */
  870|     26|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (870:7): [True: 0, False: 26]
  ------------------
  871|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  872|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  873|      0|		}
  874|     26|		h = __archive_read_ahead(a, (size_t)e_shnum * e_shentsize, NULL);
  875|     26|		if (h == NULL) {
  ------------------
  |  Branch (875:7): [True: 0, False: 26]
  ------------------
  876|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  877|      0|		}
  878|     26|		size_t sec_tbl_offset = 0;
  879|    375|		while (e_shnum > 0) {
  ------------------
  |  Branch (879:10): [True: 364, False: 11]
  ------------------
  880|    364|			uint32_t name_offset;
  881|       |
  882|    364|			name_offset = (*dec32)(h + sec_tbl_offset);
  883|    364|			if (name_offset == data_sym_offset) {
  ------------------
  |  Branch (883:8): [True: 15, False: 349]
  ------------------
  884|     15|				int64_t sel_offset;
  885|       |
  886|     15|				if (format_64) {
  ------------------
  |  Branch (886:9): [True: 8, False: 7]
  ------------------
  887|      8|					sel_offset = (*dec64)(
  888|      8|					    h + sec_tbl_offset + 0x18);
  889|      8|				} else {
  890|      7|					sel_offset = (*dec32)(
  891|      7|					    h + sec_tbl_offset + 0x10);
  892|      7|				}
  893|     15|				if (sel_offset >= 0)
  ------------------
  |  Branch (893:9): [True: 11, False: 4]
  ------------------
  894|     11|					*sfx_offset = sel_offset;
  895|     15|				break;
  896|     15|			}
  897|    349|			sec_tbl_offset += e_shentsize;
  898|    349|			e_shnum--;
  899|    349|		}
  900|     26|		break;
  901|     26|	}
  902|       |
  903|     75|	r = seek_compat(a, 0, SEEK_SET, compat);
  904|     75|	if (r < 0)
  ------------------
  |  Branch (904:6): [True: 8, False: 67]
  ------------------
  905|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  906|     75|	return (int)r;
  907|    324|}
archive_read_support_format_7zip.c:seek_compat:
 5159|    955|{
 5160|    955|	int64_t ret = ARCHIVE_FAILED;
  ------------------
  |  |  238|    955|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 5161|       |
 5162|    955|	if (a->filter->can_seek)
  ------------------
  |  Branch (5162:6): [True: 941, False: 14]
  ------------------
 5163|    941|		ret = __archive_read_seek(a, offset, whence);
 5164|     14|	else if (compat) {
  ------------------
  |  Branch (5164:11): [True: 4, False: 10]
  ------------------
 5165|      4|		switch (whence) {
 5166|      0|		case SEEK_CUR:
  ------------------
  |  Branch (5166:3): [True: 0, False: 4]
  ------------------
 5167|      0|			ret = __archive_read_consume(a, offset);
 5168|      0|			break;
 5169|      4|		case SEEK_SET:
  ------------------
  |  Branch (5169:3): [True: 4, False: 0]
  ------------------
 5170|      4|			if (a->filter->position > offset)
  ------------------
  |  Branch (5170:8): [True: 1, False: 3]
  ------------------
 5171|      1|				break;
 5172|      3|			ret = __archive_read_consume(a,
 5173|      3|			    offset - a->filter->position);
 5174|      3|			break;
 5175|      0|		default:
  ------------------
  |  Branch (5175:3): [True: 0, False: 4]
  ------------------
 5176|      0|			break;
 5177|      4|		}
 5178|      4|	}
 5179|       |
 5180|    955|	return (ret);
 5181|    955|}
archive_read_support_format_7zip.c:check_7zip_header_in_sfx:
  632|  1.21M|{
  633|  1.21M|	switch (p[5]) {
  634|  3.47k|	case 0x1C:
  ------------------
  |  Branch (634:2): [True: 3.47k, False: 1.21M]
  ------------------
  635|  3.47k|		if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0)
  ------------------
  |  |   65|  3.47k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (635:7): [True: 1.85k, False: 1.62k]
  ------------------
  636|  1.85k|			return (6);
  637|       |		/*
  638|       |		 * Test the CRC because its extraction code has 7-Zip
  639|       |		 * Magic Code, so we should do this in order not to
  640|       |		 * make a mis-detection.
  641|       |		 */
  642|  1.62k|		if (__archive_crc32(0, p + 12, 20) != archive_le32dec(p + 8))
  ------------------
  |  Branch (642:7): [True: 1.60k, False: 24]
  ------------------
  643|  1.60k|			return (6);
  644|       |		/* Hit the header! */
  645|     24|		return (0);
  646|  2.66k|	case 0x37: return (5);
  ------------------
  |  Branch (646:2): [True: 2.66k, False: 1.21M]
  ------------------
  647|  2.96k|	case 0x7A: return (4);
  ------------------
  |  Branch (647:2): [True: 2.96k, False: 1.21M]
  ------------------
  648|  2.98k|	case 0xBC: return (3);
  ------------------
  |  Branch (648:2): [True: 2.98k, False: 1.21M]
  ------------------
  649|  2.18k|	case 0xAF: return (2);
  ------------------
  |  Branch (649:2): [True: 2.18k, False: 1.21M]
  ------------------
  650|  3.04k|	case 0x27: return (1);
  ------------------
  |  Branch (650:2): [True: 3.04k, False: 1.21M]
  ------------------
  651|  1.19M|	default: return (6);
  ------------------
  |  Branch (651:2): [True: 1.19M, False: 17.3k]
  ------------------
  652|  1.21M|	}
  653|  1.21M|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_header:
  932|  8.22k|{
  933|  8.22k|	struct _7zip *zip = a->format->data;
  934|  8.22k|	struct _7zip_entry *zip_entry;
  935|  8.22k|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  234|  8.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  936|  8.22k|	struct _7z_folder *folder = 0;
  937|       |
  938|       |	/*
  939|       |	 * It should be sufficient to call archive_read_next_header() for
  940|       |	 * a reader to determine if an entry is encrypted or not. If the
  941|       |	 * encryption of an entry is only detectable when calling
  942|       |	 * archive_read_data(), so be it. We'll do the same check there
  943|       |	 * as well.
  944|       |	 */
  945|  8.22k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  416|  8.22k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (945:6): [True: 2.23k, False: 5.99k]
  ------------------
  946|  2.23k|		zip->has_encrypted_entries = 0;
  947|  2.23k|	}
  948|       |
  949|  8.22k|	a->archive.archive_format = ARCHIVE_FORMAT_7ZIP;
  ------------------
  |  |  390|  8.22k|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  950|  8.22k|	a->archive.archive_format_name = "7-Zip";
  951|       |
  952|  8.22k|	if (zip->entries == NULL) {
  ------------------
  |  Branch (952:6): [True: 2.23k, False: 5.99k]
  ------------------
  953|  2.23k|		struct _7z_header_info header;
  954|       |
  955|  2.23k|		memset(&header, 0, sizeof(header));
  956|  2.23k|		r = slurp_central_directory(a, zip, &header);
  957|  2.23k|		free_Header(&header);
  958|  2.23k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  2.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (958:7): [True: 1.98k, False: 248]
  ------------------
  959|  1.98k|			return (r);
  960|    248|		zip->entries_remaining = zip->numFiles;
  961|    248|		zip->entry = zip->entries;
  962|  5.99k|	} else {
  963|  5.99k|		++zip->entry;
  964|  5.99k|	}
  965|  6.24k|	zip_entry = zip->entry;
  966|       |
  967|  6.24k|	if (zip->entries_remaining == 0 || zip_entry == NULL)
  ------------------
  |  Branch (967:6): [True: 156, False: 6.08k]
  |  Branch (967:37): [True: 0, False: 6.08k]
  ------------------
  968|    156|		return ARCHIVE_EOF;
  ------------------
  |  |  233|    156|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  969|  6.08k|	--zip->entries_remaining;
  970|       |
  971|  6.08k|	zip->entry_offset = 0;
  972|  6.08k|	zip->end_of_entry = 0;
  973|  6.08k|	zip->entry_crc32 = 0;
  974|       |
  975|       |	/* Setup a string conversion for a filename. */
  976|  6.08k|	if (zip->sconv == NULL) {
  ------------------
  |  Branch (976:6): [True: 241, False: 5.84k]
  ------------------
  977|    241|		zip->sconv = archive_string_conversion_from_charset(
  978|    241|		    &a->archive, "UTF-16LE", 1);
  979|    241|		if (zip->sconv == NULL)
  ------------------
  |  Branch (979:7): [True: 0, False: 241]
  ------------------
  980|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  981|    241|	}
  982|       |
  983|       |	/* Figure out if the entry is encrypted by looking at the folder
  984|       |	   that is associated to the current 7zip entry. If the folder
  985|       |	   has a coder with a _7Z_CRYPTO codec then the folder is encrypted.
  986|       |	   Hence the entry must also be encrypted. */
  987|  6.08k|	archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED);
  ------------------
  |  |  461|  6.08k|#define ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED 0x00000000
  ------------------
  988|  6.08k|	if (zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (988:6): [True: 207, False: 5.88k]
  ------------------
  989|    207|		size_t fidx = 0;
  990|       |
  991|    207|		folder = &(zip->si.ci.folders[zip_entry->folderIndex]);
  992|    589|		for (fidx = 0; fidx < folder->numCoders; fidx++) {
  ------------------
  |  Branch (992:18): [True: 382, False: 207]
  ------------------
  993|    382|			int ctype = entry_compression_type(
  994|    382|			    folder->coders[fidx].codec);
  995|    382|			if (ctype != ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED)
  ------------------
  |  |  461|    382|#define ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED 0x00000000
  ------------------
  |  Branch (995:8): [True: 288, False: 94]
  ------------------
  996|    288|				archive_entry_set_compression(entry, ctype);
  997|    382|			switch(folder->coders[fidx].codec) {
  ------------------
  |  Branch (997:11): [True: 0, False: 382]
  ------------------
  998|      0|				case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (998:5): [True: 0, False: 382]
  ------------------
  999|      0|				case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (999:5): [True: 0, False: 382]
  ------------------
 1000|      0|				case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  105|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1000:5): [True: 0, False: 382]
  ------------------
 1001|      0|					archive_entry_set_is_data_encrypted(entry, 1);
 1002|      0|					zip->has_encrypted_entries = 1;
 1003|      0|					break;
 1004|      0|				}
 1005|    382|			}
 1006|    382|		}
 1007|    207|	}
 1008|       |
 1009|  6.08k|	if (zip_entry->utf16name == NULL) {
  ------------------
  |  Branch (1009:6): [True: 3.94k, False: 2.14k]
  ------------------
 1010|       |		/*
 1011|       |		 * No kName property (eg from`7z a -si`): 7-Zip derives the
 1012|       |		 * name from the archive filename, which we don't know.
 1013|       |		 */
 1014|  3.94k|		archive_entry_set_pathname(entry, "data");
 1015|  3.94k|	} else if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  2.14k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1015:13): [True: 650, False: 1.49k]
  ------------------
 1016|  2.14k|	    (const char *)zip_entry->utf16name,
 1017|  2.14k|	    zip_entry->name_len, zip->sconv) != 0) {
 1018|    650|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1018:7): [True: 0, False: 650]
  ------------------
 1019|      0|			archive_set_error(&a->archive, ENOMEM,
 1020|      0|			    "Can't allocate memory for Pathname");
 1021|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1022|      0|		}
 1023|    650|		archive_set_error(&a->archive,
 1024|    650|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    650|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1025|    650|		    "Pathname cannot be converted "
 1026|    650|		    "from %s to current locale",
 1027|    650|		    archive_string_conversion_charset_name(zip->sconv));
 1028|    650|		ret = ARCHIVE_WARN;
  ------------------
  |  |  236|    650|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1029|    650|	}
 1030|       |
 1031|       |	/* Populate some additional entry fields: */
 1032|  6.08k|	archive_entry_set_mode(entry, zip_entry->mode);
 1033|  6.08k|	if (zip_entry->flg & MTIME_IS_SET)
  ------------------
  |  |  246|  6.08k|#define MTIME_IS_SET	(1<<0)
  ------------------
  |  Branch (1033:6): [True: 303, False: 5.78k]
  ------------------
 1034|    303|		archive_entry_set_mtime(entry, zip_entry->mtime,
 1035|    303|			zip_entry->mtime_ns);
 1036|  6.08k|	if (zip_entry->flg & CTIME_IS_SET)
  ------------------
  |  |  248|  6.08k|#define CTIME_IS_SET	(1<<2)
  ------------------
  |  Branch (1036:6): [True: 92, False: 5.99k]
  ------------------
 1037|     92|		archive_entry_set_ctime(entry, zip_entry->ctime,
 1038|     92|		    zip_entry->ctime_ns);
 1039|  6.08k|	if (zip_entry->flg & ATIME_IS_SET)
  ------------------
  |  |  247|  6.08k|#define ATIME_IS_SET	(1<<1)
  ------------------
  |  Branch (1039:6): [True: 145, False: 5.94k]
  ------------------
 1040|    145|		archive_entry_set_atime(entry, zip_entry->atime,
 1041|    145|		    zip_entry->atime_ns);
 1042|  6.08k|	if (zip_entry->ssIndex != (size_t)-1) {
  ------------------
  |  Branch (1042:6): [True: 207, False: 5.88k]
  ------------------
 1043|    207|		zip->entry_bytes_remaining =
 1044|    207|		    zip->si.ss.unpackSizes[zip_entry->ssIndex];
 1045|    207|		archive_entry_set_size(entry, zip->entry_bytes_remaining);
 1046|  5.88k|	} else {
 1047|  5.88k|		zip->entry_bytes_remaining = 0;
 1048|  5.88k|		archive_entry_set_size(entry, 0);
 1049|  5.88k|	}
 1050|       |
 1051|       |	/*
 1052|       |	 * 7zip stores packed sizes per folder, not per file. A folder holding
 1053|       |	 * several entries (solid) has no per-entry packed size, so leave it
 1054|       |	 * unset in that case.
 1055|       |	 */
 1056|  6.08k|	if (zip_entry->ssIndex == (size_t)-1) {
  ------------------
  |  Branch (1056:6): [True: 5.88k, False: 207]
  ------------------
 1057|       |		// No entry in the substream list, eg a directory or an empty file.
 1058|  5.88k|		archive_entry_set_compressed_size(entry, 0);
 1059|  5.88k|	} else if (zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (1059:13): [True: 207, False: 0]
  ------------------
 1060|    207|		const struct _7z_folder *f = &zip->si.ci.folders[zip_entry->folderIndex];
 1061|    207|		int64_t packed = 0;
 1062|    207|		size_t k;
 1063|       |
 1064|    207|		int ok = f->numPackedStreams > 0 && f->numUnpackStreams == 1;
  ------------------
  |  Branch (1064:12): [True: 203, False: 4]
  |  Branch (1064:39): [True: 47, False: 156]
  ------------------
 1065|    207|		if (ok) {
  ------------------
  |  Branch (1065:7): [True: 47, False: 160]
  ------------------
 1066|     94|			for (k = 0; k < f->numPackedStreams; k++) {
  ------------------
  |  Branch (1066:16): [True: 47, False: 47]
  ------------------
 1067|     47|				int64_t s = zip->si.pi.sizes[f->packIndex + k];
 1068|     47|				if (s < 0 || packed > INT64_MAX - s) {
  ------------------
  |  Branch (1068:9): [True: 0, False: 47]
  |  Branch (1068:18): [True: 0, False: 47]
  ------------------
 1069|      0|					ok = 0;
 1070|      0|					break;
 1071|      0|				}
 1072|     47|				packed += s;
 1073|     47|			}
 1074|     47|		}
 1075|       |
 1076|    207|		if (ok)
  ------------------
  |  Branch (1076:7): [True: 47, False: 160]
  ------------------
 1077|     47|			archive_entry_set_compressed_size(entry, packed);
 1078|    207|	}
 1079|       |
 1080|       |	// These attributes are supported by the windows implementation of archive_write_disk.
 1081|  6.08k|	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  151|  6.08k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  155|  6.08k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  159|  6.08k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
 1082|       |
 1083|  6.08k|	if (zip_entry->attr & supported_attrs) {
  ------------------
  |  Branch (1083:6): [True: 1.31k, False: 4.77k]
  ------------------
 1084|  1.31k|		char buf[sizeof(",rdonly,hidden,system")];
 1085|  1.31k|		const char *fflags[3] = { "", "", "" };
 1086|  1.31k|		const char **flag = fflags;
 1087|       |
 1088|  1.31k|		if (zip_entry->attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  151|  1.31k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (1088:7): [True: 852, False: 465]
  ------------------
 1089|    852|			*flag++ = ",rdonly";
 1090|  1.31k|		if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN)
  ------------------
  |  |  155|  1.31k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
  |  Branch (1090:7): [True: 966, False: 351]
  ------------------
 1091|    966|			*flag++ = ",hidden";
 1092|  1.31k|		if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM)
  ------------------
  |  |  159|  1.31k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  |  Branch (1092:7): [True: 759, False: 558]
  ------------------
 1093|    759|			*flag++ = ",system";
 1094|       |
 1095|  1.31k|		snprintf(buf, sizeof(buf), "%s%s%s", fflags[0], fflags[1], fflags[2]);
 1096|  1.31k|		archive_entry_copy_fflags_text(entry, buf + 1);
 1097|  1.31k|	}
 1098|       |
 1099|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1100|  6.08k|	if (zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1100:6): [True: 5.88k, False: 199]
  ------------------
 1101|  5.88k|		zip->end_of_entry = 1;
 1102|       |
 1103|  6.08k|	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  6.08k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  6.08k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1103:6): [True: 72, False: 6.01k]
  ------------------
 1104|     72|		unsigned char *symname = NULL;
 1105|     72|		size_t symsize = 0;
 1106|       |
 1107|     72|		if (zip->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (1107:7): [True: 1, False: 71]
  ------------------
 1108|      1|			archive_set_error(&a->archive, ENOMEM,
 1109|      1|			    "Rejecting malformed 7zip archive: "
 1110|      1|			    "symlink contents exceed 1 megabyte");
 1111|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1112|      1|		}
 1113|       |
 1114|       |		/*
 1115|       |		 * Symbolic-name is recorded as its contents. We have to
 1116|       |		 * read the contents at this time.
 1117|       |		 */
 1118|     73|		while (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (1118:10): [True: 4, False: 69]
  ------------------
 1119|      4|			const void *buff;
 1120|      4|			unsigned char *mem;
 1121|      4|			size_t size;
 1122|      4|			int64_t offset;
 1123|       |
 1124|      4|			r = archive_read_format_7zip_read_data(a, &buff,
 1125|      4|				&size, &offset);
 1126|      4|			if (r < ARCHIVE_WARN) {
  ------------------
  |  |  236|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1126:8): [True: 2, False: 2]
  ------------------
 1127|      2|				free(symname);
 1128|      2|				return (r);
 1129|      2|			}
 1130|      2|			mem = realloc(symname, symsize + size + 1);
 1131|      2|			if (mem == NULL) {
  ------------------
  |  Branch (1131:8): [True: 0, False: 2]
  ------------------
 1132|      0|				free(symname);
 1133|      0|				archive_set_error(&a->archive, ENOMEM,
 1134|      0|				    "Can't allocate memory for Symname");
 1135|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1136|      0|			}
 1137|      2|			symname = mem;
 1138|      2|			memcpy(symname+symsize, buff, size);
 1139|      2|			symsize += size;
 1140|      2|		}
 1141|     69|		if (symsize == 0) {
  ------------------
  |  Branch (1141:7): [True: 68, False: 1]
  ------------------
 1142|       |			/* If there is no symname, handle it as a regular
 1143|       |			 * file. */
 1144|     68|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|     68|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1145|     68|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|     68|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1146|     68|			archive_entry_set_mode(entry, zip_entry->mode);
 1147|     68|		} else {
 1148|      1|			struct archive_string_conv* utf8_conv;
 1149|       |
 1150|      1|			symname[symsize] = '\0';
 1151|       |
 1152|       |			/* Symbolic links are embedded as UTF-8 strings */
 1153|      1|			utf8_conv = archive_string_conversion_from_charset(&a->archive,
 1154|      1|			    "UTF-8", 1);
 1155|      1|			if (utf8_conv == NULL) {
  ------------------
  |  Branch (1155:8): [True: 0, False: 1]
  ------------------
 1156|      0|				free(symname);
 1157|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1158|      0|			}
 1159|       |
 1160|      1|			archive_entry_copy_symlink_l(entry, (const char*)symname, symsize,
  ------------------
  |  |   83|      1|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
 1161|      1|			    utf8_conv);
 1162|      1|		}
 1163|     69|		free(symname);
 1164|     69|		archive_entry_set_size(entry, 0);
 1165|     69|	}
 1166|       |
 1167|  6.08k|	return (ret);
 1168|  6.08k|}
archive_read_support_format_7zip.c:slurp_central_directory:
 3472|  2.23k|{
 3473|  2.23k|	const unsigned char *p;
 3474|  2.23k|	int64_t next_header_offset;
 3475|  2.23k|	int64_t next_header_size;
 3476|  2.23k|	uint32_t next_header_crc;
 3477|  2.23k|	ssize_t bytes_avail;
 3478|  2.23k|	int64_t data_offset;
 3479|  2.23k|	int check_header_crc, r;
 3480|       |
 3481|  2.23k|	if (get_data_offset(a, &data_offset, 1) < 0)
  ------------------
  |  Branch (3481:6): [True: 0, False: 2.23k]
  ------------------
 3482|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3483|  2.23k|	if (__archive_read_consume(a, data_offset) < 0) {
  ------------------
  |  Branch (3483:6): [True: 0, False: 2.23k]
  ------------------
 3484|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3485|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3486|      0|	}
 3487|  2.23k|	if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL) {
  ------------------
  |  Branch (3487:6): [True: 0, False: 2.23k]
  ------------------
 3488|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3489|      0|		    "Truncated 7-Zip file header");
 3490|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3491|      0|	}
 3492|       |
 3493|  2.23k|	if (archive_ckd_add_i64(&zip->seek_base, data_offset, 32)) {
  ------------------
  |  Branch (3493:6): [True: 0, False: 2.23k]
  ------------------
 3494|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3495|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3496|      0|	}
 3497|       |
 3498|  2.23k|	if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0) {
  ------------------
  |  |   65|  2.23k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (3498:6): [True: 0, False: 2.23k]
  ------------------
 3499|      0|		archive_set_error(&a->archive, -1, "Not 7-Zip archive file");
 3500|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3501|      0|	}
 3502|       |
 3503|       |	/* CRC check. */
 3504|  2.23k|	if (__archive_crc32(0, p + 12, 20) != archive_le32dec(p + 8)) {
  ------------------
  |  Branch (3504:6): [True: 2.17k, False: 55]
  ------------------
 3505|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3506|       |		archive_set_error(&a->archive, -1, "Header CRC error");
 3507|       |		return (ARCHIVE_FATAL);
 3508|       |#endif
 3509|  2.17k|	}
 3510|       |
 3511|  2.23k|	next_header_offset = archive_le64dec(p + 12);
 3512|  2.23k|	if (next_header_offset < 0) {
  ------------------
  |  Branch (3512:6): [True: 4, False: 2.22k]
  ------------------
 3513|      4|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3514|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3515|      4|	}
 3516|  2.22k|	next_header_size = archive_le64dec(p + 20);
 3517|  2.22k|	if (next_header_size < 0) {
  ------------------
  |  Branch (3517:6): [True: 4, False: 2.22k]
  ------------------
 3518|      4|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3519|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3520|      4|	}
 3521|  2.22k|	next_header_crc = archive_le32dec(p + 28);
 3522|       |
 3523|  2.22k|	if (next_header_size == 0)
  ------------------
  |  Branch (3523:6): [True: 0, False: 2.22k]
  ------------------
 3524|       |		/* There is no entry in the archive file. */
 3525|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3526|       |
 3527|  2.22k|	__archive_read_consume(a, 32);
 3528|  2.22k|	if (next_header_offset != 0) {
  ------------------
  |  Branch (3528:6): [True: 1.83k, False: 389]
  ------------------
 3529|  1.83k|		if (bytes_avail >= next_header_offset)
  ------------------
  |  Branch (3529:7): [True: 1.82k, False: 8]
  ------------------
 3530|  1.82k|			__archive_read_consume(a, next_header_offset);
 3531|      8|		else {
 3532|      8|			int64_t target;
 3533|       |
 3534|      8|			if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3534:8): [True: 0, False: 8]
  ------------------
 3535|      8|			    zip->seek_base, next_header_offset) ||
 3536|      8|			    seek_compat(a, target, SEEK_SET, 1) < 0) {
  ------------------
  |  Branch (3536:8): [True: 8, False: 0]
  ------------------
 3537|      8|				archive_set_error(&a->archive,
 3538|      8|				    ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3539|      8|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3540|      8|			}
 3541|      8|		}
 3542|  1.83k|	}
 3543|  2.21k|	zip->stream_offset = next_header_offset;
 3544|  2.21k|	zip->header_offset = next_header_offset;
 3545|  2.21k|	zip->header_bytes_remaining = next_header_size;
 3546|  2.21k|	zip->header_crc32 = 0;
 3547|  2.21k|	zip->header_is_encoded = 0;
 3548|  2.21k|	zip->header_is_being_read = 1;
 3549|  2.21k|	zip->has_encrypted_entries = 0;
 3550|  2.21k|	check_header_crc = 1;
 3551|       |
 3552|  2.21k|	if ((p = header_bytes(a, 1)) == NULL) {
  ------------------
  |  Branch (3552:6): [True: 6, False: 2.21k]
  ------------------
 3553|      6|		archive_set_error(&a->archive,
 3554|      6|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3555|      6|		    "Truncated 7-Zip file body");
 3556|      6|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3557|      6|	}
 3558|       |	/* Parse ArchiveProperties. */
 3559|  2.21k|	switch (p[0]) {
 3560|    605|	case kEncodedHeader:
  ------------------
  |  |  145|    605|#define kEncodedHeader		0x17
  ------------------
  |  Branch (3560:2): [True: 605, False: 1.60k]
  ------------------
 3561|       |		/*
 3562|       |		 * The archive has an encoded header and we have to decode it
 3563|       |		 * in order to parse the header correctly.
 3564|       |		 */
 3565|    605|		r = decode_encoded_header_info(a, &(zip->si));
 3566|       |
 3567|       |		/* Check the EncodedHeader CRC.*/
 3568|    605|		if (r == 0 && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3568:7): [True: 538, False: 67]
  |  Branch (3568:17): [True: 492, False: 46]
  ------------------
 3569|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3570|       |			archive_set_error(&a->archive, -1,
 3571|       |			    "Damaged 7-Zip archive");
 3572|       |			r = -1;
 3573|       |#endif
 3574|    492|		}
 3575|    605|		if (r == 0) {
  ------------------
  |  Branch (3575:7): [True: 538, False: 67]
  ------------------
 3576|    538|			if (zip->si.ci.folders[0].digest_defined)
  ------------------
  |  Branch (3576:8): [True: 105, False: 433]
  ------------------
 3577|    105|				next_header_crc = zip->si.ci.folders[0].digest;
 3578|    433|			else
 3579|    433|				check_header_crc = 0;
 3580|    538|			if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3580:8): [True: 538, False: 0]
  ------------------
 3581|    538|				read_consume(a);
 3582|    538|			r = setup_decode_folder(a, zip->si.ci.folders, 1);
 3583|    538|			if (r == 0) {
  ------------------
  |  Branch (3583:8): [True: 424, False: 114]
  ------------------
 3584|    424|				zip->header_bytes_remaining =
 3585|    424|					zip->folder_outbytes_remaining;
 3586|    424|				r = seek_pack(a);
 3587|    424|			}
 3588|    538|		}
 3589|       |		/* Clean up StreamsInfo. */
 3590|    605|		free_StreamsInfo(&(zip->si));
 3591|    605|		memset(&(zip->si), 0, sizeof(zip->si));
 3592|    605|		if (r < 0)
  ------------------
  |  Branch (3592:7): [True: 184, False: 421]
  ------------------
 3593|    184|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    184|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3594|    421|		zip->header_is_encoded = 1;
 3595|    421|		zip->header_crc32 = 0;
 3596|       |		/* FALL THROUGH */
 3597|  2.02k|	case kHeader:
  ------------------
  |  |  124|  2.02k|#define kHeader			0x01
  ------------------
  |  Branch (3597:2): [True: 1.60k, False: 607]
  ------------------
 3598|       |		/*
 3599|       |		 * Parse the header.
 3600|       |		 */
 3601|  2.02k|		errno = 0;
 3602|  2.02k|		r = read_Header(a, header, zip->header_is_encoded);
 3603|  2.02k|		if (r < 0) {
  ------------------
  |  Branch (3603:7): [True: 1.74k, False: 278]
  ------------------
 3604|  1.74k|			if (errno == ENOMEM)
  ------------------
  |  Branch (3604:8): [True: 7, False: 1.73k]
  ------------------
 3605|      7|				archive_set_error(&a->archive, -1,
 3606|      7|				    "Couldn't allocate memory");
 3607|  1.73k|			else
 3608|  1.73k|				archive_set_error(&a->archive, -1,
 3609|  1.73k|				    "Damaged 7-Zip archive");
 3610|  1.74k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|  1.74k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3611|  1.74k|		}
 3612|       |
 3613|       |		/*
 3614|       |		 *  Must be kEnd.
 3615|       |		 */
 3616|    278|		if ((p = header_bytes(a, 1)) == NULL ||*p != kEnd) {
  ------------------
  |  |  123|    269|#define kEnd			0x00
  ------------------
  |  Branch (3616:7): [True: 9, False: 269]
  |  Branch (3616:42): [True: 21, False: 248]
  ------------------
 3617|     30|			archive_set_error(&a->archive, -1,
 3618|     30|			    "Malformed 7-Zip archive");
 3619|     30|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3620|     30|		}
 3621|       |
 3622|       |		/* Check the Header CRC.*/
 3623|    248|		if (check_header_crc && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3623:7): [True: 235, False: 13]
  |  Branch (3623:27): [True: 191, False: 44]
  ------------------
 3624|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3625|       |			archive_set_error(&a->archive, -1,
 3626|       |			    "Malformed 7-Zip archive");
 3627|       |			return (ARCHIVE_FATAL);
 3628|       |#endif
 3629|    191|		}
 3630|    248|		break;
 3631|      2|	default:
  ------------------
  |  Branch (3631:2): [True: 2, False: 2.20k]
  ------------------
 3632|      2|		archive_set_error(&a->archive, -1,
 3633|      2|		    "Unexpected Property ID = %X", p[0]);
 3634|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3635|  2.21k|	}
 3636|       |
 3637|       |	/* Clean up variables be used for decoding the archive header */
 3638|    248|	zip->pack_stream_remaining = 0;
 3639|    248|	zip->pack_stream_index = 0;
 3640|    248|	zip->folder_outbytes_remaining = 0;
 3641|    248|	zip->uncompressed_buffer_bytes_remaining = 0;
 3642|    248|	zip->pack_stream_bytes_unconsumed = 0;
 3643|    248|	zip->header_is_being_read = 0;
 3644|       |
 3645|    248|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    248|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3646|  2.21k|}
archive_read_support_format_7zip.c:header_bytes:
 3438|  1.23M|{
 3439|  1.23M|	struct _7zip *zip = a->format->data;
 3440|  1.23M|	const unsigned char *p;
 3441|       |
 3442|  1.23M|	if ((uint64_t)zip->header_bytes_remaining < rbytes)
  ------------------
  |  Branch (3442:6): [True: 34, False: 1.23M]
  ------------------
 3443|     34|		return (NULL);
 3444|  1.23M|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3444:6): [True: 1.22M, False: 10.8k]
  ------------------
 3445|  1.22M|		read_consume(a);
 3446|       |
 3447|  1.23M|	if (zip->header_is_encoded == 0) {
  ------------------
  |  Branch (3447:6): [True: 1.22M, False: 6.00k]
  ------------------
 3448|  1.22M|		p = __archive_read_ahead(a, rbytes, NULL);
 3449|  1.22M|		if (p == NULL)
  ------------------
  |  Branch (3449:7): [True: 459, False: 1.22M]
  ------------------
 3450|    459|			return (NULL);
 3451|  1.22M|		zip->header_bytes_remaining -= rbytes;
 3452|  1.22M|		zip->pack_stream_bytes_unconsumed = rbytes;
 3453|  1.22M|	} else {
 3454|  6.00k|		const void *buff;
 3455|  6.00k|		ssize_t bytes;
 3456|       |
 3457|  6.00k|		bytes = read_stream(a, &buff, rbytes, rbytes);
 3458|  6.00k|		if (bytes <= 0)
  ------------------
  |  Branch (3458:7): [True: 196, False: 5.80k]
  ------------------
 3459|    196|			return (NULL);
 3460|  5.80k|		zip->header_bytes_remaining -= bytes;
 3461|  5.80k|		p = buff;
 3462|  5.80k|	}
 3463|       |
 3464|       |	/* Update checksum */
 3465|  1.23M|	zip->header_crc32 = __archive_crc32(zip->header_crc32, p, rbytes);
 3466|  1.23M|	return (p);
 3467|  1.23M|}
archive_read_support_format_7zip.c:read_stream:
 3904|  6.23k|{
 3905|  6.23k|	struct _7zip *zip = a->format->data;
 3906|  6.23k|	int64_t skip_bytes = 0;
 3907|  6.23k|	ssize_t r;
 3908|       |
 3909|  6.23k|	if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3909:6): [True: 590, False: 5.64k]
  ------------------
 3910|    590|		if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3910:7): [True: 418, False: 172]
  ------------------
 3911|    418|			r = extract_pack_stream(a, 0);
 3912|    418|			if (r < 0)
  ------------------
  |  Branch (3912:8): [True: 188, False: 230]
  ------------------
 3913|    188|				return (r);
 3914|    230|			return (get_uncompressed_data(a, buff, size, minimum));
 3915|    418|		} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3915:14): [True: 41, False: 131]
  ------------------
 3916|       |			/* Extract a remaining pack stream. */
 3917|     41|			r = extract_pack_stream(a, 0);
 3918|     41|			if (r < 0)
  ------------------
  |  Branch (3918:8): [True: 2, False: 39]
  ------------------
 3919|      2|				return (r);
 3920|     39|			return (get_uncompressed_data(a, buff, size, minimum));
 3921|     41|		}
 3922|    590|	} else
 3923|  5.64k|		return (get_uncompressed_data(a, buff, size, minimum));
 3924|       |
 3925|       |	/*
 3926|       |	 * Current pack stream has been consumed.
 3927|       |	 */
 3928|    131|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3928:6): [True: 131, False: 0]
  ------------------
 3929|    131|		if (zip->header_is_being_read) {
  ------------------
  |  Branch (3929:7): [True: 1, False: 130]
  ------------------
 3930|       |			/* Invalid sequence. This might happen when
 3931|       |			 * reading a malformed archive. */
 3932|      1|			archive_set_error(&(a->archive),
 3933|      1|			    ARCHIVE_ERRNO_MISC, "Malformed 7-Zip archive");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3934|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3935|      1|		}
 3936|       |
 3937|       |		/*
 3938|       |		 * All current folder's pack streams have been
 3939|       |		 * consumed. Switch to next folder.
 3940|       |		 */
 3941|    130|		if (zip->folder_index == 0 &&
  ------------------
  |  Branch (3941:7): [True: 128, False: 2]
  ------------------
 3942|    128|		    (zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
  ------------------
  |  Branch (3942:8): [True: 0, False: 128]
  ------------------
 3943|    128|		     || zip->folder_index != zip->entry->folderIndex)) {
  ------------------
  |  Branch (3943:11): [True: 0, False: 128]
  ------------------
 3944|      0|			zip->folder_index = zip->entry->folderIndex;
 3945|      0|			skip_bytes =
 3946|      0|			    zip->si.ci.folders[zip->folder_index].skipped_bytes;
 3947|      0|		}
 3948|       |
 3949|    130|		if (zip->folder_index >= zip->si.ci.numFolders) {
  ------------------
  |  Branch (3949:7): [True: 0, False: 130]
  ------------------
 3950|       |			/*
 3951|       |			 * We have consumed all folders and its pack streams.
 3952|       |			 */
 3953|      0|			*buff = NULL;
 3954|      0|			return (0);
 3955|      0|		}
 3956|    130|		r = setup_decode_folder(a,
 3957|    130|			&(zip->si.ci.folders[zip->folder_index]), 0);
 3958|    130|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    130|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3958:7): [True: 10, False: 120]
  ------------------
 3959|     10|			return (r);
 3960|       |
 3961|    120|		zip->folder_index++;
 3962|    120|	}
 3963|       |
 3964|       |	/*
 3965|       |	 * Switch to next pack stream.
 3966|       |	 */
 3967|    120|	r = seek_pack(a);
 3968|    120|	if (r < 0)
  ------------------
  |  Branch (3968:6): [True: 4, False: 116]
  ------------------
 3969|      4|		return (r);
 3970|       |
 3971|       |	/* Extract a new pack stream. */
 3972|    116|	r = extract_pack_stream(a, 0);
 3973|    116|	if (r < 0)
  ------------------
  |  Branch (3973:6): [True: 42, False: 74]
  ------------------
 3974|     42|		return (r);
 3975|       |
 3976|       |	/*
 3977|       |	 * Skip the bytes we already have skipped in skip_stream().
 3978|       |	 */
 3979|     74|	while (1) {
  ------------------
  |  Branch (3979:9): [True: 74, Folded]
  ------------------
 3980|     74|		size_t request;
 3981|     74|		ssize_t skipped;
 3982|       |
 3983|     74|		if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3983:7): [True: 1, False: 73]
  ------------------
 3984|      1|			if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3984:8): [True: 0, False: 1]
  ------------------
 3985|      0|				r = extract_pack_stream(a, 0);
 3986|      0|				if (r < 0)
  ------------------
  |  Branch (3986:9): [True: 0, False: 0]
  ------------------
 3987|      0|					return (r);
 3988|      1|			} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3988:15): [True: 1, False: 0]
  ------------------
 3989|       |				/* Extract a remaining pack stream. */
 3990|      1|				r = extract_pack_stream(a, 0);
 3991|      1|				if (r < 0)
  ------------------
  |  Branch (3991:9): [True: 0, False: 1]
  ------------------
 3992|      0|					return (r);
 3993|      1|			} else {
 3994|      0|				archive_set_error(&a->archive,
 3995|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3996|      0|				    "Truncated 7-Zip file body");
 3997|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3998|      0|			}
 3999|      1|		}
 4000|       |
 4001|     74|		if (!skip_bytes)
  ------------------
  |  Branch (4001:7): [True: 74, False: 0]
  ------------------
 4002|     74|			break;
 4003|       |
 4004|      0|		if (skip_bytes > MAX_READ)
  ------------------
  |  |  405|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
  |  Branch (4004:7): [True: 0, False: 0]
  ------------------
 4005|      0|			request = MAX_READ;
  ------------------
  |  |  405|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
 4006|      0|		else
 4007|      0|			request = (size_t)skip_bytes;
 4008|       |
 4009|      0|		skipped = get_uncompressed_data(a, buff, request, 0);
 4010|      0|		if (skipped < 0)
  ------------------
  |  Branch (4010:7): [True: 0, False: 0]
  ------------------
 4011|      0|			return (skipped);
 4012|      0|		skip_bytes -= skipped;
 4013|      0|		if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4013:7): [True: 0, False: 0]
  ------------------
 4014|      0|			read_consume(a);
 4015|      0|	}
 4016|       |
 4017|     74|	return (get_uncompressed_data(a, buff, size, minimum));
 4018|     74|}
archive_read_support_format_7zip.c:extract_pack_stream:
 3714|    698|{
 3715|    698|	struct _7zip *zip = a->format->data;
 3716|    698|	ssize_t bytes_avail;
 3717|    698|	int r;
 3718|       |
 3719|    698|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   96|  1.39k|#define _7Z_COPY	0
  ------------------
  |  Branch (3719:6): [True: 298, False: 400]
  |  Branch (3719:32): [True: 134, False: 164]
  ------------------
 3720|    134|		if (minimum == 0)
  ------------------
  |  Branch (3720:7): [True: 134, False: 0]
  ------------------
 3721|    134|			minimum = 1;
 3722|    134|		if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL
  ------------------
  |  Branch (3722:7): [True: 0, False: 134]
  ------------------
 3723|    134|		    || bytes_avail <= 0) {
  ------------------
  |  Branch (3723:10): [True: 0, False: 134]
  ------------------
 3724|      0|			archive_set_error(&a->archive,
 3725|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3726|      0|			    "Truncated 7-Zip file body");
 3727|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3728|      0|		}
 3729|    134|		if (bytes_avail > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3729:7): [True: 134, False: 0]
  ------------------
 3730|    134|			bytes_avail = (ssize_t)zip->pack_stream_inbytes_remaining;
 3731|    134|		zip->pack_stream_inbytes_remaining -= bytes_avail;
 3732|    134|		if (bytes_avail > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3732:7): [True: 11, False: 123]
  ------------------
 3733|     11|			bytes_avail = (ssize_t)zip->folder_outbytes_remaining;
 3734|    134|		zip->folder_outbytes_remaining -= bytes_avail;
 3735|    134|		zip->uncompressed_buffer_bytes_remaining = bytes_avail;
 3736|    134|		return (ARCHIVE_OK);
  ------------------
  |  |  234|    134|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3737|    134|	}
 3738|       |
 3739|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3740|    564|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3740:6): [True: 416, False: 148]
  ------------------
 3741|    416|		size_t new_size = UBUFF_SIZE;
  ------------------
  |  |  294|    416|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3742|       |
 3743|    416|		if (new_size < minimum)
  ------------------
  |  Branch (3743:7): [True: 0, False: 416]
  ------------------
 3744|      0|		    new_size = align_size(minimum);
 3745|    416|		zip->uncompressed_buffer = malloc(new_size);
 3746|    416|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3746:7): [True: 0, False: 416]
  ------------------
 3747|      0|			archive_set_error(&a->archive, ENOMEM,
 3748|      0|			    "No memory for 7-Zip decompression");
 3749|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3750|      0|		}
 3751|    416|		zip->uncompressed_buffer_size = new_size;
 3752|    416|		zip->uncompressed_buffer_bytes_remaining = 0;
 3753|    416|	} else if (zip->uncompressed_buffer_size < minimum ||
  ------------------
  |  Branch (3753:13): [True: 0, False: 148]
  ------------------
 3754|    148|	    zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3754:6): [True: 0, False: 148]
  ------------------
 3755|       |		/*
 3756|       |		 * Make sure the uncompressed buffer can have bytes
 3757|       |		 * at least `minimum' bytes.
 3758|       |		 * NOTE: This case happen when reading the header.
 3759|       |		 */
 3760|      0|		size_t used;
 3761|      0|		if (zip->uncompressed_buffer_pointer != 0)
  ------------------
  |  Branch (3761:7): [True: 0, False: 0]
  ------------------
 3762|      0|			used = zip->uncompressed_buffer_pointer -
 3763|      0|				zip->uncompressed_buffer;
 3764|      0|		else
 3765|      0|			used = 0;
 3766|      0|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3766:7): [True: 0, False: 0]
  ------------------
 3767|       |			/*
 3768|       |			 * Expand the uncompressed buffer up to
 3769|       |			 * the minimum size.
 3770|       |			 */
 3771|      0|			void *p;
 3772|      0|			size_t new_size = align_size(minimum);
 3773|       |
 3774|      0|			p = realloc(zip->uncompressed_buffer, new_size);
 3775|      0|			if (p == NULL) {
  ------------------
  |  Branch (3775:8): [True: 0, False: 0]
  ------------------
 3776|      0|				archive_set_error(&a->archive, ENOMEM,
 3777|      0|				    "No memory for 7-Zip decompression");
 3778|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3779|      0|			}
 3780|      0|			zip->uncompressed_buffer = (unsigned char *)p;
 3781|      0|			zip->uncompressed_buffer_size = new_size;
 3782|      0|		}
 3783|       |		/*
 3784|       |		 * Move unconsumed bytes to the head.
 3785|       |		 */
 3786|      0|		if (used) {
  ------------------
  |  Branch (3786:7): [True: 0, False: 0]
  ------------------
 3787|      0|			memmove(zip->uncompressed_buffer,
 3788|      0|				zip->uncompressed_buffer + used,
 3789|      0|				zip->uncompressed_buffer_bytes_remaining);
 3790|      0|		}
 3791|      0|	} else
 3792|    148|		zip->uncompressed_buffer_bytes_remaining = 0;
 3793|    564|	zip->uncompressed_buffer_pointer = NULL;
 3794|    742|	for (;;) {
 3795|    742|		size_t bytes_in, bytes_out;
 3796|    742|		const void *buff_in;
 3797|    742|		unsigned char *buff_out;
 3798|    742|		int end_of_data;
 3799|       |
 3800|       |		/*
 3801|       |		 * Note: '1' here is a performance optimization.
 3802|       |		 * Recall that the decompression layer returns a count of
 3803|       |		 * available bytes; asking for more than that forces the
 3804|       |		 * decompressor to combine reads by copying data.
 3805|       |		 */
 3806|    742|		buff_in = __archive_read_ahead(a, 1, &bytes_avail);
 3807|    742|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (3807:7): [True: 0, False: 742]
  ------------------
 3808|      0|			archive_set_error(&a->archive,
 3809|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3810|      0|			    "Truncated 7-Zip file body");
 3811|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3812|      0|		}
 3813|       |
 3814|    742|		buff_out = zip->uncompressed_buffer
 3815|    742|			+ zip->uncompressed_buffer_bytes_remaining;
 3816|    742|		bytes_out = zip->uncompressed_buffer_size
 3817|    742|			- zip->uncompressed_buffer_bytes_remaining;
 3818|    742|		bytes_in = bytes_avail;
 3819|    742|		if (bytes_in > (uint64_t)zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3819:7): [True: 742, False: 0]
  ------------------
 3820|    742|			bytes_in = (size_t)zip->pack_stream_inbytes_remaining;
 3821|       |		/* Drive decompression. */
 3822|    742|		r = decompress(a, zip, buff_out, &bytes_out,
 3823|    742|			buff_in, &bytes_in);
 3824|    742|		switch (r) {
 3825|    505|		case ARCHIVE_OK:
  ------------------
  |  |  234|    505|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3825:3): [True: 505, False: 237]
  ------------------
 3826|    505|			end_of_data = 0;
 3827|    505|			break;
 3828|     91|		case ARCHIVE_EOF:
  ------------------
  |  |  233|     91|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3828:3): [True: 91, False: 651]
  ------------------
 3829|     91|			end_of_data = 1;
 3830|     91|			break;
 3831|    146|		default:
  ------------------
  |  Branch (3831:3): [True: 146, False: 596]
  ------------------
 3832|    146|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    146|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3833|    742|		}
 3834|    596|		zip->pack_stream_inbytes_remaining -= bytes_in;
 3835|    596|		if (bytes_out > (uint64_t)zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3835:7): [True: 245, False: 351]
  ------------------
 3836|    245|			bytes_out = (size_t)zip->folder_outbytes_remaining;
 3837|    596|		zip->folder_outbytes_remaining -= bytes_out;
 3838|    596|		zip->uncompressed_buffer_bytes_remaining += bytes_out;
 3839|    596|		zip->pack_stream_bytes_unconsumed = bytes_in;
 3840|       |
 3841|       |		/*
 3842|       |		 * Continue decompression until uncompressed_buffer is full.
 3843|       |		 */
 3844|    596|		if (zip->uncompressed_buffer_bytes_remaining ==
  ------------------
  |  Branch (3844:7): [True: 1, False: 595]
  ------------------
 3845|    596|		    zip->uncompressed_buffer_size)
 3846|      1|			break;
 3847|    595|		if (zip->odd_bcj_size &&
  ------------------
  |  Branch (3847:7): [True: 138, False: 457]
  ------------------
 3848|    138|		    zip->uncompressed_buffer_bytes_remaining +
  ------------------
  |  Branch (3848:7): [True: 0, False: 138]
  ------------------
 3849|    138|		    bcj_lookahead(zip->codec2) >
 3850|    138|		    zip->uncompressed_buffer_size)
 3851|      0|			break;
 3852|    595|		if (zip->pack_stream_inbytes_remaining == 0 &&
  ------------------
  |  Branch (3852:7): [True: 579, False: 16]
  ------------------
 3853|    579|		    zip->folder_outbytes_remaining == 0)
  ------------------
  |  Branch (3853:7): [True: 329, False: 250]
  ------------------
 3854|    329|			break;
 3855|    266|		if (end_of_data || (bytes_in == 0 && bytes_out == 0)) {
  ------------------
  |  Branch (3855:7): [True: 79, False: 187]
  |  Branch (3855:23): [True: 9, False: 178]
  |  Branch (3855:40): [True: 9, False: 0]
  ------------------
 3856|     88|			archive_set_error(&(a->archive),
 3857|     88|			    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|     88|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3858|     88|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     88|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3859|     88|		}
 3860|    178|		read_consume(a);
 3861|    178|	}
 3862|    330|	if (zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3862:6): [True: 0, False: 330]
  ------------------
 3863|      0|		archive_set_error(&(a->archive),
 3864|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3865|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3866|      0|	}
 3867|    330|	zip->uncompressed_buffer_pointer = zip->uncompressed_buffer;
 3868|    330|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    330|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3869|    330|}
archive_read_support_format_7zip.c:decompress:
 1795|    742|{
 1796|    742|	const uint8_t *t_next_in;
 1797|    742|	uint8_t *t_next_out;
 1798|    742|	size_t o_avail_in, o_avail_out;
 1799|    742|	size_t t_avail_in, t_avail_out;
 1800|    742|	uint8_t *bcj2_next_out;
 1801|    742|	size_t bcj2_avail_out;
 1802|    742|	size_t odd_bcj_out = 0;
 1803|    742|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  234|    742|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1804|       |
 1805|    742|	t_avail_in = o_avail_in = *used;
 1806|    742|	t_avail_out = o_avail_out = *outbytes;
 1807|    742|	t_next_in = b;
 1808|    742|	t_next_out = buff;
 1809|       |
 1810|    742|	if (zip->codec != _7Z_LZMA2 && bcj_lookahead(zip->codec2) != 0) {
  ------------------
  |  |   98|  1.48k|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1810:6): [True: 680, False: 62]
  |  Branch (1810:33): [True: 239, False: 441]
  ------------------
 1811|    239|		int i;
 1812|    239|		size_t min_out = bcj_lookahead(zip->codec2);
 1813|       |
 1814|       |		/* Do not copy out the BCJ remaining bytes when the output
 1815|       |		 * buffer size is less than the filter's lookahead size. */
 1816|    239|		if (o_avail_in != 0 && t_avail_out < min_out &&
  ------------------
  |  Branch (1816:7): [True: 172, False: 67]
  |  Branch (1816:26): [True: 0, False: 172]
  ------------------
 1817|      0|		    zip->odd_bcj_size) {
  ------------------
  |  Branch (1817:7): [True: 0, False: 0]
  ------------------
 1818|      0|			*used = 0;
 1819|      0|			*outbytes = 0;
 1820|      0|			return (ret);
 1821|      0|		}
 1822|    418|		for (i = 0; zip->odd_bcj_size > 0 && t_avail_out; i++) {
  ------------------
  |  Branch (1822:15): [True: 179, False: 239]
  |  Branch (1822:40): [True: 179, False: 0]
  ------------------
 1823|    179|			*t_next_out++ = zip->odd_bcj[i];
 1824|    179|			t_avail_out--;
 1825|    179|			zip->odd_bcj_size--;
 1826|    179|			odd_bcj_out++;
 1827|    179|		}
 1828|       |		/*
 1829|       |		 * PPMd is the only codec which can still produce output
 1830|       |		 * after its packed stream has been consumed: it is asked
 1831|       |		 * to flush the rest of the folder when called with no
 1832|       |		 * input. Returning here would skip that flush and leave
 1833|       |		 * the folder short, so let it through.
 1834|       |		 */
 1835|    239|		if ((o_avail_in == 0 && zip->codec != _7Z_PPMD) ||
  ------------------
  |  |  101|     67|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1835:8): [True: 67, False: 172]
  |  Branch (1835:27): [True: 67, False: 0]
  ------------------
 1836|    172|		    t_avail_out == 0) {
  ------------------
  |  Branch (1836:7): [True: 0, False: 172]
  ------------------
 1837|     67|			*used = o_avail_in - t_avail_in;
 1838|     67|			*outbytes = o_avail_out - t_avail_out;
 1839|     67|			if (o_avail_in == 0)
  ------------------
  |  Branch (1839:8): [True: 67, False: 0]
  ------------------
 1840|     67|				ret = ARCHIVE_EOF;
  ------------------
  |  |  233|     67|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1841|     67|			return (ret);
 1842|     67|		}
 1843|    239|	}
 1844|       |
 1845|    675|	bcj2_next_out = t_next_out;
 1846|    675|	bcj2_avail_out = t_avail_out;
 1847|    675|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  109|    675|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1847:6): [True: 45, False: 630]
  ------------------
 1848|       |		/*
 1849|       |		 * Decode a remaining decompressed main stream for BCJ2.
 1850|       |		 */
 1851|     45|		if (zip->tmp_stream_bytes_remaining) {
  ------------------
  |  Branch (1851:7): [True: 0, False: 45]
  ------------------
 1852|      0|			ssize_t bytes;
 1853|      0|			size_t remaining = zip->tmp_stream_bytes_remaining;
 1854|      0|			bytes = Bcj2_Decode(zip, t_next_out, t_avail_out);
 1855|      0|			if (bytes < 0) {
  ------------------
  |  Branch (1855:8): [True: 0, False: 0]
  ------------------
 1856|      0|				archive_set_error(&(a->archive),
 1857|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1858|      0|				    "BCJ2 conversion failed");
 1859|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1860|      0|			}
 1861|      0|			zip->main_stream_bytes_remaining -=
 1862|      0|			    remaining - zip->tmp_stream_bytes_remaining;
 1863|      0|			t_avail_out -= bytes;
 1864|      0|			if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1864:8): [True: 0, False: 0]
  |  Branch (1864:27): [True: 0, False: 0]
  ------------------
 1865|      0|				*used = 0;
 1866|      0|				*outbytes = o_avail_out - t_avail_out;
 1867|      0|				if (o_avail_in == 0 &&
  ------------------
  |  Branch (1867:9): [True: 0, False: 0]
  ------------------
 1868|      0|				    zip->tmp_stream_bytes_remaining)
  ------------------
  |  Branch (1868:9): [True: 0, False: 0]
  ------------------
 1869|      0|					ret = ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1870|      0|				return (ret);
 1871|      0|			}
 1872|      0|			t_next_out += bytes;
 1873|      0|			bcj2_next_out = t_next_out;
 1874|      0|			bcj2_avail_out = t_avail_out;
 1875|      0|		}
 1876|     45|		t_next_out = zip->tmp_stream_buff;
 1877|     45|		t_avail_out = zip->tmp_stream_buff_size;
 1878|     45|	}
 1879|       |
 1880|    675|	switch (zip->codec) {
 1881|    174|	case _7Z_COPY:
  ------------------
  |  |   96|    174|#define _7Z_COPY	0
  ------------------
  |  Branch (1881:2): [True: 174, False: 501]
  ------------------
 1882|    174|	{
 1883|    174|		size_t bytes = (t_avail_in > t_avail_out) ?
  ------------------
  |  Branch (1883:18): [True: 0, False: 174]
  ------------------
 1884|    174|		    t_avail_out : t_avail_in;
 1885|       |
 1886|    174|		memcpy(t_next_out, t_next_in, bytes);
 1887|    174|		t_avail_in -= bytes;
 1888|    174|		t_avail_out -= bytes;
 1889|    174|		if (o_avail_in == 0)
  ------------------
  |  Branch (1889:7): [True: 10, False: 164]
  ------------------
 1890|     10|			ret = ARCHIVE_EOF;
  ------------------
  |  |  233|     10|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1891|    174|		break;
 1892|      0|	}
 1893|      0|#ifdef HAVE_LZMA_H
 1894|    241|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   97|    179|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   98|    241|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1894:2): [True: 179, False: 496]
  |  Branch (1894:17): [True: 62, False: 613]
  ------------------
 1895|    241|		zip->lzstream.next_in = t_next_in;
 1896|    241|		zip->lzstream.avail_in = t_avail_in;
 1897|    241|		zip->lzstream.next_out = t_next_out;
 1898|    241|		zip->lzstream.avail_out = t_avail_out;
 1899|       |
 1900|    241|		r = lzma_code(&(zip->lzstream), LZMA_RUN);
 1901|    241|		switch (r) {
 1902|     33|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1902:3): [True: 33, False: 208]
  ------------------
 1903|     33|			lzma_end(&(zip->lzstream));
 1904|     33|			zip->lzstream_valid = 0;
 1905|     33|			ret = ARCHIVE_EOF;
  ------------------
  |  |  233|     33|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1906|     33|			break;
 1907|    202|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1907:3): [True: 202, False: 39]
  ------------------
 1908|    202|			break;
 1909|      6|		default:
  ------------------
  |  Branch (1909:3): [True: 6, False: 235]
  ------------------
 1910|      6|			archive_set_error(&(a->archive),
 1911|      6|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1912|      6|				"Decompression failed (%d)",
 1913|      6|			    r);
 1914|      6|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1915|    241|		}
 1916|    235|		t_avail_in = zip->lzstream.avail_in;
 1917|    235|		t_avail_out = zip->lzstream.avail_out;
 1918|    235|		break;
 1919|      0|#endif
 1920|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1921|      0|	case _7Z_BZ2:
  ------------------
  |  |  100|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1921:2): [True: 0, False: 675]
  ------------------
 1922|      0|		if (t_avail_in > UINT_MAX)
  ------------------
  |  Branch (1922:7): [True: 0, False: 0]
  ------------------
 1923|      0|			t_avail_in = UINT_MAX;
 1924|      0|		if (t_avail_out > UINT_MAX)
  ------------------
  |  Branch (1924:7): [True: 0, False: 0]
  ------------------
 1925|      0|			t_avail_out = UINT_MAX;
 1926|      0|		zip->bzstream.next_in = (char *)(uintptr_t)t_next_in;
 1927|      0|		zip->bzstream.avail_in = (unsigned int)t_avail_in;
 1928|      0|		zip->bzstream.next_out = (char *)(uintptr_t)t_next_out;
 1929|      0|		zip->bzstream.avail_out = (unsigned int)t_avail_out;
 1930|      0|		r = BZ2_bzDecompress(&(zip->bzstream));
 1931|      0|		switch (r) {
 1932|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1932:3): [True: 0, False: 0]
  ------------------
 1933|      0|			switch (BZ2_bzDecompressEnd(&(zip->bzstream))) {
 1934|      0|			case BZ_OK:
  ------------------
  |  Branch (1934:4): [True: 0, False: 0]
  ------------------
 1935|      0|				break;
 1936|      0|			default:
  ------------------
  |  Branch (1936:4): [True: 0, False: 0]
  ------------------
 1937|      0|				archive_set_error(&(a->archive),
 1938|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1939|      0|				    "Failed to clean up decompressor");
 1940|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1941|      0|			}
 1942|      0|			zip->bzstream_valid = 0;
 1943|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1944|      0|			break;
 1945|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1945:3): [True: 0, False: 0]
  ------------------
 1946|      0|			break;
 1947|      0|		default:
  ------------------
  |  Branch (1947:3): [True: 0, False: 0]
  ------------------
 1948|      0|			archive_set_error(&(a->archive),
 1949|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1950|      0|			    "bzip decompression failed");
 1951|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1952|      0|		}
 1953|      0|		t_avail_in = zip->bzstream.avail_in;
 1954|      0|		t_avail_out = zip->bzstream.avail_out;
 1955|      0|		break;
 1956|      0|#endif
 1957|      0|#ifdef HAVE_ZLIB_H
 1958|      3|	case _7Z_DEFLATE:
  ------------------
  |  |   99|      3|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1958:2): [True: 3, False: 672]
  ------------------
 1959|      3|		if (t_avail_in > UINT_MAX)
  ------------------
  |  Branch (1959:7): [True: 0, False: 3]
  ------------------
 1960|      0|			t_avail_in = UINT_MAX;
 1961|      3|		if (t_avail_out > UINT_MAX)
  ------------------
  |  Branch (1961:7): [True: 0, False: 3]
  ------------------
 1962|      0|			t_avail_out = UINT_MAX;
 1963|      3|		zip->stream.next_in = (Bytef *)(uintptr_t)t_next_in;
 1964|      3|		zip->stream.avail_in = (uInt)t_avail_in;
 1965|      3|		zip->stream.next_out = t_next_out;
 1966|      3|		zip->stream.avail_out = (uInt)t_avail_out;
 1967|      3|		r = inflate(&(zip->stream), 0);
 1968|      3|		switch (r) {
 1969|      1|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1969:3): [True: 1, False: 2]
  ------------------
 1970|      1|			ret = ARCHIVE_EOF;
  ------------------
  |  |  233|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1971|      1|			break;
 1972|      1|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1972:3): [True: 1, False: 2]
  ------------------
 1973|      1|			break;
 1974|      1|		default:
  ------------------
  |  Branch (1974:3): [True: 1, False: 2]
  ------------------
 1975|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1976|      1|			    "File decompression failed (%d)", r);
 1977|      1|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1978|      3|		}
 1979|      2|		t_avail_in = zip->stream.avail_in;
 1980|      2|		t_avail_out = zip->stream.avail_out;
 1981|      2|		break;
 1982|      0|#endif
 1983|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1984|       |	case _7Z_ZSTD:
 1985|       |	{
 1986|       |		/* src, size, pos */
 1987|       |		ZSTD_inBuffer input = { t_next_in, t_avail_in, 0 };
 1988|       |		/* dst, size, pos */
 1989|       |		ZSTD_outBuffer output = { t_next_out, t_avail_out, 0 };
 1990|       |
 1991|       |		size_t const zret = ZSTD_decompressStream(zip->zstd_dstream,
 1992|       |		    &output, &input);
 1993|       |		if (ZSTD_isError(zret)) {
 1994|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1995|       |			    "Zstd decompression failed: %s",
 1996|       |			    ZSTD_getErrorName(zret));
 1997|       |			return ARCHIVE_FAILED;
 1998|       |		}
 1999|       |		t_avail_in -= input.pos;
 2000|       |		t_avail_out -= output.pos;
 2001|       |		break;
 2002|       |	}
 2003|       |#endif
 2004|    257|	case _7Z_PPMD:
  ------------------
  |  |  101|    257|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (2004:2): [True: 257, False: 418]
  ------------------
 2005|    257|	{
 2006|    257|		int64_t flush_bytes;
 2007|       |
 2008|    257|		if (!zip->ppmd7_valid || zip->ppmd7_stat < 0 ||
  ------------------
  |  Branch (2008:7): [True: 0, False: 257]
  |  Branch (2008:28): [True: 0, False: 257]
  ------------------
 2009|    257|		    t_avail_out <= 0) {
  ------------------
  |  Branch (2009:7): [True: 0, False: 257]
  ------------------
 2010|      0|			archive_set_error(&(a->archive),
 2011|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2012|      0|			    "Decompression internal error");
 2013|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2014|      0|		}
 2015|    257|		zip->ppstream.next_in = t_next_in;
 2016|    257|		zip->ppstream.avail_in = t_avail_in;
 2017|    257|		zip->ppstream.stream_in = 0;
 2018|    257|		zip->ppstream.next_out = t_next_out;
 2019|    257|		zip->ppstream.avail_out = t_avail_out;
 2020|    257|		if (zip->ppmd7_stat == 0) {
  ------------------
  |  Branch (2020:7): [True: 166, False: 91]
  ------------------
 2021|    166|			zip->bytein.a = a;
 2022|    166|			zip->bytein.Read = &ppmd_read;
 2023|    166|			zip->range_dec.Stream = &zip->bytein;
 2024|    166|			r = __archive_ppmd7_functions.Ppmd7z_RangeDec_Init(
 2025|    166|				&(zip->range_dec));
 2026|    166|			if (r == 0) {
  ------------------
  |  Branch (2026:8): [True: 3, False: 163]
  ------------------
 2027|      3|				zip->ppmd7_stat = -1;
 2028|      3|				archive_set_error(&a->archive,
 2029|      3|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2030|      3|				    "Failed to initialize PPMd range decoder");
 2031|      3|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2032|      3|			}
 2033|    163|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (2033:8): [True: 5, False: 158]
  ------------------
 2034|      5|				zip->ppmd7_stat = -1;
 2035|      5|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2036|      5|			}
 2037|    158|			zip->ppmd7_stat = 1;
 2038|    158|		}
 2039|       |
 2040|    249|		if (t_avail_in == 0) {
  ------------------
  |  Branch (2040:7): [True: 79, False: 170]
  ------------------
 2041|       |			/* XXX Flush out remaining decoded data XXX
 2042|       |			 *
 2043|       |			 * The bytes a BCJ filter parked on the previous call
 2044|       |			 * have just been written to the output buffer, and
 2045|       |			 * count towards what the folder still owes. Asking
 2046|       |			 * PPMd to decode them a second time would run the
 2047|       |			 * range decoder off the end of the packed stream. */
 2048|     79|			flush_bytes = zip->folder_outbytes_remaining -
 2049|     79|			    (int64_t)odd_bcj_out;
 2050|       |			/* Those bytes were all that was left of the folder. */
 2051|     79|			if (flush_bytes <= 0)
  ------------------
  |  Branch (2051:8): [True: 0, False: 79]
  ------------------
 2052|      0|				break;
 2053|     79|		} else
 2054|    170|			flush_bytes = 0;
 2055|       |
 2056|  1.27M|		do {
 2057|  1.27M|			int sym;
 2058|       |
 2059|  1.27M|			sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
 2060|  1.27M|				&(zip->ppmd7_context), &(zip->range_dec.p));
 2061|  1.27M|			if (sym < 0) {
  ------------------
  |  Branch (2061:8): [True: 19, False: 1.27M]
  ------------------
 2062|     19|				zip->ppmd7_stat = -1;
 2063|     19|				archive_set_error(&a->archive,
 2064|     19|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     19|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2065|     19|				    "Failed to decode PPMd");
 2066|     19|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     19|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2067|     19|			}
 2068|  1.27M|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (2068:8): [True: 84, False: 1.27M]
  ------------------
 2069|     84|				zip->ppmd7_stat = -1;
 2070|     84|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     84|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2071|     84|			}
 2072|  1.27M|			*zip->ppstream.next_out++ = (unsigned char)sym;
 2073|  1.27M|			zip->ppstream.avail_out--;
 2074|  1.27M|			if (flush_bytes > 0)
  ------------------
  |  Branch (2074:8): [True: 1.06k, False: 1.27M]
  ------------------
 2075|  1.06k|				flush_bytes--;
 2076|  1.27M|		} while (zip->ppstream.avail_out &&
  ------------------
  |  Branch (2076:12): [True: 1.27M, False: 13]
  ------------------
 2077|  1.27M|			(zip->ppstream.avail_in || flush_bytes));
  ------------------
  |  Branch (2077:5): [True: 1.27M, False: 1.19k]
  |  Branch (2077:31): [True: 1.06k, False: 133]
  ------------------
 2078|       |
 2079|    146|		t_avail_in = zip->ppstream.avail_in;
 2080|    146|		t_avail_out = zip->ppstream.avail_out;
 2081|    146|		break;
 2082|    249|	}
 2083|      0|	default:
  ------------------
  |  Branch (2083:2): [True: 0, False: 675]
  ------------------
 2084|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2085|      0|		    "Decompression internal error");
 2086|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2087|    675|	}
 2088|    557|	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  234|  1.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  233|     44|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2088:6): [True: 44, False: 513]
  |  Branch (2088:27): [True: 0, False: 44]
  ------------------
 2089|      0|		return (ret);
 2090|       |
 2091|    557|	if (zip->codec == _7Z_PPMD)
  ------------------
  |  |  101|    557|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (2091:6): [True: 146, False: 411]
  ------------------
 2092|    146|		*used = zip->ppstream.stream_in;
 2093|    411|	else
 2094|    411|		*used = o_avail_in - t_avail_in;
 2095|    557|	*outbytes = o_avail_out - t_avail_out;
 2096|       |
 2097|       |	/*
 2098|       |	 * Decode BCJ.
 2099|       |	 */
 2100|    557|	if (zip->codec != _7Z_LZMA2 && bcj_lookahead(zip->codec2) != 0) {
  ------------------
  |  |   98|  1.11k|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (2100:6): [True: 497, False: 60]
  |  Branch (2100:33): [True: 172, False: 325]
  ------------------
 2101|    172|		size_t l;
 2102|       |
 2103|    172|		switch (zip->codec2) {
 2104|     46|		case _7Z_X86:
  ------------------
  |  |  108|     46|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (2104:3): [True: 46, False: 126]
  ------------------
 2105|     46|			l = x86_Convert(zip, buff, *outbytes);
 2106|     46|			break;
 2107|     10|		case _7Z_ARM:
  ------------------
  |  |  112|     10|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (2107:3): [True: 10, False: 162]
  ------------------
 2108|     10|			l = arm_Convert(zip, buff, *outbytes);
 2109|     10|			break;
 2110|     14|		case _7Z_ARMTHUMB:
  ------------------
  |  |  113|     14|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (2110:3): [True: 14, False: 158]
  ------------------
 2111|     14|			l = armthumb_Convert(zip, buff, *outbytes);
 2112|     14|			break;
 2113|     28|		case _7Z_ARM64:
  ------------------
  |  |  114|     28|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (2113:3): [True: 28, False: 144]
  ------------------
 2114|     28|			l = arm64_Convert(zip, buff, *outbytes);
 2115|     28|			break;
 2116|     16|		case _7Z_SPARC:
  ------------------
  |  |  116|     16|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (2116:3): [True: 16, False: 156]
  ------------------
 2117|     16|			l = sparc_Convert(zip, buff, *outbytes);
 2118|     16|			break;
 2119|     13|		case _7Z_POWERPC:
  ------------------
  |  |  110|     13|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (2119:3): [True: 13, False: 159]
  ------------------
 2120|     13|			l = powerpc_Convert(zip, buff, *outbytes);
 2121|     13|			break;
 2122|     27|		case _7Z_RISCV:
  ------------------
  |  |  115|     27|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (2122:3): [True: 27, False: 145]
  ------------------
 2123|     27|			l = riscv_Convert(zip, buff, *outbytes);
 2124|     27|			break;
 2125|     18|		case _7Z_IA64:
  ------------------
  |  |  111|     18|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (2125:3): [True: 18, False: 154]
  ------------------
 2126|     18|			l = ia64_Convert(zip, buff, *outbytes);
 2127|     18|			break;
 2128|      0|		default:
  ------------------
  |  Branch (2128:3): [True: 0, False: 172]
  ------------------
 2129|       |			/* Unreachable: bcj_lookahead() returns non-zero only
 2130|       |			 * for the codecs handled above. Guards against the two
 2131|       |			 * lists drifting apart. */
 2132|      0|			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2133|      0|			    "BCJ filter internal error");
 2134|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2135|    172|		}
 2136|       |
 2137|       |		/* Keep the bytes which could not be converted yet, they are
 2138|       |		 * prepended to the output buffer on the next call. */
 2139|    172|		zip->odd_bcj_size = *outbytes - l;
 2140|    172|		if (zip->odd_bcj_size > 0 &&
  ------------------
  |  Branch (2140:7): [True: 139, False: 33]
  ------------------
 2141|    139|		    zip->odd_bcj_size <= sizeof(zip->odd_bcj) &&
  ------------------
  |  Branch (2141:7): [True: 139, False: 0]
  ------------------
 2142|    139|		    o_avail_in && ret != ARCHIVE_EOF) {
  ------------------
  |  |  233|    139|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2142:7): [True: 139, False: 0]
  |  Branch (2142:21): [True: 138, False: 1]
  ------------------
 2143|    138|			memcpy(zip->odd_bcj,
 2144|    138|			    ((unsigned char *)buff) + l,
 2145|    138|			    zip->odd_bcj_size);
 2146|    138|			*outbytes = l;
 2147|    138|		} else
 2148|     34|			zip->odd_bcj_size = 0;
 2149|    172|	}
 2150|       |
 2151|       |	/*
 2152|       |	 * Decode BCJ2 with a decompressed main stream.
 2153|       |	 */
 2154|    557|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  109|    557|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (2154:6): [True: 45, False: 512]
  ------------------
 2155|     45|		ssize_t bytes;
 2156|       |
 2157|     45|		zip->tmp_stream_bytes_avail =
 2158|     45|		    zip->tmp_stream_buff_size - t_avail_out;
 2159|     45|		if (zip->tmp_stream_bytes_avail >
  ------------------
  |  Branch (2159:7): [True: 4, False: 41]
  ------------------
 2160|     45|		      (uint64_t)zip->main_stream_bytes_remaining)
 2161|      4|			zip->tmp_stream_bytes_avail =
 2162|      4|			    zip->main_stream_bytes_remaining;
 2163|     45|		zip->tmp_stream_bytes_remaining = zip->tmp_stream_bytes_avail;
 2164|     45|		bytes = Bcj2_Decode(zip, bcj2_next_out, bcj2_avail_out);
 2165|     45|		if (bytes < 0) {
  ------------------
  |  Branch (2165:7): [True: 28, False: 17]
  ------------------
 2166|     28|			archive_set_error(&(a->archive),
 2167|     28|			    ARCHIVE_ERRNO_MISC, "BCJ2 conversion failed");
  ------------------
  |  |  204|     28|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2168|     28|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     28|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2169|     28|		}
 2170|     17|		zip->main_stream_bytes_remaining -=
 2171|     17|		    zip->tmp_stream_bytes_avail
 2172|     17|		      - zip->tmp_stream_bytes_remaining;
 2173|     17|		bcj2_avail_out -= bytes;
 2174|     17|		*outbytes = o_avail_out - bcj2_avail_out;
 2175|     17|	}
 2176|       |
 2177|       |	/*
 2178|       |	 * Decode Delta. LZMA1 and LZMA2 use liblzma's Delta filter instead.
 2179|       |	 */
 2180|    529|	if (zip->codec2 == _7Z_DELTA &&
  ------------------
  |  |  102|  1.05k|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (2180:6): [True: 21, False: 508]
  ------------------
 2181|     21|	    zip->codec != _7Z_LZMA && zip->codec != _7Z_LZMA2)
  ------------------
  |  |   97|    550|#define _7Z_LZMA	0x030101
  ------------------
              	    zip->codec != _7Z_LZMA && zip->codec != _7Z_LZMA2)
  ------------------
  |  |   98|     21|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (2181:6): [True: 21, False: 0]
  |  Branch (2181:32): [True: 21, False: 0]
  ------------------
 2182|     21|		delta_Decode(zip, buff, *outbytes);
 2183|       |
 2184|    529|	return (ret);
 2185|    557|}
archive_read_support_format_7zip.c:Bcj2_Decode:
 5019|     45|{
 5020|     45|	size_t inPos = 0, outPos = 0;
 5021|     45|	const uint8_t *buf0, *buf1, *buf2, *buf3;
 5022|     45|	size_t size0, size1, size2, size3;
 5023|     45|	const uint8_t *buffer, *bufferLim;
 5024|     45|	size_t i, j;
 5025|       |
 5026|     45|	size0 = zip->tmp_stream_bytes_remaining;
 5027|     45|	buf0 = zip->tmp_stream_buff + zip->tmp_stream_bytes_avail - size0;
 5028|     45|	size1 = zip->sub_stream_bytes_remaining[0];
 5029|     45|	buf1 = zip->sub_stream_buff[0] + zip->sub_stream_size[0] - size1;
 5030|     45|	size2 = zip->sub_stream_bytes_remaining[1];
 5031|     45|	buf2 = zip->sub_stream_buff[1] + zip->sub_stream_size[1] - size2;
 5032|     45|	size3 = zip->sub_stream_bytes_remaining[2];
 5033|     45|	buf3 = zip->sub_stream_buff[2] + zip->sub_stream_size[2] - size3;
 5034|       |
 5035|     45|	buffer = buf3;
 5036|     45|	bufferLim = buffer + size3;
 5037|       |
 5038|     45|	if (zip->bcj_state == 0) {
  ------------------
  |  Branch (5038:6): [True: 39, False: 6]
  ------------------
 5039|       |		/*
 5040|       |		 * Initialize.
 5041|       |		 */
 5042|     39|		zip->bcj2_prevByte = 0;
 5043|     39|		for (i = 0;
 5044|  10.1k|		    i < sizeof(zip->bcj2_p) / sizeof(zip->bcj2_p[0]); i++)
  ------------------
  |  Branch (5044:7): [True: 10.0k, False: 39]
  ------------------
 5045|  10.0k|			zip->bcj2_p[i] = kBitModelTotal >> 1;
  ------------------
  |  | 4994|  10.0k|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  ------------------
  |  |  |  | 4993|  10.0k|#define kNumBitModelTotalBits 11
  |  |  ------------------
  ------------------
 5046|     39|		RC_INIT2;
  ------------------
  |  | 4999|     39|#define RC_INIT2 do {							\
  |  | 5000|     39|	zip->bcj2_code = 0;						\
  |  | 5001|     39|	zip->bcj2_range = 0xFFFFFFFF;					\
  |  | 5002|     39|	{								\
  |  | 5003|     39|		int ii;							\
  |  | 5004|    234|		for (ii = 0; ii < 5; ii++) {				\
  |  |  ------------------
  |  |  |  Branch (5004:16): [True: 195, False: 39]
  |  |  ------------------
  |  | 5005|    195|			RC_TEST;					\
  |  |  ------------------
  |  |  |  | 4998|    195|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4985|      0|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4998:23): [True: 0, False: 195]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 5006|    195|			zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; \
  |  |  ------------------
  |  |  |  | 4997|    195|#define RC_READ_BYTE (*buffer++)
  |  |  ------------------
  |  | 5007|    195|		}							\
  |  | 5008|     39|	}								\
  |  | 5009|     39|} while (0)
  |  |  ------------------
  |  |  |  Branch (5009:10): [Folded, False: 39]
  |  |  ------------------
  ------------------
 5047|     39|		zip->bcj_state = 1;
 5048|     39|	}
 5049|       |
 5050|       |	/*
 5051|       |	 * Gather the odd bytes of a previous call.
 5052|       |	 */
 5053|     45|	for (i = 0; zip->odd_bcj_size > 0 && outPos < outSize; i++) {
  ------------------
  |  Branch (5053:14): [True: 0, False: 45]
  |  Branch (5053:39): [True: 0, False: 0]
  ------------------
 5054|      0|		outBuf[outPos++] = zip->odd_bcj[i];
 5055|      0|		zip->odd_bcj_size--;
 5056|      0|	}
 5057|       |
 5058|     45|	if (outSize == 0) {
  ------------------
  |  Branch (5058:6): [True: 0, False: 45]
  ------------------
 5059|      0|		zip->bcj2_outPos += outPos;
 5060|      0|		return (outPos);
 5061|      0|	}
 5062|       |
 5063|    131|	for (;;) {
 5064|    131|		uint8_t b;
 5065|    131|		CProb *prob;
  ------------------
  |  |  384|    131|#define CProb uint16_t
  ------------------
 5066|    131|		uint32_t bound;
 5067|    131|		uint32_t ttt;
 5068|       |
 5069|    131|		size_t limit = size0 - inPos;
 5070|    131|		if (outSize - outPos < limit)
  ------------------
  |  Branch (5070:7): [True: 0, False: 131]
  ------------------
 5071|      0|			limit = outSize - outPos;
 5072|       |
 5073|    131|		if (zip->bcj_state == 1) {
  ------------------
  |  Branch (5073:7): [True: 131, False: 0]
  ------------------
 5074|    947|			while (limit != 0) {
  ------------------
  |  Branch (5074:11): [True: 930, False: 17]
  ------------------
 5075|    930|				uint8_t bb = buf0[inPos];
 5076|    930|				outBuf[outPos++] = bb;
 5077|    930|				if (IsJ(zip->bcj2_prevByte, bb)) {
  ------------------
  |  | 4988|    930|#define IsJ(b0, b1) ((b1 & 0xFE) == 0xE8 || IsJcc(b0, b1))
  |  |  ------------------
  |  |  |  | 4987|    843|#define IsJcc(b0, b1) ((b0) == 0x0F && ((b1) & 0xF0) == 0x80)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4987:24): [True: 167, False: 676]
  |  |  |  |  |  Branch (4987:40): [True: 27, False: 140]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (4988:22): [True: 87, False: 843]
  |  |  ------------------
  ------------------
 5078|    114|					zip->bcj_state = 2;
 5079|    114|					break;
 5080|    114|				}
 5081|    816|				inPos++;
 5082|    816|				zip->bcj2_prevByte = bb;
 5083|    816|				limit--;
 5084|    816|			}
 5085|    131|		}
 5086|       |
 5087|    131|		if (limit == 0 || outPos == outSize)
  ------------------
  |  Branch (5087:7): [True: 17, False: 114]
  |  Branch (5087:21): [True: 0, False: 114]
  ------------------
 5088|     17|			break;
 5089|    114|		zip->bcj_state = 1;
 5090|       |
 5091|    114|		b = buf0[inPos++];
 5092|       |
 5093|    114|		if (b == 0xE8)
  ------------------
  |  Branch (5093:7): [True: 44, False: 70]
  ------------------
 5094|     44|			prob = zip->bcj2_p + zip->bcj2_prevByte;
 5095|     70|		else if (b == 0xE9)
  ------------------
  |  Branch (5095:12): [True: 43, False: 27]
  ------------------
 5096|     43|			prob = zip->bcj2_p + 256;
 5097|     27|		else
 5098|     27|			prob = zip->bcj2_p + 257;
 5099|       |
 5100|    114|		IF_BIT_0(prob) {
  ------------------
  |  | 5013|    114|#define IF_BIT_0(p) ttt = *(p); bound = (zip->bcj2_range >> kNumBitModelTotalBits) * ttt; if (zip->bcj2_code < bound)
  |  |  ------------------
  |  |  |  | 4993|    114|#define kNumBitModelTotalBits 11
  |  |  ------------------
  |  |  |  Branch (5013:95): [True: 88, False: 26]
  |  |  ------------------
  ------------------
 5101|     88|			UPDATE_0(prob)
  ------------------
  |  | 5014|     88|#define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4994|     88|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  |  |  ------------------
  |  |  |  |  |  | 4993|     88|#define kNumBitModelTotalBits 11
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4995|     88|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 5011|     88|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4991|     88|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4990|     88|#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; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4998|      2|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4985|      2|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  238|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (4998:23): [True: 2, 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; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4997|      0|#define RC_READ_BYTE (*buffer++)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (5011:23): [True: 2, False: 86]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5102|     86|			zip->bcj2_prevByte = b;
 5103|     86|		} else {
 5104|     26|			uint32_t dest;
 5105|     26|			const uint8_t *v;
 5106|     26|			uint8_t out[4];
 5107|       |
 5108|     26|			UPDATE_1(prob)
  ------------------
  |  | 5015|     26|#define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4995|     26|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 5011|     26|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4991|     26|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4990|     26|#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; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4998|      3|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4985|      3|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  238|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (4998: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; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4997|      0|#define RC_READ_BYTE (*buffer++)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (5011:23): [True: 3, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5109|     23|			if (b == 0xE8) {
  ------------------
  |  Branch (5109:8): [True: 3, False: 20]
  ------------------
 5110|      3|				v = buf1;
 5111|      3|				if (size1 < 4)
  ------------------
  |  Branch (5111:9): [True: 3, False: 0]
  ------------------
 5112|      3|					return SZ_ERROR_DATA;
  ------------------
  |  | 4985|      3|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  ------------------
  |  |  |  |  238|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  ------------------
  ------------------
 5113|      0|				buf1 += 4;
 5114|      0|				size1 -= 4;
 5115|     20|			} else {
 5116|     20|				v = buf2;
 5117|     20|				if (size2 < 4)
  ------------------
  |  Branch (5117:9): [True: 20, False: 0]
  ------------------
 5118|     20|					return SZ_ERROR_DATA;
  ------------------
  |  | 4985|     20|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  ------------------
  |  |  |  |  238|     20|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  ------------------
  ------------------
 5119|      0|				buf2 += 4;
 5120|      0|				size2 -= 4;
 5121|      0|			}
 5122|      0|			dest = archive_be32dec(v) -
 5123|      0|			    (zip->bcj2_outPos + outPos + 4);
 5124|      0|			archive_le32enc(out, dest);
 5125|      0|			zip->bcj2_prevByte = out[3];
 5126|       |
 5127|      0|			for (i = 0; i < 4 && outPos < outSize; i++)
  ------------------
  |  Branch (5127:16): [True: 0, False: 0]
  |  Branch (5127:25): [True: 0, False: 0]
  ------------------
 5128|      0|				outBuf[outPos++] = out[i];
 5129|      0|			if (i < 4) {
  ------------------
  |  Branch (5129:8): [True: 0, False: 0]
  ------------------
 5130|       |				/*
 5131|       |				 * Save odd bytes which we could not add into
 5132|       |				 * the output buffer because of out of space.
 5133|       |				 */
 5134|      0|				zip->odd_bcj_size = 4 - i;
 5135|      0|				for (; i < 4; i++) {
  ------------------
  |  Branch (5135:12): [True: 0, False: 0]
  ------------------
 5136|      0|					j = i - 4 + (unsigned)zip->odd_bcj_size;
 5137|      0|					zip->odd_bcj[j] = out[i];
 5138|      0|				}
 5139|      0|				break;
 5140|      0|			}
 5141|      0|		}
 5142|    114|	}
 5143|     17|	zip->tmp_stream_bytes_remaining -= inPos;
 5144|     17|	zip->sub_stream_bytes_remaining[0] = size1;
 5145|     17|	zip->sub_stream_bytes_remaining[1] = size2;
 5146|     17|	zip->sub_stream_bytes_remaining[2] = bufferLim - buffer;
 5147|     17|	zip->bcj2_outPos += outPos;
 5148|       |
 5149|     17|	return ((ssize_t)outPos);
 5150|     45|}
archive_read_support_format_7zip.c:ppmd_read:
 1369|  17.3k|{
 1370|  17.3k|	struct archive_read *a = ((IByteIn*)p)->a;
 1371|  17.3k|	struct _7zip *zip = a->format->data;
 1372|  17.3k|	Byte b;
 1373|       |
 1374|  17.3k|	if (zip->ppstream.avail_in == 0) {
  ------------------
  |  Branch (1374:6): [True: 121, False: 17.2k]
  ------------------
 1375|       |		/*
 1376|       |		 * Ppmd7_DecodeSymbol might require reading multiple bytes
 1377|       |		 * and we are on boundary;
 1378|       |		 * last resort to read using __archive_read_ahead.
 1379|       |		 */
 1380|    121|		if (zip->pack_stream_inbytes_remaining <= 0 ||
  ------------------
  |  Branch (1380:7): [True: 106, False: 15]
  ------------------
 1381|     15|		    zip->ppstream.stream_in >=
  ------------------
  |  Branch (1381:7): [True: 15, False: 0]
  ------------------
 1382|    121|		    (uint64_t)zip->pack_stream_inbytes_remaining) {
 1383|    121|			archive_set_error(&a->archive,
 1384|    121|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    121|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1385|    121|			    "Truncated 7z file data");
 1386|    121|			zip->ppstream.overconsumed = 1;
 1387|    121|			return (0);
 1388|    121|		}
 1389|      0|		const uint8_t *data = __archive_read_ahead(a,
 1390|      0|		    zip->ppstream.stream_in + 1, NULL);
 1391|      0|		if (data == NULL) {
  ------------------
  |  Branch (1391:7): [True: 0, False: 0]
  ------------------
 1392|      0|			archive_set_error(&a->archive,
 1393|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1394|      0|			    "Truncated 7z file data");
 1395|      0|			zip->ppstream.overconsumed = 1;
 1396|      0|			return (0);
 1397|      0|		}
 1398|      0|		b = data[zip->ppstream.stream_in];
 1399|  17.2k|	} else {
 1400|  17.2k|		b = *zip->ppstream.next_in++;
 1401|  17.2k|		zip->ppstream.avail_in--;
 1402|  17.2k|	}
 1403|  17.2k|	zip->ppstream.stream_in++;
 1404|  17.2k|	return (b);
 1405|  17.3k|}
archive_read_support_format_7zip.c:x86_Convert:
 4393|     46|{
 4394|     46|	static const uint8_t kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
 4395|     46|	static const uint8_t kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
 4396|     46|	size_t bufferPos, prevPosT;
 4397|     46|	uint32_t ip, prevMask;
 4398|       |
 4399|     46|	if (size < 5)
  ------------------
  |  Branch (4399:6): [True: 1, False: 45]
  ------------------
 4400|      1|		return 0;
 4401|       |
 4402|     45|	bufferPos = 0;
 4403|     45|	prevPosT = zip->bcj_prevPosT;
 4404|     45|	prevMask = zip->bcj_prevMask;
 4405|     45|	ip = zip->bcj_ip;
 4406|       |
 4407|  1.65k|	for (;;) {
 4408|  1.65k|		uint8_t *p = data + bufferPos;
 4409|  1.65k|		uint8_t *limit = data + size - 4;
 4410|       |
 4411|  10.1k|		for (; p < limit; p++)
  ------------------
  |  Branch (4411:10): [True: 10.1k, False: 45]
  ------------------
 4412|  10.1k|			if ((*p & 0xFE) == 0xE8)
  ------------------
  |  Branch (4412:8): [True: 1.61k, False: 8.49k]
  ------------------
 4413|  1.61k|				break;
 4414|  1.65k|		bufferPos = (size_t)(p - data);
 4415|  1.65k|		if (p >= limit)
  ------------------
  |  Branch (4415:7): [True: 45, False: 1.61k]
  ------------------
 4416|     45|			break;
 4417|  1.61k|		prevPosT = bufferPos - prevPosT;
 4418|  1.61k|		if (prevPosT == 0 || prevPosT > 3)
  ------------------
  |  Branch (4418:7): [True: 0, False: 1.61k]
  |  Branch (4418:24): [True: 568, False: 1.04k]
  ------------------
 4419|    568|			prevMask = 0;
 4420|  1.04k|		else {
 4421|  1.04k|			prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7;
 4422|  1.04k|			if (prevMask != 0) {
  ------------------
  |  Branch (4422:8): [True: 1.00k, False: 35]
  ------------------
 4423|  1.00k|				unsigned char b =
 4424|  1.00k|					p[4 - kMaskToBitNumber[prevMask]];
 4425|  1.00k|				if (!kMaskToAllowedStatus[prevMask] ||
  ------------------
  |  Branch (4425:9): [True: 466, False: 542]
  ------------------
 4426|    542|				    Test86MSByte(b)) {
  ------------------
  |  | 4380|    542|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4380:26): [True: 21, False: 521]
  |  |  |  Branch (4380:38): [True: 39, False: 482]
  |  |  ------------------
  ------------------
 4427|    526|					prevPosT = bufferPos;
 4428|    526|					prevMask = ((prevMask << 1) & 0x7) | 1;
 4429|    526|					bufferPos++;
 4430|    526|					continue;
 4431|    526|				}
 4432|  1.00k|			}
 4433|  1.04k|		}
 4434|  1.08k|		prevPosT = bufferPos;
 4435|       |
 4436|  1.08k|		if (Test86MSByte(p[4])) {
  ------------------
  |  | 4380|  1.08k|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4380:26): [True: 138, False: 947]
  |  |  |  Branch (4380:38): [True: 99, False: 848]
  |  |  ------------------
  ------------------
 4437|    237|			uint32_t src = archive_le32dec(p + 1);
 4438|    237|			uint32_t dest;
 4439|    254|			for (;;) {
 4440|    254|				uint8_t b;
 4441|    254|				int b_index;
 4442|       |
 4443|    254|				dest = src - (ip + (uint32_t)bufferPos);
 4444|    254|				if (prevMask == 0)
  ------------------
  |  Branch (4444:9): [True: 117, False: 137]
  ------------------
 4445|    117|					break;
 4446|    137|				b_index = kMaskToBitNumber[prevMask] * 8;
 4447|    137|				b = (uint8_t)(dest >> (24 - b_index));
 4448|    137|				if (!Test86MSByte(b))
  ------------------
  |  | 4380|    137|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4380:26): [True: 15, False: 122]
  |  |  |  Branch (4380:38): [True: 2, False: 120]
  |  |  ------------------
  ------------------
 4449|    120|					break;
 4450|     17|				src = dest ^ ((1 << (32 - b_index)) - 1);
 4451|     17|			}
 4452|    237|			p[4] = (uint8_t)(~(((dest >> 24) & 1) - 1));
 4453|    237|			p[3] = (uint8_t)(dest >> 16);
 4454|    237|			p[2] = (uint8_t)(dest >> 8);
 4455|    237|			p[1] = (uint8_t)dest;
 4456|    237|			bufferPos += 5;
 4457|    848|		} else {
 4458|    848|			prevMask = ((prevMask << 1) & 0x7) | 1;
 4459|    848|			bufferPos++;
 4460|    848|		}
 4461|  1.08k|	}
 4462|     45|	zip->bcj_prevPosT = prevPosT;
 4463|     45|	zip->bcj_prevMask = prevMask;
 4464|     45|	zip->bcj_ip += (uint32_t)bufferPos;
 4465|     45|	return (bufferPos);
 4466|     46|}
archive_read_support_format_7zip.c:arm_Convert:
 4476|     10|{
 4477|       |	// This function was adapted from
 4478|       |	// static size_t bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4479|       |	// in https://git.tukaani.org/xz-embedded.git
 4480|       |
 4481|       |	/*
 4482|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4483|       |	 *
 4484|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4485|       |	 *          Igor Pavlov <https://7-zip.org/>
 4486|       |	 *
 4487|       |	 * This file has been put into the public domain.
 4488|       |	 * You can do whatever you want with this file.
 4489|       |	 */
 4490|       |
 4491|     10|	size_t i;
 4492|     10|	uint32_t addr;
 4493|       |
 4494|    105|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4494:14): [True: 95, False: 10]
  ------------------
 4495|     95|		if (buf[i + 3] == 0xEB) {
  ------------------
  |  Branch (4495:7): [True: 18, False: 77]
  ------------------
 4496|       |			// Calculate the transformed addr.
 4497|     18|			addr = archive_le24dec(buf + i);
 4498|     18|			addr <<= 2;
 4499|     18|			addr -= zip->bcj_ip + (uint32_t)i;
 4500|     18|			addr >>= 2;
 4501|       |
 4502|       |			// Store the transformed addr in buf.
 4503|     18|			archive_le24enc(buf + i, addr);
 4504|     18|		}
 4505|     95|	}
 4506|       |
 4507|     10|	zip->bcj_ip += (uint32_t)i;
 4508|       |
 4509|     10|	return i;
 4510|     10|}
archive_read_support_format_7zip.c:armthumb_Convert:
 4520|     14|{
 4521|       |	// This function was adapted from
 4522|       |	// static size_t bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4523|       |	// in https://git.tukaani.org/xz-embedded.git
 4524|       |
 4525|       |	/*
 4526|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4527|       |	 *
 4528|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4529|       |	 *          Igor Pavlov <https://7-zip.org/>
 4530|       |	 *
 4531|       |	 * SPDX-License-Identifier: 0BSD
 4532|       |	 */
 4533|       |
 4534|     14|	size_t i;
 4535|     14|	uint32_t addr;
 4536|       |
 4537|    249|	for (i = 0; i + 4 <= size; i += 2) {
  ------------------
  |  Branch (4537:14): [True: 235, False: 14]
  ------------------
 4538|    235|		if ((buf[i + 1] & 0xF8) == 0xF0
  ------------------
  |  Branch (4538:7): [True: 100, False: 135]
  ------------------
 4539|    100|		    && (buf[i + 3] & 0xF8) == 0xF8) {
  ------------------
  |  Branch (4539:10): [True: 12, False: 88]
  ------------------
 4540|     12|			addr = (((uint32_t)buf[i + 1] & 0x07) << 19)
 4541|     12|			    | ((uint32_t)buf[i] << 11)
 4542|     12|			    | (((uint32_t)buf[i + 3] & 0x07) << 8)
 4543|     12|			    | (uint32_t)buf[i + 2];
 4544|     12|			addr <<= 1;
 4545|     12|			addr -= zip->bcj_ip + (uint32_t)i;
 4546|     12|			addr >>= 1;
 4547|     12|			buf[i + 1] = (uint8_t)(0xF0 | ((addr >> 19) & 0x07));
 4548|     12|			buf[i] = (uint8_t)(addr >> 11);
 4549|     12|			buf[i + 3] = (uint8_t)(0xF8 | ((addr >> 8) & 0x07));
 4550|     12|			buf[i + 2] = (uint8_t)addr;
 4551|     12|			i += 2;
 4552|     12|		}
 4553|    235|	}
 4554|       |
 4555|     14|	zip->bcj_ip += (uint32_t)i;
 4556|       |
 4557|     14|	return i;
 4558|     14|}
archive_read_support_format_7zip.c:arm64_Convert:
 4562|     28|{
 4563|       |	// This function was adapted from
 4564|       |	// static size_t bcj_arm64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4565|       |	// in https://git.tukaani.org/xz-embedded.git
 4566|       |
 4567|       |	/*
 4568|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4569|       |	 *
 4570|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4571|       |	 *          Igor Pavlov <https://7-zip.org/>
 4572|       |	 *
 4573|       |	 * This file has been put into the public domain.
 4574|       |	 * You can do whatever you want with this file.
 4575|       |	 */
 4576|       |
 4577|     28|	size_t i;
 4578|     28|	uint32_t instr;
 4579|     28|	uint32_t addr;
 4580|       |
 4581|    629|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4581:14): [True: 601, False: 28]
  ------------------
 4582|    601|		instr = archive_le32dec(buf + i);
 4583|       |
 4584|    601|		if ((instr >> 26) == 0x25) {
  ------------------
  |  Branch (4584:7): [True: 71, False: 530]
  ------------------
 4585|       |			/* BL instruction */
 4586|     71|			addr = instr - ((zip->bcj_ip + (uint32_t)i) >> 2);
 4587|     71|			instr = 0x94000000 | (addr & 0x03FFFFFF);
 4588|       |
 4589|     71|			archive_le32enc(buf + i, instr);
 4590|    530|		} else if ((instr & 0x9F000000) == 0x90000000) {
  ------------------
  |  Branch (4590:14): [True: 114, False: 416]
  ------------------
 4591|       |			/* ADRP instruction */
 4592|    114|			addr = ((instr >> 29) & 3) | ((instr >> 3) & 0x1FFFFC);
 4593|       |
 4594|       |			/* Only convert values in the range +/-512 MiB. */
 4595|    114|			if ((addr + 0x020000) & 0x1C0000)
  ------------------
  |  Branch (4595:8): [True: 72, False: 42]
  ------------------
 4596|     72|				continue;
 4597|       |
 4598|     42|			addr -= (zip->bcj_ip + (uint32_t)i) >> 12;
 4599|       |
 4600|     42|			instr &= 0x9000001F;
 4601|     42|			instr |= (addr & 3) << 29;
 4602|     42|			instr |= (addr & 0x03FFFC) << 3;
 4603|     42|			instr |= (0U - (addr & 0x020000)) & 0xE00000;
 4604|       |
 4605|     42|			archive_le32enc(buf + i, instr);
 4606|     42|		}
 4607|    601|	}
 4608|       |
 4609|     28|	zip->bcj_ip += (uint32_t)i;
 4610|       |
 4611|     28|	return i;
 4612|     28|}
archive_read_support_format_7zip.c:sparc_Convert:
 4616|     16|{
 4617|       |	// This function was adapted from
 4618|       |	// static size_t bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4619|       |	// in https://git.tukaani.org/xz-embedded.git
 4620|       |
 4621|       |	/*
 4622|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4623|       |	 *
 4624|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4625|       |	 *          Igor Pavlov <https://7-zip.org/>
 4626|       |	 *
 4627|       |	 * Copyright (C) The XZ Embedded authors and contributors
 4628|       |	 *
 4629|       |	 * Permission to use, copy, modify, and/or distribute this
 4630|       |	 * software for any purpose with or without fee is hereby granted.
 4631|       |	 *
 4632|       |	 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 4633|       |	 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 4634|       |	 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 4635|       |	 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 4636|       |	 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 4637|       |	 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 4638|       |	 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 4639|       |	 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 4640|       |	 */
 4641|       |
 4642|     16|	size_t i;
 4643|     16|	uint32_t instr;
 4644|       |
 4645|     16|	size &= ~(size_t)3;
 4646|       |
 4647|    204|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4647:14): [True: 188, False: 16]
  ------------------
 4648|    188|		instr = archive_be32dec(buf + i);
 4649|       |
 4650|    188|		if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {
  ------------------
  |  Branch (4650:7): [True: 55, False: 133]
  |  Branch (4650:33): [True: 10, False: 123]
  ------------------
 4651|     65|			instr <<= 2;
 4652|     65|			instr -= zip->bcj_ip + (uint32_t)i;
 4653|     65|			instr >>= 2;
 4654|     65|			instr = ((uint32_t)0x40000000 - (instr & 0x400000))
 4655|     65|			        | 0x40000000 | (instr & 0x3FFFFF);
 4656|       |
 4657|     65|			archive_be32enc(buf + i, instr);
 4658|     65|		}
 4659|    188|	}
 4660|       |
 4661|     16|	zip->bcj_ip += (uint32_t)i;
 4662|       |
 4663|     16|	return i;
 4664|     16|}
archive_read_support_format_7zip.c:powerpc_Convert:
 4668|     13|{
 4669|       |	// This function was adapted from
 4670|       |	// static size_t powerpc_code(void *simple, uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size)
 4671|       |	// in https://git.tukaani.org/xz.git
 4672|       |
 4673|       |	/*
 4674|       |	 * Filter for PowerPC (big endian) binaries
 4675|       |	 *
 4676|       |	 * Authors: Igor Pavlov
 4677|       |	 *          Lasse Collin
 4678|       |	 *
 4679|       |	 * Copyright (C) The XZ Utils authors and contributors
 4680|       |	 *
 4681|       |	 * Permission to use, copy, modify, and/or distribute this
 4682|       |	 * software for any purpose with or without fee is hereby granted.
 4683|       |	 *
 4684|       |	 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 4685|       |	 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 4686|       |	 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 4687|       |	 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 4688|       |	 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 4689|       |	 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 4690|       |	 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 4691|       |	 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 4692|       |	 */
 4693|       |
 4694|     13|	size &= ~(size_t)3;
 4695|       |
 4696|     13|	size_t i;
 4697|    238|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4697:14): [True: 225, False: 13]
  ------------------
 4698|       |		// PowerPC branch 6(48) 24(Offset) 1(Abs) 1(Link)
 4699|    225|		if ((buf[i] >> 2) == 0x12
  ------------------
  |  Branch (4699:7): [True: 101, False: 124]
  ------------------
 4700|    101|			&& ((buf[i + 3] & 3) == 1)) {
  ------------------
  |  Branch (4700:7): [True: 51, False: 50]
  ------------------
 4701|       |
 4702|     51|			const uint32_t src
 4703|     51|				= (((uint32_t)(buf[i + 0]) & 3) << 24)
 4704|     51|				| ((uint32_t)(buf[i + 1]) << 16)
 4705|     51|				| ((uint32_t)(buf[i + 2]) << 8)
 4706|     51|				| ((uint32_t)(buf[i + 3]) & ~UINT32_C(3));
 4707|       |
 4708|     51|			uint32_t dest = src - (zip->bcj_ip + (uint32_t)(i));
 4709|       |
 4710|     51|			buf[i + 0] = 0x48 | ((dest >> 24) &  0x03);
 4711|     51|			buf[i + 1] = (dest >> 16);
 4712|     51|			buf[i + 2] = (dest >> 8);
 4713|     51|			buf[i + 3] &= 0x03;
 4714|     51|			buf[i + 3] |= dest;
 4715|     51|		}
 4716|    225|	}
 4717|       |
 4718|     13|	zip->bcj_ip += (uint32_t)i;
 4719|       |
 4720|     13|	return i;
 4721|     13|}
archive_read_support_format_7zip.c:riscv_Convert:
 4725|     27|{
 4726|       |	// This function was adapted from
 4727|       |	// static size_t bcj_riscv(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4728|       |	// in https://git.tukaani.org/xz-embedded.git
 4729|       |
 4730|       |	/*
 4731|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4732|       |	 *
 4733|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4734|       |	 *          Igor Pavlov <https://7-zip.org/>
 4735|       |	 *
 4736|       |	 * SPDX-License-Identifier: 0BSD
 4737|       |	 */
 4738|       |
 4739|     27|	if (size < 8)
  ------------------
  |  Branch (4739:6): [True: 1, False: 26]
  ------------------
 4740|      1|		return 0;
 4741|     26|	size -= 8;
 4742|       |
 4743|     26|	size_t i;
 4744|    873|	for (i = 0; i <= size; i += 2) {
  ------------------
  |  Branch (4744:14): [True: 847, False: 26]
  ------------------
 4745|    847|		uint32_t inst = buf[i];
 4746|       |
 4747|    847|		if (inst == 0xEF) {
  ------------------
  |  Branch (4747:7): [True: 100, False: 747]
  ------------------
 4748|       |			// JAL. Only filter rd=x1(ra) and rd=x5(t0).
 4749|    100|			const uint32_t b1 = buf[i + 1];
 4750|       |
 4751|    100|			if ((b1 & 0x0D) != 0)
  ------------------
  |  Branch (4751:8): [True: 87, False: 13]
  ------------------
 4752|     87|				continue;
 4753|       |
 4754|     13|			const uint32_t b2 = buf[i + 2];
 4755|     13|			const uint32_t b3 = buf[i + 3];
 4756|       |
 4757|     13|			uint32_t addr = ((b1 & 0xF0) << 13)
 4758|     13|					| (b2 << 9) | (b3 << 1);
 4759|     13|			addr -= zip->bcj_ip + (uint32_t)i;
 4760|       |
 4761|     13|			buf[i + 1] = (uint8_t)((b1 & 0x0F)
 4762|     13|					| ((addr >> 8) & 0xF0));
 4763|     13|			buf[i + 2] = (uint8_t)(((addr >> 16) & 0x0F)
 4764|     13|					| ((addr >> 7) & 0x10)
 4765|     13|					| ((addr << 4) & 0xE0));
 4766|     13|			buf[i + 3] = (uint8_t)(((addr >> 4) & 0x7F)
 4767|     13|					| ((addr >> 13) & 0x80));
 4768|       |
 4769|     13|			i += 4 - 2;
 4770|    747|		} else if ((inst & 0x7F) == 0x17) {
  ------------------
  |  Branch (4770:14): [True: 127, False: 620]
  ------------------
 4771|       |			// AUIPC, paired with a second instruction (inst2)
 4772|       |			// that is within the next four bytes.
 4773|    127|			uint32_t inst2;
 4774|       |
 4775|    127|			inst |= (uint32_t)buf[i + 1] << 8;
 4776|    127|			inst |= (uint32_t)buf[i + 2] << 16;
 4777|    127|			inst |= (uint32_t)buf[i + 3] << 24;
 4778|       |
 4779|    127|			if (inst & 0xE80) {
  ------------------
  |  Branch (4779:8): [True: 83, False: 44]
  ------------------
 4780|       |				// AUIPC's rd doesn't equal x0 or x2.
 4781|     83|				inst2 = archive_le32dec(buf + i + 4);
 4782|       |
 4783|     83|				if (((inst << 8) ^ (inst2 - 3)) & 0xF8003) {
  ------------------
  |  Branch (4783:9): [True: 41, False: 42]
  ------------------
 4784|     41|					i += 6 - 2;
 4785|     41|					continue;
 4786|     41|				}
 4787|       |
 4788|     42|				uint32_t addr = (inst & 0xFFFFF000)
 4789|     42|						+ (inst2 >> 20);
 4790|       |
 4791|     42|				inst = 0x17 | (2 << 7) | (inst2 << 12);
 4792|     42|				inst2 = addr;
 4793|     44|			} else {
 4794|       |				// AUIPC's rd equals x0 or x2.
 4795|     44|				const uint32_t inst2_rs1 = inst >> 27;
 4796|       |
 4797|     44|				if ((uint32_t)((inst - 0x3117) << 18)
  ------------------
  |  Branch (4797:9): [True: 34, False: 10]
  ------------------
 4798|     44|						>= (inst2_rs1 & 0x1D)) {
 4799|     34|					i += 4 - 2;
 4800|     34|					continue;
 4801|     34|				}
 4802|       |
 4803|     10|				uint32_t addr = archive_be32dec(buf + i + 4);
 4804|     10|				addr -= zip->bcj_ip + (uint32_t)i;
 4805|       |
 4806|     10|				inst2 = (inst >> 12) | (addr << 20);
 4807|     10|				inst = 0x17 | (inst2_rs1 << 7)
 4808|     10|					| ((addr + 0x800) & 0xFFFFF000);
 4809|     10|			}
 4810|       |
 4811|     52|			archive_le32enc(buf + i, inst);
 4812|     52|			archive_le32enc(buf + i + 4, inst2);
 4813|       |
 4814|     52|			i += 8 - 2;
 4815|     52|		}
 4816|    847|	}
 4817|       |
 4818|     26|	zip->bcj_ip += (uint32_t)i;
 4819|       |
 4820|     26|	return i;
 4821|     27|}
archive_read_support_format_7zip.c:ia64_Convert:
 4825|     18|{
 4826|       |	// This function was adapted from
 4827|       |	// static size_t bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4828|       |	// in https://git.tukaani.org/xz-embedded.git
 4829|       |
 4830|       |	/*
 4831|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4832|       |	 *
 4833|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4834|       |	 *          Igor Pavlov <https://7-zip.org/>
 4835|       |	 *
 4836|       |	 * SPDX-License-Identifier: 0BSD
 4837|       |	 */
 4838|       |
 4839|     18|	static const uint8_t branch_table[32] = {
 4840|     18|		0, 0, 0, 0, 0, 0, 0, 0,
 4841|     18|		0, 0, 0, 0, 0, 0, 0, 0,
 4842|     18|		4, 4, 6, 6, 0, 0, 7, 7,
 4843|     18|		4, 4, 0, 0, 4, 4, 0, 0
 4844|     18|	};
 4845|       |
 4846|       |	/* Loop counters */
 4847|     18|	size_t i;
 4848|     18|	size_t j;
 4849|       |
 4850|       |	/* Instruction slot (0, 1, or 2) in the 128-bit instruction word */
 4851|     18|	uint32_t slot;
 4852|       |
 4853|       |	/* Bitwise offset of the instruction indicated by slot */
 4854|     18|	uint32_t bit_pos;
 4855|       |
 4856|       |	/* bit_pos split into byte and bit parts */
 4857|     18|	uint32_t byte_pos;
 4858|     18|	uint32_t bit_res;
 4859|       |
 4860|       |	/* Address part of an instruction */
 4861|     18|	uint32_t addr;
 4862|       |
 4863|       |	/* Mask used to detect which instructions to convert */
 4864|     18|	uint32_t mask;
 4865|       |
 4866|       |	/* 41-bit instruction stored somewhere in the lowest 48 bits */
 4867|     18|	uint64_t instr;
 4868|       |
 4869|       |	/* Instruction normalized with bit_res for easier manipulation */
 4870|     18|	uint64_t norm;
 4871|       |
 4872|     18|	size &= ~(size_t)15;
 4873|       |
 4874|    107|	for (i = 0; i < size; i += 16) {
  ------------------
  |  Branch (4874:14): [True: 89, False: 18]
  ------------------
 4875|     89|		mask = branch_table[buf[i] & 0x1F];
 4876|    356|		for (slot = 0, bit_pos = 5; slot < 3; ++slot, bit_pos += 41) {
  ------------------
  |  Branch (4876:31): [True: 267, False: 89]
  ------------------
 4877|    267|			if (((mask >> slot) & 1) == 0)
  ------------------
  |  Branch (4877:8): [True: 126, False: 141]
  ------------------
 4878|    126|				continue;
 4879|       |
 4880|    141|			byte_pos = bit_pos >> 3;
 4881|    141|			bit_res = bit_pos & 7;
 4882|    141|			instr = 0;
 4883|    987|			for (j = 0; j < 6; ++j)
  ------------------
  |  Branch (4883:16): [True: 846, False: 141]
  ------------------
 4884|    846|				instr |= (uint64_t)(buf[i + j + byte_pos])
 4885|    846|				    << (8 * j);
 4886|       |
 4887|    141|			norm = instr >> bit_res;
 4888|       |
 4889|    141|			if (((norm >> 37) & 0x0F) == 0x05
  ------------------
  |  Branch (4889:8): [True: 48, False: 93]
  ------------------
 4890|     48|			    && ((norm >> 9) & 0x07) == 0) {
  ------------------
  |  Branch (4890:11): [True: 37, False: 11]
  ------------------
 4891|     37|				addr = (norm >> 13) & 0x0FFFFF;
 4892|     37|				addr |= ((uint32_t)(norm >> 36) & 1) << 20;
 4893|     37|				addr <<= 4;
 4894|     37|				addr -= zip->bcj_ip + (uint32_t)i;
 4895|     37|				addr >>= 4;
 4896|       |
 4897|     37|				norm &= ~((uint64_t)0x8FFFFF << 13);
 4898|     37|				norm |= (uint64_t)(addr & 0x0FFFFF) << 13;
 4899|     37|				norm |= (uint64_t)(addr & 0x100000)
 4900|     37|				    << (36 - 20);
 4901|       |
 4902|     37|				instr &= (1U << bit_res) - 1;
 4903|     37|				instr |= norm << bit_res;
 4904|       |
 4905|    259|				for (j = 0; j < 6; j++)
  ------------------
  |  Branch (4905:17): [True: 222, False: 37]
  ------------------
 4906|    222|					buf[i + j + byte_pos]
 4907|    222|					    = (uint8_t)(instr >> (8 * j));
 4908|     37|			}
 4909|    141|		}
 4910|     89|	}
 4911|       |
 4912|     18|	zip->bcj_ip += (uint32_t)i;
 4913|       |
 4914|     18|	return i;
 4915|     18|}
archive_read_support_format_7zip.c:delta_Decode:
 4927|     21|{
 4928|       |	// This was adapted from src/liblzma/delta/delta_decoder.c's
 4929|       |	// static void decode_buffer(lzma_delta_coder *coder, uint8_t *buffer, size_t size)
 4930|       |	// function in https://github.com/tukaani-project/xz.git
 4931|       |
 4932|       |	/*
 4933|       |	 * Delta filter decoder
 4934|       |	 *
 4935|       |	 * Author: Lasse Collin
 4936|       |	 *
 4937|       |	 * SPDX-License-Identifier: 0BSD
 4938|       |	 */
 4939|       |
 4940|     21|	size_t i;
 4941|       |
 4942|    406|	for (i = 0; i < size; i++) {
  ------------------
  |  Branch (4942:14): [True: 385, False: 21]
  ------------------
 4943|    385|		buf[i] += zip->delta_history[
 4944|    385|			(zip->delta_dist + zip->delta_pos) & 0xFF];
 4945|    385|		zip->delta_history[zip->delta_pos--] = buf[i];
 4946|    385|	}
 4947|     21|}
archive_read_support_format_7zip.c:bcj_lookahead:
 4958|  1.57k|{
 4959|  1.57k|	switch (codec2) {
 4960|    250|	case _7Z_X86:
  ------------------
  |  |  108|    250|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (4960:2): [True: 250, False: 1.32k]
  ------------------
 4961|    250|		return (5);
 4962|    124|	case _7Z_RISCV:
  ------------------
  |  |  115|    124|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (4962:2): [True: 124, False: 1.45k]
  ------------------
 4963|    124|		return (8);
 4964|     74|	case _7Z_IA64:
  ------------------
  |  |  111|     74|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (4964:2): [True: 74, False: 1.50k]
  ------------------
 4965|     74|		return (16);
 4966|     45|	case _7Z_ARM:
  ------------------
  |  |  112|     45|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (4966:2): [True: 45, False: 1.53k]
  ------------------
 4967|    116|	case _7Z_ARMTHUMB:
  ------------------
  |  |  113|    116|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (4967:2): [True: 71, False: 1.50k]
  ------------------
 4968|    237|	case _7Z_ARM64:
  ------------------
  |  |  114|    237|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (4968:2): [True: 121, False: 1.45k]
  ------------------
 4969|    292|	case _7Z_POWERPC:
  ------------------
  |  |  110|    292|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (4969:2): [True: 55, False: 1.52k]
  ------------------
 4970|    361|	case _7Z_SPARC:
  ------------------
  |  |  116|    361|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (4970:2): [True: 69, False: 1.50k]
  ------------------
 4971|    361|		return (4);
 4972|    767|	default:
  ------------------
  |  Branch (4972:2): [True: 767, False: 809]
  ------------------
 4973|    767|		return (0);
 4974|  1.57k|	}
 4975|  1.57k|}
archive_read_support_format_7zip.c:get_uncompressed_data:
 3651|  6.10k|{
 3652|  6.10k|	struct _7zip *zip = a->format->data;
 3653|  6.10k|	ssize_t bytes_avail;
 3654|       |
 3655|  6.10k|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   96|  12.2k|#define _7Z_COPY	0
  ------------------
  |  Branch (3655:6): [True: 538, False: 5.57k]
  |  Branch (3655:32): [True: 209, False: 329]
  ------------------
 3656|       |		/* Copy mode. */
 3657|       |
 3658|    209|		*buff = __archive_read_ahead(a, minimum, &bytes_avail);
 3659|    209|		if (*buff == NULL) {
  ------------------
  |  Branch (3659:7): [True: 1, False: 208]
  ------------------
 3660|      1|			archive_set_error(&a->archive,
 3661|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3662|      1|			    "Truncated 7-Zip file data");
 3663|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3664|      1|		}
 3665|    208|		if ((size_t)bytes_avail >
  ------------------
  |  Branch (3665:7): [True: 208, False: 0]
  ------------------
 3666|    208|		    zip->uncompressed_buffer_bytes_remaining)
 3667|    208|			bytes_avail = (ssize_t)
 3668|    208|			    zip->uncompressed_buffer_bytes_remaining;
 3669|    208|		if ((size_t)bytes_avail > size)
  ------------------
  |  Branch (3669:7): [True: 81, False: 127]
  ------------------
 3670|     81|			bytes_avail = (ssize_t)size;
 3671|       |
 3672|    208|		zip->pack_stream_bytes_unconsumed = bytes_avail;
 3673|  5.90k|	} else if (zip->uncompressed_buffer_pointer == NULL) {
  ------------------
  |  Branch (3673:13): [True: 0, False: 5.90k]
  ------------------
 3674|       |		/* Decompression has failed. */
 3675|      0|		archive_set_error(&(a->archive),
 3676|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3677|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3678|  5.90k|	} else {
 3679|       |		/* Packed mode. */
 3680|  5.90k|		if (minimum > zip->uncompressed_buffer_bytes_remaining) {
  ------------------
  |  Branch (3680:7): [True: 0, False: 5.90k]
  ------------------
 3681|       |			/*
 3682|       |			 * If remaining uncompressed data size is less than
 3683|       |			 * the minimum size, fill the buffer up to the
 3684|       |			 * minimum size.
 3685|       |			 */
 3686|      0|			if (extract_pack_stream(a, minimum) < 0)
  ------------------
  |  Branch (3686:8): [True: 0, False: 0]
  ------------------
 3687|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3688|      0|		}
 3689|  5.90k|		if (size > zip->uncompressed_buffer_bytes_remaining)
  ------------------
  |  Branch (3689:7): [True: 0, False: 5.90k]
  ------------------
 3690|      0|			bytes_avail = (ssize_t)
 3691|      0|			    zip->uncompressed_buffer_bytes_remaining;
 3692|  5.90k|		else
 3693|  5.90k|			bytes_avail = (ssize_t)size;
 3694|  5.90k|		*buff = zip->uncompressed_buffer_pointer;
 3695|  5.90k|		zip->uncompressed_buffer_pointer += bytes_avail;
 3696|  5.90k|	}
 3697|  6.10k|	zip->uncompressed_buffer_bytes_remaining -= bytes_avail;
 3698|  6.10k|	return (bytes_avail);
 3699|  6.10k|}
archive_read_support_format_7zip.c:decode_encoded_header_info:
 3403|    605|{
 3404|    605|	struct _7zip *zip = a->format->data;
 3405|    605|	int64_t pi_end;
 3406|       |
 3407|    605|	errno = 0;
 3408|    605|	if (read_StreamsInfo(a, si) < 0) {
  ------------------
  |  Branch (3408:6): [True: 66, False: 539]
  ------------------
 3409|     66|		if (errno == ENOMEM)
  ------------------
  |  Branch (3409:7): [True: 0, False: 66]
  ------------------
 3410|      0|			archive_set_error(&a->archive, -1,
 3411|      0|			    "Couldn't allocate memory");
 3412|     66|		else
 3413|     66|			archive_set_error(&a->archive, -1,
 3414|     66|			    "Malformed 7-Zip archive");
 3415|     66|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     66|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3416|     66|	}
 3417|       |
 3418|    539|	if (si->pi.numPackStreams == 0 || si->ci.numFolders == 0) {
  ------------------
  |  Branch (3418:6): [True: 0, False: 539]
  |  Branch (3418:36): [True: 1, False: 538]
  ------------------
 3419|      1|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3420|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3421|      1|	}
 3422|       |
 3423|    538|	if (archive_ckd_add_i64(&pi_end, si->pi.pos, si->pi.sizes[0])) {
  ------------------
  |  Branch (3423:6): [True: 0, False: 538]
  ------------------
 3424|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3425|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3426|      0|	}
 3427|       |
 3428|    538|	if (zip->header_offset < pi_end) {
  ------------------
  |  Branch (3428:6): [True: 0, False: 538]
  ------------------
 3429|      0|		archive_set_error(&a->archive, -1, "Malformed Header offset");
 3430|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3431|      0|	}
 3432|       |
 3433|    538|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    538|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3434|    538|}
archive_read_support_format_7zip.c:read_StreamsInfo:
 2878|  1.75k|{
 2879|  1.75k|	struct _7zip *zip = a->format->data;
 2880|  1.75k|	const unsigned char *p;
 2881|  1.75k|	size_t i;
 2882|       |
 2883|  1.75k|	memset(si, 0, sizeof(*si));
 2884|       |
 2885|  1.75k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2885:6): [True: 0, False: 1.75k]
  ------------------
 2886|      0|		return (-1);
 2887|  1.75k|	if (*p == kPackInfo) {
  ------------------
  |  |  129|  1.75k|#define kPackInfo		0x06
  ------------------
  |  Branch (2887:6): [True: 1.61k, False: 143]
  ------------------
 2888|  1.61k|		int64_t packPos;
 2889|       |
 2890|  1.61k|		if (read_PackInfo(a, &(si->pi)) < 0)
  ------------------
  |  Branch (2890:7): [True: 156, False: 1.45k]
  ------------------
 2891|    156|			return (-1);
 2892|       |
 2893|  1.45k|		if (si->pi.positions == NULL || si->pi.sizes == NULL)
  ------------------
  |  Branch (2893:7): [True: 1, False: 1.45k]
  |  Branch (2893:35): [True: 0, False: 1.45k]
  ------------------
 2894|      1|			return (-1);
 2895|       |		/*
 2896|       |		 * Calculate packed stream positions.
 2897|       |		 */
 2898|  1.45k|		packPos = si->pi.pos;
 2899|  3.26k|		for (i = 0; i < si->pi.numPackStreams; i++) {
  ------------------
  |  Branch (2899:15): [True: 1.86k, False: 1.40k]
  ------------------
 2900|  1.86k|			si->pi.positions[i] = packPos;
 2901|  1.86k|			if (archive_ckd_add_i64(&packPos,
  ------------------
  |  Branch (2901:8): [True: 0, False: 1.86k]
  ------------------
 2902|  1.86k|			    packPos, si->pi.sizes[i]))
 2903|      0|				return (-1);
 2904|  1.86k|			if (packPos > zip->header_offset)
  ------------------
  |  Branch (2904:8): [True: 50, False: 1.81k]
  ------------------
 2905|     50|				return (-1);
 2906|  1.86k|		}
 2907|  1.40k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2907:7): [True: 1, False: 1.40k]
  ------------------
 2908|      1|			return (-1);
 2909|  1.40k|	}
 2910|  1.55k|	if (*p == kUnPackInfo) {
  ------------------
  |  |  130|  1.55k|#define kUnPackInfo		0x07
  ------------------
  |  Branch (2910:6): [True: 1.53k, False: 11]
  ------------------
 2911|  1.53k|		size_t packIndex;
 2912|  1.53k|		struct _7z_folder *f;
 2913|       |
 2914|  1.53k|		if (read_CodersInfo(a, &(si->ci)) < 0)
  ------------------
  |  Branch (2914:7): [True: 667, False: 872]
  ------------------
 2915|    667|			return (-1);
 2916|       |
 2917|       |		/*
 2918|       |		 * Calculate packed stream indexes.
 2919|       |		 */
 2920|    872|		packIndex = 0;
 2921|    872|		f = si->ci.folders;
 2922|  1.75k|		for (i = 0; i < si->ci.numFolders; i++) {
  ------------------
  |  Branch (2922:15): [True: 882, False: 868]
  ------------------
 2923|    882|			f[i].packIndex = packIndex;
 2924|    882|			if (archive_ckd_add_size(&packIndex,
  ------------------
  |  Branch (2924:8): [True: 0, False: 882]
  ------------------
 2925|    882|			    packIndex, f[i].numPackedStreams) ||
 2926|    882|			    packIndex > si->pi.numPackStreams)
  ------------------
  |  Branch (2926:8): [True: 4, False: 878]
  ------------------
 2927|      4|				return (-1);
 2928|    882|		}
 2929|    868|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2929:7): [True: 3, False: 865]
  ------------------
 2930|      3|			return (-1);
 2931|    868|	}
 2932|       |
 2933|    876|	if (*p == kSubStreamsInfo) {
  ------------------
  |  |  131|    876|#define kSubStreamsInfo		0x08
  ------------------
  |  Branch (2933:6): [True: 334, False: 542]
  ------------------
 2934|    334|		if (read_SubStreamsInfo(a, &(si->ss),
  ------------------
  |  Branch (2934:7): [True: 106, False: 228]
  ------------------
 2935|    334|		    si->ci.folders, si->ci.numFolders) < 0)
 2936|    106|			return (-1);
 2937|    228|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2937:7): [True: 4, False: 224]
  ------------------
 2938|      4|			return (-1);
 2939|    228|	}
 2940|       |
 2941|       |	/*
 2942|       |	 *  Must be kEnd.
 2943|       |	 */
 2944|    766|	if (*p != kEnd)
  ------------------
  |  |  123|    766|#define kEnd			0x00
  ------------------
  |  Branch (2944:6): [True: 6, False: 760]
  ------------------
 2945|      6|		return (-1);
 2946|    760|	return (0);
 2947|    766|}
archive_read_support_format_7zip.c:read_PackInfo:
 2352|  1.61k|{
 2353|  1.61k|	const unsigned char *p;
 2354|  1.61k|	size_t i;
 2355|       |
 2356|  1.61k|	memset(pi, 0, sizeof(*pi));
 2357|       |
 2358|       |	/*
 2359|       |	 * Read PackPos.
 2360|       |	 */
 2361|  1.61k|	if (parse_7zip_int64(a, &(pi->pos)) < 0)
  ------------------
  |  Branch (2361:6): [True: 27, False: 1.58k]
  ------------------
 2362|     27|		return (-1);
 2363|       |
 2364|       |	/*
 2365|       |	 * Read NumPackStreams.
 2366|       |	 */
 2367|  1.58k|	if (parse_7zip_size(a, &(pi->numPackStreams)) < 0)
  ------------------
  |  Branch (2367:6): [True: 42, False: 1.54k]
  ------------------
 2368|     42|		return (-1);
 2369|  1.54k|	if (pi->numPackStreams == 0)
  ------------------
  |  Branch (2369:6): [True: 5, False: 1.54k]
  ------------------
 2370|      5|		return (-1);
 2371|       |
 2372|       |	/*
 2373|       |	 * Read PackSizes[num]
 2374|       |	 */
 2375|  1.54k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2375:6): [True: 1, False: 1.54k]
  ------------------
 2376|      1|		return (-1);
 2377|  1.54k|	if (*p == kEnd)
  ------------------
  |  |  123|  1.54k|#define kEnd			0x00
  ------------------
  |  Branch (2377:6): [True: 1, False: 1.53k]
  ------------------
 2378|       |		/* PackSizes[num] are not present. */
 2379|      1|		return (0);
 2380|  1.53k|	if (*p != kSize)
  ------------------
  |  |  132|  1.53k|#define kSize			0x09
  ------------------
  |  Branch (2380:6): [True: 8, False: 1.53k]
  ------------------
 2381|      8|		return (-1);
 2382|  1.53k|	pi->sizes = calloc(pi->numPackStreams, sizeof(int64_t));
 2383|  1.53k|	pi->positions = calloc(pi->numPackStreams, sizeof(int64_t));
 2384|  1.53k|	if (pi->sizes == NULL || pi->positions == NULL)
  ------------------
  |  Branch (2384:6): [True: 0, False: 1.53k]
  |  Branch (2384:27): [True: 0, False: 1.53k]
  ------------------
 2385|      0|		return (-1);
 2386|       |
 2387|  13.1k|	for (i = 0; i < pi->numPackStreams; i++) {
  ------------------
  |  Branch (2387:14): [True: 11.7k, False: 1.48k]
  ------------------
 2388|  11.7k|		if (parse_7zip_int64(a, &(pi->sizes[i])) < 0)
  ------------------
  |  Branch (2388:7): [True: 51, False: 11.6k]
  ------------------
 2389|     51|			return (-1);
 2390|  11.7k|	}
 2391|       |
 2392|       |	/*
 2393|       |	 * Read PackStreamDigests[num]
 2394|       |	 */
 2395|  1.48k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2395:6): [True: 0, False: 1.48k]
  ------------------
 2396|      0|		return (-1);
 2397|  1.48k|	if (*p == kEnd) {
  ------------------
  |  |  123|  1.48k|#define kEnd			0x00
  ------------------
  |  Branch (2397:6): [True: 1.45k, False: 24]
  ------------------
 2398|       |		/* PackStreamDigests[num] are not present. */
 2399|  1.45k|		pi->digest.defineds =
 2400|  1.45k|		    calloc(pi->numPackStreams, sizeof(*pi->digest.defineds));
 2401|  1.45k|		pi->digest.digests =
 2402|  1.45k|		    calloc(pi->numPackStreams, sizeof(*pi->digest.digests));
 2403|  1.45k|		if (pi->digest.defineds == NULL || pi->digest.digests == NULL)
  ------------------
  |  Branch (2403:7): [True: 0, False: 1.45k]
  |  Branch (2403:38): [True: 0, False: 1.45k]
  ------------------
 2404|      0|			return (-1);
 2405|  1.45k|		return (0);
 2406|  1.45k|	}
 2407|       |
 2408|     24|	if (*p != kCRC)
  ------------------
  |  |  133|     24|#define kCRC			0x0A
  ------------------
  |  Branch (2408:6): [True: 5, False: 19]
  ------------------
 2409|      5|		return (-1);
 2410|       |
 2411|     19|	if (read_Digests(a, &(pi->digest), pi->numPackStreams) < 0)
  ------------------
  |  Branch (2411:6): [True: 13, False: 6]
  ------------------
 2412|     13|		return (-1);
 2413|       |
 2414|       |	/*
 2415|       |	 *  Must be marked by kEnd.
 2416|       |	 */
 2417|      6|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2417:6): [True: 0, False: 6]
  ------------------
 2418|      0|		return (-1);
 2419|      6|	if (*p != kEnd)
  ------------------
  |  |  123|      6|#define kEnd			0x00
  ------------------
  |  Branch (2419:6): [True: 4, False: 2]
  ------------------
 2420|      4|		return (-1);
 2421|      2|	return (0);
 2422|      6|}
archive_read_support_format_7zip.c:parse_7zip_int64:
 2248|  1.12M|{
 2249|  1.12M|	uint64_t v;
 2250|  1.12M|	const unsigned char *p;
 2251|  1.12M|	unsigned char avail, mask;
 2252|  1.12M|	int i;
 2253|       |
 2254|  1.12M|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2254:6): [True: 86, False: 1.12M]
  ------------------
 2255|     86|		return (-1);
 2256|  1.12M|	avail = *p;
 2257|  1.12M|	mask = 0x80;
 2258|  1.12M|	v = 0;
 2259|  1.17M|	for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (2259:14): [True: 1.17M, False: 2.88k]
  ------------------
 2260|  1.17M|		if (avail & mask) {
  ------------------
  |  Branch (2260:7): [True: 44.7k, False: 1.12M]
  ------------------
 2261|  44.7k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2261:8): [True: 59, False: 44.6k]
  ------------------
 2262|     59|				return (-1);
 2263|  44.6k|			v |= ((uint64_t)*p) << (8 * i);
 2264|  44.6k|			mask >>= 1;
 2265|  44.6k|			continue;
 2266|  44.7k|		}
 2267|  1.12M|		v += ((uint64_t)(avail & (mask - 1))) << (8 * i);
 2268|  1.12M|		break;
 2269|  1.17M|	}
 2270|  1.12M|	if (v > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2270:6): [True: 396, False: 1.12M]
  ------------------
 2271|    396|		return (-1);
 2272|  1.12M|	*val = (int64_t)v;
 2273|  1.12M|	return (0);
 2274|  1.12M|}
archive_read_support_format_7zip.c:parse_7zip_size:
 2236|  1.08M|{
 2237|  1.08M|	int64_t v;
 2238|       |
 2239|  1.08M|	if (parse_7zip_int64(a, &v) < 0 || v > UMAX_ENTRY)
  ------------------
  |  |  402|  1.08M|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  207|  1.08M|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2239:6): [True: 339, False: 1.08M]
  |  Branch (2239:37): [True: 285, False: 1.08M]
  ------------------
 2240|    624|		return (-1);
 2241|       |
 2242|  1.08M|	*val = (size_t)v;
 2243|  1.08M|	return (0);
 2244|  1.08M|}
archive_read_support_format_7zip.c:read_Digests:
 2305|    346|{
 2306|    346|	const unsigned char *p;
 2307|    346|	size_t i;
 2308|       |
 2309|    346|	if (num == 0)
  ------------------
  |  Branch (2309:6): [True: 1, False: 345]
  ------------------
 2310|      1|		return (-1);
 2311|    345|	memset(d, 0, sizeof(*d));
 2312|       |
 2313|    345|	d->defineds = malloc(num);
 2314|    345|	if (d->defineds == NULL)
  ------------------
  |  Branch (2314:6): [True: 0, False: 345]
  ------------------
 2315|      0|		return (-1);
 2316|       |	/*
 2317|       |	 * Read Bools.
 2318|       |	 */
 2319|    345|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2319:6): [True: 1, False: 344]
  ------------------
 2320|      1|		return (-1);
 2321|    344|	if (*p == 0) {
  ------------------
  |  Branch (2321:6): [True: 37, False: 307]
  ------------------
 2322|     37|		if (read_Bools(a, d->defineds, num) < 0)
  ------------------
  |  Branch (2322:7): [True: 4, False: 33]
  ------------------
 2323|      4|			return (-1);
 2324|     37|	} else
 2325|       |		/* All are defined */
 2326|    307|		memset(d->defineds, 1, num);
 2327|       |
 2328|    340|	d->digests = calloc(num, sizeof(*d->digests));
 2329|    340|	if (d->digests == NULL)
  ------------------
  |  Branch (2329:6): [True: 0, False: 340]
  ------------------
 2330|      0|		return (-1);
 2331|  1.38k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2331:14): [True: 1.05k, False: 327]
  ------------------
 2332|  1.05k|		if (d->defineds[i]) {
  ------------------
  |  Branch (2332:7): [True: 783, False: 274]
  ------------------
 2333|    783|			if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (2333:8): [True: 13, False: 770]
  ------------------
 2334|     13|				return (-1);
 2335|    770|			d->digests[i] = archive_le32dec(p);
 2336|    770|		}
 2337|  1.05k|	}
 2338|       |
 2339|    327|	return (0);
 2340|    340|}
archive_read_support_format_7zip.c:read_Bools:
 2278|  1.23k|{
 2279|  1.23k|	const unsigned char *p;
 2280|  1.23k|	size_t i;
 2281|  1.23k|	unsigned mask = 0, avail = 0;
 2282|       |
 2283|  40.3k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2283:14): [True: 39.1k, False: 1.21k]
  ------------------
 2284|  39.1k|		if (mask == 0) {
  ------------------
  |  Branch (2284:7): [True: 5.73k, False: 33.4k]
  ------------------
 2285|  5.73k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2285:8): [True: 17, False: 5.71k]
  ------------------
 2286|     17|				return (-1);
 2287|  5.71k|			avail = *p;
 2288|  5.71k|			mask = 0x80;
 2289|  5.71k|		}
 2290|  39.1k|		data[i] = (avail & mask) ? 1 : 0;
  ------------------
  |  Branch (2290:13): [True: 20.7k, False: 18.3k]
  ------------------
 2291|  39.1k|		mask >>= 1;
 2292|  39.1k|	}
 2293|  1.21k|	return (0);
 2294|  1.23k|}
archive_read_support_format_7zip.c:read_CodersInfo:
 2587|  1.53k|{
 2588|  1.53k|	struct _7zip *zip = a->format->data;
 2589|  1.53k|	const unsigned char *p;
 2590|  1.53k|	struct _7z_digests digest;
 2591|  1.53k|	size_t dataStreamIndex, i;
 2592|       |
 2593|  1.53k|	memset(ci, 0, sizeof(*ci));
 2594|  1.53k|	memset(&digest, 0, sizeof(digest));
 2595|       |
 2596|  1.53k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2596:6): [True: 0, False: 1.53k]
  ------------------
 2597|      0|		goto failed;
 2598|  1.53k|	if (*p != kFolder)
  ------------------
  |  |  134|  1.53k|#define kFolder			0x0B
  ------------------
  |  Branch (2598:6): [True: 1, False: 1.53k]
  ------------------
 2599|      1|		goto failed;
 2600|       |
 2601|       |	/*
 2602|       |	 * Read NumFolders.
 2603|       |	 */
 2604|  1.53k|	if (parse_7zip_size(a, &(ci->numFolders)) < 0)
  ------------------
  |  Branch (2604:6): [True: 26, False: 1.51k]
  ------------------
 2605|     26|		goto failed;
 2606|       |	/*
 2607|       |	 * Each folder is encoded by at least one byte in the coders
 2608|       |	 * list that follows, so a folder count larger than the bytes
 2609|       |	 * left in the header cannot be honored and is rejected here
 2610|       |	 * before it is used to size the folders allocation.
 2611|       |	 */
 2612|  1.51k|	if (ci->numFolders > (uint64_t)zip->header_bytes_remaining)
  ------------------
  |  Branch (2612:6): [True: 4, False: 1.50k]
  ------------------
 2613|      4|		goto failed;
 2614|       |
 2615|       |	/*
 2616|       |	 * Read External.
 2617|       |	 */
 2618|  1.50k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2618:6): [True: 0, False: 1.50k]
  ------------------
 2619|      0|		goto failed;
 2620|  1.50k|	switch (*p) {
 2621|  1.48k|	case 0:
  ------------------
  |  Branch (2621:2): [True: 1.48k, False: 20]
  ------------------
 2622|  1.48k|		ci->folders =
 2623|  1.48k|			calloc(ci->numFolders, sizeof(*ci->folders));
 2624|  1.48k|		if (ci->folders == NULL)
  ------------------
  |  Branch (2624:7): [True: 0, False: 1.48k]
  ------------------
 2625|      0|			return (-1);
 2626|  3.45k|		for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2626:15): [True: 2.51k, False: 943]
  ------------------
 2627|  2.51k|			if (read_Folder(a, &(ci->folders[i])) < 0)
  ------------------
  |  Branch (2627:8): [True: 545, False: 1.96k]
  ------------------
 2628|    545|				goto failed;
 2629|  2.51k|		}
 2630|    943|		break;
 2631|    943|	case 1:
  ------------------
  |  Branch (2631:2): [True: 18, False: 1.49k]
  ------------------
 2632|     18|		if (parse_7zip_size(a, &dataStreamIndex) < 0)
  ------------------
  |  Branch (2632:7): [True: 8, False: 10]
  ------------------
 2633|      8|			return (-1);
 2634|     10|		if (ci->numFolders > 0) {
  ------------------
  |  Branch (2634:7): [True: 5, False: 5]
  ------------------
 2635|      5|			archive_set_error(&a->archive, -1,
 2636|      5|			    "Malformed 7-Zip archive");
 2637|      5|			goto failed;
 2638|      5|		}
 2639|      5|		break;
 2640|      5|	default:
  ------------------
  |  Branch (2640:2): [True: 2, False: 1.50k]
  ------------------
 2641|      2|		archive_set_error(&a->archive, -1,
 2642|      2|		    "Malformed 7-Zip archive");
 2643|      2|		goto failed;
 2644|  1.50k|	}
 2645|       |
 2646|    948|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2646:6): [True: 3, False: 945]
  ------------------
 2647|      3|		goto failed;
 2648|    945|	if (*p != kCodersUnPackSize)
  ------------------
  |  |  135|    945|#define kCodersUnPackSize	0x0C
  ------------------
  |  Branch (2648:6): [True: 26, False: 919]
  ------------------
 2649|     26|		goto failed;
 2650|       |
 2651|  1.93k|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2651:14): [True: 1.03k, False: 893]
  ------------------
 2652|  1.03k|		struct _7z_folder *folder = &(ci->folders[i]);
 2653|  1.03k|		size_t j;
 2654|       |
 2655|  1.03k|		folder->unPackSize =
 2656|  1.03k|		    calloc(folder->numOutStreams, sizeof(*folder->unPackSize));
 2657|  1.03k|		if (folder->unPackSize == NULL)
  ------------------
  |  Branch (2657:7): [True: 0, False: 1.03k]
  ------------------
 2658|      0|			goto failed;
 2659|  3.45k|		for (j = 0; j < folder->numOutStreams; j++) {
  ------------------
  |  Branch (2659:15): [True: 2.44k, False: 1.01k]
  ------------------
 2660|  2.44k|			if (parse_7zip_int64(a, &(folder->unPackSize[j])) < 0)
  ------------------
  |  Branch (2660:8): [True: 26, False: 2.41k]
  ------------------
 2661|     26|				goto failed;
 2662|  2.44k|		}
 2663|  1.03k|	}
 2664|       |
 2665|       |	/*
 2666|       |	 * Read CRCs.
 2667|       |	 */
 2668|    893|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2668:6): [True: 2, False: 891]
  ------------------
 2669|      2|		goto failed;
 2670|    891|	if (*p == kEnd)
  ------------------
  |  |  123|    891|#define kEnd			0x00
  ------------------
  |  Branch (2670:6): [True: 748, False: 143]
  ------------------
 2671|    748|		return (0);
 2672|    143|	if (*p != kCRC)
  ------------------
  |  |  133|    143|#define kCRC			0x0A
  ------------------
  |  Branch (2672:6): [True: 10, False: 133]
  ------------------
 2673|     10|		goto failed;
 2674|    133|	if (read_Digests(a, &digest, ci->numFolders) < 0)
  ------------------
  |  Branch (2674:6): [True: 2, False: 131]
  ------------------
 2675|      2|		goto failed;
 2676|    312|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2676:14): [True: 181, False: 131]
  ------------------
 2677|    181|		ci->folders[i].digest_defined = digest.defineds[i];
 2678|    181|		ci->folders[i].digest = digest.digests[i];
 2679|    181|	}
 2680|       |
 2681|       |	/*
 2682|       |	 *  Must be kEnd.
 2683|       |	 */
 2684|    131|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2684:6): [True: 1, False: 130]
  ------------------
 2685|      1|		goto failed;
 2686|    130|	if (*p != kEnd)
  ------------------
  |  |  123|    130|#define kEnd			0x00
  ------------------
  |  Branch (2686:6): [True: 6, False: 124]
  ------------------
 2687|      6|		goto failed;
 2688|    124|	free_Digest(&digest);
 2689|    124|	return (0);
 2690|    659|failed:
 2691|    659|	free_Digest(&digest);
 2692|    659|	return (-1);
 2693|    130|}
archive_read_support_format_7zip.c:read_Folder:
 2441|  2.51k|{
 2442|  2.51k|	struct _7zip *zip = a->format->data;
 2443|  2.51k|	const unsigned char *p;
 2444|  2.51k|	size_t numInStreamsTotal = 0;
 2445|  2.51k|	size_t numOutStreamsTotal = 0;
 2446|  2.51k|	size_t i;
 2447|       |
 2448|  2.51k|	memset(f, 0, sizeof(*f));
 2449|       |
 2450|       |	/*
 2451|       |	 * Read NumCoders.
 2452|       |	 */
 2453|  2.51k|	if (parse_7zip_size(a, &(f->numCoders)) < 0)
  ------------------
  |  Branch (2453:6): [True: 71, False: 2.44k]
  ------------------
 2454|     71|		return (-1);
 2455|  2.44k|	if (f->numCoders > 4)
  ------------------
  |  Branch (2455:6): [True: 17, False: 2.42k]
  ------------------
 2456|       |		/* Too many coders. */
 2457|     17|		return (-1);
 2458|       |
 2459|  2.42k|	f->coders = calloc(f->numCoders, sizeof(*f->coders));
 2460|  2.42k|	if (f->coders == NULL)
  ------------------
  |  Branch (2460:6): [True: 0, False: 2.42k]
  ------------------
 2461|      0|		return (-1);
 2462|  6.12k|	for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2462:14): [True: 3.87k, False: 2.24k]
  ------------------
 2463|  3.87k|		size_t codec_size;
 2464|  3.87k|		int simple, attr;
 2465|       |
 2466|  3.87k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2466:7): [True: 2, False: 3.87k]
  ------------------
 2467|      2|			return (-1);
 2468|       |		/*
 2469|       |		 * 0:3 CodecIdSize
 2470|       |		 * 4:  0 - IsSimple
 2471|       |		 *     1 - Is not Simple
 2472|       |		 * 5:  0 - No Attributes
 2473|       |		 *     1 - There are Attributes;
 2474|       |		 * 7:  Must be zero.
 2475|       |		 */
 2476|  3.87k|		codec_size = *p & 0xf;
 2477|  3.87k|		simple = (*p & 0x10) ? 0 : 1;
  ------------------
  |  Branch (2477:12): [True: 713, False: 3.16k]
  ------------------
 2478|  3.87k|		attr = *p & 0x20;
 2479|  3.87k|		if (*p & 0x80)
  ------------------
  |  Branch (2479:7): [True: 10, False: 3.86k]
  ------------------
 2480|     10|			return (-1);/* Not supported. */
 2481|       |
 2482|       |		/*
 2483|       |		 * Read Decompression Method IDs.
 2484|       |		 */
 2485|  3.86k|		if ((p = header_bytes(a, codec_size)) == NULL)
  ------------------
  |  Branch (2485:7): [True: 5, False: 3.86k]
  ------------------
 2486|      5|			return (-1);
 2487|       |
 2488|  3.86k|		if (decode_codec_id(p, codec_size, &f->coders[i].codec) < 0)
  ------------------
  |  Branch (2488:7): [True: 10, False: 3.85k]
  ------------------
 2489|     10|			return (-1);
 2490|       |
 2491|  3.85k|		if (simple) {
  ------------------
  |  Branch (2491:7): [True: 3.15k, False: 700]
  ------------------
 2492|  3.15k|			f->coders[i].numInStreams = 1;
 2493|  3.15k|			f->coders[i].numOutStreams = 1;
 2494|  3.15k|		} else {
 2495|    700|			if (parse_7zip_size(
  ------------------
  |  Branch (2495:8): [True: 31, False: 669]
  ------------------
 2496|    700|			    a, &(f->coders[i].numInStreams)) < 0)
 2497|     31|				return (-1);
 2498|    669|			if (parse_7zip_size(
  ------------------
  |  Branch (2498:8): [True: 65, False: 604]
  ------------------
 2499|    669|			    a, &(f->coders[i].numOutStreams)) < 0)
 2500|     65|				return (-1);
 2501|    669|		}
 2502|       |
 2503|  3.75k|		if (attr) {
  ------------------
  |  Branch (2503:7): [True: 1.09k, False: 2.66k]
  ------------------
 2504|  1.09k|			if (parse_7zip_size(
  ------------------
  |  Branch (2504:8): [True: 42, False: 1.05k]
  ------------------
 2505|  1.09k|			    a, &(f->coders[i].propertiesSize)) < 0)
 2506|     42|				return (-1);
 2507|  1.05k|			if ((p = header_bytes(
  ------------------
  |  Branch (2507:8): [True: 13, False: 1.03k]
  ------------------
 2508|  1.05k|			    a, f->coders[i].propertiesSize)) == NULL)
 2509|     13|				return (-1);
 2510|  1.03k|			f->coders[i].properties =
 2511|  1.03k|			    malloc(f->coders[i].propertiesSize);
 2512|  1.03k|			if (f->coders[i].properties == NULL)
  ------------------
  |  Branch (2512:8): [True: 0, False: 1.03k]
  ------------------
 2513|      0|				return (-1);
 2514|  1.03k|			memcpy(f->coders[i].properties, p,
 2515|  1.03k|			    f->coders[i].propertiesSize);
 2516|  1.03k|		}
 2517|       |
 2518|  3.69k|		if (archive_ckd_add_size(&numInStreamsTotal,
  ------------------
  |  Branch (2518:7): [True: 0, False: 3.69k]
  ------------------
 2519|  3.69k|		    numInStreamsTotal, f->coders[i].numInStreams) ||
 2520|  3.69k|		    archive_ckd_add_size(&numOutStreamsTotal,
  ------------------
  |  Branch (2520:7): [True: 0, False: 3.69k]
  ------------------
 2521|  3.69k|		    numOutStreamsTotal, f->coders[i].numOutStreams))
 2522|      0|			return (-1);
 2523|  3.69k|	}
 2524|       |
 2525|  2.24k|	if (numOutStreamsTotal == 0 ||
  ------------------
  |  Branch (2525:6): [True: 12, False: 2.23k]
  ------------------
 2526|  2.23k|	    numInStreamsTotal < numOutStreamsTotal-1)
  ------------------
  |  Branch (2526:6): [True: 8, False: 2.22k]
  ------------------
 2527|     20|		return (-1);
 2528|       |
 2529|  2.22k|	f->numBindPairs = numOutStreamsTotal - 1;
 2530|  2.22k|	if ((uint64_t)zip->header_bytes_remaining < f->numBindPairs)
  ------------------
  |  Branch (2530:6): [True: 2, False: 2.22k]
  ------------------
 2531|      2|			return (-1);
 2532|  2.22k|	if (f->numBindPairs > 0) {
  ------------------
  |  Branch (2532:6): [True: 1.02k, False: 1.20k]
  ------------------
 2533|  1.02k|		f->bindPairs =
 2534|  1.02k|			calloc(f->numBindPairs, sizeof(*f->bindPairs));
 2535|  1.02k|		if (f->bindPairs == NULL)
  ------------------
  |  Branch (2535:7): [True: 0, False: 1.02k]
  ------------------
 2536|      0|			return (-1);
 2537|  1.02k|	} else
 2538|  1.20k|		f->bindPairs = NULL;
 2539|   536k|	for (i = 0; i < f->numBindPairs; i++) {
  ------------------
  |  Branch (2539:14): [True: 534k, False: 2.04k]
  ------------------
 2540|   534k|		if (parse_7zip_size(a, &(f->bindPairs[i].inIndex)) < 0)
  ------------------
  |  Branch (2540:7): [True: 83, False: 534k]
  ------------------
 2541|     83|			return (-1);
 2542|   534k|		if (parse_7zip_size(a, &(f->bindPairs[i].outIndex)) < 0)
  ------------------
  |  Branch (2542:7): [True: 95, False: 534k]
  ------------------
 2543|     95|			return (-1);
 2544|   534k|	}
 2545|       |
 2546|  2.04k|	f->numPackedStreams = numInStreamsTotal - f->numBindPairs;
 2547|       |	/* packedStreams are not needed; parse/verify nonetheless */
 2548|  2.04k|	if (f->numPackedStreams == 1) {
  ------------------
  |  Branch (2548:6): [True: 1.78k, False: 258]
  ------------------
 2549|  1.98k|		for (i = 0; i < numInStreamsTotal; i++) {
  ------------------
  |  Branch (2549:15): [True: 1.98k, False: 0]
  ------------------
 2550|  1.98k|			size_t j;
 2551|  6.01k|			for (j = 0; j < f->numBindPairs; j++) {
  ------------------
  |  Branch (2551:16): [True: 4.22k, False: 1.78k]
  ------------------
 2552|  4.22k|				if (f->bindPairs[j].inIndex == i)
  ------------------
  |  Branch (2552:9): [True: 198, False: 4.02k]
  ------------------
 2553|    198|					break;
 2554|  4.22k|			}
 2555|  1.98k|			if (j == f->numBindPairs)
  ------------------
  |  Branch (2555:8): [True: 1.78k, False: 198]
  ------------------
 2556|  1.78k|				break;
 2557|  1.98k|		}
 2558|  1.78k|		if (i == numInStreamsTotal)
  ------------------
  |  Branch (2558:7): [True: 0, False: 1.78k]
  ------------------
 2559|      0|			return (-1);
 2560|  1.78k|	} else {
 2561|  4.22k|		for (i = 0; i < f->numPackedStreams; i++) {
  ------------------
  |  Branch (2561:15): [True: 4.04k, False: 179]
  ------------------
 2562|  4.04k|			size_t packedStream;
 2563|  4.04k|			if (parse_7zip_size(a, &packedStream) < 0)
  ------------------
  |  Branch (2563:8): [True: 79, False: 3.96k]
  ------------------
 2564|     79|				return (-1);
 2565|  4.04k|		}
 2566|    258|	}
 2567|  1.96k|	f->numInStreams = numInStreamsTotal;
 2568|  1.96k|	f->numOutStreams = numOutStreamsTotal;
 2569|       |
 2570|  1.96k|	return (0);
 2571|  2.04k|}
archive_read_support_format_7zip.c:decode_codec_id:
 1355|  3.86k|{
 1356|  3.86k|	size_t i;
 1357|       |
 1358|  3.86k|	*id = 0;
 1359|  12.7k|	for (i = 0; i < id_size; i++) {
  ------------------
  |  Branch (1359:14): [True: 8.85k, False: 3.85k]
  ------------------
 1360|  8.85k|		if (archive_ckd_mul_i64(id, *id, 256) ||
  ------------------
  |  Branch (1360:7): [True: 10, False: 8.84k]
  ------------------
 1361|  8.84k|		    archive_ckd_add_i64(id, *id, codecId[i]))
  ------------------
  |  Branch (1361:7): [True: 0, False: 8.84k]
  ------------------
 1362|     10|			return (-1);
 1363|  8.85k|	}
 1364|  3.85k|	return (0);
 1365|  3.86k|}
archive_read_support_format_7zip.c:free_Digest:
 2298|  21.7k|{
 2299|  21.7k|	free(d->defineds);
 2300|  21.7k|	free(d->digests);
 2301|  21.7k|}
archive_read_support_format_7zip.c:read_SubStreamsInfo:
 2724|    334|{
 2725|    334|	struct _7zip *zip = a->format->data;
 2726|    334|	const unsigned char *p;
 2727|    334|	int64_t *usizes;
 2728|    334|	size_t numDigests;
 2729|    334|	size_t unpack_streams;
 2730|    334|	size_t i;
 2731|    334|	int type;
 2732|       |
 2733|    334|	memset(ss, 0, sizeof(*ss));
 2734|       |
 2735|    667|	for (i = 0; i < numFolders; i++)
  ------------------
  |  Branch (2735:14): [True: 333, False: 334]
  ------------------
 2736|    333|		f[i].numUnpackStreams = 1;
 2737|       |
 2738|    334|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2738:6): [True: 0, False: 334]
  ------------------
 2739|      0|		return (-1);
 2740|    334|	type = *p;
 2741|       |
 2742|    334|	if (type == kNumUnPackStream) {
  ------------------
  |  |  136|    334|#define kNumUnPackStream	0x0D
  ------------------
  |  Branch (2742:6): [True: 207, False: 127]
  ------------------
 2743|    207|		unpack_streams = 0;
 2744|    405|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2744:15): [True: 206, False: 199]
  ------------------
 2745|    206|			if (parse_7zip_size(a, &(f[i].numUnpackStreams)) < 0)
  ------------------
  |  Branch (2745:8): [True: 8, False: 198]
  ------------------
 2746|      8|				return (-1);
 2747|    198|			if (archive_ckd_add_size(&unpack_streams,
  ------------------
  |  Branch (2747:8): [True: 0, False: 198]
  ------------------
 2748|    198|			    unpack_streams, f[i].numUnpackStreams))
 2749|      0|				return (-1);
 2750|    198|		}
 2751|    199|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2751:7): [True: 1, False: 198]
  ------------------
 2752|      1|			return (-1);
 2753|    198|		type = *p;
 2754|    198|	} else
 2755|    127|		unpack_streams = numFolders;
 2756|       |
 2757|    325|	if (unpack_streams > UMAX_ENTRY)
  ------------------
  |  |  402|    325|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  207|    325|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2757:6): [True: 0, False: 325]
  ------------------
 2758|      0|		return (-1);
 2759|       |	/*
 2760|       |	 * Each unpack stream beyond the first one of a folder needs its
 2761|       |	 * size stored in the remaining header bytes.
 2762|       |	 */
 2763|    325|	if (unpack_streams > numFolders &&
  ------------------
  |  Branch (2763:6): [True: 192, False: 133]
  ------------------
 2764|    192|	    unpack_streams - numFolders >
  ------------------
  |  Branch (2764:6): [True: 3, False: 189]
  ------------------
 2765|    192|	    (uint64_t)zip->header_bytes_remaining)
 2766|      3|		return (-1);
 2767|       |
 2768|    322|	if (type != kSize) {
  ------------------
  |  |  132|    322|#define kSize			0x09
  ------------------
  |  Branch (2768:6): [True: 137, False: 185]
  ------------------
 2769|    264|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2769:15): [True: 138, False: 126]
  ------------------
 2770|    138|			if (f[i].numUnpackStreams > 1)
  ------------------
  |  Branch (2770:8): [True: 11, False: 127]
  ------------------
 2771|     11|				return (-1);
 2772|    138|		}
 2773|    137|	}
 2774|       |
 2775|    311|	ss->unpack_streams = unpack_streams;
 2776|    311|	if (unpack_streams) {
  ------------------
  |  Branch (2776:6): [True: 305, False: 6]
  ------------------
 2777|    305|		ss->unpackSizes = calloc(unpack_streams,
 2778|    305|		    sizeof(*ss->unpackSizes));
 2779|    305|		ss->digestsDefined = calloc(unpack_streams,
 2780|    305|		    sizeof(*ss->digestsDefined));
 2781|    305|		ss->digests = calloc(unpack_streams,
 2782|    305|		    sizeof(*ss->digests));
 2783|    305|		if (ss->unpackSizes == NULL || ss->digestsDefined == NULL ||
  ------------------
  |  Branch (2783:7): [True: 0, False: 305]
  |  Branch (2783:34): [True: 0, False: 305]
  ------------------
 2784|    305|		    ss->digests == NULL)
  ------------------
  |  Branch (2784:7): [True: 0, False: 305]
  ------------------
 2785|      0|			return (-1);
 2786|    305|	}
 2787|       |
 2788|    311|	usizes = ss->unpackSizes;
 2789|    559|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2789:14): [True: 310, False: 249]
  ------------------
 2790|    310|		int64_t size, sum;
 2791|    310|		size_t pack;
 2792|       |
 2793|    310|		if (f[i].numUnpackStreams == 0)
  ------------------
  |  Branch (2793:7): [True: 3, False: 307]
  ------------------
 2794|      3|			continue;
 2795|       |
 2796|    307|		sum = 0;
 2797|    307|		if (type == kSize) {
  ------------------
  |  |  132|    307|#define kSize			0x09
  ------------------
  |  Branch (2797:7): [True: 182, False: 125]
  ------------------
 2798|  20.1k|			for (pack = 1; pack < f[i].numUnpackStreams; pack++) {
  ------------------
  |  Branch (2798:19): [True: 20.0k, False: 131]
  ------------------
 2799|  20.0k|				if (parse_7zip_int64(a, usizes) < 0)
  ------------------
  |  Branch (2799:9): [True: 47, False: 19.9k]
  ------------------
 2800|     47|					return (-1);
 2801|  19.9k|				if (archive_ckd_add_i64(&sum, sum, *usizes++))
  ------------------
  |  Branch (2801:9): [True: 4, False: 19.9k]
  ------------------
 2802|      4|					return (-1);
 2803|  19.9k|			}
 2804|    182|		}
 2805|    256|		size = folder_uncompressed_size(&f[i]);
 2806|    256|		if (size < sum)
  ------------------
  |  Branch (2806:7): [True: 11, False: 245]
  ------------------
 2807|     11|			return (-1);
 2808|    245|		*usizes++ = size - sum;
 2809|    245|	}
 2810|       |
 2811|    249|	if (type == kSize) {
  ------------------
  |  |  132|    249|#define kSize			0x09
  ------------------
  |  Branch (2811:6): [True: 123, False: 126]
  ------------------
 2812|    123|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2812:7): [True: 5, False: 118]
  ------------------
 2813|      5|			return (-1);
 2814|    118|		type = *p;
 2815|    118|	}
 2816|       |
 2817|    244|	numDigests = 0;
 2818|    487|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2818:14): [True: 243, False: 244]
  ------------------
 2819|    243|		if (f[i].numUnpackStreams != 1 || !f[i].digest_defined)
  ------------------
  |  Branch (2819:7): [True: 114, False: 129]
  |  Branch (2819:37): [True: 128, False: 1]
  ------------------
 2820|    242|			if (archive_ckd_add_size(&numDigests,
  ------------------
  |  Branch (2820:8): [True: 0, False: 242]
  ------------------
 2821|    242|			    numDigests, f[i].numUnpackStreams)) {
 2822|      0|				errno = ENOMEM;
 2823|      0|				return (-1);
 2824|      0|			}
 2825|    243|	}
 2826|       |
 2827|    244|	if (type == kCRC) {
  ------------------
  |  |  133|    244|#define kCRC			0x0A
  ------------------
  |  Branch (2827:6): [True: 194, False: 50]
  ------------------
 2828|    194|		struct _7z_digests tmpDigests;
 2829|    194|		unsigned char *digestsDefined = ss->digestsDefined;
 2830|    194|		uint32_t *digests = ss->digests;
 2831|    194|		size_t di = 0;
 2832|       |
 2833|    194|		memset(&tmpDigests, 0, sizeof(tmpDigests));
 2834|    194|		if (read_Digests(a, &(tmpDigests), numDigests) < 0) {
  ------------------
  |  Branch (2834:7): [True: 4, False: 190]
  ------------------
 2835|      4|			free_Digest(&tmpDigests);
 2836|      4|			return (-1);
 2837|      4|		}
 2838|    382|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2838:15): [True: 192, False: 190]
  ------------------
 2839|    192|			if (f[i].numUnpackStreams == 1 && f[i].digest_defined) {
  ------------------
  |  Branch (2839:8): [True: 106, False: 86]
  |  Branch (2839:38): [True: 0, False: 106]
  ------------------
 2840|      0|				*digestsDefined++ = 1;
 2841|      0|				*digests++ = f[i].digest;
 2842|    192|			} else {
 2843|    192|				size_t j;
 2844|       |
 2845|    613|				for (j = 0; j < f[i].numUnpackStreams;
  ------------------
  |  Branch (2845:17): [True: 421, False: 192]
  ------------------
 2846|    421|				    j++, di++) {
 2847|    421|					*digestsDefined++ =
 2848|    421|					    tmpDigests.defineds[di];
 2849|    421|					*digests++ =
 2850|    421|					    tmpDigests.digests[di];
 2851|    421|				}
 2852|    192|			}
 2853|    192|		}
 2854|    190|		free_Digest(&tmpDigests);
 2855|    190|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2855:7): [True: 1, False: 189]
  ------------------
 2856|      1|			return (-1);
 2857|    189|		type = *p;
 2858|    189|	}
 2859|       |
 2860|       |	/*
 2861|       |	 *  Must be kEnd.
 2862|       |	 */
 2863|    239|	if (type != kEnd)
  ------------------
  |  |  123|    239|#define kEnd			0x00
  ------------------
  |  Branch (2863:6): [True: 11, False: 228]
  ------------------
 2864|     11|		return (-1);
 2865|    228|	return (0);
 2866|    239|}
archive_read_support_format_7zip.c:folder_uncompressed_size:
 2697|    957|{
 2698|    957|	size_t n = f->numOutStreams;
 2699|    957|	size_t pairs = f->numBindPairs;
 2700|       |
 2701|  1.20k|	while (n-- > 0) {
  ------------------
  |  Branch (2701:9): [True: 1.20k, False: 0]
  ------------------
 2702|  1.20k|		size_t i;
 2703|  6.88k|		for (i = 0; i < pairs; i++) {
  ------------------
  |  Branch (2703:15): [True: 5.92k, False: 957]
  ------------------
 2704|  5.92k|			if (f->bindPairs[i].outIndex == n)
  ------------------
  |  Branch (2704:8): [True: 246, False: 5.67k]
  ------------------
 2705|    246|				break;
 2706|  5.92k|		}
 2707|  1.20k|		if (i >= pairs)
  ------------------
  |  Branch (2707:7): [True: 957, False: 246]
  ------------------
 2708|    957|			return (f->unPackSize[n]);
 2709|  1.20k|	}
 2710|      0|	return (0);
 2711|    957|}
archive_read_support_format_7zip.c:read_consume:
 1286|  1.22M|{
 1287|  1.22M|	struct _7zip *zip = a->format->data;
 1288|       |
 1289|  1.22M|	if (zip->pack_stream_bytes_unconsumed) {
  ------------------
  |  Branch (1289:6): [True: 1.22M, False: 0]
  ------------------
 1290|  1.22M|		int64_t r;
 1291|       |
 1292|  1.22M|		if ((r = __archive_read_consume(a,
  ------------------
  |  Branch (1292:7): [True: 0, False: 1.22M]
  ------------------
 1293|  1.22M|		    zip->pack_stream_bytes_unconsumed)) < 0)
 1294|      0|			return ((int)r);
 1295|       |
 1296|  1.22M|		zip->stream_offset += zip->pack_stream_bytes_unconsumed;
 1297|  1.22M|		zip->pack_stream_bytes_unconsumed = 0;
 1298|  1.22M|	}
 1299|       |
 1300|  1.22M|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.22M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1301|  1.22M|}
archive_read_support_format_7zip.c:setup_decode_folder:
 4039|    668|{
 4040|    668|	struct _7zip *zip = a->format->data;
 4041|    668|	const struct _7z_coder *coder1, *coder2;
 4042|    668|	const char *cname = (header)?"archive header":"file content";
  ------------------
  |  Branch (4042:22): [True: 538, False: 130]
  ------------------
 4043|    668|	size_t i;
 4044|    668|	int r, found_bcj2 = 0;
 4045|       |
 4046|       |	/*
 4047|       |	 * Release the memory which the previous folder used for BCJ2.
 4048|       |	 */
 4049|  2.67k|	for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4049:14): [True: 2.00k, False: 668]
  ------------------
 4050|  2.00k|		free(zip->sub_stream_buff[i]);
 4051|  2.00k|		zip->sub_stream_buff[i] = NULL;
 4052|  2.00k|	}
 4053|       |
 4054|       |	/*
 4055|       |	 * Check coder types before modifying any stream-reader state, so that
 4056|       |	 * an early return leaves zip unchanged (avoids partially-initialized
 4057|       |	 * state that callers would have to reason about).
 4058|       |	 */
 4059|  1.69k|	for (i = 0; i < folder->numCoders; i++) {
  ------------------
  |  Branch (4059:14): [True: 1.02k, False: 668]
  ------------------
 4060|  1.02k|		switch(folder->coders[i].codec) {
  ------------------
  |  Branch (4060:10): [True: 42, False: 985]
  ------------------
 4061|      0|			case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (4061:4): [True: 0, False: 1.02k]
  ------------------
 4062|      0|			case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (4062:4): [True: 0, False: 1.02k]
  ------------------
 4063|      0|			case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  105|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (4063:4): [True: 0, False: 1.02k]
  ------------------
 4064|       |				/* For entry that is associated with this folder, mark
 4065|       |				   it as encrypted (data+metadata). */
 4066|      0|				zip->has_encrypted_entries = 1;
 4067|      0|				if (a->entry) {
  ------------------
  |  Branch (4067:9): [True: 0, False: 0]
  ------------------
 4068|      0|					archive_entry_set_is_data_encrypted(a->entry, 1);
 4069|      0|					archive_entry_set_is_metadata_encrypted(a->entry, 1);
 4070|      0|				}
 4071|      0|				archive_set_error(&(a->archive),
 4072|      0|					ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4073|      0|					"The %s is encrypted, "
 4074|      0|					"but currently not supported", cname);
 4075|      0|				return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (4075:13): [True: 0, False: 0]
  ------------------
 4076|      0|			}
 4077|     42|			case _7Z_X86_BCJ2: {
  ------------------
  |  |  109|     42|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (4077:4): [True: 42, False: 985]
  ------------------
 4078|     42|				found_bcj2++;
 4079|     42|				break;
 4080|      0|			}
 4081|  1.02k|		}
 4082|  1.02k|	}
 4083|       |	/* Now that we've checked for encryption, if there were still no
 4084|       |	 * encrypted entries found we can say for sure that there are none.
 4085|       |	 */
 4086|    668|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  416|    668|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (4086:6): [True: 0, False: 668]
  ------------------
 4087|      0|		zip->has_encrypted_entries = 0;
 4088|      0|	}
 4089|       |
 4090|    668|	if ((folder->numCoders > 2 && !found_bcj2) || found_bcj2 > 1) {
  ------------------
  |  Branch (4090:7): [True: 41, False: 627]
  |  Branch (4090:32): [True: 0, False: 41]
  |  Branch (4090:48): [True: 0, False: 668]
  ------------------
 4091|      0|		archive_set_error(&(a->archive),
 4092|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4093|      0|		    "The %s is encoded with many filters, "
 4094|      0|		    "but currently not supported", cname);
 4095|      0|		return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              		return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (4095:11): [True: 0, False: 0]
  ------------------
 4096|      0|	}
 4097|       |
 4098|       |	/*
 4099|       |	 * 7-Zip can be asked to chain two compressors in one folder
 4100|       |	 * (e.g. -m0=LZMA2 -m1=LZMA2). This is slow and gains nothing.
 4101|       |	 * Our decoder intentionally only supports a compressor
 4102|       |	 * followed by an optional filter.
 4103|       |	 */
 4104|    668|	if (folder->numCoders == 2 && !found_bcj2 &&
  ------------------
  |  Branch (4104:6): [True: 236, False: 432]
  |  Branch (4104:32): [True: 235, False: 1]
  ------------------
 4105|    235|	    compressor_name(folder->coders[0].codec) != NULL &&
  ------------------
  |  Branch (4105:6): [True: 225, False: 10]
  ------------------
 4106|    225|	    compressor_name(folder->coders[1].codec) != NULL) {
  ------------------
  |  Branch (4106:6): [True: 6, False: 219]
  ------------------
 4107|      6|		archive_set_error(&(a->archive),
 4108|      6|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4109|      6|		    "The %s is compressed twice with chained compressors "
 4110|      6|		    "(%s and %s), which is not supported", cname,
 4111|      6|		    compressor_name(folder->coders[0].codec),
 4112|      6|		    compressor_name(folder->coders[1].codec));
 4113|      6|		return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  240|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              		return (header ? ARCHIVE_FATAL : ARCHIVE_FAILED);
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (4113:11): [True: 5, False: 1]
  ------------------
 4114|      6|	}
 4115|       |
 4116|       |	/*
 4117|       |	 * Initialize a stream reader.
 4118|       |	 */
 4119|    662|	zip->pack_stream_remaining = folder->numPackedStreams;
 4120|    662|	zip->pack_stream_index = folder->packIndex;
 4121|    662|	zip->folder_outbytes_remaining = folder_uncompressed_size(folder);
 4122|    662|	zip->uncompressed_buffer_bytes_remaining = 0;
 4123|    662|	coder1 = &(folder->coders[0]);
 4124|    662|	if (folder->numCoders == 2)
  ------------------
  |  Branch (4124:6): [True: 230, False: 432]
  ------------------
 4125|    230|		coder2 = &(folder->coders[1]);
 4126|    432|	else
 4127|    432|		coder2 = NULL;
 4128|       |
 4129|    662|	if (found_bcj2) {
  ------------------
  |  Branch (4129:6): [True: 42, False: 620]
  ------------------
 4130|       |		/*
 4131|       |		 * Preparation to decode BCJ2.
 4132|       |		 * Decoding BCJ2 requires four sources. Those are at least,
 4133|       |		 * as far as I know, two types of the storage form.
 4134|       |		 */
 4135|     42|		const struct _7z_coder *fc = folder->coders;
 4136|     42|		static const struct _7z_coder coder_copy = {0, 1, 1, 0, NULL};
 4137|     42|		const struct _7z_coder *scoder[3] =
 4138|     42|			{&coder_copy, &coder_copy, &coder_copy};
 4139|     42|		const void *buff;
 4140|     42|		ssize_t bytes;
 4141|     42|		unsigned char *b[3] = {NULL, NULL, NULL};
 4142|     42|		int64_t sunpack[3] ={-1, -1, -1};
 4143|     42|		int64_t remaining;
 4144|     42|		size_t s[3] = {0, 0, 0};
 4145|     42|		int idx[3] = {0, 1, 2};
 4146|       |
 4147|     42|		if (folder->numCoders == 4 && fc[3].codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  109|     83|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (4147:7): [True: 41, False: 1]
  |  Branch (4147:33): [True: 41, False: 0]
  ------------------
 4148|     41|		    folder->numInStreams == 7 && folder->numOutStreams == 4 &&
  ------------------
  |  Branch (4148:7): [True: 41, False: 0]
  |  Branch (4148:36): [True: 41, False: 0]
  ------------------
 4149|     41|		    zip->pack_stream_remaining == 4) {
  ------------------
  |  Branch (4149:7): [True: 41, False: 0]
  ------------------
 4150|       |			/* Source type 1 made by 7zr or 7z with -m options. */
 4151|     41|			if (folder->bindPairs[0].inIndex == 5) {
  ------------------
  |  Branch (4151:8): [True: 41, False: 0]
  ------------------
 4152|       |				/* The form made by 7zr */
 4153|     41|				idx[0] = 1; idx[1] = 2; idx[2] = 0;
 4154|     41|				scoder[1] = &(fc[1]);
 4155|     41|				scoder[2] = &(fc[0]);
 4156|     41|				sunpack[1] = folder->unPackSize[1];
 4157|     41|				sunpack[2] = folder->unPackSize[0];
 4158|     41|				coder1 = &(fc[2]);
 4159|     41|			} else {
 4160|       |				/*
 4161|       |				 * NOTE: Some patterns do not work.
 4162|       |				 * work:
 4163|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=COPY
 4164|       |				 *       -m3=(any)
 4165|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=(any)
 4166|       |				 *       -m3=COPY
 4167|       |				 *  7z a -m0=BCJ2 -m1=(any) -m2=COPY
 4168|       |				 *       -m3=COPY
 4169|       |				 * not work:
 4170|       |				 *  other patterns.
 4171|       |				 *
 4172|       |				 * We have to handle this like `pipe' or
 4173|       |				 * our libarchive7s filter frame work,
 4174|       |				 * decoding the BCJ2 main stream sequentially,
 4175|       |				 * m3 -> m2 -> m1 -> BCJ2.
 4176|       |				 *
 4177|       |				 */
 4178|      0|				if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   96|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (4178:9): [True: 0, False: 0]
  ------------------
 4179|      0|				    fc[1].codec == _7Z_COPY)
  ------------------
  |  |   96|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (4179:9): [True: 0, False: 0]
  ------------------
 4180|      0|					coder1 = &(folder->coders[2]);
 4181|      0|				else if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   96|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (4181:14): [True: 0, False: 0]
  ------------------
 4182|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   96|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (4182:9): [True: 0, False: 0]
  ------------------
 4183|      0|					coder1 = &(folder->coders[1]);
 4184|      0|				else if (fc[1].codec == _7Z_COPY &&
  ------------------
  |  |   96|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (4184:14): [True: 0, False: 0]
  ------------------
 4185|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   96|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (4185:9): [True: 0, False: 0]
  ------------------
 4186|      0|					coder1 = &(folder->coders[0]);
 4187|      0|				else {
 4188|      0|					archive_set_error(&(a->archive),
 4189|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4190|      0|					    "Unsupported form of "
 4191|      0|					    "BCJ2 streams");
 4192|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4193|      0|				}
 4194|      0|			}
 4195|     41|			coder2 = &(fc[3]);
 4196|     41|			remaining = folder->unPackSize[2];
 4197|     41|		} else if (coder2 != NULL && coder2->codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  109|      2|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (4197:14): [True: 1, False: 0]
  |  Branch (4197:32): [True: 1, False: 0]
  ------------------
 4198|      1|		    zip->pack_stream_remaining == 4 &&
  ------------------
  |  Branch (4198:7): [True: 0, False: 1]
  ------------------
 4199|      0|		    folder->numInStreams == 5 && folder->numOutStreams == 2) {
  ------------------
  |  Branch (4199:7): [True: 0, False: 0]
  |  Branch (4199:36): [True: 0, False: 0]
  ------------------
 4200|       |			/* Source type 0 made by 7z */
 4201|      0|			remaining = folder->unPackSize[0];
 4202|      1|		} else {
 4203|       |			/* We got an unexpected form. */
 4204|      1|			archive_set_error(&(a->archive),
 4205|      1|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4206|      1|			    "Unsupported form of BCJ2 streams");
 4207|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4208|      1|		}
 4209|     41|		zip->main_stream_bytes_remaining = remaining;
 4210|       |
 4211|       |
 4212|       |		/* Skip the main stream at this time. */
 4213|     41|		if ((r = seek_pack(a)) < 0)
  ------------------
  |  Branch (4213:7): [True: 0, False: 41]
  ------------------
 4214|      0|			return (r);
 4215|     41|		zip->pack_stream_bytes_unconsumed =
 4216|     41|		    zip->pack_stream_inbytes_remaining;
 4217|     41|		if ((r = read_consume(a)) < 0)
  ------------------
  |  Branch (4217:7): [True: 0, False: 41]
  ------------------
 4218|      0|			return (r);
 4219|       |
 4220|       |		/* Read following three sub streams. */
 4221|    161|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4221:15): [True: 122, False: 39]
  ------------------
 4222|    122|			const struct _7z_coder *coder = scoder[i];
 4223|       |
 4224|    122|			if ((r = seek_pack(a)) < 0) {
  ------------------
  |  Branch (4224:8): [True: 0, False: 122]
  ------------------
 4225|      0|				free(b[0]); free(b[1]); free(b[2]);
 4226|      0|				return (r);
 4227|      0|			}
 4228|       |
 4229|    122|			if (sunpack[i] == -1)
  ------------------
  |  Branch (4229:8): [True: 41, False: 81]
  ------------------
 4230|     41|				zip->folder_outbytes_remaining =
 4231|     41|				    zip->pack_stream_inbytes_remaining;
 4232|     81|			else
 4233|     81|				zip->folder_outbytes_remaining = sunpack[i];
 4234|       |
 4235|    122|			r = init_decompression(a, zip, coder, NULL);
 4236|    122|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  234|    122|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4236:8): [True: 0, False: 122]
  ------------------
 4237|      0|				free(b[0]); free(b[1]); free(b[2]);
 4238|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4239|      0|			}
 4240|       |
 4241|       |			/* Allocate memory for the decoded data of a sub
 4242|       |			 * stream. */
 4243|    122|			if ((uint64_t)zip->folder_outbytes_remaining > SIZE_MAX) {
  ------------------
  |  Branch (4243:8): [True: 0, False: 122]
  ------------------
 4244|      0|				free(b[0]); free(b[1]); free(b[2]);
 4245|      0|				archive_set_error(&a->archive,
 4246|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4247|      0|				    "7-Zip sub-stream size exceeds "
 4248|      0|				    "platform maximum");
 4249|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4250|      0|			}
 4251|    122|			b[i] = malloc((size_t)zip->folder_outbytes_remaining);
 4252|    122|			if (b[i] == NULL) {
  ------------------
  |  Branch (4252:8): [True: 0, False: 122]
  ------------------
 4253|      0|				free(b[0]); free(b[1]); free(b[2]);
 4254|      0|				archive_set_error(&a->archive, ENOMEM,
 4255|      0|				    "No memory for 7-Zip decompression");
 4256|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4257|      0|			}
 4258|       |
 4259|       |			/* Extract a sub stream. */
 4260|    242|			while (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (4260:11): [True: 122, False: 120]
  ------------------
 4261|    122|				r = (int)extract_pack_stream(a, 0);
 4262|    122|				if (r < 0) {
  ------------------
  |  Branch (4262:9): [True: 2, False: 120]
  ------------------
 4263|      2|					free(b[0]); free(b[1]); free(b[2]);
 4264|      2|					return (r);
 4265|      2|				}
 4266|    120|				bytes = get_uncompressed_data(a, &buff,
 4267|    120|				    zip->uncompressed_buffer_bytes_remaining,
 4268|    120|				    0);
 4269|    120|				if (bytes < 0) {
  ------------------
  |  Branch (4269:9): [True: 0, False: 120]
  ------------------
 4270|      0|					free(b[0]); free(b[1]); free(b[2]);
 4271|      0|					return ((int)bytes);
 4272|      0|				}
 4273|    120|				memcpy(b[i]+s[i], buff, bytes);
 4274|    120|				s[i] += bytes;
 4275|    120|				if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4275:9): [True: 120, False: 0]
  ------------------
 4276|    120|					read_consume(a);
 4277|    120|			}
 4278|    122|		}
 4279|       |
 4280|       |		/* Set the sub streams to the right place. */
 4281|    156|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4281:15): [True: 117, False: 39]
  ------------------
 4282|    117|			zip->sub_stream_buff[i] = b[idx[i]];
 4283|    117|			zip->sub_stream_size[i] = s[idx[i]];
 4284|    117|			zip->sub_stream_bytes_remaining[i] = s[idx[i]];
 4285|    117|		}
 4286|       |
 4287|       |		/* Allocate memory used for decoded main stream bytes. */
 4288|     39|		if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4288:7): [True: 39, False: 0]
  ------------------
 4289|     39|			zip->tmp_stream_buff_size = 32 * 1024;
 4290|     39|			zip->tmp_stream_buff =
 4291|     39|			    malloc(zip->tmp_stream_buff_size);
 4292|     39|			if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4292:8): [True: 0, False: 39]
  ------------------
 4293|      0|				archive_set_error(&a->archive, ENOMEM,
 4294|      0|				    "No memory for 7-Zip decompression");
 4295|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4296|      0|			}
 4297|     39|		}
 4298|     39|		zip->tmp_stream_bytes_avail = 0;
 4299|     39|		zip->tmp_stream_bytes_remaining = 0;
 4300|     39|		zip->odd_bcj_size = 0;
 4301|     39|		zip->bcj2_outPos = 0;
 4302|       |
 4303|       |		/*
 4304|       |		 * Reset a stream reader in order to read the main stream
 4305|       |		 * of BCJ2.
 4306|       |		 */
 4307|     39|		zip->pack_stream_remaining = 1;
 4308|     39|		zip->pack_stream_index = folder->packIndex;
 4309|     39|		zip->folder_outbytes_remaining =
 4310|     39|		    folder_uncompressed_size(folder);
 4311|     39|		zip->uncompressed_buffer_bytes_remaining = 0;
 4312|     39|	}
 4313|       |
 4314|       |	/*
 4315|       |	 * Initialize the decompressor for the new folder's pack streams.
 4316|       |	 */
 4317|    659|	r = init_decompression(a, zip, coder1, coder2);
 4318|    659|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    659|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4318:6): [True: 115, False: 544]
  ------------------
 4319|    115|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    115|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4320|    544|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    544|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4321|    659|}
archive_read_support_format_7zip.c:compressor_name:
 4023|    472|{
 4024|    472|	switch (codec) {
 4025|    203|	case _7Z_COPY:    return ("Copy");
  ------------------
  |  |   96|    203|#define _7Z_COPY	0
  ------------------
  |  Branch (4025:2): [True: 203, False: 269]
  ------------------
 4026|     24|	case _7Z_LZMA:    return ("LZMA");
  ------------------
  |  |   97|     24|#define _7Z_LZMA	0x030101
  ------------------
  |  Branch (4026:2): [True: 24, False: 448]
  ------------------
 4027|     12|	case _7Z_LZMA2:   return ("LZMA2");
  ------------------
  |  |   98|     12|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (4027:2): [True: 12, False: 460]
  ------------------
 4028|      2|	case _7Z_DEFLATE: return ("Deflate");
  ------------------
  |  |   99|      2|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (4028:2): [True: 2, False: 470]
  ------------------
 4029|      0|	case _7Z_BZ2:     return ("BZip2");
  ------------------
  |  |  100|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (4029:2): [True: 0, False: 472]
  ------------------
 4030|      2|	case _7Z_PPMD:    return ("PPMd");
  ------------------
  |  |  101|      2|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (4030:2): [True: 2, False: 470]
  ------------------
 4031|      0|	case _7Z_ZSTD:    return ("Zstd");
  ------------------
  |  |  118|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (4031:2): [True: 0, False: 472]
  ------------------
 4032|    229|	default:          return (NULL);
  ------------------
  |  Branch (4032:2): [True: 229, False: 243]
  ------------------
 4033|    472|	}
 4034|    472|}
archive_read_support_format_7zip.c:init_decompression:
 1410|    781|{
 1411|    781|	int r;
 1412|       |
 1413|    781|	zip->codec = coder1->codec;
 1414|    781|	zip->codec2 = -1;
 1415|       |
 1416|    781|	switch (zip->codec) {
 1417|    292|	case _7Z_COPY:
  ------------------
  |  |   96|    292|#define _7Z_COPY	0
  ------------------
  |  Branch (1417:2): [True: 292, False: 489]
  ------------------
 1418|    292|	case _7Z_BZ2:
  ------------------
  |  |  100|    292|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1418:2): [True: 0, False: 781]
  ------------------
 1419|    294|	case _7Z_DEFLATE:
  ------------------
  |  |   99|    294|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1419:2): [True: 2, False: 779]
  ------------------
 1420|    294|	case _7Z_ZSTD:
  ------------------
  |  |  118|    294|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1420:2): [True: 0, False: 781]
  ------------------
 1421|    484|	case _7Z_PPMD:
  ------------------
  |  |  101|    484|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1421:2): [True: 190, False: 591]
  ------------------
 1422|    484|		if (coder2 != NULL) {
  ------------------
  |  Branch (1422:7): [True: 191, False: 293]
  ------------------
 1423|    191|			if (coder2->codec != _7Z_X86 &&
  ------------------
  |  |  108|    382|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1423:8): [True: 164, False: 27]
  ------------------
 1424|    164|			    coder2->codec != _7Z_X86_BCJ2 &&
  ------------------
  |  |  109|    355|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1424:8): [True: 164, False: 0]
  ------------------
 1425|    164|			    coder2->codec != _7Z_ARM &&
  ------------------
  |  |  112|    355|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1425:8): [True: 154, False: 10]
  ------------------
 1426|    154|			    coder2->codec != _7Z_ARMTHUMB &&
  ------------------
  |  |  113|    345|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1426:8): [True: 140, False: 14]
  ------------------
 1427|    140|			    coder2->codec != _7Z_ARM64 &&
  ------------------
  |  |  114|    331|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1427:8): [True: 112, False: 28]
  ------------------
 1428|    112|			    coder2->codec != _7Z_IA64 &&
  ------------------
  |  |  111|    303|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1428:8): [True: 94, False: 18]
  ------------------
 1429|     94|			    coder2->codec != _7Z_POWERPC &&
  ------------------
  |  |  110|    285|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1429:8): [True: 81, False: 13]
  ------------------
 1430|     81|			    coder2->codec != _7Z_RISCV &&
  ------------------
  |  |  115|    272|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1430:8): [True: 54, False: 27]
  ------------------
 1431|     54|			    coder2->codec != _7Z_SPARC &&
  ------------------
  |  |  116|    245|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1431:8): [True: 38, False: 16]
  ------------------
 1432|     38|			    coder2->codec != _7Z_DELTA) {
  ------------------
  |  |  102|     38|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1432:8): [True: 26, False: 12]
  ------------------
 1433|     26|				archive_set_error(&a->archive,
 1434|     26|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     26|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1435|     26|				    "Unsupported filter %jx for %jx",
 1436|     26|				    (uintmax_t)coder2->codec,
 1437|     26|				    (uintmax_t)coder1->codec);
 1438|     26|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     26|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1439|     26|			}
 1440|    165|			if (coder2->codec == _7Z_DELTA &&
  ------------------
  |  |  102|    330|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1440:8): [True: 12, False: 153]
  ------------------
 1441|     12|			    coder2->propertiesSize != 1) {
  ------------------
  |  Branch (1441:8): [True: 1, False: 11]
  ------------------
 1442|      1|				archive_set_error(&a->archive,
 1443|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1444|      1|				    "Invalid Delta parameter");
 1445|      1|				return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1446|      1|			}
 1447|    164|			zip->codec2 = coder2->codec;
 1448|    164|			zip->bcj_state = 0;
 1449|    164|			if (coder2->codec == _7Z_X86)
  ------------------
  |  |  108|    164|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1449:8): [True: 27, False: 137]
  ------------------
 1450|     27|				x86_Init(zip);
 1451|    137|			else if (coder2->codec == _7Z_ARM)
  ------------------
  |  |  112|    137|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1451:13): [True: 10, False: 127]
  ------------------
 1452|     10|				arm_Init(zip);
 1453|    127|			else if (coder2->codec == _7Z_ARMTHUMB)
  ------------------
  |  |  113|    127|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1453:13): [True: 14, False: 113]
  ------------------
 1454|     14|				armthumb_Init(zip);
 1455|    113|			else if (coder2->codec == _7Z_ARM64 ||
  ------------------
  |  |  114|    226|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1455:13): [True: 28, False: 85]
  ------------------
 1456|     85|			    coder2->codec == _7Z_IA64 ||
  ------------------
  |  |  111|    198|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1456:8): [True: 18, False: 67]
  ------------------
 1457|     67|			    coder2->codec == _7Z_POWERPC ||
  ------------------
  |  |  110|    180|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1457:8): [True: 13, False: 54]
  ------------------
 1458|     54|			    coder2->codec == _7Z_RISCV ||
  ------------------
  |  |  115|    167|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1458:8): [True: 27, False: 27]
  ------------------
 1459|     27|			    coder2->codec == _7Z_SPARC)
  ------------------
  |  |  116|     27|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1459:8): [True: 16, False: 11]
  ------------------
 1460|    102|				zip->bcj_ip = 0;
 1461|     11|			else if (coder2->codec == _7Z_DELTA)
  ------------------
  |  |  102|     11|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1461:13): [True: 11, False: 0]
  ------------------
 1462|     11|				delta_Init(zip, coder2->properties[0] + 1);
 1463|    164|		}
 1464|    457|		break;
 1465|    457|	default:
  ------------------
  |  Branch (1465:2): [True: 297, False: 484]
  ------------------
 1466|    297|		break;
 1467|    781|	}
 1468|       |
 1469|    754|	switch (zip->codec) {
 1470|    265|	case _7Z_COPY:
  ------------------
  |  |   96|    265|#define _7Z_COPY	0
  ------------------
  |  Branch (1470:2): [True: 265, False: 489]
  ------------------
 1471|    265|		break;
 1472|       |
 1473|    239|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   97|    183|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   98|    239|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1473:2): [True: 183, False: 571]
  |  Branch (1473:17): [True: 56, False: 698]
  ------------------
 1474|    239|#ifdef HAVE_LZMA_H
 1475|    239|#if LZMA_VERSION_MAJOR >= 5
 1476|       |/* Effectively disable the limiter. */
 1477|    239|#define LZMA_MEMLIMIT   UINT64_MAX
 1478|       |#else
 1479|       |/* NOTE: This needs to check memory size which running system has. */
 1480|       |#define LZMA_MEMLIMIT   (1U << 30)
 1481|       |#endif
 1482|    239|	{
 1483|    239|		lzma_options_delta delta_opt;
 1484|    239|		lzma_filter filters[LZMA_FILTERS_MAX], *ff;
 1485|    239|		int fi = 0;
 1486|       |
 1487|    239|		if (zip->lzstream_valid) {
  ------------------
  |  Branch (1487:7): [True: 147, False: 92]
  ------------------
 1488|    147|			lzma_end(&(zip->lzstream));
 1489|    147|			zip->lzstream_valid = 0;
 1490|    147|		}
 1491|       |
 1492|       |		/*
 1493|       |		 * NOTE: liblzma incompletely handle the BCJ+LZMA compressed
 1494|       |		 * data made by 7-Zip because 7-Zip does not add End-Of-
 1495|       |		 * Payload Marker(EOPM) at the end of LZMA compressed data,
 1496|       |		 * and so liblzma cannot know the end of the compressed data
 1497|       |		 * without EOPM. So consequently liblzma will not return last
 1498|       |		 * three or four bytes of uncompressed data because
 1499|       |		 * LZMA_FILTER_X86 filter does not handle input data if its
 1500|       |		 * data size is less than five bytes. If liblzma detect EOPM
 1501|       |		 * or know the uncompressed data size, liblzma will flush out
 1502|       |		 * the remaining that three or four bytes of uncompressed
 1503|       |		 * data. That is why we have to use our converting program
 1504|       |		 * for BCJ+LZMA. If we were able to tell the uncompressed
 1505|       |		 * size to liblzma when using lzma_raw_decoder() liblzma
 1506|       |		 * could correctly deal with BCJ+LZMA. But unfortunately
 1507|       |		 * there is no way to do that.
 1508|       |		 *
 1509|       |		 * Reference: https://web.archive.org/web/20240405171610/https://www.mail-archive.com/xz-devel@tukaani.org/msg00373.html
 1510|       |		 */
 1511|    239|		if (coder2 != NULL) {
  ------------------
  |  Branch (1511:7): [True: 67, False: 172]
  ------------------
 1512|     67|			zip->codec2 = coder2->codec;
 1513|       |
 1514|     67|			filters[fi].options = NULL;
 1515|       |			/*
 1516|       |			 * Only LZMA2 gets liblzma's branch filters; for LZMA1
 1517|       |			 * we run our own instead, for the reason given above.
 1518|       |			 */
 1519|     67|			if (zip->codec != _7Z_LZMA2 &&
  ------------------
  |  |   98|    134|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1519:8): [True: 22, False: 45]
  ------------------
 1520|     22|			    bcj_lookahead(zip->codec2) != 0) {
  ------------------
  |  Branch (1520:8): [True: 21, False: 1]
  ------------------
 1521|       |				/* Use our filter. */
 1522|     21|				if (zip->codec2 == _7Z_X86)
  ------------------
  |  |  108|     21|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1522:9): [True: 19, False: 2]
  ------------------
 1523|     19|					x86_Init(zip);
 1524|      2|				else if (zip->codec2 == _7Z_ARM)
  ------------------
  |  |  112|      2|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1524:14): [True: 0, False: 2]
  ------------------
 1525|      0|					arm_Init(zip);
 1526|      2|				else if (zip->codec2 == _7Z_ARMTHUMB)
  ------------------
  |  |  113|      2|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1526:14): [True: 0, False: 2]
  ------------------
 1527|      0|					armthumb_Init(zip);
 1528|      2|				else /* ARM64, IA64, POWERPC, RISCV, SPARC. */
 1529|      2|					zip->bcj_ip = 0;
 1530|     46|			} else {
 1531|     46|				switch (zip->codec2) {
 1532|      0|				case _7Z_X86:
  ------------------
  |  |  108|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1532:5): [True: 0, False: 46]
  ------------------
 1533|      0|					filters[fi].id = LZMA_FILTER_X86;
 1534|      0|					fi++;
 1535|      0|					break;
 1536|     39|				case _7Z_X86_BCJ2:
  ------------------
  |  |  109|     39|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1536:5): [True: 39, False: 7]
  ------------------
 1537|       |					/* Use our filter. */
 1538|     39|					zip->bcj_state = 0;
 1539|     39|					break;
 1540|      2|				case _7Z_DELTA:
  ------------------
  |  |  102|      2|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1540:5): [True: 2, False: 44]
  ------------------
 1541|      2|					if (coder2->propertiesSize != 1) {
  ------------------
  |  Branch (1541:10): [True: 1, False: 1]
  ------------------
 1542|      1|						archive_set_error(&a->archive,
 1543|      1|						    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1544|      1|						    "Invalid Delta parameter");
 1545|      1|						return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1546|      1|					}
 1547|      1|					filters[fi].id = LZMA_FILTER_DELTA;
 1548|      1|					memset(&delta_opt, 0, sizeof(delta_opt));
 1549|      1|					delta_opt.type = LZMA_DELTA_TYPE_BYTE;
 1550|      1|					delta_opt.dist =
 1551|      1|					    coder2->properties[0] + 1;
 1552|      1|					filters[fi].options = &delta_opt;
 1553|      1|					fi++;
 1554|      1|					break;
 1555|       |				/* Following filters have not been tested yet. */
 1556|      1|				case _7Z_POWERPC:
  ------------------
  |  |  110|      1|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1556:5): [True: 1, False: 45]
  ------------------
 1557|      1|					filters[fi].id = LZMA_FILTER_POWERPC;
 1558|      1|					fi++;
 1559|      1|					break;
 1560|      1|				case _7Z_IA64:
  ------------------
  |  |  111|      1|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1560:5): [True: 1, False: 45]
  ------------------
 1561|      1|					filters[fi].id = LZMA_FILTER_IA64;
 1562|      1|					fi++;
 1563|      1|					break;
 1564|      1|				case _7Z_ARM:
  ------------------
  |  |  112|      1|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1564:5): [True: 1, False: 45]
  ------------------
 1565|      1|					filters[fi].id = LZMA_FILTER_ARM;
 1566|      1|					fi++;
 1567|      1|					break;
 1568|      0|				case _7Z_ARMTHUMB:
  ------------------
  |  |  113|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1568:5): [True: 0, False: 46]
  ------------------
 1569|      0|					filters[fi].id = LZMA_FILTER_ARMTHUMB;
 1570|      0|					fi++;
 1571|      0|					break;
 1572|       |#ifdef LZMA_FILTER_ARM64
 1573|       |				case _7Z_ARM64:
 1574|       |					filters[fi].id = LZMA_FILTER_ARM64;
 1575|       |					fi++;
 1576|       |					break;
 1577|       |#endif
 1578|       |#ifdef LZMA_FILTER_RISCV
 1579|       |				case _7Z_RISCV:
 1580|       |					filters[fi].id = LZMA_FILTER_RISCV;
 1581|       |					fi++;
 1582|       |					break;
 1583|       |#endif
 1584|      0|				case _7Z_SPARC:
  ------------------
  |  |  116|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1584:5): [True: 0, False: 46]
  ------------------
 1585|      0|					filters[fi].id = LZMA_FILTER_SPARC;
 1586|      0|					fi++;
 1587|      0|					break;
 1588|      2|				default:
  ------------------
  |  Branch (1588:5): [True: 2, False: 44]
  ------------------
 1589|      2|					archive_set_error(&a->archive,
 1590|      2|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1591|      2|					    "Unexpected codec ID: %jX",
 1592|      2|					    (uintmax_t)zip->codec2);
 1593|      2|					return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1594|     46|				}
 1595|     46|			}
 1596|     67|		}
 1597|       |
 1598|    236|		if (zip->codec == _7Z_LZMA2)
  ------------------
  |  |   98|    236|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1598:7): [True: 54, False: 182]
  ------------------
 1599|     54|			filters[fi].id = LZMA_FILTER_LZMA2;
 1600|    182|		else
 1601|    182|			filters[fi].id = LZMA_FILTER_LZMA1;
 1602|    236|		filters[fi].options = NULL;
 1603|    236|		ff = &filters[fi];
 1604|    236|		r = lzma_properties_decode(&filters[fi], NULL,
 1605|    236|		    coder1->properties, coder1->propertiesSize);
 1606|    236|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1606:7): [True: 4, False: 232]
  ------------------
 1607|      4|			set_error(a, r);
 1608|      4|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1609|      4|		}
 1610|    232|		fi++;
 1611|       |
 1612|    232|		filters[fi].id = LZMA_VLI_UNKNOWN;
 1613|    232|		filters[fi].options = NULL;
 1614|    232|		r = lzma_raw_decoder(&(zip->lzstream), filters);
 1615|    232|		free(ff->options);
 1616|    232|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1616:7): [True: 0, False: 232]
  ------------------
 1617|      0|			set_error(a, r);
 1618|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1619|      0|		}
 1620|    232|		zip->lzstream_valid = 1;
 1621|    232|		zip->lzstream.total_in = 0;
 1622|    232|		zip->lzstream.total_out = 0;
 1623|    232|		break;
 1624|    232|	}
 1625|       |#else
 1626|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1627|       |		    "LZMA codec is unsupported");
 1628|       |		return (ARCHIVE_FAILED);
 1629|       |#endif
 1630|      0|	case _7Z_BZ2:
  ------------------
  |  |  100|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1630:2): [True: 0, False: 754]
  ------------------
 1631|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1632|      0|		if (zip->bzstream_valid) {
  ------------------
  |  Branch (1632:7): [True: 0, False: 0]
  ------------------
 1633|      0|			BZ2_bzDecompressEnd(&(zip->bzstream));
 1634|      0|			zip->bzstream_valid = 0;
 1635|      0|		}
 1636|      0|		r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 0);
 1637|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1637:7): [True: 0, False: 0]
  ------------------
 1638|      0|			r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 1);
 1639|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1639:7): [True: 0, False: 0]
  ------------------
 1640|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1641|      0|			const char *detail = NULL;
 1642|      0|			switch (r) {
  ------------------
  |  Branch (1642:12): [True: 0, False: 0]
  ------------------
 1643|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1643:4): [True: 0, False: 0]
  ------------------
 1644|      0|				detail = "invalid setup parameter";
 1645|      0|				break;
 1646|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1646:4): [True: 0, False: 0]
  ------------------
 1647|      0|				err = ENOMEM;
 1648|      0|				detail = "out of memory";
 1649|      0|				break;
 1650|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1650:4): [True: 0, False: 0]
  ------------------
 1651|      0|				detail = "mis-compiled library";
 1652|      0|				break;
 1653|      0|			}
 1654|      0|			archive_set_error(&a->archive, err,
 1655|      0|			    "Internal error initializing decompressor: %s",
 1656|      0|			    detail != NULL ? detail : "??");
  ------------------
  |  Branch (1656:8): [True: 0, False: 0]
  ------------------
 1657|      0|			zip->bzstream_valid = 0;
 1658|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1659|      0|		}
 1660|      0|		zip->bzstream_valid = 1;
 1661|      0|		zip->bzstream.total_in_lo32 = 0;
 1662|      0|		zip->bzstream.total_in_hi32 = 0;
 1663|      0|		zip->bzstream.total_out_lo32 = 0;
 1664|      0|		zip->bzstream.total_out_hi32 = 0;
 1665|      0|		break;
 1666|       |#else
 1667|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1668|       |		    "BZ2 codec is unsupported");
 1669|       |		return (ARCHIVE_FAILED);
 1670|       |#endif
 1671|      0|	case _7Z_ZSTD:
  ------------------
  |  |  118|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1671:2): [True: 0, False: 754]
  ------------------
 1672|      0|	{
 1673|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1674|       |		if (zip->zstdstream_valid) {
 1675|       |			ZSTD_freeDStream(zip->zstd_dstream);
 1676|       |			zip->zstdstream_valid = 0;
 1677|       |		}
 1678|       |		zip->zstd_dstream = ZSTD_createDStream();
 1679|       |		zip->zstdstream_valid = 1;
 1680|       |		break;
 1681|       |#else
 1682|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1683|      0|			"ZSTD codec is unsupported");
 1684|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1685|      0|#endif
 1686|      0|	}
 1687|      2|	case _7Z_DEFLATE:
  ------------------
  |  |   99|      2|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1687:2): [True: 2, False: 752]
  ------------------
 1688|      2|#ifdef HAVE_ZLIB_H
 1689|      2|		if (zip->stream_valid)
  ------------------
  |  Branch (1689:7): [True: 0, False: 2]
  ------------------
 1690|      0|			r = inflateReset(&(zip->stream));
 1691|      2|		else
 1692|      2|			r = inflateInit2(&(zip->stream),
 1693|      2|			    -15 /* Don't check for zlib header */);
 1694|      2|		if (r != Z_OK) {
  ------------------
  |  Branch (1694:7): [True: 0, False: 2]
  ------------------
 1695|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1696|      0|			    "Couldn't initialize zlib stream");
 1697|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1698|      0|		}
 1699|      2|		zip->stream_valid = 1;
 1700|      2|		zip->stream.total_in = 0;
 1701|      2|		zip->stream.total_out = 0;
 1702|      2|		break;
 1703|       |#else
 1704|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1705|       |		    "DEFLATE codec is unsupported");
 1706|       |		return (ARCHIVE_FAILED);
 1707|       |#endif
 1708|    190|	case _7Z_PPMD:
  ------------------
  |  |  101|    190|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1708:2): [True: 190, False: 564]
  ------------------
 1709|    190|	{
 1710|    190|		unsigned order;
 1711|    190|		uint32_t msize;
 1712|       |
 1713|    190|		if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1713:7): [True: 0, False: 190]
  ------------------
 1714|      0|			__archive_ppmd7_functions.Ppmd7_Free(
 1715|      0|			    &zip->ppmd7_context);
 1716|      0|			zip->ppmd7_valid = 0;
 1717|      0|		}
 1718|       |
 1719|    190|		if (coder1->propertiesSize < 5) {
  ------------------
  |  Branch (1719:7): [True: 1, False: 189]
  ------------------
 1720|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1721|      1|			    "Malformed PPMd parameter");
 1722|      1|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1723|      1|		}
 1724|    189|		order = coder1->properties[0];
 1725|    189|		msize = archive_le32dec(&(coder1->properties[1]));
 1726|    189|		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   18|    378|#define PPMD7_MIN_ORDER 2
  ------------------
              		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   19|    377|#define PPMD7_MAX_ORDER 64
  ------------------
  |  Branch (1726:7): [True: 1, False: 188]
  |  Branch (1726:34): [True: 1, False: 187]
  ------------------
 1727|    187|		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   21|    376|#define PPMD7_MIN_MEM_SIZE (1 << 11)
  ------------------
              		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   22|    184|#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3)
  ------------------
  |  Branch (1727:7): [True: 3, False: 184]
  |  Branch (1727:37): [True: 1, False: 183]
  ------------------
 1728|      6|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1729|      6|			    "Malformed PPMd parameter");
 1730|      6|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1731|      6|		}
 1732|       |		/*
 1733|       |		 * PPMd cannot grow this pool incrementally;
 1734|       |		 * Ppmd7_Alloc() mallocs the full msize.
 1735|       |		 */
 1736|    183|		if (msize > MAX_DECODER_SIZE) {
  ------------------
  |  |   72|    183|#define MAX_DECODER_SIZE	(576 * 1024 * 1024)
  ------------------
  |  Branch (1736:7): [True: 16, False: 167]
  ------------------
 1737|     16|			archive_set_error(&a->archive, ENOMEM,
 1738|     16|			    "PPMd dictionary exceeds decoder memory limit");
 1739|     16|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1740|     16|		}
 1741|    167|		__archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context);
 1742|    167|		r = __archive_ppmd7_functions.Ppmd7_Alloc(
 1743|    167|			&zip->ppmd7_context, msize);
 1744|    167|		if (r == 0) {
  ------------------
  |  Branch (1744:7): [True: 0, False: 167]
  ------------------
 1745|      0|			archive_set_error(&a->archive, ENOMEM,
 1746|      0|			    "Coludn't allocate memory for PPMd");
 1747|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1748|      0|		}
 1749|    167|		__archive_ppmd7_functions.Ppmd7_Init(
 1750|    167|			&zip->ppmd7_context, order);
 1751|    167|		__archive_ppmd7_functions.Ppmd7z_RangeDec_CreateVTable(
 1752|    167|			&zip->range_dec);
 1753|    167|		zip->ppmd7_valid = 1;
 1754|    167|		zip->ppmd7_stat = 0;
 1755|    167|		zip->ppstream.overconsumed = 0;
 1756|    167|		break;
 1757|    167|	}
 1758|      0|	case _7Z_X86:
  ------------------
  |  |  108|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1758:2): [True: 0, False: 754]
  ------------------
 1759|      0|	case _7Z_X86_BCJ2:
  ------------------
  |  |  109|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1759:2): [True: 0, False: 754]
  ------------------
 1760|      0|	case _7Z_POWERPC:
  ------------------
  |  |  110|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1760:2): [True: 0, False: 754]
  ------------------
 1761|      1|	case _7Z_IA64:
  ------------------
  |  |  111|      1|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1761:2): [True: 1, False: 753]
  ------------------
 1762|      2|	case _7Z_ARM:
  ------------------
  |  |  112|      2|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1762:2): [True: 1, False: 753]
  ------------------
 1763|      3|	case _7Z_ARMTHUMB:
  ------------------
  |  |  113|      3|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1763:2): [True: 1, False: 753]
  ------------------
 1764|      4|	case _7Z_ARM64:
  ------------------
  |  |  114|      4|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1764:2): [True: 1, False: 753]
  ------------------
 1765|      5|	case _7Z_RISCV:
  ------------------
  |  |  115|      5|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1765:2): [True: 1, False: 753]
  ------------------
 1766|      5|	case _7Z_SPARC:
  ------------------
  |  |  116|      5|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1766:2): [True: 0, False: 754]
  ------------------
 1767|      6|	case _7Z_DELTA:
  ------------------
  |  |  102|      6|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1767:2): [True: 1, False: 753]
  ------------------
 1768|      6|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1769|      6|		    "Unexpected codec ID: %jX", (uintmax_t)zip->codec);
 1770|      6|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1771|      0|	case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (1771:2): [True: 0, False: 754]
  ------------------
 1772|      0|	case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  104|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (1772:2): [True: 0, False: 754]
  ------------------
 1773|      0|	case _7Z_CRYPTO_AES_256_SHA_256:
  ------------------
  |  |  105|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1773:2): [True: 0, False: 754]
  ------------------
 1774|      0|		if (a->entry) {
  ------------------
  |  Branch (1774:7): [True: 0, False: 0]
  ------------------
 1775|      0|			archive_entry_set_is_metadata_encrypted(a->entry, 1);
 1776|      0|			archive_entry_set_is_data_encrypted(a->entry, 1);
 1777|      0|			zip->has_encrypted_entries = 1;
 1778|      0|		}
 1779|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1780|      0|		    "Crypto codec not supported yet (ID: 0x%jX)",
 1781|      0|		    (uintmax_t)zip->codec);
 1782|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1783|     52|	default:
  ------------------
  |  Branch (1783:2): [True: 52, False: 702]
  ------------------
 1784|     52|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     52|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1785|     52|		    "Unknown codec ID: %jX", (uintmax_t)zip->codec);
 1786|     52|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     52|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1787|    754|	}
 1788|       |
 1789|    666|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    666|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1790|    754|}
archive_read_support_format_7zip.c:x86_Init:
 4384|     46|{
 4385|     46|	zip->bcj_state = 0;
 4386|     46|	zip->bcj_prevPosT = (size_t)0 - 1;
 4387|     46|	zip->bcj_prevMask = 0;
 4388|     46|	zip->bcj_ip = 5;
 4389|     46|}
archive_read_support_format_7zip.c:arm_Init:
 4470|     10|{
 4471|     10|	zip->bcj_ip = 8;
 4472|     10|}
archive_read_support_format_7zip.c:armthumb_Init:
 4514|     14|{
 4515|     14|	zip->bcj_ip = 4;
 4516|     14|}
archive_read_support_format_7zip.c:delta_Init:
 4919|     11|{
 4920|     11|	zip->delta_dist = dist;
 4921|     11|	zip->delta_pos = 0;
 4922|     11|	memset(zip->delta_history, 0, sizeof(zip->delta_history));
 4923|     11|}
archive_read_support_format_7zip.c:set_error:
 1309|      4|{
 1310|       |
 1311|      4|	switch (ret) {
 1312|      0|	case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1312:2): [True: 0, False: 4]
  ------------------
 1313|      0|	case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1313:2): [True: 0, False: 4]
  ------------------
 1314|      0|		break;
 1315|      0|	case LZMA_MEM_ERROR:
  ------------------
  |  Branch (1315:2): [True: 0, False: 4]
  ------------------
 1316|      0|		archive_set_error(&a->archive, ENOMEM,
 1317|      0|		    "Lzma library error: Cannot allocate memory");
 1318|      0|		break;
 1319|      0|	case LZMA_MEMLIMIT_ERROR:
  ------------------
  |  Branch (1319:2): [True: 0, False: 4]
  ------------------
 1320|      0|		archive_set_error(&a->archive, ENOMEM,
 1321|      0|		    "Lzma library error: Out of memory");
 1322|      0|		break;
 1323|      0|	case LZMA_FORMAT_ERROR:
  ------------------
  |  Branch (1323:2): [True: 0, False: 4]
  ------------------
 1324|      0|		archive_set_error(&a->archive,
 1325|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1326|      0|		    "Lzma library error: format not recognized");
 1327|      0|		break;
 1328|      4|	case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (1328:2): [True: 4, False: 0]
  ------------------
 1329|      4|		archive_set_error(&a->archive,
 1330|      4|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1331|      4|		    "Lzma library error: Invalid options");
 1332|      4|		break;
 1333|      0|	case LZMA_DATA_ERROR:
  ------------------
  |  Branch (1333:2): [True: 0, False: 4]
  ------------------
 1334|      0|		archive_set_error(&a->archive,
 1335|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1336|      0|		    "Lzma library error: Corrupted input data");
 1337|      0|		break;
 1338|      0|	case LZMA_BUF_ERROR:
  ------------------
  |  Branch (1338:2): [True: 0, False: 4]
  ------------------
 1339|      0|		archive_set_error(&a->archive,
 1340|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1341|      0|		    "Lzma library error:  No progress is possible");
 1342|      0|		break;
 1343|      0|	default:
  ------------------
  |  Branch (1343:2): [True: 0, False: 4]
  ------------------
 1344|       |		/* Return an error. */
 1345|      0|		archive_set_error(&a->archive,
 1346|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1347|      0|		    "Lzma decompression failed:  Unknown error");
 1348|      0|		break;
 1349|      4|	}
 1350|      4|}
archive_read_support_format_7zip.c:seek_pack:
 3873|    707|{
 3874|    707|	struct _7zip *zip = a->format->data;
 3875|    707|	int64_t pack_offset;
 3876|       |
 3877|    707|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3877:6): [True: 6, False: 701]
  ------------------
 3878|      6|		archive_set_error(&(a->archive),
 3879|      6|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3880|      6|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3881|      6|	}
 3882|    701|	zip->pack_stream_inbytes_remaining =
 3883|    701|	    zip->si.pi.sizes[zip->pack_stream_index];
 3884|    701|	pack_offset = zip->si.pi.positions[zip->pack_stream_index];
 3885|    701|	if (zip->stream_offset != pack_offset) {
  ------------------
  |  Branch (3885:6): [True: 577, False: 124]
  ------------------
 3886|    577|		int64_t target;
 3887|       |
 3888|    577|		if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3888:7): [True: 0, False: 577]
  ------------------
 3889|    577|		    zip->seek_base, pack_offset) ||
 3890|    577|		    0 > seek_compat(a, target, SEEK_SET, 1)) {
  ------------------
  |  Branch (3890:7): [True: 1, False: 576]
  ------------------
 3891|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3892|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3893|      1|		}
 3894|    576|		zip->stream_offset = pack_offset;
 3895|    576|	}
 3896|    700|	zip->pack_stream_index++;
 3897|    700|	zip->pack_stream_remaining--;
 3898|    700|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    700|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3899|    701|}
archive_read_support_format_7zip.c:free_StreamsInfo:
 2870|  20.7k|{
 2871|  20.7k|	free_PackInfo(&(si->pi));
 2872|  20.7k|	free_CodersInfo(&(si->ci));
 2873|  20.7k|	free_SubStreamsInfo(&(si->ss));
 2874|  20.7k|}
archive_read_support_format_7zip.c:free_PackInfo:
 2344|  20.7k|{
 2345|  20.7k|	free(pi->sizes);
 2346|  20.7k|	free(pi->positions);
 2347|  20.7k|	free_Digest(&(pi->digest));
 2348|  20.7k|}
archive_read_support_format_7zip.c:free_CodersInfo:
 2575|  20.7k|{
 2576|  20.7k|	size_t i;
 2577|       |
 2578|  20.7k|	if (ci->folders) {
  ------------------
  |  Branch (2578:6): [True: 1.48k, False: 19.2k]
  ------------------
 2579|  2.50M|		for (i = 0; i < ci->numFolders; i++)
  ------------------
  |  Branch (2579:15): [True: 2.50M, False: 1.48k]
  ------------------
 2580|  2.50M|			free_Folder(&(ci->folders[i]));
 2581|  1.48k|		free(ci->folders);
 2582|  1.48k|	}
 2583|  20.7k|}
archive_read_support_format_7zip.c:free_Folder:
 2426|  2.50M|{
 2427|  2.50M|	if (f->coders) {
  ------------------
  |  Branch (2427:6): [True: 2.42k, False: 2.49M]
  ------------------
 2428|  2.42k|		size_t i;
 2429|       |
 2430|  6.36k|		for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2430:15): [True: 3.94k, False: 2.42k]
  ------------------
 2431|  3.94k|			free(f->coders[i].properties);
 2432|  3.94k|		}
 2433|  2.42k|		free(f->coders);
 2434|  2.42k|	}
 2435|  2.50M|	free(f->bindPairs);
 2436|  2.50M|	free(f->unPackSize);
 2437|  2.50M|}
archive_read_support_format_7zip.c:free_SubStreamsInfo:
 2715|  20.7k|{
 2716|  20.7k|	free(ss->unpackSizes);
 2717|  20.7k|	free(ss->digestsDefined);
 2718|  20.7k|	free(ss->digests);
 2719|  20.7k|}
archive_read_support_format_7zip.c:read_Header:
 2980|  2.02k|{
 2981|  2.02k|	struct _7zip *zip = a->format->data;
 2982|  2.02k|	const unsigned char *p;
 2983|  2.02k|	struct _7z_folder *folders;
 2984|  2.02k|	struct _7z_stream_info *si = &(zip->si);
 2985|  2.02k|	struct _7zip_entry *entries;
 2986|  2.02k|	size_t folderIndex, indexInFolder;
 2987|  2.02k|	size_t i;
 2988|  2.02k|	size_t eindex, empty_streams, sindex;
 2989|  2.02k|	int attr_seen = 0;
 2990|       |
 2991|  2.02k|	if (check_header_id) {
  ------------------
  |  Branch (2991:6): [True: 421, False: 1.60k]
  ------------------
 2992|       |		/*
 2993|       |		 * Read Header.
 2994|       |		 */
 2995|    421|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2995:7): [True: 191, False: 230]
  ------------------
 2996|    191|			return (-1);
 2997|    230|		if (*p != kHeader)
  ------------------
  |  |  124|    230|#define kHeader			0x01
  ------------------
  |  Branch (2997:7): [True: 128, False: 102]
  ------------------
 2998|    128|			return (-1);
 2999|    230|	}
 3000|       |
 3001|       |	/*
 3002|       |	 * Read ArchiveProperties.
 3003|       |	 */
 3004|  1.70k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3004:6): [True: 0, False: 1.70k]
  ------------------
 3005|      0|		return (-1);
 3006|  1.70k|	if (*p == kArchiveProperties) {
  ------------------
  |  |  125|  1.70k|#define kArchiveProperties	0x02
  ------------------
  |  Branch (3006:6): [True: 85, False: 1.62k]
  ------------------
 3007|  1.30k|		for (;;) {
 3008|  1.30k|			int64_t size;
 3009|  1.30k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3009:8): [True: 3, False: 1.30k]
  ------------------
 3010|      3|				return (-1);
 3011|  1.30k|			if (*p == kEnd)
  ------------------
  |  |  123|  1.30k|#define kEnd			0x00
  ------------------
  |  Branch (3011:8): [True: 7, False: 1.29k]
  ------------------
 3012|      7|				break;
 3013|  1.29k|			if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (3013:8): [True: 12, False: 1.28k]
  ------------------
 3014|     12|				return (-1);
 3015|  1.28k|			if (size < 0 || zip->header_bytes_remaining < size)
  ------------------
  |  Branch (3015:8): [True: 0, False: 1.28k]
  |  Branch (3015:20): [True: 1, False: 1.28k]
  ------------------
 3016|      1|				return (-1);
 3017|       |
 3018|       |			/* Skip the property data to keep header parsing aligned. */
 3019|  2.31k|			while (size > 0) {
  ------------------
  |  Branch (3019:11): [True: 1.09k, False: 1.22k]
  ------------------
 3020|  1.09k|				int64_t skip = size;
 3021|       |
 3022|  1.09k|				if (skip > UBUFF_SIZE)
  ------------------
  |  |  294|  1.09k|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (3022:9): [True: 59, False: 1.03k]
  ------------------
 3023|     59|					skip = UBUFF_SIZE;
  ------------------
  |  |  294|     59|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3024|  1.09k|				if (header_bytes(a, (size_t)skip) == NULL)
  ------------------
  |  Branch (3024:9): [True: 62, False: 1.03k]
  ------------------
 3025|     62|					return (-1);
 3026|  1.03k|				size -= skip;
 3027|  1.03k|			}
 3028|  1.28k|		}
 3029|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3029:7): [True: 0, False: 7]
  ------------------
 3030|      0|			return (-1);
 3031|      7|	}
 3032|       |
 3033|       |	/*
 3034|       |	 * Read MainStreamsInfo.
 3035|       |	 */
 3036|  1.62k|	if (*p == kMainStreamsInfo) {
  ------------------
  |  |  127|  1.62k|#define kMainStreamsInfo	0x04
  ------------------
  |  Branch (3036:6): [True: 1.15k, False: 474]
  ------------------
 3037|  1.15k|		if (read_StreamsInfo(a, &(zip->si)) < 0)
  ------------------
  |  Branch (3037:7): [True: 932, False: 221]
  ------------------
 3038|    932|			return (-1);
 3039|    221|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3039:7): [True: 7, False: 214]
  ------------------
 3040|      7|			return (-1);
 3041|    221|	}
 3042|    688|	if (*p == kEnd)
  ------------------
  |  |  123|    688|#define kEnd			0x00
  ------------------
  |  Branch (3042:6): [True: 8, False: 680]
  ------------------
 3043|      8|		return (0);
 3044|       |
 3045|       |	/*
 3046|       |	 * Read FilesInfo.
 3047|       |	 */
 3048|    680|	if (*p != kFilesInfo)
  ------------------
  |  |  128|    680|#define kFilesInfo		0x05
  ------------------
  |  Branch (3048:6): [True: 15, False: 665]
  ------------------
 3049|     15|		return (-1);
 3050|       |
 3051|    665|	if (parse_7zip_size(a, &(zip->numFiles)) < 0)
  ------------------
  |  Branch (3051:6): [True: 23, False: 642]
  ------------------
 3052|     23|		return (-1);
 3053|    642|	if (!files_info_numfiles_is_sane(zip))
  ------------------
  |  Branch (3053:6): [True: 2, False: 640]
  ------------------
 3054|      2|		return (-1);
 3055|       |
 3056|    640|	zip->entries = calloc(zip->numFiles, sizeof(*zip->entries));
 3057|    640|	if (zip->entries == NULL)
  ------------------
  |  Branch (3057:6): [True: 0, False: 640]
  ------------------
 3058|      0|		return (-1);
 3059|    640|	entries = zip->entries;
 3060|       |
 3061|    640|	empty_streams = 0;
 3062|  7.90k|	for (;;) {
 3063|  7.90k|		int type;
 3064|  7.90k|		int64_t size;
 3065|  7.90k|		size_t ll;
 3066|       |
 3067|  7.90k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3067:7): [True: 12, False: 7.89k]
  ------------------
 3068|     12|			return (-1);
 3069|  7.89k|		type = *p;
 3070|  7.89k|		if (type == kEnd)
  ------------------
  |  |  123|  7.89k|#define kEnd			0x00
  ------------------
  |  Branch (3070:7): [True: 312, False: 7.58k]
  ------------------
 3071|    312|			break;
 3072|       |
 3073|  7.58k|		if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (3073:7): [True: 39, False: 7.54k]
  ------------------
 3074|     39|			return (-1);
 3075|  7.54k|		if (zip->header_bytes_remaining < size ||
  ------------------
  |  Branch (3075:7): [True: 14, False: 7.52k]
  ------------------
 3076|  7.52k|		    size > (int64_t)(SIZE_MAX / 4))
  ------------------
  |  Branch (3076:7): [True: 2, False: 7.52k]
  ------------------
 3077|     16|			return (-1);
 3078|  7.52k|		ll = (size_t)size;
 3079|       |
 3080|  7.52k|		switch (type) {
 3081|    293|		case kEmptyStream:
  ------------------
  |  |  137|    293|#define kEmptyStream		0x0E
  ------------------
  |  Branch (3081:3): [True: 293, False: 7.23k]
  ------------------
 3082|    293|			if (h->emptyStreamBools != NULL)
  ------------------
  |  Branch (3082:8): [True: 1, False: 292]
  ------------------
 3083|      1|				return (-1);
 3084|    292|			h->emptyStreamBools = calloc(zip->numFiles,
 3085|    292|			    sizeof(*h->emptyStreamBools));
 3086|    292|			if (h->emptyStreamBools == NULL)
  ------------------
  |  Branch (3086:8): [True: 0, False: 292]
  ------------------
 3087|      0|				return (-1);
 3088|    292|			if (read_Bools(
  ------------------
  |  Branch (3088:8): [True: 0, False: 292]
  ------------------
 3089|    292|			    a, h->emptyStreamBools, zip->numFiles) < 0)
 3090|      0|				return (-1);
 3091|    292|			empty_streams = 0;
 3092|  19.9k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3092:16): [True: 19.6k, False: 292]
  ------------------
 3093|  19.6k|				if (h->emptyStreamBools[i])
  ------------------
  |  Branch (3093:9): [True: 14.0k, False: 5.56k]
  ------------------
 3094|  14.0k|					empty_streams++;
 3095|  19.6k|			}
 3096|    292|			break;
 3097|    236|		case kEmptyFile:
  ------------------
  |  |  138|    236|#define kEmptyFile		0x0F
  ------------------
  |  Branch (3097:3): [True: 236, False: 7.28k]
  ------------------
 3098|    236|			if (empty_streams <= 0) {
  ------------------
  |  Branch (3098:8): [True: 212, False: 24]
  ------------------
 3099|       |				/* Unexcepted sequence. Skip this. */
 3100|    212|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3100:9): [True: 3, False: 209]
  ------------------
 3101|      3|					return (-1);
 3102|    209|				break;
 3103|    212|			}
 3104|     24|			if (h->emptyFileBools != NULL)
  ------------------
  |  Branch (3104:8): [True: 1, False: 23]
  ------------------
 3105|      1|				return (-1);
 3106|     23|			h->emptyFileBools = calloc(empty_streams,
 3107|     23|			    sizeof(*h->emptyFileBools));
 3108|     23|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (3108:8): [True: 0, False: 23]
  ------------------
 3109|      0|				return (-1);
 3110|     23|			if (read_Bools(a, h->emptyFileBools, empty_streams) < 0)
  ------------------
  |  Branch (3110:8): [True: 1, False: 22]
  ------------------
 3111|      1|				return (-1);
 3112|     22|			break;
 3113|    237|		case kAnti:
  ------------------
  |  |  139|    237|#define kAnti			0x10
  ------------------
  |  Branch (3113:3): [True: 237, False: 7.28k]
  ------------------
 3114|    237|			if (empty_streams <= 0) {
  ------------------
  |  Branch (3114:8): [True: 229, False: 8]
  ------------------
 3115|       |				/* Unexcepted sequence. Skip this. */
 3116|    229|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3116:9): [True: 2, False: 227]
  ------------------
 3117|      2|					return (-1);
 3118|    227|				break;
 3119|    229|			}
 3120|      8|			if (h->antiBools != NULL)
  ------------------
  |  Branch (3120:8): [True: 1, False: 7]
  ------------------
 3121|      1|				return (-1);
 3122|      7|			h->antiBools = calloc(empty_streams,
 3123|      7|			    sizeof(*h->antiBools));
 3124|      7|			if (h->antiBools == NULL)
  ------------------
  |  Branch (3124:8): [True: 0, False: 7]
  ------------------
 3125|      0|				return (-1);
 3126|      7|			if (read_Bools(a, h->antiBools, empty_streams) < 0)
  ------------------
  |  Branch (3126:8): [True: 0, False: 7]
  ------------------
 3127|      0|				return (-1);
 3128|      7|			break;
 3129|    484|		case kCTime:
  ------------------
  |  |  141|    484|#define kCTime			0x12
  ------------------
  |  Branch (3129:3): [True: 484, False: 7.04k]
  ------------------
 3130|  2.28k|		case kATime:
  ------------------
  |  |  142|  2.28k|#define kATime			0x13
  ------------------
  |  Branch (3130:3): [True: 1.80k, False: 5.72k]
  ------------------
 3131|  2.69k|		case kMTime:
  ------------------
  |  |  143|  2.69k|#define kMTime			0x14
  ------------------
  |  Branch (3131:3): [True: 403, False: 7.12k]
  ------------------
 3132|  2.69k|			if (read_Times(a, type) < 0)
  ------------------
  |  Branch (3132:8): [True: 141, False: 2.55k]
  ------------------
 3133|    141|				return (-1);
 3134|  2.55k|			break;
 3135|  2.55k|		case kName:
  ------------------
  |  |  140|    159|#define kName			0x11
  ------------------
  |  Branch (3135:3): [True: 159, False: 7.36k]
  ------------------
 3136|    159|		{
 3137|    159|			unsigned char *np;
 3138|    159|			size_t nl, nb;
 3139|       |
 3140|       |			/* Skip one byte. */
 3141|    159|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3141:8): [True: 0, False: 159]
  ------------------
 3142|      0|				return (-1);
 3143|    159|			ll--;
 3144|       |
 3145|    159|			if ((ll & 1) || ll < zip->numFiles * 4)
  ------------------
  |  Branch (3145:8): [True: 1, False: 158]
  |  Branch (3145:20): [True: 0, False: 158]
  ------------------
 3146|      1|				return (-1);
 3147|       |
 3148|    158|			if (zip->entry_names != NULL)
  ------------------
  |  Branch (3148:8): [True: 0, False: 158]
  ------------------
 3149|      0|				return (-1);
 3150|    158|			zip->entry_names = malloc(ll);
 3151|    158|			if (zip->entry_names == NULL)
  ------------------
  |  Branch (3151:8): [True: 1, False: 157]
  ------------------
 3152|      1|				return (-1);
 3153|    157|			np = zip->entry_names;
 3154|    157|			nb = ll;
 3155|       |			/*
 3156|       |			 * Copy whole file names.
 3157|       |			 * NOTE: This loop prevents from expanding
 3158|       |			 * the uncompressed buffer in order not to
 3159|       |			 * use extra memory resource.
 3160|       |			 */
 3161|    320|			while (nb) {
  ------------------
  |  Branch (3161:11): [True: 175, False: 145]
  ------------------
 3162|    175|				size_t b;
 3163|    175|				if (nb > UBUFF_SIZE)
  ------------------
  |  |  294|    175|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (3163:9): [True: 25, False: 150]
  ------------------
 3164|     25|					b = UBUFF_SIZE;
  ------------------
  |  |  294|     25|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3165|    150|				else
 3166|    150|					b = nb;
 3167|    175|				if ((p = header_bytes(a, b)) == NULL)
  ------------------
  |  Branch (3167:9): [True: 12, False: 163]
  ------------------
 3168|     12|					return (-1);
 3169|    163|				memcpy(np, p, b);
 3170|    163|				np += b;
 3171|    163|				nb -= b;
 3172|    163|			}
 3173|    145|			np = zip->entry_names;
 3174|    145|			nl = ll;
 3175|       |
 3176|  3.70k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3176:16): [True: 3.57k, False: 135]
  ------------------
 3177|  3.57k|				entries[i].utf16name = np;
 3178|       |#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
 3179|       |				entries[i].wname = (wchar_t *)np;
 3180|       |#endif
 3181|       |
 3182|       |				/* Find a terminator. */
 3183|  58.0k|				while (nl >= 2 && (np[0] || np[1])) {
  ------------------
  |  Branch (3183:12): [True: 58.0k, False: 10]
  |  Branch (3183:24): [True: 52.8k, False: 5.25k]
  |  Branch (3183:33): [True: 1.69k, False: 3.56k]
  ------------------
 3184|  54.5k|					np += 2;
 3185|  54.5k|					nl -= 2;
 3186|  54.5k|				}
 3187|  3.57k|				if (nl < 2)
  ------------------
  |  Branch (3187:9): [True: 10, False: 3.56k]
  ------------------
 3188|     10|					return (-1);/* Terminator not found */
 3189|  3.56k|				entries[i].name_len = np - entries[i].utf16name;
 3190|  3.56k|				np += 2;
 3191|  3.56k|				nl -= 2;
 3192|  3.56k|			}
 3193|    135|			break;
 3194|    145|		}
 3195|    163|		case kAttributes:
  ------------------
  |  |  144|    163|#define kAttributes		0x15
  ------------------
  |  Branch (3195:3): [True: 163, False: 7.36k]
  ------------------
 3196|    163|		{
 3197|    163|			int allAreDefined;
 3198|       |
 3199|    163|			if ((p = header_bytes(a, 2)) == NULL)
  ------------------
  |  Branch (3199:8): [True: 0, False: 163]
  ------------------
 3200|      0|				return (-1);
 3201|    163|			allAreDefined = *p;
 3202|    163|			if (attr_seen)
  ------------------
  |  Branch (3202:8): [True: 1, False: 162]
  ------------------
 3203|      1|				return (-1);
 3204|    162|			attr_seen = 1;
 3205|    162|			if (!allAreDefined) {
  ------------------
  |  Branch (3205:8): [True: 47, False: 115]
  ------------------
 3206|     47|				h->attrBools = calloc(zip->numFiles,
 3207|     47|				    sizeof(*h->attrBools));
 3208|     47|				if (h->attrBools == NULL)
  ------------------
  |  Branch (3208:9): [True: 0, False: 47]
  ------------------
 3209|      0|					return (-1);
 3210|     47|				if (read_Bools(a, h->attrBools,
  ------------------
  |  Branch (3210:9): [True: 2, False: 45]
  ------------------
 3211|     47|				    zip->numFiles) < 0)
 3212|      2|					return (-1);
 3213|     47|			}
 3214|  5.30k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3214:16): [True: 5.15k, False: 150]
  ------------------
 3215|  5.15k|				if (allAreDefined || h->attrBools[i]) {
  ------------------
  |  Branch (3215:9): [True: 2.58k, False: 2.57k]
  |  Branch (3215:26): [True: 982, False: 1.58k]
  ------------------
 3216|  3.56k|					if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (3216:10): [True: 10, False: 3.55k]
  ------------------
 3217|     10|						return (-1);
 3218|  3.55k|					entries[i].attr = archive_le32dec(p);
 3219|  3.55k|				}
 3220|  5.15k|			}
 3221|    150|			break;
 3222|    160|		}
 3223|  1.24k|		case kDummy:
  ------------------
  |  |  146|  1.24k|#define kDummy			0x19
  ------------------
  |  Branch (3223:3): [True: 1.24k, False: 6.27k]
  ------------------
 3224|  1.24k|			if (ll == 0)
  ------------------
  |  Branch (3224:8): [True: 92, False: 1.15k]
  ------------------
 3225|     92|				break;
 3226|  1.15k|			__LA_FALLTHROUGH;
 3227|  3.65k|		default:
  ------------------
  |  Branch (3227:3): [True: 2.49k, False: 5.02k]
  ------------------
 3228|  3.65k|			if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3228:8): [True: 74, False: 3.58k]
  ------------------
 3229|     74|				return (-1);
 3230|  3.58k|			break;
 3231|  7.52k|		}
 3232|  7.52k|	}
 3233|       |
 3234|       |	/*
 3235|       |	 * Set up entry's attributes.
 3236|       |	 */
 3237|    312|	folders = si->ci.folders;
 3238|    312|	eindex = sindex = 0;
 3239|    312|	folderIndex = indexInFolder = 0;
 3240|  8.07k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3240:14): [True: 7.80k, False: 270]
  ------------------
 3241|  7.80k|		if (h->emptyStreamBools == NULL || h->emptyStreamBools[i] == 0)
  ------------------
  |  Branch (3241:7): [True: 217, False: 7.58k]
  |  Branch (3241:38): [True: 253, False: 7.33k]
  ------------------
 3242|    470|			entries[i].flg |= HAS_STREAM;
  ------------------
  |  |  250|    470|#define HAS_STREAM	(1<<4)
  ------------------
 3243|       |		/* The high 16 bits of attributes is a posix file mode. */
 3244|  7.80k|		entries[i].mode = entries[i].attr >> 16;
 3245|       |
 3246|  7.80k|		if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
  ------------------
  |  |  170|  7.80k|#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
  ------------------
  |  Branch (3246:7): [True: 6.73k, False: 1.06k]
  ------------------
 3247|       |			// Only windows permissions specified for this entry. Translate to
 3248|       |			// reasonable corresponding unix permissions.
 3249|       |
 3250|  6.73k|			if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
  ------------------
  |  |  163|  6.73k|#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  ------------------
  |  Branch (3250:8): [True: 348, False: 6.38k]
  ------------------
 3251|    348|				if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  151|    348|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3251:9): [True: 178, False: 170]
  ------------------
 3252|       |					// Read-only directory.
 3253|    178|					entries[i].mode = AE_IFDIR | 0555;
  ------------------
  |  |  221|    178|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3254|    178|				} else {
 3255|       |					// Read-write directory.
 3256|    170|					entries[i].mode = AE_IFDIR | 0755;
  ------------------
  |  |  221|    170|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3257|    170|				}
 3258|  6.38k|			} else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  151|  6.38k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3258:15): [True: 274, False: 6.11k]
  ------------------
 3259|       |				// Readonly file.
 3260|    274|				entries[i].mode = AE_IFREG | 0444;
  ------------------
  |  |  216|    274|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3261|  6.11k|			} else {
 3262|       |				// Assume read-write file.
 3263|  6.11k|				entries[i].mode = AE_IFREG | 0644;
  ------------------
  |  |  216|  6.11k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3264|  6.11k|			}
 3265|  6.73k|		}
 3266|       |
 3267|  7.80k|		if (entries[i].flg & HAS_STREAM) {
  ------------------
  |  |  250|  7.80k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3267:7): [True: 470, False: 7.33k]
  ------------------
 3268|    470|			if (sindex >= si->ss.unpack_streams)
  ------------------
  |  Branch (3268:8): [True: 42, False: 428]
  ------------------
 3269|     42|				return (-1);
 3270|    428|			if (entries[i].mode == 0)
  ------------------
  |  Branch (3270:8): [True: 1, False: 427]
  ------------------
 3271|      1|				entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      1|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3272|    428|			if (si->ss.digestsDefined[sindex])
  ------------------
  |  Branch (3272:8): [True: 265, False: 163]
  ------------------
 3273|    265|				entries[i].flg |= CRC32_IS_SET;
  ------------------
  |  |  249|    265|#define CRC32_IS_SET	(1<<3)
  ------------------
 3274|    428|			entries[i].ssIndex = sindex;
 3275|    428|			sindex++;
 3276|  7.33k|		} else {
 3277|  7.33k|			int dir = 1;
 3278|       |
 3279|  7.33k|			if (h->emptyFileBools != NULL) {
  ------------------
  |  Branch (3279:8): [True: 993, False: 6.33k]
  ------------------
 3280|    993|				dir = !h->emptyFileBools[eindex];
 3281|    993|				eindex++;
 3282|    993|			}
 3283|  7.33k|			if (entries[i].mode == 0) {
  ------------------
  |  Branch (3283:8): [True: 232, False: 7.09k]
  ------------------
 3284|    232|				if (dir)
  ------------------
  |  Branch (3284:9): [True: 158, False: 74]
  ------------------
 3285|    158|					entries[i].mode = AE_IFDIR | 0777;
  ------------------
  |  |  221|    158|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3286|     74|				else
 3287|     74|					entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|     74|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3288|  7.09k|			} else if (dir &&
  ------------------
  |  Branch (3288:15): [True: 6.71k, False: 388]
  ------------------
 3289|  6.71k|			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  6.71k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  6.71k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3289:8): [True: 6.34k, False: 362]
  ------------------
 3290|  6.34k|				entries[i].mode &= ~AE_IFMT;
  ------------------
  |  |  215|  6.34k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 3291|  6.34k|				entries[i].mode |= AE_IFDIR;
  ------------------
  |  |  221|  6.34k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3292|  6.34k|			}
 3293|  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 (3293:8): [True: 6.91k, False: 413]
  ------------------
 3294|  6.91k|			    entries[i].name_len >= 2 &&
  ------------------
  |  Branch (3294:8): [True: 908, False: 6.01k]
  ------------------
 3295|    908|			    (entries[i].utf16name[entries[i].name_len-2] != '/' ||
  ------------------
  |  Branch (3295:9): [True: 853, False: 55]
  ------------------
 3296|    877|			     entries[i].utf16name[entries[i].name_len-1] != 0)) {
  ------------------
  |  Branch (3296:9): [True: 24, False: 31]
  ------------------
 3297|    877|				entries[i].utf16name[entries[i].name_len] = '/';
 3298|    877|				entries[i].utf16name[entries[i].name_len+1] = 0;
 3299|    877|				entries[i].name_len += 2;
 3300|    877|			}
 3301|  7.33k|			entries[i].ssIndex = -1;
 3302|  7.33k|		}
 3303|  7.75k|		if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  151|  7.75k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3303:7): [True: 956, False: 6.80k]
  ------------------
 3304|    956|			entries[i].mode &= ~0222;/* Read only. */
 3305|       |
 3306|  7.75k|		if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
  ------------------
  |  |  250|  7.75k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3306:7): [True: 7.33k, False: 428]
  |  Branch (3306:45): [True: 7.23k, False: 97]
  ------------------
 3307|       |			/*
 3308|       |			 * The entry is an empty file or a directory file,
 3309|       |			 * those both have no contents.
 3310|       |			 */
 3311|  7.23k|			entries[i].folderIndex = -1;
 3312|  7.23k|			continue;
 3313|  7.23k|		}
 3314|    525|		if (indexInFolder == 0) {
  ------------------
  |  Branch (3314:7): [True: 151, False: 374]
  ------------------
 3315|    151|			for (;;) {
 3316|    151|				if (folderIndex >= si->ci.numFolders)
  ------------------
  |  Branch (3316:9): [True: 0, False: 151]
  ------------------
 3317|      0|					return (-1);
 3318|    151|				if (folders[folderIndex].numUnpackStreams)
  ------------------
  |  Branch (3318:9): [True: 151, False: 0]
  ------------------
 3319|    151|					break;
 3320|      0|				folderIndex++;
 3321|      0|			}
 3322|    151|		}
 3323|    525|		entries[i].folderIndex = folderIndex;
 3324|    525|		if ((entries[i].flg & HAS_STREAM) == 0)
  ------------------
  |  |  250|    525|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3324:7): [True: 97, False: 428]
  ------------------
 3325|     97|			continue;
 3326|    428|		indexInFolder++;
 3327|    428|		if (indexInFolder >= folders[folderIndex].numUnpackStreams) {
  ------------------
  |  Branch (3327:7): [True: 133, False: 295]
  ------------------
 3328|    133|			folderIndex++;
 3329|    133|			indexInFolder = 0;
 3330|    133|		}
 3331|    428|	}
 3332|       |
 3333|    270|	return (0);
 3334|    312|}
archive_read_support_format_7zip.c:files_info_numfiles_is_sane:
 2964|    642|{
 2965|    642|	int64_t empty_stream_map_bytes;
 2966|       |
 2967|    642|	if (zip->numFiles > SIZE_MAX / sizeof(*zip->entries))
  ------------------
  |  Branch (2967:6): [True: 0, False: 642]
  ------------------
 2968|      0|		return (0);
 2969|       |
 2970|    642|	if (zip->numFiles <= zip->si.ss.unpack_streams)
  ------------------
  |  Branch (2970:6): [True: 150, False: 492]
  ------------------
 2971|    150|		return (1);
 2972|       |
 2973|    492|	empty_stream_map_bytes = (zip->numFiles + 7) / 8;
 2974|    492|	return (empty_stream_map_bytes <= zip->header_bytes_remaining);
 2975|    642|}
archive_read_support_format_7zip.c:read_Times:
 3338|  2.69k|{
 3339|  2.69k|	struct _7zip *zip = a->format->data;
 3340|  2.69k|	const unsigned char *p;
 3341|  2.69k|	struct _7zip_entry *entries = zip->entries;
 3342|  2.69k|	unsigned char *timeBools = NULL;
 3343|  2.69k|	int allAreDefined;
 3344|  2.69k|	size_t dataIndex, i;
 3345|       |
 3346|       |	/* Read allAreDefined. */
 3347|  2.69k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3347:6): [True: 3, False: 2.68k]
  ------------------
 3348|      3|		goto failed;
 3349|  2.68k|	allAreDefined = *p;
 3350|       |
 3351|  2.68k|	if (!allAreDefined) {
  ------------------
  |  Branch (3351:6): [True: 828, False: 1.86k]
  ------------------
 3352|    828|		timeBools = calloc(zip->numFiles, sizeof(*timeBools));
 3353|    828|		if (timeBools == NULL)
  ------------------
  |  Branch (3353:7): [True: 0, False: 828]
  ------------------
 3354|      0|			goto failed;
 3355|    828|		if (read_Bools(a, timeBools, zip->numFiles) < 0)
  ------------------
  |  Branch (3355:7): [True: 10, False: 818]
  ------------------
 3356|     10|			goto failed;
 3357|    828|	}
 3358|       |
 3359|       |	/* Read external. */
 3360|  2.67k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3360:6): [True: 6, False: 2.67k]
  ------------------
 3361|      6|		goto failed;
 3362|  2.67k|	if (*p) {
  ------------------
  |  Branch (3362:6): [True: 2.16k, False: 510]
  ------------------
 3363|  2.16k|		if (parse_7zip_size(a, &dataIndex) < 0)
  ------------------
  |  Branch (3363:7): [True: 51, False: 2.11k]
  ------------------
 3364|     51|			goto failed;
 3365|  2.16k|	}
 3366|       |
 3367|  8.77k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3367:14): [True: 6.22k, False: 2.55k]
  ------------------
 3368|  6.22k|		if (!allAreDefined && !timeBools[i])
  ------------------
  |  Branch (3368:7): [True: 3.91k, False: 2.31k]
  |  Branch (3368:25): [True: 2.87k, False: 1.03k]
  ------------------
 3369|  2.87k|			continue;
 3370|  3.34k|		if ((p = header_bytes(a, 8)) == NULL)
  ------------------
  |  Branch (3370:7): [True: 71, False: 3.27k]
  ------------------
 3371|     71|			goto failed;
 3372|  3.27k|		switch (type) {
  ------------------
  |  Branch (3372:11): [True: 3.27k, False: 0]
  ------------------
 3373|    562|		case kCTime:
  ------------------
  |  |  141|    562|#define kCTime			0x12
  ------------------
  |  Branch (3373:3): [True: 562, False: 2.71k]
  ------------------
 3374|    562|			__archive_ntfs_to_unix(archive_le64dec(p),
 3375|    562|			    &(entries[i].ctime),
 3376|    562|			    &(entries[i].ctime_ns));
 3377|    562|			entries[i].flg |= CTIME_IS_SET;
  ------------------
  |  |  248|    562|#define CTIME_IS_SET	(1<<2)
  ------------------
 3378|    562|			break;
 3379|  1.56k|		case kATime:
  ------------------
  |  |  142|  1.56k|#define kATime			0x13
  ------------------
  |  Branch (3379:3): [True: 1.56k, False: 1.71k]
  ------------------
 3380|  1.56k|			__archive_ntfs_to_unix(archive_le64dec(p),
 3381|  1.56k|			    &(entries[i].atime),
 3382|  1.56k|			    &(entries[i].atime_ns));
 3383|  1.56k|			entries[i].flg |= ATIME_IS_SET;
  ------------------
  |  |  247|  1.56k|#define ATIME_IS_SET	(1<<1)
  ------------------
 3384|  1.56k|			break;
 3385|  1.14k|		case kMTime:
  ------------------
  |  |  143|  1.14k|#define kMTime			0x14
  ------------------
  |  Branch (3385:3): [True: 1.14k, False: 2.12k]
  ------------------
 3386|  1.14k|			__archive_ntfs_to_unix(archive_le64dec(p),
 3387|  1.14k|			    &(entries[i].mtime),
 3388|  1.14k|			    &(entries[i].mtime_ns));
 3389|  1.14k|			entries[i].flg |= MTIME_IS_SET;
  ------------------
  |  |  246|  1.14k|#define MTIME_IS_SET	(1<<0)
  ------------------
 3390|  1.14k|			break;
 3391|  3.27k|		}
 3392|  3.27k|	}
 3393|       |
 3394|  2.55k|	free(timeBools);
 3395|  2.55k|	return (0);
 3396|    141|failed:
 3397|    141|	free(timeBools);
 3398|    141|	return (-1);
 3399|  2.62k|}
archive_read_support_format_7zip.c:free_Header:
 2951|  2.23k|{
 2952|  2.23k|	free(h->emptyStreamBools);
 2953|  2.23k|	free(h->emptyFileBools);
 2954|  2.23k|	free(h->antiBools);
 2955|  2.23k|	free(h->attrBools);
 2956|  2.23k|}
archive_read_support_format_7zip.c:entry_compression_type:
  916|    382|{
  917|    382|	switch (codec) {
  918|    100|	case _7Z_COPY:    return (ARCHIVE_ENTRY_COMPRESSION_STORE);
  ------------------
  |  |   96|    100|#define _7Z_COPY	0
  ------------------
              	case _7Z_COPY:    return (ARCHIVE_ENTRY_COMPRESSION_STORE);
  ------------------
  |  |  462|    100|#define ARCHIVE_ENTRY_COMPRESSION_STORE       0x00000001 /* Uncompressed */
  ------------------
  |  Branch (918:2): [True: 100, False: 282]
  ------------------
  919|    127|	case _7Z_LZMA:    return (ARCHIVE_ENTRY_COMPRESSION_LZMA);
  ------------------
  |  |   97|    127|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA:    return (ARCHIVE_ENTRY_COMPRESSION_LZMA);
  ------------------
  |  |  465|    127|#define ARCHIVE_ENTRY_COMPRESSION_LZMA        0x00000004
  ------------------
  |  Branch (919:2): [True: 127, False: 255]
  ------------------
  920|     61|	case _7Z_LZMA2:   return (ARCHIVE_ENTRY_COMPRESSION_LZMA2);
  ------------------
  |  |   98|     61|#define _7Z_LZMA2	0x21
  ------------------
              	case _7Z_LZMA2:   return (ARCHIVE_ENTRY_COMPRESSION_LZMA2);
  ------------------
  |  |  466|     61|#define ARCHIVE_ENTRY_COMPRESSION_LZMA2       0x00000005
  ------------------
  |  Branch (920:2): [True: 61, False: 321]
  ------------------
  921|      0|	case _7Z_DEFLATE: return (ARCHIVE_ENTRY_COMPRESSION_DEFLATE);
  ------------------
  |  |   99|      0|#define _7Z_DEFLATE	0x040108
  ------------------
              	case _7Z_DEFLATE: return (ARCHIVE_ENTRY_COMPRESSION_DEFLATE);
  ------------------
  |  |  463|      0|#define ARCHIVE_ENTRY_COMPRESSION_DEFLATE     0x00000002
  ------------------
  |  Branch (921:2): [True: 0, False: 382]
  ------------------
  922|      0|	case _7Z_BZ2:     return (ARCHIVE_ENTRY_COMPRESSION_BZIP2);
  ------------------
  |  |  100|      0|#define _7Z_BZ2		0x040202
  ------------------
              	case _7Z_BZ2:     return (ARCHIVE_ENTRY_COMPRESSION_BZIP2);
  ------------------
  |  |  464|      0|#define ARCHIVE_ENTRY_COMPRESSION_BZIP2       0x00000003
  ------------------
  |  Branch (922:2): [True: 0, False: 382]
  ------------------
  923|      0|	case _7Z_PPMD:    return (ARCHIVE_ENTRY_COMPRESSION_PPMD);
  ------------------
  |  |  101|      0|#define _7Z_PPMD	0x030401
  ------------------
              	case _7Z_PPMD:    return (ARCHIVE_ENTRY_COMPRESSION_PPMD);
  ------------------
  |  |  469|      0|#define ARCHIVE_ENTRY_COMPRESSION_PPMD        0x00000008
  ------------------
  |  Branch (923:2): [True: 0, False: 382]
  ------------------
  924|      0|	case _7Z_ZSTD:    return (ARCHIVE_ENTRY_COMPRESSION_ZSTD);
  ------------------
  |  |  118|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
              	case _7Z_ZSTD:    return (ARCHIVE_ENTRY_COMPRESSION_ZSTD);
  ------------------
  |  |  468|      0|#define ARCHIVE_ENTRY_COMPRESSION_ZSTD        0x00000007
  ------------------
  |  Branch (924:2): [True: 0, False: 382]
  ------------------
  925|     94|	default:          return (ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED);
  ------------------
  |  |  461|     94|#define ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED 0x00000000
  ------------------
  |  Branch (925:2): [True: 94, False: 288]
  ------------------
  926|    382|	}
  927|    382|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data:
 1173|  6.17k|{
 1174|  6.17k|	struct _7zip *zip = a->format->data;
 1175|  6.17k|	ssize_t bytes;
 1176|  6.17k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  234|  6.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1177|       |
 1178|  6.17k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  416|  6.17k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1178:6): [True: 0, False: 6.17k]
  ------------------
 1179|      0|		zip->has_encrypted_entries = 0;
 1180|      0|	}
 1181|       |
 1182|  6.17k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1182:6): [True: 56, False: 6.11k]
  ------------------
 1183|     56|		read_consume(a);
 1184|       |
 1185|  6.17k|	*offset = zip->entry_offset;
 1186|  6.17k|	*size = 0;
 1187|  6.17k|	*buff = NULL;
 1188|       |	/*
 1189|       |	 * If we hit end-of-entry last time, clean up and return
 1190|       |	 * ARCHIVE_EOF this time.
 1191|       |	 */
 1192|  6.17k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1192:6): [True: 5.94k, False: 231]
  ------------------
 1193|  5.94k|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|  5.94k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1194|       |
 1195|    231|	size_t bytes_to_read = MAX_READ;
  ------------------
  |  |  405|    231|#define MAX_READ	16 * 1024 * 1024
  ------------------
 1196|    231|	if ((int64_t)bytes_to_read > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (1196:6): [True: 189, False: 42]
  ------------------
 1197|    189|		bytes_to_read = (size_t)zip->entry_bytes_remaining;
 1198|    189|	}
 1199|    231|	bytes = read_stream(a, buff, bytes_to_read, 0);
 1200|    231|	if (bytes < 0)
  ------------------
  |  Branch (1200:6): [True: 56, False: 175]
  ------------------
 1201|     56|		return ((int)bytes);
 1202|    175|	if (bytes == 0) {
  ------------------
  |  Branch (1202:6): [True: 36, False: 139]
  ------------------
 1203|     36|		archive_set_error(&a->archive,
 1204|     36|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     36|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1205|     36|		    "Truncated 7-Zip file body");
 1206|     36|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1207|     36|	}
 1208|    139|	zip->entry_bytes_remaining -= bytes;
 1209|    139|	if (zip->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1209:6): [True: 106, False: 33]
  ------------------
 1210|    106|		zip->end_of_entry = 1;
 1211|       |
 1212|       |	/* Update checksum */
 1213|    139|	if ((zip->entry->flg & CRC32_IS_SET) && bytes)
  ------------------
  |  |  249|    139|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1213:6): [True: 115, False: 24]
  |  Branch (1213:42): [True: 115, False: 0]
  ------------------
 1214|    115|		zip->entry_crc32 = __archive_crc32(zip->entry_crc32, *buff,
 1215|    115|		    bytes);
 1216|       |
 1217|       |	/* If we hit the end, swallow any end-of-data marker. */
 1218|    139|	if (zip->end_of_entry) {
  ------------------
  |  Branch (1218:6): [True: 106, False: 33]
  ------------------
 1219|       |		/* Check computed CRC against file contents. */
 1220|    106|		if ((zip->entry->flg & CRC32_IS_SET) &&
  ------------------
  |  |  249|    106|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1220:7): [True: 87, False: 19]
  ------------------
 1221|     87|			zip->si.ss.digests[zip->entry->ssIndex] !=
  ------------------
  |  Branch (1221:4): [True: 82, False: 5]
  ------------------
 1222|     87|		    zip->entry_crc32) {
 1223|     82|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     82|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1224|     82|			    "7-Zip bad CRC: 0x%x should be 0x%x",
 1225|     82|			    zip->entry_crc32,
 1226|     82|			    zip->si.ss.digests[zip->entry->ssIndex]);
 1227|     82|			ret = ARCHIVE_WARN;
  ------------------
  |  |  236|     82|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1228|     82|		}
 1229|    106|	}
 1230|       |
 1231|    139|	*size = bytes;
 1232|    139|	*offset = zip->entry_offset;
 1233|    139|	zip->entry_offset += bytes;
 1234|       |
 1235|    139|	return (ret);
 1236|    175|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data_skip:
 1240|  5.99k|{
 1241|  5.99k|	struct _7zip *zip = a->format->data;
 1242|  5.99k|	int r;
 1243|       |
 1244|  5.99k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1244:6): [True: 58, False: 5.93k]
  ------------------
 1245|     58|		read_consume(a);
 1246|       |
 1247|       |	/* If we've already read to end of data, we're done. */
 1248|  5.99k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1248:6): [True: 5.99k, False: 1]
  ------------------
 1249|  5.99k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  5.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1250|       |
 1251|       |	/*
 1252|       |	 * If the length is at the beginning, we can skip the
 1253|       |	 * compressed data much more quickly.
 1254|       |	 */
 1255|      1|	r = skip_stream(a, zip->entry_bytes_remaining);
 1256|      1|	if (r < 0)
  ------------------
  |  Branch (1256:6): [True: 0, False: 1]
  ------------------
 1257|      0|		return (r);
 1258|      1|	zip->entry_bytes_remaining = 0;
 1259|       |
 1260|       |	/* This entry is finished and done. */
 1261|      1|	zip->end_of_entry = 1;
 1262|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  234|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1263|      1|}
archive_read_support_format_7zip.c:skip_stream:
 4325|      1|{
 4326|      1|	struct _7zip *zip = a->format->data;
 4327|      1|	const void *p;
 4328|      1|	int64_t skipped_bytes;
 4329|      1|	int64_t bytes = skip_bytes;
 4330|       |
 4331|      1|	if (zip->folder_index == 0) {
  ------------------
  |  Branch (4331:6): [True: 1, False: 0]
  ------------------
 4332|      1|		int64_t *v;
 4333|       |
 4334|       |		/*
 4335|       |		 * Optimization for a list mode.
 4336|       |		 * Avoid unnecessary decoding operations.
 4337|       |		 */
 4338|      1|		v = &zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes;
 4339|      1|		if (archive_ckd_add_i64(v, *v, skip_bytes)) {
  ------------------
  |  Branch (4339:7): [True: 0, False: 1]
  ------------------
 4340|      0|			archive_set_error(&a->archive,
 4341|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4342|      0|			    "Too many bytes to skip");
 4343|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4344|      0|		}
 4345|      1|		return (ARCHIVE_OK);
  ------------------
  |  |  234|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4346|      1|	}
 4347|       |
 4348|      0|	while (bytes) {
  ------------------
  |  Branch (4348:9): [True: 0, False: 0]
  ------------------
 4349|      0|		size_t request;
 4350|       |
 4351|      0|		if (bytes > MAX_READ)
  ------------------
  |  |  405|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
  |  Branch (4351:7): [True: 0, False: 0]
  ------------------
 4352|      0|			request = MAX_READ;
  ------------------
  |  |  405|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
 4353|      0|		else
 4354|      0|			request = (size_t)bytes;
 4355|       |
 4356|      0|		skipped_bytes = read_stream(a, &p, request, 0);
 4357|      0|		if (skipped_bytes < 0)
  ------------------
  |  Branch (4357:7): [True: 0, False: 0]
  ------------------
 4358|      0|			return (skipped_bytes);
 4359|      0|		if (skipped_bytes == 0) {
  ------------------
  |  Branch (4359:7): [True: 0, False: 0]
  ------------------
 4360|      0|			archive_set_error(&a->archive,
 4361|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4362|      0|			    "Truncated 7-Zip file body");
 4363|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4364|      0|		}
 4365|      0|		bytes -= skipped_bytes;
 4366|      0|		if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4366:7): [True: 0, False: 0]
  ------------------
 4367|      0|			read_consume(a);
 4368|      0|	}
 4369|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4370|      0|}
archive_read_support_format_7zip.c:archive_read_format_7zip_cleanup:
 1267|  20.1k|{
 1268|  20.1k|	struct _7zip *zip = a->format->data;
 1269|       |
 1270|  20.1k|	free_StreamsInfo(&(zip->si));
 1271|  20.1k|	free(zip->entries);
 1272|  20.1k|	free(zip->entry_names);
 1273|  20.1k|	free_decompression(a, zip);
 1274|  20.1k|	free(zip->uncompressed_buffer);
 1275|  20.1k|	free(zip->sub_stream_buff[0]);
 1276|  20.1k|	free(zip->sub_stream_buff[1]);
 1277|  20.1k|	free(zip->sub_stream_buff[2]);
 1278|  20.1k|	free(zip->tmp_stream_buff);
 1279|  20.1k|	free(zip);
 1280|  20.1k|	a->format->data = NULL;
 1281|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1282|  20.1k|}
archive_read_support_format_7zip.c:free_decompression:
 2189|  20.1k|{
 2190|  20.1k|	int r = ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2191|       |
 2192|       |#if !defined(HAVE_ZLIB_H) &&\
 2193|       |	!(defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR))
 2194|       |	(void)a;/* UNUSED */
 2195|       |#endif
 2196|  20.1k|#ifdef HAVE_LZMA_H
 2197|  20.1k|	if (zip->lzstream_valid)
  ------------------
  |  Branch (2197:6): [True: 52, False: 20.0k]
  ------------------
 2198|     52|		lzma_end(&(zip->lzstream));
 2199|  20.1k|#endif
 2200|  20.1k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 2201|  20.1k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (2201:6): [True: 0, False: 20.1k]
  ------------------
 2202|      0|		if (BZ2_bzDecompressEnd(&(zip->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (2202:7): [True: 0, False: 0]
  ------------------
 2203|      0|			archive_set_error(&a->archive,
 2204|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2205|      0|			    "Failed to clean up bzip2 decompressor");
 2206|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2207|      0|		}
 2208|      0|		zip->bzstream_valid = 0;
 2209|      0|	}
 2210|  20.1k|#endif
 2211|  20.1k|#ifdef HAVE_ZLIB_H
 2212|  20.1k|	if (zip->stream_valid) {
  ------------------
  |  Branch (2212:6): [True: 2, False: 20.1k]
  ------------------
 2213|      2|		if (inflateEnd(&(zip->stream)) != Z_OK) {
  ------------------
  |  Branch (2213:7): [True: 0, False: 2]
  ------------------
 2214|      0|			archive_set_error(&a->archive,
 2215|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2216|      0|			    "Failed to clean up zlib decompressor");
 2217|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2218|      0|		}
 2219|      2|		zip->stream_valid = 0;
 2220|      2|	}
 2221|  20.1k|#endif
 2222|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 2223|       |	if (zip->zstdstream_valid)
 2224|       |		ZSTD_freeDStream(zip->zstd_dstream);
 2225|       |#endif
 2226|  20.1k|	if (zip->ppmd7_valid) {
  ------------------
  |  Branch (2226:6): [True: 167, False: 19.9k]
  ------------------
 2227|    167|		__archive_ppmd7_functions.Ppmd7_Free(
 2228|    167|			&zip->ppmd7_context);
 2229|    167|		zip->ppmd7_valid = 0;
 2230|    167|	}
 2231|  20.1k|	return (r);
 2232|  20.1k|}

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

archive_read_support_format_ar:
   99|  20.1k|{
  100|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  101|  20.1k|	struct ar *ar;
  102|  20.1k|	int r;
  103|       |
  104|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  105|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
  106|       |
  107|  20.1k|	ar = calloc(1, sizeof(*ar));
  108|  20.1k|	if (ar == NULL) {
  ------------------
  |  Branch (108:6): [True: 0, False: 20.1k]
  ------------------
  109|      0|		archive_set_error(_a, ENOMEM, "Can't allocate ar data");
  110|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  111|      0|	}
  112|  20.1k|	ar->strtab = NULL;
  113|       |
  114|  20.1k|	r = __archive_read_register_format(a,
  115|  20.1k|	    ar,
  116|  20.1k|	    "ar",
  117|  20.1k|	    archive_read_format_ar_bid,
  118|  20.1k|	    NULL,
  119|  20.1k|	    archive_read_format_ar_read_header,
  120|  20.1k|	    archive_read_format_ar_read_data,
  121|  20.1k|	    archive_read_format_ar_skip,
  122|  20.1k|	    NULL,
  123|  20.1k|	    archive_read_format_ar_cleanup,
  124|  20.1k|	    NULL,
  125|  20.1k|	    NULL);
  126|       |
  127|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (127:6): [True: 0, False: 20.1k]
  ------------------
  128|      0|		free(ar);
  129|  20.1k|	return (r);
  130|  20.1k|}
archive_read_support_format_ar.c:archive_read_format_ar_cleanup:
  134|  20.1k|{
  135|  20.1k|	struct ar *ar = a->format->data;
  136|       |
  137|  20.1k|	free(ar->strtab);
  138|  20.1k|	free(ar);
  139|  20.1k|	a->format->data = NULL;
  140|       |
  141|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  142|  20.1k|}
archive_read_support_format_ar.c:archive_read_format_ar_bid:
  146|  19.8k|{
  147|  19.8k|	const void *h;
  148|       |
  149|  19.8k|	(void)best_bid; /* UNUSED */
  150|       |
  151|       |	/*
  152|       |	 * Verify the 8-byte file signature.
  153|       |	 * TODO: Do we need to check more than this?
  154|       |	 */
  155|  19.8k|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (155:6): [True: 41, False: 19.8k]
  ------------------
  156|     41|		return (-1);
  157|  19.8k|	if (memcmp(h, "!<arch>\n", 8) == 0) {
  ------------------
  |  Branch (157:6): [True: 247, False: 19.5k]
  ------------------
  158|    247|		return (64);
  159|    247|	}
  160|  19.5k|	return (-1);
  161|  19.8k|}
archive_read_support_format_ar.c:archive_read_format_ar_read_header:
  411|  2.09k|{
  412|  2.09k|	struct ar *ar = a->format->data;
  413|  2.09k|	int64_t unconsumed;
  414|  2.09k|	const void *header_data;
  415|  2.09k|	int ret;
  416|       |
  417|  2.09k|	if (!ar->read_global_header) {
  ------------------
  |  Branch (417:6): [True: 247, False: 1.84k]
  ------------------
  418|       |		/*
  419|       |		 * We are at the beginning of the archive now,
  420|       |		 * so we have to consume the ar global header first.
  421|       |		 */
  422|    247|		__archive_read_consume(a, 8);
  423|    247|		ar->read_global_header = 1;
  424|       |		/* Set a default format code for now. */
  425|    247|		a->archive.archive_format = ARCHIVE_FORMAT_AR;
  ------------------
  |  |  381|    247|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  426|    247|	}
  427|       |
  428|  2.16k|	do {
  429|       |		/* Read the header for the next file entry. */
  430|  2.16k|		if ((header_data = __archive_read_ahead(a, 60, NULL)) == NULL)
  ------------------
  |  Branch (430:7): [True: 95, False: 2.06k]
  ------------------
  431|       |			/* Broken header. */
  432|     95|			return (ARCHIVE_EOF);
  ------------------
  |  |  233|     95|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  433|       |
  434|  2.06k|		unconsumed = 60;
  435|       |
  436|  2.06k|		ret = _ar_read_header(a, entry, ar, (const char *)header_data,
  437|  2.06k|		    &unconsumed);
  438|       |
  439|  2.06k|		if (unconsumed)
  ------------------
  |  Branch (439:7): [True: 1.34k, False: 725]
  ------------------
  440|  1.34k|			__archive_read_consume(a, unconsumed);
  441|  2.06k|	} while (ret == ARCHIVE_OK && archive_entry_pathname(entry) == NULL);
  ------------------
  |  |  234|  4.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (441:11): [True: 1.93k, False: 128]
  |  Branch (441:32): [True: 71, False: 1.86k]
  ------------------
  442|       |
  443|  1.99k|	return ret;
  444|  2.09k|}
archive_read_support_format_ar.c:_ar_read_header:
  166|  2.06k|{
  167|  2.06k|	char filename[AR_name_size + 1];
  168|  2.06k|	uint64_t number; /* Used to hold parsed numbers before validation. */
  169|  2.06k|	char *p;
  170|  2.06k|	const void *b;
  171|       |
  172|       |	/* Verify the magic signature on the file header. */
  173|  2.06k|	if (strncmp(h + AR_fmag_offset, "`\n", 2) != 0) {
  ------------------
  |  |   81|  2.06k|#define AR_fmag_offset 58
  ------------------
  |  Branch (173:6): [True: 68, False: 1.99k]
  ------------------
  174|     68|		archive_set_error(&a->archive, EINVAL,
  175|     68|		    "Incorrect file header signature");
  176|     68|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     68|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  177|     68|	}
  178|       |
  179|       |	/* Copy filename into work buffer. */
  180|  1.99k|	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   69|  1.99k|#define AR_name_offset 0
  ------------------
              	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   70|  1.99k|#define AR_name_size 16
  ------------------
  181|  1.99k|	filename[AR_name_size] = '\0';
  ------------------
  |  |   70|  1.99k|#define AR_name_size 16
  ------------------
  182|       |
  183|       |	/*
  184|       |	 * Guess the format variant based on the filename.
  185|       |	 */
  186|  1.99k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR) {
  ------------------
  |  |  381|  1.99k|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (186:6): [True: 394, False: 1.60k]
  ------------------
  187|       |		/* We don't already know the variant, so let's guess. */
  188|       |		/*
  189|       |		 * Biggest clue is presence of '/': GNU starts special
  190|       |		 * filenames with '/', appends '/' as terminator to
  191|       |		 * non-special names, so anything with '/' should be
  192|       |		 * GNU except for BSD long filenames.
  193|       |		 */
  194|    394|		if (strncmp(filename, "#1/", 3) == 0)
  ------------------
  |  Branch (194:7): [True: 61, False: 333]
  ------------------
  195|     61|			a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
  ------------------
  |  |  383|     61|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  381|     61|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  196|    333|		else if (strchr(filename, '/') != NULL)
  ------------------
  |  Branch (196:12): [True: 135, False: 198]
  ------------------
  197|    135|			a->archive.archive_format = ARCHIVE_FORMAT_AR_GNU;
  ------------------
  |  |  382|    135|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  381|    135|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  198|    198|		else if (strncmp(filename, "__.SYMDEF", 9) == 0)
  ------------------
  |  Branch (198:12): [True: 0, False: 198]
  ------------------
  199|      0|			a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
  ------------------
  |  |  383|      0|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  381|      0|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  200|       |		/*
  201|       |		 * XXX Do GNU/SVR4 'ar' programs ever omit trailing '/'
  202|       |		 * if name exactly fills 16-byte field?  If so, we
  203|       |		 * can't assume entries without '/' are BSD. XXX
  204|       |		 */
  205|    394|	}
  206|       |
  207|       |	/* Update format name from the code. */
  208|  1.99k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR_GNU)
  ------------------
  |  |  382|  1.99k|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  381|  1.99k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (208:6): [True: 859, False: 1.13k]
  ------------------
  209|    859|		a->archive.archive_format_name = "ar (GNU/SVR4)";
  210|  1.13k|	else if (a->archive.archive_format == ARCHIVE_FORMAT_AR_BSD)
  ------------------
  |  |  383|  1.13k|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  381|  1.13k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (210:11): [True: 941, False: 198]
  ------------------
  211|    941|		a->archive.archive_format_name = "ar (BSD)";
  212|    198|	else
  213|    198|		a->archive.archive_format_name = "ar";
  214|       |
  215|       |	/*
  216|       |	 * Remove trailing spaces from the filename.  GNU and BSD
  217|       |	 * variants both pad filename area out with spaces.
  218|       |	 * This will only be wrong if GNU/SVR4 'ar' implementations
  219|       |	 * omit trailing '/' for 16-char filenames and we have
  220|       |	 * a 16-char filename that ends in ' '.
  221|       |	 */
  222|  1.99k|	p = filename + AR_name_size - 1;
  ------------------
  |  |   70|  1.99k|#define AR_name_size 16
  ------------------
  223|  3.33k|	while (p >= filename && *p == ' ') {
  ------------------
  |  Branch (223:9): [True: 3.33k, False: 1]
  |  Branch (223:26): [True: 1.34k, False: 1.99k]
  ------------------
  224|  1.34k|		*p = '\0';
  225|  1.34k|		p--;
  226|  1.34k|	}
  227|       |
  228|       |	/*
  229|       |	 * Remove trailing slash unless first character is '/'.
  230|       |	 * (BSD entries never end in '/', so this will only trim
  231|       |	 * GNU-format entries.  GNU special entries start with '/'
  232|       |	 * and are not terminated in '/', so we don't trim anything
  233|       |	 * that starts with '/'.)
  234|       |	 */
  235|  1.99k|	if (filename[0] != '/' && p > filename && *p == '/') {
  ------------------
  |  Branch (235:6): [True: 1.70k, False: 291]
  |  Branch (235:28): [True: 1.67k, False: 32]
  |  Branch (235:44): [True: 13, False: 1.66k]
  ------------------
  236|     13|		*p = '\0';
  237|     13|	}
  238|       |
  239|  1.99k|	if (p < filename) {
  ------------------
  |  Branch (239:6): [True: 1, False: 1.99k]
  ------------------
  240|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  241|      1|		    "Found entry with empty filename");
  242|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  243|      1|	}
  244|       |
  245|       |	/*
  246|       |	 * Parse the time, owner, mode, size fields.
  247|       |	 * This must come before any call to _read_ahead.
  248|       |	 */
  249|  1.99k|	ar_parse_common_header(ar, entry, h);
  250|       |
  251|       |	/*
  252|       |	 * '/' is the ranlib index.
  253|       |	 * Ignore it since it contains linker information.
  254|       |	 */
  255|  1.99k|	if (strcmp(filename, "/") == 0) {
  ------------------
  |  Branch (255:6): [True: 35, False: 1.96k]
  ------------------
  256|       |		/* This is not a file entry. Ignore. */
  257|     35|		archive_entry_copy_pathname(entry, NULL);
  258|       |
  259|       |		/* Skip special file entry. */
  260|     35|		return (archive_read_format_ar_skip(a));
  261|     35|	}
  262|       |
  263|       |	/*
  264|       |	 * '//' is the GNU filename table.
  265|       |	 * Later entries can refer to names in this table.
  266|       |	 */
  267|  1.96k|	if (strcmp(filename, "//") == 0) {
  ------------------
  |  Branch (267:6): [True: 60, False: 1.90k]
  ------------------
  268|     60|		char *st;
  269|     60|		int64_t entry_size;
  270|     60|		size_t strtab_size;
  271|       |
  272|       |		/* This is not a file entry. Ignore. */
  273|     60|		archive_entry_copy_pathname(entry, NULL);
  274|       |
  275|       |		/* Get the size of the filename table. */
  276|     60|		entry_size = archive_entry_size(entry);
  277|     60|		if (entry_size == 0 || entry_size > 1024 * 1024 * 1024) {
  ------------------
  |  Branch (277:7): [True: 2, False: 58]
  |  Branch (277:26): [True: 1, False: 57]
  ------------------
  278|      3|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  279|      3|			    "Invalid filename table size");
  280|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  281|      3|		}
  282|     57|		strtab_size = (size_t)entry_size;
  283|     57|		if (ar->strtab != NULL) {
  ------------------
  |  Branch (283:7): [True: 1, False: 56]
  ------------------
  284|      1|			archive_set_error(&a->archive, EINVAL,
  285|      1|			    "More than one filename table exists");
  286|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  287|      1|		}
  288|       |
  289|       |		/* Read the filename table into memory. */
  290|     56|		st = malloc(strtab_size);
  291|     56|		if (st == NULL) {
  ------------------
  |  Branch (291:7): [True: 0, False: 56]
  ------------------
  292|      0|			archive_set_error(&a->archive, ENOMEM,
  293|      0|			    "Can't allocate filename table buffer");
  294|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  295|      0|		}
  296|     56|		ar->strtab = st;
  297|     56|		ar->strtab_size = strtab_size;
  298|       |
  299|     56|		if (*unconsumed) {
  ------------------
  |  Branch (299:7): [True: 56, False: 0]
  ------------------
  300|     56|			__archive_read_consume(a, *unconsumed);
  301|     56|			*unconsumed = 0;
  302|     56|		}
  303|       |
  304|     56|		if ((b = __archive_read_ahead(a, strtab_size, NULL)) == NULL) {
  ------------------
  |  Branch (304:7): [True: 2, False: 54]
  ------------------
  305|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  306|      2|			    "Truncated input file");
  307|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  308|      2|		}
  309|     54|		memcpy(st, b, strtab_size);
  310|       |
  311|       |		/* Skip special file entry. */
  312|     54|		if (archive_read_format_ar_skip(a) != ARCHIVE_OK)
  ------------------
  |  |  234|     54|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (312:7): [True: 1, False: 53]
  ------------------
  313|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  314|       |
  315|       |		/* Parse the filename table. */
  316|     53|		return (ar_parse_gnu_filename_table(a));
  317|     54|	}
  318|       |
  319|       |	/*
  320|       |	 * GNU variant handles long filenames by storing /<number>
  321|       |	 * to indicate a name stored in the filename table.
  322|       |	 * XXX TODO: Verify that it's all digits... Don't be fooled
  323|       |	 * by "/9xyz" XXX
  324|       |	 */
  325|  1.90k|	if (filename[0] == '/' && filename[1] >= '0' && filename[1] <= '9') {
  ------------------
  |  Branch (325:6): [True: 196, False: 1.70k]
  |  Branch (325:28): [True: 160, False: 36]
  |  Branch (325:50): [True: 155, False: 5]
  ------------------
  326|    155|		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   69|    155|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   70|    155|#define AR_name_size 16
  ------------------
  327|       |		/* Fail if we can't look up the real name. */
  328|    155|		if (ar->strtab == NULL || number >= ar->strtab_size) {
  ------------------
  |  Branch (328:7): [True: 7, False: 148]
  |  Branch (328:29): [True: 8, False: 140]
  ------------------
  329|     15|			archive_set_error(&a->archive, EINVAL,
  330|     15|			    "Can't find long filename for GNU/SVR4 archive entry");
  331|     15|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     15|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  332|     15|		}
  333|       |
  334|    140|		archive_entry_copy_pathname(entry, &ar->strtab[(size_t)number]);
  335|    140|		return (ARCHIVE_OK);
  ------------------
  |  |  234|    140|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  336|    155|	}
  337|       |
  338|       |	/*
  339|       |	 * BSD handles long filenames by storing "#1/" followed by the
  340|       |	 * length of filename as a decimal number, then prepends the
  341|       |	 * the filename to the file contents.
  342|       |	 */
  343|  1.74k|	if (strncmp(filename, "#1/", 3) == 0) {
  ------------------
  |  Branch (343:6): [True: 688, False: 1.05k]
  ------------------
  344|    688|		size_t bsd_name_length;
  345|       |
  346|       |		/* Parse the size of the name, adjust the file size. */
  347|    688|		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   69|    688|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   70|    688|#define AR_name_size 16
  ------------------
  348|       |		/* Sanity check the filename length:
  349|       |		 *   = Must be <= SIZE_MAX - 1
  350|       |		 *   = Must be <= 1MB
  351|       |		 *   = Cannot be bigger than the entire entry
  352|       |		 */
  353|    688|		if (number > SIZE_MAX - 1
  ------------------
  |  Branch (353:7): [True: 0, False: 688]
  ------------------
  354|    688|		    || number > 1024 * 1024
  ------------------
  |  Branch (354:10): [True: 6, False: 682]
  ------------------
  355|    682|		    || number > (uint64_t)ar->entry_bytes_remaining) {
  ------------------
  |  Branch (355:10): [True: 13, False: 669]
  ------------------
  356|     19|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     19|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  357|     19|			    "Bad input file size");
  358|     19|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  359|     19|		}
  360|    669|		bsd_name_length = (size_t)number;
  361|    669|		ar->entry_bytes_remaining -= bsd_name_length;
  362|       |		/* Adjust file size reported to client. */
  363|    669|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  364|       |
  365|    669|		if (*unconsumed) {
  ------------------
  |  Branch (365:7): [True: 669, False: 0]
  ------------------
  366|    669|			__archive_read_consume(a, *unconsumed);
  367|    669|			*unconsumed = 0;
  368|    669|		}
  369|       |
  370|       |		/* Read the long name into memory. */
  371|    669|		if ((b = __archive_read_ahead(a, bsd_name_length, NULL)) == NULL) {
  ------------------
  |  Branch (371:7): [True: 1, False: 668]
  ------------------
  372|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  373|      1|			    "Truncated input file");
  374|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  375|      1|		}
  376|       |		/* Store it in the entry. */
  377|    668|		p = malloc(bsd_name_length + 1);
  378|    668|		if (p == NULL) {
  ------------------
  |  Branch (378:7): [True: 0, False: 668]
  ------------------
  379|      0|			archive_set_error(&a->archive, ENOMEM,
  380|      0|			    "Can't allocate fname buffer");
  381|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  382|      0|		}
  383|    668|		strncpy(p, b, bsd_name_length);
  384|    668|		p[bsd_name_length] = '\0';
  385|       |
  386|    668|		__archive_read_consume(a, bsd_name_length);
  387|       |
  388|    668|		archive_entry_copy_pathname(entry, p);
  389|    668|		free(p);
  390|    668|		return (ARCHIVE_OK);
  ------------------
  |  |  234|    668|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  391|    668|	}
  392|       |
  393|       |	/*
  394|       |	 * Otherwise, this is a standard entry.  The filename
  395|       |	 * has already been trimmed as much as possible, based
  396|       |	 * on our current knowledge of the format.
  397|       |	 *
  398|       |	 * Note for future implementations:
  399|       |	 *
  400|       |	 * - "/" is the SVR4/GNU archive symbol table.
  401|       |	 * - "/SYM64/" is the SVR4/GNU 64-bit variant archive symbol table.
  402|       |	 * - "__.SYMDEF" is a BSD archive symbol table.
  403|       |	 */
  404|  1.05k|	archive_entry_copy_pathname(entry, filename);
  405|  1.05k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  406|  1.74k|}
archive_read_support_format_ar.c:ar_parse_common_header:
  450|  1.99k|{
  451|  1.99k|	int64_t n;
  452|       |
  453|       |	/* Copy remaining header */
  454|  1.99k|	archive_entry_set_mtime(entry,
  455|  1.99k|	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   71|  1.99k|#define AR_date_offset 16
  ------------------
              	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   72|  1.99k|#define AR_date_size 12
  ------------------
  456|  1.99k|	archive_entry_set_uid(entry,
  457|  1.99k|	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   73|  1.99k|#define AR_uid_offset 28
  ------------------
              	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   74|  1.99k|#define AR_uid_size 6
  ------------------
  458|  1.99k|	archive_entry_set_gid(entry,
  459|  1.99k|	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   75|  1.99k|#define AR_gid_offset 34
  ------------------
              	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   76|  1.99k|#define AR_gid_size 6
  ------------------
  460|  1.99k|	archive_entry_set_mode(entry,
  461|  1.99k|	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   77|  1.99k|#define AR_mode_offset 40
  ------------------
              	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   78|  1.99k|#define AR_mode_size 8
  ------------------
  462|  1.99k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  1.99k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  463|  1.99k|	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|  1.99k|#define AR_size_offset 48
  ------------------
              	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   80|  1.99k|#define AR_size_size 10
  ------------------
  464|       |
  465|  1.99k|	ar->entry_offset = 0;
  466|  1.99k|	ar->entry_padding = n % 2;
  467|  1.99k|	archive_entry_set_size(entry, n);
  468|  1.99k|	ar->entry_bytes_remaining = n;
  469|  1.99k|}
archive_read_support_format_ar.c:ar_atol8:
  569|  1.99k|{
  570|  1.99k|	uint64_t l;
  571|  1.99k|	unsigned int digit, base;
  572|       |
  573|  1.99k|	base = 8;
  574|       |
  575|  6.05k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (575:10): [True: 1.90k, False: 4.15k]
  |  Branch (575:23): [True: 2.21k, False: 1.93k]
  |  Branch (575:38): [True: 4.06k, False: 63]
  ------------------
  576|  4.06k|		p++;
  577|       |
  578|  1.99k|	l = 0;
  579|  1.99k|	digit = *p - '0';
  580|  2.61k|	while (*p >= '0' && digit < base && char_cnt-- > 0) {
  ------------------
  |  Branch (580:9): [True: 1.21k, False: 1.39k]
  |  Branch (580:22): [True: 632, False: 584]
  |  Branch (580:38): [True: 615, False: 17]
  ------------------
  581|    615|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (581:7): [True: 0, False: 615]
  ------------------
  582|    615|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (582:7): [True: 0, False: 615]
  ------------------
  583|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  584|      0|			break;
  585|      0|		}
  586|    615|		digit = *++p - '0';
  587|    615|	}
  588|  1.99k|	return (l);
  589|  1.99k|}
archive_read_support_format_ar.c:ar_parse_gnu_filename_table:
  530|     53|{
  531|     53|	struct ar *ar = a->format->data;
  532|     53|	char *p;
  533|     53|	size_t size;
  534|       |
  535|     53|	size = ar->strtab_size;
  536|       |
  537|  5.20k|	for (p = ar->strtab; p < ar->strtab + size - 1; ++p) {
  ------------------
  |  Branch (537:23): [True: 5.15k, False: 53]
  ------------------
  538|       |		/* Normalize backslash, even before separator check. */
  539|  5.15k|		if (*p == '\\')
  ------------------
  |  Branch (539:7): [True: 350, False: 4.80k]
  ------------------
  540|    350|			*p = '/';
  541|  5.15k|		if (*p == '/' && *(p + 1) == '\n') {
  ------------------
  |  Branch (541:7): [True: 831, False: 4.32k]
  |  Branch (541:20): [True: 334, False: 497]
  ------------------
  542|    334|			*p++ = '\0';
  543|    334|			*p = '\0';
  544|    334|		}
  545|  5.15k|	}
  546|       |	/*
  547|       |	 * GNU ar always pads the table to an even size.
  548|       |	 * The pad character is either '\n' or '`'.
  549|       |	 * For Windows Archive files, the pad character can be '\0'.
  550|       |	 */
  551|     53|	if (p != ar->strtab + size && *p != '\n' && *p != '`' && *p != '\0')
  ------------------
  |  Branch (551:6): [True: 49, False: 4]
  |  Branch (551:32): [True: 45, False: 4]
  |  Branch (551:46): [True: 20, False: 25]
  |  Branch (551:59): [True: 16, False: 4]
  ------------------
  552|     16|		goto bad_string_table;
  553|       |
  554|       |	/* Enforce zero termination. */
  555|     37|	ar->strtab[size - 1] = '\0';
  556|       |
  557|     37|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     37|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  558|       |
  559|     16|bad_string_table:
  560|     16|	archive_set_error(&a->archive, EINVAL,
  561|     16|	    "Invalid string table");
  562|     16|	free(ar->strtab);
  563|     16|	ar->strtab = NULL;
  564|     16|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  565|     53|}
archive_read_support_format_ar.c:ar_atol10:
  593|  8.83k|{
  594|  8.83k|	uint64_t l;
  595|  8.83k|	unsigned int base, digit;
  596|       |
  597|  8.83k|	base = 10;
  598|       |
  599|  26.2k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (599:10): [True: 8.38k, False: 17.8k]
  |  Branch (599:23): [True: 9.65k, False: 8.19k]
  |  Branch (599:38): [True: 17.4k, False: 637]
  ------------------
  600|  17.4k|		p++;
  601|  8.83k|	l = 0;
  602|  8.83k|	digit = *p - '0';
  603|  17.8k|	while (*p >= '0' && digit < base  && char_cnt-- > 0) {
  ------------------
  |  Branch (603:9): [True: 11.8k, False: 6.03k]
  |  Branch (603:22): [True: 9.38k, False: 2.43k]
  |  Branch (603:39): [True: 9.02k, False: 360]
  ------------------
  604|  9.02k|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (604:7): [True: 0, False: 9.02k]
  ------------------
  605|  9.02k|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (605:7): [True: 0, False: 9.02k]
  ------------------
  606|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  607|      0|			break;
  608|      0|		}
  609|  9.02k|		digit = *++p - '0';
  610|  9.02k|	}
  611|  8.83k|	return (l);
  612|  8.83k|}
archive_read_support_format_ar.c:archive_read_format_ar_read_data:
  474|  3.92k|{
  475|  3.92k|	struct ar *ar = a->format->data;
  476|  3.92k|	ssize_t bytes_read;
  477|       |
  478|  3.92k|	if (ar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (478:6): [True: 1.03k, False: 2.89k]
  ------------------
  479|  1.03k|		__archive_read_consume(a, ar->entry_bytes_unconsumed);
  480|  1.03k|		ar->entry_bytes_unconsumed = 0;
  481|  1.03k|	}
  482|       |
  483|  3.92k|	if (ar->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (483:6): [True: 1.05k, False: 2.86k]
  ------------------
  484|  1.05k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  485|  1.05k|		if (bytes_read == 0) {
  ------------------
  |  Branch (485:7): [True: 23, False: 1.03k]
  ------------------
  486|     23|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     23|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  487|     23|			    "Truncated ar archive");
  488|     23|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     23|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  489|     23|		}
  490|  1.03k|		if (bytes_read < 0)
  ------------------
  |  Branch (490:7): [True: 0, False: 1.03k]
  ------------------
  491|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  492|  1.03k|		if (bytes_read > ar->entry_bytes_remaining)
  ------------------
  |  Branch (492:7): [True: 1.02k, False: 13]
  ------------------
  493|  1.02k|			bytes_read = (ssize_t)ar->entry_bytes_remaining;
  494|  1.03k|		*size = bytes_read;
  495|  1.03k|		ar->entry_bytes_unconsumed = bytes_read;
  496|  1.03k|		*offset = ar->entry_offset;
  497|  1.03k|		ar->entry_offset += bytes_read;
  498|  1.03k|		ar->entry_bytes_remaining -= bytes_read;
  499|  1.03k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  500|  2.86k|	} else {
  501|  2.86k|		if (__archive_read_consume(a, ar->entry_padding) < 0)
  ------------------
  |  Branch (501:7): [True: 1, False: 2.86k]
  ------------------
  502|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  503|  2.86k|		ar->entry_padding = 0;
  504|  2.86k|		*buff = NULL;
  505|  2.86k|		*size = 0;
  506|  2.86k|		*offset = ar->entry_offset;
  507|  2.86k|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|  2.86k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  508|  2.86k|	}
  509|  3.92k|}
archive_read_support_format_ar.c:archive_read_format_ar_skip:
  513|  1.93k|{
  514|  1.93k|	struct ar *ar = a->format->data;
  515|       |
  516|  1.93k|	if (__archive_read_consume(a,
  ------------------
  |  Branch (516:6): [True: 2, False: 1.93k]
  ------------------
  517|  1.93k|	    ar->entry_bytes_remaining + ar->entry_padding +
  518|  1.93k|	    ar->entry_bytes_unconsumed) < 0)
  519|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  520|       |
  521|  1.93k|	ar->entry_bytes_remaining = 0;
  522|  1.93k|	ar->entry_bytes_unconsumed = 0;
  523|  1.93k|	ar->entry_padding = 0;
  524|       |
  525|  1.93k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.93k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  526|  1.93k|}

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

archive_read_support_format_cpio:
  225|  20.1k|{
  226|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  227|  20.1k|	struct cpio *cpio;
  228|  20.1k|	int r;
  229|       |
  230|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  231|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cpio");
  232|       |
  233|  20.1k|	cpio = calloc(1, sizeof(*cpio));
  234|  20.1k|	if (cpio == NULL) {
  ------------------
  |  Branch (234:6): [True: 0, False: 20.1k]
  ------------------
  235|      0|		archive_set_error(_a, ENOMEM, "Can't allocate cpio data");
  236|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  237|      0|	}
  238|       |
  239|  20.1k|	r = __archive_read_register_format(a,
  240|  20.1k|	    cpio,
  241|  20.1k|	    "cpio",
  242|  20.1k|	    archive_read_format_cpio_bid,
  243|  20.1k|	    archive_read_format_cpio_options,
  244|  20.1k|	    archive_read_format_cpio_read_header,
  245|  20.1k|	    archive_read_format_cpio_read_data,
  246|  20.1k|	    archive_read_format_cpio_skip,
  247|  20.1k|	    NULL,
  248|  20.1k|	    archive_read_format_cpio_cleanup,
  249|  20.1k|	    NULL,
  250|  20.1k|	    NULL);
  251|       |
  252|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (252:6): [True: 0, False: 20.1k]
  ------------------
  253|      0|		free(cpio);
  254|  20.1k|	return (r);
  255|  20.1k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_bid:
  260|  19.8k|{
  261|  19.8k|	struct cpio *cpio = a->format->data;
  262|  19.8k|	const void *h;
  263|  19.8k|	int bid;
  264|       |
  265|  19.8k|	(void)best_bid; /* UNUSED */
  266|       |
  267|  19.8k|	if ((h = __archive_read_ahead(a, 6, NULL)) == NULL)
  ------------------
  |  Branch (267:6): [True: 40, False: 19.8k]
  ------------------
  268|     40|		return (-1);
  269|       |
  270|  19.8k|	bid = 0;
  271|  19.8k|	if (memcmp(h, "070707", 6) == 0) {
  ------------------
  |  Branch (271:6): [True: 56, False: 19.7k]
  ------------------
  272|       |		/* ASCII cpio archive (odc, POSIX.1) */
  273|     56|		cpio->read_header = header_odc;
  274|     56|		bid += 48;
  275|       |		/*
  276|       |		 * XXX TODO:  More verification; Could check that only octal
  277|       |		 * digits appear in appropriate header locations. XXX
  278|       |		 */
  279|  19.7k|	} else if (memcmp(h, "070727", 6) == 0) {
  ------------------
  |  Branch (279:13): [True: 266, False: 19.4k]
  ------------------
  280|       |		/* afio large ASCII cpio archive */
  281|    266|		cpio->read_header = header_odc;
  282|    266|		bid += 48;
  283|       |		/*
  284|       |		 * XXX TODO:  More verification; Could check that almost hex
  285|       |		 * digits appear in appropriate header locations. XXX
  286|       |		 */
  287|  19.4k|	} else if (memcmp(h, "070701", 6) == 0) {
  ------------------
  |  Branch (287:13): [True: 217, False: 19.2k]
  ------------------
  288|       |		/* ASCII cpio archive (SVR4 without CRC) */
  289|    217|		cpio->read_header = header_newc;
  290|    217|		bid += 48;
  291|       |		/*
  292|       |		 * XXX TODO:  More verification; Could check that only hex
  293|       |		 * digits appear in appropriate header locations. XXX
  294|       |		 */
  295|  19.2k|	} else if (memcmp(h, "070702", 6) == 0) {
  ------------------
  |  Branch (295:13): [True: 140, False: 19.1k]
  ------------------
  296|       |		/* ASCII cpio archive (SVR4 with CRC) */
  297|       |		/* XXX TODO: Flag that we should check the CRC. XXX */
  298|    140|		cpio->read_header = header_newc;
  299|    140|		bid += 48;
  300|       |		/*
  301|       |		 * XXX TODO:  More verification; Could check that only hex
  302|       |		 * digits appear in appropriate header locations. XXX
  303|       |		 */
  304|  19.1k|	} else if (memcmp(h, "070704", 6) == 0) {
  ------------------
  |  Branch (304:13): [True: 56, False: 19.0k]
  ------------------
  305|       |		/* SVR4 with CRC, 64-bit file size (SWUpdate) */
  306|     56|		cpio->read_header = header_newc;
  307|     56|		bid += 48;
  308|  19.0k|	} else if (archive_be16dec(h) == 070707) {
  ------------------
  |  Branch (308:13): [True: 92, False: 18.9k]
  ------------------
  309|       |		/* big-endian binary cpio archives */
  310|     92|		cpio->read_header = header_bin_be;
  311|     92|		bid += 16;
  312|       |		/* Is more verification possible here? */
  313|  18.9k|	} else if (archive_le16dec(h) == 070707) {
  ------------------
  |  Branch (313:13): [True: 17, False: 18.9k]
  ------------------
  314|       |		/* little-endian binary cpio archives */
  315|     17|		cpio->read_header = header_bin_le;
  316|     17|		bid += 16;
  317|       |		/* Is more verification possible here? */
  318|     17|	} else
  319|  18.9k|		return (ARCHIVE_WARN);
  ------------------
  |  |  236|  18.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  320|       |
  321|    844|	return (bid);
  322|  19.8k|}
archive_read_support_format_cpio.c:header_odc:
  843|  1.74k|{
  844|  1.74k|	const void *h;
  845|  1.74k|	int r;
  846|  1.74k|	const char *header;
  847|       |
  848|  1.74k|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_POSIX;
  ------------------
  |  |  361|  1.74k|#define	ARCHIVE_FORMAT_CPIO_POSIX		(ARCHIVE_FORMAT_CPIO | 1)
  |  |  ------------------
  |  |  |  |  360|  1.74k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  849|  1.74k|	a->archive.archive_format_name = "POSIX octet-oriented cpio";
  850|       |
  851|       |	/* Find the start of the next header. */
  852|  1.74k|	r = find_odc_header(a);
  853|  1.74k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  236|  1.74k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (853:6): [True: 223, False: 1.52k]
  ------------------
  854|    223|		return (r);
  855|       |
  856|  1.52k|	if (a->archive.archive_format == ARCHIVE_FORMAT_CPIO_AFIO_LARGE) {
  ------------------
  |  |  366|  1.52k|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  360|  1.52k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  |  Branch (856:6): [True: 85, False: 1.44k]
  ------------------
  857|     85|		int r2 = (header_afiol(a, cpio, entry, namelength, name_pad));
  858|     85|		if (r2 == ARCHIVE_OK)
  ------------------
  |  |  234|     85|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (858:7): [True: 23, False: 62]
  ------------------
  859|     23|			return (r);
  860|     62|		else
  861|     62|			return (r2);
  862|     85|	}
  863|       |
  864|       |	/* Read fixed-size portion of header. */
  865|  1.44k|	h = __archive_read_ahead(a, odc_header_size, NULL);
  ------------------
  |  |   93|  1.44k|#define	odc_header_size 76
  ------------------
  866|  1.44k|	if (h == NULL) {
  ------------------
  |  Branch (866:6): [True: 0, False: 1.44k]
  ------------------
  867|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  868|      0|		    "End of file trying to read next cpio header");
  869|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  870|      0|	}
  871|       |
  872|       |	/* Parse out octal fields. */
  873|  1.44k|	header = (const char *)h;
  874|       |
  875|  1.44k|	archive_entry_set_dev(entry, 
  876|  1.44k|		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   73|  1.44k|#define	odc_dev_offset 6
  ------------------
              		(dev_t)atol8(header + odc_dev_offset, odc_dev_size));
  ------------------
  |  |   74|  1.44k|#define	odc_dev_size 6
  ------------------
  877|  1.44k|	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   75|  1.44k|#define	odc_ino_offset 12
  ------------------
              	archive_entry_set_ino(entry, atol8(header + odc_ino_offset, odc_ino_size));
  ------------------
  |  |   76|  1.44k|#define	odc_ino_size 6
  ------------------
  878|  1.44k|	archive_entry_set_mode(entry, 
  879|  1.44k|		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   77|  1.44k|#define	odc_mode_offset 18
  ------------------
              		(mode_t)atol8(header + odc_mode_offset, odc_mode_size));
  ------------------
  |  |   78|  1.44k|#define	odc_mode_size 6
  ------------------
  880|  1.44k|	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   79|  1.44k|#define	odc_uid_offset 24
  ------------------
              	archive_entry_set_uid(entry, atol8(header + odc_uid_offset, odc_uid_size));
  ------------------
  |  |   80|  1.44k|#define	odc_uid_size 6
  ------------------
  881|  1.44k|	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   81|  1.44k|#define	odc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol8(header + odc_gid_offset, odc_gid_size));
  ------------------
  |  |   82|  1.44k|#define	odc_gid_size 6
  ------------------
  882|  1.44k|	archive_entry_set_nlink(entry, 
  883|  1.44k|		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   83|  1.44k|#define	odc_nlink_offset 36
  ------------------
              		(unsigned int)atol8(header + odc_nlink_offset, odc_nlink_size));
  ------------------
  |  |   84|  1.44k|#define	odc_nlink_size 6
  ------------------
  884|  1.44k|	archive_entry_set_rdev(entry,
  885|  1.44k|		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   85|  1.44k|#define	odc_rdev_offset 42
  ------------------
              		(dev_t)atol8(header + odc_rdev_offset, odc_rdev_size));
  ------------------
  |  |   86|  1.44k|#define	odc_rdev_size 6
  ------------------
  886|  1.44k|	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   87|  1.44k|#define	odc_mtime_offset 48
  ------------------
              	archive_entry_set_mtime(entry, atol8(header + odc_mtime_offset, odc_mtime_size), 0);
  ------------------
  |  |   88|  1.44k|#define	odc_mtime_size 11
  ------------------
  887|  1.44k|	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   89|  1.44k|#define	odc_namesize_offset 59
  ------------------
              	*namelength = (size_t)atol8(header + odc_namesize_offset, odc_namesize_size);
  ------------------
  |  |   90|  1.44k|#define	odc_namesize_size 6
  ------------------
  888|  1.44k|	*name_pad = 0; /* No padding of filename. */
  889|       |
  890|       |	/*
  891|       |	 * Note: entry_bytes_remaining is at least 64 bits and
  892|       |	 * therefore guaranteed to be big enough for a 33-bit file
  893|       |	 * size.
  894|       |	 */
  895|  1.44k|	cpio->entry_bytes_remaining =
  896|  1.44k|	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   91|  1.44k|#define	odc_filesize_offset 65
  ------------------
              	    atol8(header + odc_filesize_offset, odc_filesize_size);
  ------------------
  |  |   92|  1.44k|#define	odc_filesize_size 11
  ------------------
  897|  1.44k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  898|  1.44k|	cpio->entry_padding = 0;
  899|  1.44k|	__archive_read_consume(a, odc_header_size);
  ------------------
  |  |   93|  1.44k|#define	odc_header_size 76
  ------------------
  900|  1.44k|	return (r);
  901|  1.44k|}
archive_read_support_format_cpio.c:find_odc_header:
  761|  1.74k|{
  762|  1.74k|	const void *h;
  763|  1.74k|	const char *p, *q;
  764|  1.74k|	int64_t skip;
  765|  1.74k|	uintmax_t skipped = 0;
  766|  1.74k|	ssize_t bytes;
  767|       |
  768|  6.07k|	for (;;) {
  769|  6.07k|		size_t header_size;
  770|       |
  771|  6.07k|		header_size = afiol_header_size;
  ------------------
  |  |  162|  6.07k|#define afiol_header_size 116
  ------------------
  772|  6.07k|		h = __archive_read_ahead(a, afiol_header_size, &bytes);
  ------------------
  |  |  162|  6.07k|#define afiol_header_size 116
  ------------------
  773|  6.07k|		if (h == NULL) {
  ------------------
  |  Branch (773:7): [True: 437, False: 5.63k]
  ------------------
  774|    437|			if (bytes >= odc_header_size) {
  ------------------
  |  |   93|    437|#define	odc_header_size 76
  ------------------
  |  Branch (774:8): [True: 214, False: 223]
  ------------------
  775|    214|				header_size = odc_header_size;
  ------------------
  |  |   93|    214|#define	odc_header_size 76
  ------------------
  776|    214|				h = __archive_read_ahead(a, odc_header_size,
  ------------------
  |  |   93|    214|#define	odc_header_size 76
  ------------------
  777|    214|				    &bytes);
  778|    214|			}
  779|    437|			if (h == NULL) {
  ------------------
  |  Branch (779:8): [True: 223, False: 214]
  ------------------
  780|    223|				archive_set_error(&a->archive,
  781|    223|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    223|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  782|    223|				    "End of file trying to read next cpio header");
  783|    223|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    223|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  784|    223|			}
  785|    437|		}
  786|  5.85k|		p = h;
  787|  5.85k|		q = p + bytes;
  788|       |
  789|       |		/* Try the typical case first, then go into the slow search.*/
  790|  5.85k|		if (memcmp("070707", p, 6) == 0 && is_octal(p, odc_header_size))
  ------------------
  |  |   93|  1.13k|#define	odc_header_size 76
  ------------------
  |  Branch (790:7): [True: 1.13k, False: 4.72k]
  |  Branch (790:38): [True: 237, False: 895]
  ------------------
  791|    237|			return (ARCHIVE_OK);
  ------------------
  |  |  234|    237|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  792|  5.61k|		if (memcmp("070727", p, 6) == 0 && is_afio_large(p, bytes)) {
  ------------------
  |  Branch (792:7): [True: 491, False: 5.12k]
  |  Branch (792:38): [True: 55, False: 436]
  ------------------
  793|     55|			a->archive.archive_format = ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  366|     55|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  360|     55|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  794|     55|			return (ARCHIVE_OK);
  ------------------
  |  |  234|     55|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  795|     55|		}
  796|       |
  797|       |		/*
  798|       |		 * Scan ahead until we find something that looks
  799|       |		 * like an odc header.
  800|       |		 */
  801|  3.95M|		while (p + header_size <= q) {
  ------------------
  |  Branch (801:10): [True: 3.94M, False: 4.32k]
  ------------------
  802|  3.94M|			switch (p[5]) {
  803|  1.12M|			case '7':
  ------------------
  |  Branch (803:4): [True: 1.12M, False: 2.81M]
  ------------------
  804|  1.12M|				if ((memcmp("070707", p, 6) == 0
  ------------------
  |  Branch (804:10): [True: 16.0k, False: 1.11M]
  ------------------
  805|  16.0k|				    && is_octal(p, odc_header_size))
  ------------------
  |  |   93|  16.0k|#define	odc_header_size 76
  ------------------
  |  Branch (805:12): [True: 1.20k, False: 14.8k]
  ------------------
  806|  1.12M|				    || (memcmp("070727", p, 6) == 0
  ------------------
  |  Branch (806:13): [True: 349k, False: 778k]
  ------------------
  807|   349k|				        && is_afio_large(p, q - p))) {
  ------------------
  |  Branch (807:16): [True: 30, False: 349k]
  ------------------
  808|  1.23k|					skip = p - (const char *)h;
  809|  1.23k|					__archive_read_consume(a, skip);
  810|  1.23k|					skipped += skip;
  811|  1.23k|					if (p[4] == '2')
  ------------------
  |  Branch (811:10): [True: 30, False: 1.20k]
  ------------------
  812|     30|						a->archive.archive_format =
  813|     30|						    ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  366|     30|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  360|     30|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  814|  1.23k|					if (skipped > 0) {
  ------------------
  |  Branch (814:10): [True: 1.23k, False: 0]
  ------------------
  815|  1.23k|						archive_set_error(&a->archive,
  816|  1.23k|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.23k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  817|  1.23k|						    "Skipped %ju bytes before "
  818|  1.23k|						    "finding valid header",
  819|  1.23k|						    skipped);
  820|  1.23k|						return (ARCHIVE_WARN);
  ------------------
  |  |  236|  1.23k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  821|  1.23k|					}
  822|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  823|  1.23k|				}
  824|  1.12M|				p += 2;
  825|  1.12M|				break;
  826|   422k|			case '0':
  ------------------
  |  Branch (826:4): [True: 422k, False: 3.52M]
  ------------------
  827|   422k|				p++;
  828|   422k|				break;
  829|  2.39M|			default:
  ------------------
  |  Branch (829:4): [True: 2.39M, False: 1.55M]
  ------------------
  830|  2.39M|				p += 6;
  831|  2.39M|				break;
  832|  3.94M|			}
  833|  3.94M|		}
  834|  4.32k|		skip = p - (const char *)h;
  835|  4.32k|		__archive_read_consume(a, skip);
  836|  4.32k|		skipped += skip;
  837|  4.32k|	}
  838|  1.74k|}
archive_read_support_format_cpio.c:is_octal:
  729|  17.1k|{
  730|   406k|	while (len-- > 0) {
  ------------------
  |  Branch (730:9): [True: 405k, False: 1.44k]
  ------------------
  731|   405k|		if (*p < '0' || *p > '7')
  ------------------
  |  Branch (731:7): [True: 14.7k, False: 390k]
  |  Branch (731:19): [True: 1.02k, False: 389k]
  ------------------
  732|  15.7k|			return (0);
  733|   389k|	        ++p;
  734|   389k|	}
  735|  1.44k|	return (1);
  736|  17.1k|}
archive_read_support_format_cpio.c:is_afio_large:
  740|   349k|{
  741|   349k|	if (len < afiol_header_size)
  ------------------
  |  |  162|   349k|#define afiol_header_size 116
  ------------------
  |  Branch (741:6): [True: 84, False: 349k]
  ------------------
  742|     84|		return (0);
  743|   349k|	if (h[afiol_ino_m_offset] != 'm'
  ------------------
  |  |  138|   349k|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
  |  Branch (743:6): [True: 339k, False: 10.3k]
  ------------------
  744|  10.3k|	    || h[afiol_mtime_n_offset] != 'n'
  ------------------
  |  |  151|  10.3k|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
  |  Branch (744:9): [True: 1.33k, False: 9.03k]
  ------------------
  745|  9.03k|	    || h[afiol_xsize_s_offset] != 's'
  ------------------
  |  |  158|  9.03k|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
  |  Branch (745:9): [True: 508, False: 8.52k]
  ------------------
  746|  8.52k|	    || h[afiol_filesize_c_offset] != ':')
  ------------------
  |  |  161|  8.52k|#define	afiol_filesize_c_offset 115	/* ':' */
  ------------------
  |  Branch (746:9): [True: 376, False: 8.15k]
  ------------------
  747|   341k|		return (0);
  748|  8.15k|	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  134|  8.15k|#define	afiol_dev_offset 6
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  138|  8.15k|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
              	if (!is_hex(h + afiol_dev_offset, afiol_ino_m_offset - afiol_dev_offset))
  ------------------
  |  |  134|  8.15k|#define	afiol_dev_offset 6
  ------------------
  |  Branch (748:6): [True: 5.77k, False: 2.37k]
  ------------------
  749|  5.77k|		return (0);
  750|  2.37k|	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  139|  2.37k|#define	afiol_mode_offset 31
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  151|  2.37k|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
              	if (!is_hex(h + afiol_mode_offset, afiol_mtime_n_offset - afiol_mode_offset))
  ------------------
  |  |  139|  2.37k|#define	afiol_mode_offset 31
  ------------------
  |  Branch (750:6): [True: 855, False: 1.52k]
  ------------------
  751|    855|		return (0);
  752|  1.52k|	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  152|  1.52k|#define	afiol_namesize_offset 86
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  158|  1.52k|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
              	if (!is_hex(h + afiol_namesize_offset, afiol_xsize_s_offset - afiol_namesize_offset))
  ------------------
  |  |  152|  1.52k|#define	afiol_namesize_offset 86
  ------------------
  |  Branch (752:6): [True: 535, False: 987]
  ------------------
  753|    535|		return (0);
  754|    987|	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  159|    987|#define	afiol_filesize_offset 99
  ------------------
              	if (!is_hex(h + afiol_filesize_offset, afiol_filesize_size))
  ------------------
  |  |  160|    987|#define	afiol_filesize_size 16	/* hex */
  ------------------
  |  Branch (754:6): [True: 902, False: 85]
  ------------------
  755|    902|		return (0);
  756|     85|	return (1);
  757|    987|}
archive_read_support_format_cpio.c:is_hex:
  540|   197k|{
  541|  3.69M|	while (len-- > 0) {
  ------------------
  |  Branch (541:9): [True: 3.68M, False: 12.3k]
  ------------------
  542|  3.68M|		if ((*p >= '0' && *p <= '9')
  ------------------
  |  Branch (542:8): [True: 3.61M, False: 68.1k]
  |  Branch (542:21): [True: 2.29M, False: 1.31M]
  ------------------
  543|  1.38M|		    || (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (543:11): [True: 942k, False: 445k]
  |  Branch (543:24): [True: 826k, False: 115k]
  ------------------
  544|   560k|		    || (*p >= 'A' && *p <= 'F'))
  ------------------
  |  Branch (544:11): [True: 492k, False: 68.3k]
  |  Branch (544:24): [True: 375k, False: 116k]
  ------------------
  545|  3.49M|			++p;
  546|   184k|		else
  547|   184k|			return (0);
  548|  3.68M|	}
  549|  12.3k|	return (1);
  550|   197k|}
archive_read_support_format_cpio.c:header_afiol:
  913|     85|{
  914|     85|	int64_t t;
  915|     85|	uint64_t u;
  916|     85|	const void *h;
  917|     85|	const char *header;
  918|       |
  919|     85|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_AFIO_LARGE;
  ------------------
  |  |  366|     85|#define	ARCHIVE_FORMAT_CPIO_AFIO_LARGE		(ARCHIVE_FORMAT_CPIO | 6)
  |  |  ------------------
  |  |  |  |  360|     85|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  920|     85|	a->archive.archive_format_name = "afio large ASCII";
  921|       |
  922|       |	/* Read fixed-size portion of header. */
  923|     85|	h = __archive_read_ahead(a, afiol_header_size, NULL);
  ------------------
  |  |  162|     85|#define afiol_header_size 116
  ------------------
  924|     85|	if (h == NULL) {
  ------------------
  |  Branch (924:6): [True: 0, False: 85]
  ------------------
  925|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  926|      0|		    "End of file trying to read next cpio header");
  927|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  928|      0|	}
  929|       |
  930|       |	/* Parse out octal fields. */
  931|     85|	header = (const char *)h;
  932|       |
  933|     85|	archive_entry_set_dev(entry, 
  934|     85|		(dev_t)atol16(header + afiol_dev_offset, afiol_dev_size));
  ------------------
  |  |  134|     85|#define	afiol_dev_offset 6
  ------------------
              		(dev_t)atol16(header + afiol_dev_offset, afiol_dev_size));
  ------------------
  |  |  135|     85|#define	afiol_dev_size 8	/* hex */
  ------------------
  935|     85|	u = atol16u(header + afiol_ino_offset, afiol_ino_size);
  ------------------
  |  |  136|     85|#define	afiol_ino_offset 14
  ------------------
              	u = atol16u(header + afiol_ino_offset, afiol_ino_size);
  ------------------
  |  |  137|     85|#define	afiol_ino_size 16	/* hex */
  ------------------
  936|     85|#if ARCHIVE_VERSION_NUMBER < 4000000
  937|     85|	archive_entry_set_ino(entry, (int64_t)(u & INT64_MAX));
  938|       |#else
  939|       |	archive_entry_set_ino(entry, u);
  940|       |#endif
  941|     85|	archive_entry_set_mode(entry,
  942|     85|		(mode_t)atol8(header + afiol_mode_offset, afiol_mode_size));
  ------------------
  |  |  139|     85|#define	afiol_mode_offset 31
  ------------------
              		(mode_t)atol8(header + afiol_mode_offset, afiol_mode_size));
  ------------------
  |  |  140|     85|#define	afiol_mode_size 6	/* oct */
  ------------------
  943|     85|	archive_entry_set_uid(entry, atol16(header + afiol_uid_offset, afiol_uid_size));
  ------------------
  |  |  141|     85|#define	afiol_uid_offset 37
  ------------------
              	archive_entry_set_uid(entry, atol16(header + afiol_uid_offset, afiol_uid_size));
  ------------------
  |  |  142|     85|#define	afiol_uid_size 8	/* hex */
  ------------------
  944|     85|	archive_entry_set_gid(entry, atol16(header + afiol_gid_offset, afiol_gid_size));
  ------------------
  |  |  143|     85|#define	afiol_gid_offset 45
  ------------------
              	archive_entry_set_gid(entry, atol16(header + afiol_gid_offset, afiol_gid_size));
  ------------------
  |  |  144|     85|#define	afiol_gid_size 8	/* hex */
  ------------------
  945|     85|	archive_entry_set_nlink(entry,
  946|     85|		(unsigned int)atol16(header + afiol_nlink_offset, afiol_nlink_size));
  ------------------
  |  |  145|     85|#define	afiol_nlink_offset 53
  ------------------
              		(unsigned int)atol16(header + afiol_nlink_offset, afiol_nlink_size));
  ------------------
  |  |  146|     85|#define	afiol_nlink_size 8	/* hex */
  ------------------
  947|     85|	archive_entry_set_rdev(entry,
  948|     85|		(dev_t)atol16(header + afiol_rdev_offset, afiol_rdev_size));
  ------------------
  |  |  147|     85|#define	afiol_rdev_offset 61
  ------------------
              		(dev_t)atol16(header + afiol_rdev_offset, afiol_rdev_size));
  ------------------
  |  |  148|     85|#define	afiol_rdev_size 8	/* hex */
  ------------------
  949|     85|	archive_entry_set_mtime(entry, atol16(header + afiol_mtime_offset, afiol_mtime_size), 0);
  ------------------
  |  |  149|     85|#define	afiol_mtime_offset 69
  ------------------
              	archive_entry_set_mtime(entry, atol16(header + afiol_mtime_offset, afiol_mtime_size), 0);
  ------------------
  |  |  150|     85|#define	afiol_mtime_size 16	/* hex */
  ------------------
  950|     85|	*namelength = (size_t)atol16(header + afiol_namesize_offset, afiol_namesize_size);
  ------------------
  |  |  152|     85|#define	afiol_namesize_offset 86
  ------------------
              	*namelength = (size_t)atol16(header + afiol_namesize_offset, afiol_namesize_size);
  ------------------
  |  |  153|     85|#define	afiol_namesize_size 4	/* hex */
  ------------------
  951|     85|	*name_pad = 0; /* No padding of filename. */
  952|       |
  953|     85|	t = atol16(header + afiol_filesize_offset, afiol_filesize_size);
  ------------------
  |  |  159|     85|#define	afiol_filesize_offset 99
  ------------------
              	t = atol16(header + afiol_filesize_offset, afiol_filesize_size);
  ------------------
  |  |  160|     85|#define	afiol_filesize_size 16	/* hex */
  ------------------
  954|     85|	if (t < 0) {
  ------------------
  |  Branch (954:6): [True: 62, False: 23]
  ------------------
  955|     62|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     62|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  956|     62|		    "Nonsensical file size");
  957|     62|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     62|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  958|     62|	}
  959|     23|	cpio->entry_bytes_remaining = t;
  960|     23|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  961|     23|	cpio->entry_padding = 0;
  962|     23|	__archive_read_consume(a, afiol_header_size);
  ------------------
  |  |  162|     23|#define afiol_header_size 116
  ------------------
  963|     23|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  964|     85|}
archive_read_support_format_cpio.c:atol16:
 1113|  80.9k|{
 1114|  80.9k|	return ((int64_t)atol16u(p, char_cnt));
 1115|  80.9k|}
archive_read_support_format_cpio.c:atol16u:
 1119|  88.7k|{
 1120|  88.7k|	uint64_t l;
 1121|  88.7k|	int digit;
 1122|       |
 1123|  88.7k|	l = 0;
 1124|   800k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1124:9): [True: 711k, False: 88.7k]
  ------------------
 1125|   711k|		if (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (1125:7): [True: 54.8k, False: 657k]
  |  Branch (1125:20): [True: 54.8k, False: 0]
  ------------------
 1126|  54.8k|			digit = *p - 'a' + 10;
 1127|   657k|		else if (*p >= 'A' && *p <= 'F')
  ------------------
  |  Branch (1127:12): [True: 116k, False: 540k]
  |  Branch (1127:25): [True: 116k, False: 0]
  ------------------
 1128|   116k|			digit = *p - 'A' + 10;
 1129|   540k|		else if (*p >= '0' && *p <= '9')
  ------------------
  |  Branch (1129:12): [True: 540k, False: 0]
  |  Branch (1129:25): [True: 540k, False: 0]
  ------------------
 1130|   540k|			digit = *p - '0';
 1131|      0|		else
 1132|      0|			return (l);
 1133|   711k|		p++;
 1134|   711k|		l <<= 4;
 1135|   711k|		l |= digit;
 1136|   711k|	}
 1137|  88.7k|	return (l);
 1138|  88.7k|}
archive_read_support_format_cpio.c:atol8:
 1094|  14.4k|{
 1095|  14.4k|	uint64_t l;
 1096|  14.4k|	int digit;
 1097|       |
 1098|  14.4k|	l = 0;
 1099|   115k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1099:9): [True: 101k, False: 14.4k]
  ------------------
 1100|   101k|		if (*p >= '0' && *p <= '7')
  ------------------
  |  Branch (1100:7): [True: 101k, False: 0]
  |  Branch (1100:20): [True: 101k, False: 82]
  ------------------
 1101|   101k|			digit = *p - '0';
 1102|     82|		else
 1103|     82|			return ((int64_t)l);
 1104|   101k|		p++;
 1105|   101k|		l <<= 3;
 1106|   101k|		l |= digit;
 1107|   101k|	}
 1108|  14.4k|	return ((int64_t)l);
 1109|  14.4k|}
archive_read_support_format_cpio.c:header_newc:
  625|  7.52k|{
  626|  7.52k|	const void *h;
  627|  7.52k|	const char *header;
  628|  7.52k|	uint64_t size;
  629|  7.52k|	int swupdate = 0;
  630|  7.52k|	int r;
  631|       |
  632|  7.52k|	r = find_newc_header(a);
  633|  7.52k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  236|  7.52k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (633:6): [True: 190, False: 7.33k]
  ------------------
  634|    190|		return (r);
  635|       |
  636|       |	/* Read fixed-size portion of header. */
  637|  7.33k|	h = __archive_read_ahead(a, newc_header_size, NULL);
  ------------------
  |  |  123|  7.33k|#define	newc_header_size 110
  ------------------
  638|  7.33k|	if (h == NULL) {
  ------------------
  |  Branch (638:6): [True: 0, False: 7.33k]
  ------------------
  639|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  640|      0|		    "End of file trying to read next cpio header");
  641|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  642|      0|	}
  643|       |
  644|       |	/* Parse out hex fields. */
  645|  7.33k|	header = (const char *)h;
  646|       |
  647|  7.33k|	if (memcmp(header + newc_magic_offset, "070701", 6) == 0) {
  ------------------
  |  |   95|  7.33k|#define	newc_magic_offset 0
  ------------------
  |  Branch (647:6): [True: 5.10k, False: 2.22k]
  ------------------
  648|  5.10k|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC;
  ------------------
  |  |  364|  5.10k|#define	ARCHIVE_FORMAT_CPIO_SVR4_NOCRC		(ARCHIVE_FORMAT_CPIO | 4)
  |  |  ------------------
  |  |  |  |  360|  5.10k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  649|  5.10k|		a->archive.archive_format_name = "ASCII cpio (SVR4 with no CRC)";
  650|  5.10k|	} else if (memcmp(header + newc_magic_offset, "070702", 6) == 0) {
  ------------------
  |  |   95|  2.22k|#define	newc_magic_offset 0
  ------------------
  |  Branch (650:13): [True: 1.86k, False: 363]
  ------------------
  651|  1.86k|		a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_CRC;
  ------------------
  |  |  365|  1.86k|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC		(ARCHIVE_FORMAT_CPIO | 5)
  |  |  ------------------
  |  |  |  |  360|  1.86k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  652|  1.86k|		a->archive.archive_format_name = "ASCII cpio (SVR4 with CRC)";
  653|  1.86k|	} else if (memcmp(header + newc_magic_offset, "070704", 6) == 0) {
  ------------------
  |  |   95|    363|#define	newc_magic_offset 0
  ------------------
  |  Branch (653:13): [True: 363, False: 0]
  ------------------
  654|       |		/*
  655|       |		 * SVR4 with CRC for files of 4 GiB and more, used by
  656|       |		 * SWUpdate: rdevmajor has the upper 32 bits of the file
  657|       |		 * size, so the entry has no rdevmajor.
  658|       |		 */
  659|    363|		a->archive.archive_format =
  660|    363|		    ARCHIVE_FORMAT_CPIO_SVR4_CRC_SWUPDATE;
  ------------------
  |  |  368|    363|#define	ARCHIVE_FORMAT_CPIO_SVR4_CRC_SWUPDATE	(ARCHIVE_FORMAT_CPIO | 8)
  |  |  ------------------
  |  |  |  |  360|    363|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  661|    363|		a->archive.archive_format_name =
  662|    363|		    "ASCII cpio (SVR4 with CRC, SWUpdate 64-bit)";
  663|    363|		swupdate = 1;
  664|    363|	} else {
  665|       |		/* TODO: Abort here? */
  666|      0|	}
  667|       |
  668|  7.33k|	archive_entry_set_devmajor(entry,
  669|  7.33k|		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  111|  7.33k|#define	newc_devmajor_offset 62
  ------------------
              		(dev_t)atol16(header + newc_devmajor_offset, newc_devmajor_size));
  ------------------
  |  |  112|  7.33k|#define	newc_devmajor_size 8
  ------------------
  670|  7.33k|	archive_entry_set_devminor(entry, 
  671|  7.33k|		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  113|  7.33k|#define	newc_devminor_offset 70
  ------------------
              		(dev_t)atol16(header + newc_devminor_offset, newc_devminor_size));
  ------------------
  |  |  114|  7.33k|#define	newc_devminor_size 8
  ------------------
  672|  7.33k|	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   97|  7.33k|#define	newc_ino_offset 6
  ------------------
              	archive_entry_set_ino(entry, atol16(header + newc_ino_offset, newc_ino_size));
  ------------------
  |  |   98|  7.33k|#define	newc_ino_size 8
  ------------------
  673|  7.33k|	archive_entry_set_mode(entry, 
  674|  7.33k|		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |   99|  7.33k|#define	newc_mode_offset 14
  ------------------
              		(mode_t)atol16(header + newc_mode_offset, newc_mode_size));
  ------------------
  |  |  100|  7.33k|#define	newc_mode_size 8
  ------------------
  675|  7.33k|	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  101|  7.33k|#define	newc_uid_offset 22
  ------------------
              	archive_entry_set_uid(entry, atol16(header + newc_uid_offset, newc_uid_size));
  ------------------
  |  |  102|  7.33k|#define	newc_uid_size 8
  ------------------
  676|  7.33k|	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  103|  7.33k|#define	newc_gid_offset 30
  ------------------
              	archive_entry_set_gid(entry, atol16(header + newc_gid_offset, newc_gid_size));
  ------------------
  |  |  104|  7.33k|#define	newc_gid_size 8
  ------------------
  677|  7.33k|	archive_entry_set_nlink(entry,
  678|  7.33k|		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  105|  7.33k|#define	newc_nlink_offset 38
  ------------------
              		(unsigned int)atol16(header + newc_nlink_offset, newc_nlink_size));
  ------------------
  |  |  106|  7.33k|#define	newc_nlink_size 8
  ------------------
  679|  7.33k|	if (!swupdate)
  ------------------
  |  Branch (679:6): [True: 6.97k, False: 363]
  ------------------
  680|  6.97k|		archive_entry_set_rdevmajor(entry, (dev_t)atol16(
  681|  6.97k|		    header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  115|  6.97k|#define	newc_rdevmajor_offset 78
  ------------------
              		    header + newc_rdevmajor_offset, newc_rdevmajor_size));
  ------------------
  |  |  116|  6.97k|#define	newc_rdevmajor_size 8
  ------------------
  682|  7.33k|	archive_entry_set_rdevminor(entry,
  683|  7.33k|		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  117|  7.33k|#define	newc_rdevminor_offset 86
  ------------------
              		(dev_t)atol16(header + newc_rdevminor_offset, newc_rdevminor_size));
  ------------------
  |  |  118|  7.33k|#define	newc_rdevminor_size 8
  ------------------
  684|  7.33k|	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  107|  7.33k|#define	newc_mtime_offset 46
  ------------------
              	archive_entry_set_mtime(entry, atol16(header + newc_mtime_offset, newc_mtime_size), 0);
  ------------------
  |  |  108|  7.33k|#define	newc_mtime_size 8
  ------------------
  685|  7.33k|	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  119|  7.33k|#define	newc_namesize_offset 94
  ------------------
              	*namelength = (size_t)atol16(header + newc_namesize_offset, newc_namesize_size);
  ------------------
  |  |  120|  7.33k|#define	newc_namesize_size 8
  ------------------
  686|       |	/* Pad name to 2 more than a multiple of 4. */
  687|  7.33k|	*name_pad = (2 - *namelength) & 3;
  688|       |
  689|       |	/* Make sure that the padded name length fits into size_t. */
  690|  7.33k|	if (*name_pad > SIZE_MAX - *namelength) {
  ------------------
  |  Branch (690:6): [True: 0, False: 7.33k]
  ------------------
  691|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  692|      0|		    "cpio archive has invalid namelength");
  693|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  694|      0|	}
  695|       |
  696|       |	/*
  697|       |	 * The file size has 32 bits, 64 bits in the SWUpdate variant.
  698|       |	 * entry_bytes_remaining is an int64_t, and the data is padded
  699|       |	 * to a multiple of 4, so a 64-bit size must not be larger than
  700|       |	 * INT64_MAX - 3.  A 32-bit size always fits.
  701|       |	 */
  702|  7.33k|	size = atol16u(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  109|  7.33k|#define	newc_filesize_offset 54
  ------------------
              	size = atol16u(header + newc_filesize_offset, newc_filesize_size);
  ------------------
  |  |  110|  7.33k|#define	newc_filesize_size 8
  ------------------
  703|  7.33k|	if (swupdate) {
  ------------------
  |  Branch (703:6): [True: 363, False: 6.97k]
  ------------------
  704|    363|		size |= atol16u(header + newc_rdevmajor_offset,
  ------------------
  |  |  115|    363|#define	newc_rdevmajor_offset 78
  ------------------
  705|    363|		    newc_rdevmajor_size) << 32;
  ------------------
  |  |  116|    363|#define	newc_rdevmajor_size 8
  ------------------
  706|    363|		if (size > (uint64_t)INT64_MAX - 3) {
  ------------------
  |  Branch (706:7): [True: 27, False: 336]
  ------------------
  707|     27|			archive_set_error(&a->archive,
  708|     27|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     27|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  709|     27|			    "cpio archive has invalid file size");
  710|     27|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     27|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  711|     27|		}
  712|    363|	}
  713|  7.30k|	cpio->entry_bytes_remaining = (int64_t)size;
  714|  7.30k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  715|       |	/* Pad file contents to a multiple of 4. */
  716|  7.30k|	cpio->entry_padding = 3 & -cpio->entry_bytes_remaining;
  717|  7.30k|	__archive_read_consume(a, newc_header_size);
  ------------------
  |  |  123|  7.30k|#define	newc_header_size 110
  ------------------
  718|  7.30k|	return (r);
  719|  7.33k|}
archive_read_support_format_cpio.c:find_newc_header:
  554|  7.52k|{
  555|  7.52k|	const void *h;
  556|  7.52k|	const char *p, *q;
  557|  7.52k|	int64_t skip;
  558|  7.52k|	uintmax_t skipped = 0;
  559|  7.52k|	ssize_t bytes;
  560|       |
  561|  21.2k|	for (;;) {
  562|  21.2k|		h = __archive_read_ahead(a, newc_header_size, &bytes);
  ------------------
  |  |  123|  21.2k|#define	newc_header_size 110
  ------------------
  563|  21.2k|		if (h == NULL) {
  ------------------
  |  Branch (563:7): [True: 190, False: 21.0k]
  ------------------
  564|    190|			archive_set_error(&a->archive,
  565|    190|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    190|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  566|    190|			    "End of file trying to read next cpio header");
  567|    190|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    190|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  568|    190|		}
  569|  21.0k|		p = h;
  570|  21.0k|		q = p + bytes;
  571|       |
  572|       |		/* Try the typical case first, then go into the slow search.*/
  573|  21.0k|		if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (573:7): [True: 3.29k, False: 17.7k]
  ------------------
  574|  3.29k|		    && (p[5] == '1' || p[5] == '2' || p[5] == '4')
  ------------------
  |  Branch (574:11): [True: 1.06k, False: 2.22k]
  |  Branch (574:26): [True: 753, False: 1.47k]
  |  Branch (574:41): [True: 347, False: 1.12k]
  ------------------
  575|  2.16k|		    && is_hex(p, newc_header_size))
  ------------------
  |  |  123|  2.16k|#define	newc_header_size 110
  ------------------
  |  Branch (575:10): [True: 1.10k, False: 1.06k]
  ------------------
  576|  1.10k|			return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  577|       |
  578|       |		/*
  579|       |		 * Scan ahead until we find something that looks
  580|       |		 * like a newc header.
  581|       |		 */
  582|  8.65M|		while (p + newc_header_size <= q) {
  ------------------
  |  |  123|  8.65M|#define	newc_header_size 110
  ------------------
  |  Branch (582:10): [True: 8.63M, False: 13.6k]
  ------------------
  583|  8.63M|			switch (p[5]) {
  584|   348k|			case '1':
  ------------------
  |  Branch (584:4): [True: 348k, False: 8.28M]
  ------------------
  585|   546k|			case '2':
  ------------------
  |  Branch (585:4): [True: 197k, False: 8.43M]
  ------------------
  586|   548k|			case '4':
  ------------------
  |  Branch (586:4): [True: 1.48k, False: 8.63M]
  ------------------
  587|   548k|				if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (587:9): [True: 182k, False: 366k]
  ------------------
  588|   182k|				    && is_hex(p, newc_header_size)) {
  ------------------
  |  |  123|   182k|#define	newc_header_size 110
  ------------------
  |  Branch (588:12): [True: 6.22k, False: 175k]
  ------------------
  589|  6.22k|					skip = p - (const char *)h;
  590|  6.22k|					__archive_read_consume(a, skip);
  591|  6.22k|					skipped += skip;
  592|  6.22k|					if (skipped > 0) {
  ------------------
  |  Branch (592:10): [True: 6.22k, False: 0]
  ------------------
  593|  6.22k|						archive_set_error(&a->archive,
  594|  6.22k|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  6.22k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  595|  6.22k|						    "Skipped %ju bytes before "
  596|  6.22k|						    "finding valid header",
  597|  6.22k|						    skipped);
  598|  6.22k|						return (ARCHIVE_WARN);
  ------------------
  |  |  236|  6.22k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  599|  6.22k|					}
  600|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  601|  6.22k|				}
  602|   541k|				p += 2;
  603|   541k|				break;
  604|   948k|			case '7':
  ------------------
  |  Branch (604:4): [True: 948k, False: 7.68M]
  ------------------
  605|       |				/* A header may start two bytes on. */
  606|   948k|				p += 2;
  607|   948k|				break;
  608|  1.65M|			case '0':
  ------------------
  |  Branch (608:4): [True: 1.65M, False: 6.98M]
  ------------------
  609|  1.65M|				p++;
  610|  1.65M|				break;
  611|  5.48M|			default:
  ------------------
  |  Branch (611:4): [True: 5.48M, False: 3.14M]
  ------------------
  612|  5.48M|				p += 6;
  613|  5.48M|				break;
  614|  8.63M|			}
  615|  8.63M|		}
  616|  13.6k|		skip = p - (const char *)h;
  617|  13.6k|		__archive_read_consume(a, skip);
  618|  13.6k|		skipped += skip;
  619|  13.6k|	}
  620|  7.52k|}
archive_read_support_format_cpio.c:header_bin_be:
 1015|  1.62k|{
 1016|  1.62k|	const void *h;
 1017|  1.62k|	const unsigned char *header;
 1018|       |
 1019|  1.62k|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_BE;
  ------------------
  |  |  363|  1.62k|#define	ARCHIVE_FORMAT_CPIO_BIN_BE		(ARCHIVE_FORMAT_CPIO | 3)
  |  |  ------------------
  |  |  |  |  360|  1.62k|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
 1020|  1.62k|	a->archive.archive_format_name = "cpio (big-endian binary)";
 1021|       |
 1022|       |	/* Read fixed-size portion of header. */
 1023|  1.62k|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   69|  1.62k|#define	bin_header_size 26
  ------------------
 1024|  1.62k|	if (h == NULL) {
  ------------------
  |  Branch (1024:6): [True: 33, False: 1.59k]
  ------------------
 1025|     33|	    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     33|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1026|     33|		"End of file trying to read next cpio header");
 1027|     33|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     33|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1028|     33|	}
 1029|       |
 1030|       |	/* Parse out binary fields. */
 1031|  1.59k|	header = (const unsigned char *)h;
 1032|       |
 1033|  1.59k|	archive_entry_set_dev(entry, archive_be16dec(header + bin_dev_offset));
  ------------------
  |  |   49|  1.59k|#define	bin_dev_offset 2
  ------------------
 1034|  1.59k|	archive_entry_set_ino(entry, archive_be16dec(header + bin_ino_offset));
  ------------------
  |  |   51|  1.59k|#define	bin_ino_offset 4
  ------------------
 1035|  1.59k|	archive_entry_set_mode(entry, archive_be16dec(header + bin_mode_offset));
  ------------------
  |  |   53|  1.59k|#define	bin_mode_offset 6
  ------------------
 1036|  1.59k|	if (cpio->option_pwb) {
  ------------------
  |  Branch (1036:6): [True: 0, False: 1.59k]
  ------------------
 1037|       |		/* turn off random bits left over from V6 inode */
 1038|      0|		archive_entry_set_mode(entry, archive_entry_mode(entry) & 067777);
 1039|      0|		if ((archive_entry_mode(entry) & AE_IFMT) == 0)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (1039:7): [True: 0, False: 0]
  ------------------
 1040|      0|			archive_entry_set_mode(entry, archive_entry_mode(entry) | AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1041|      0|	}
 1042|  1.59k|	archive_entry_set_uid(entry, archive_be16dec(header + bin_uid_offset));
  ------------------
  |  |   55|  1.59k|#define	bin_uid_offset 8
  ------------------
 1043|  1.59k|	archive_entry_set_gid(entry, archive_be16dec(header + bin_gid_offset));
  ------------------
  |  |   57|  1.59k|#define	bin_gid_offset 10
  ------------------
 1044|  1.59k|	archive_entry_set_nlink(entry, archive_be16dec(header + bin_nlink_offset));
  ------------------
  |  |   59|  1.59k|#define	bin_nlink_offset 12
  ------------------
 1045|  1.59k|	archive_entry_set_rdev(entry, archive_be16dec(header + bin_rdev_offset));
  ------------------
  |  |   61|  1.59k|#define	bin_rdev_offset 14
  ------------------
 1046|  1.59k|	archive_entry_set_mtime(entry, cpio_be32dec(header + bin_mtime_offset), 0);
  ------------------
  |  |   63|  1.59k|#define	bin_mtime_offset 16
  ------------------
 1047|  1.59k|	*namelength = archive_be16dec(header + bin_namesize_offset);
  ------------------
  |  |   65|  1.59k|#define	bin_namesize_offset 20
  ------------------
 1048|  1.59k|	*name_pad = *namelength & 1; /* Pad to even. */
 1049|       |
 1050|  1.59k|	cpio->entry_bytes_remaining = cpio_be32dec(header + bin_filesize_offset);
  ------------------
  |  |   67|  1.59k|#define	bin_filesize_offset 22
  ------------------
 1051|  1.59k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
 1052|  1.59k|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
 1053|  1.59k|	    __archive_read_consume(a, bin_header_size);
  ------------------
  |  |   69|  1.59k|#define	bin_header_size 26
  ------------------
 1054|  1.59k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1055|  1.62k|}
archive_read_support_format_cpio.c:cpio_be32dec:
 1083|  3.18k|{
 1084|  3.18k|	return ((int64_t)archive_be16dec(p) << 16) | archive_be16dec(p + 2);
 1085|  3.18k|}
archive_read_support_format_cpio.c:header_bin_le:
  970|    546|{
  971|    546|	const void *h;
  972|    546|	const unsigned char *header;
  973|       |
  974|    546|	a->archive.archive_format = ARCHIVE_FORMAT_CPIO_BIN_LE;
  ------------------
  |  |  362|    546|#define	ARCHIVE_FORMAT_CPIO_BIN_LE		(ARCHIVE_FORMAT_CPIO | 2)
  |  |  ------------------
  |  |  |  |  360|    546|#define	ARCHIVE_FORMAT_CPIO			0x10000
  |  |  ------------------
  ------------------
  975|    546|	a->archive.archive_format_name = "cpio (little-endian binary)";
  976|       |
  977|       |	/* Read fixed-size portion of header. */
  978|    546|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   69|    546|#define	bin_header_size 26
  ------------------
  979|    546|	if (h == NULL) {
  ------------------
  |  Branch (979:6): [True: 8, False: 538]
  ------------------
  980|      8|	    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  981|      8|		"End of file trying to read next cpio header");
  982|      8|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  983|      8|	}
  984|       |
  985|       |	/* Parse out binary fields. */
  986|    538|	header = (const unsigned char *)h;
  987|       |
  988|    538|	archive_entry_set_dev(entry, archive_le16dec(header + bin_dev_offset));
  ------------------
  |  |   49|    538|#define	bin_dev_offset 2
  ------------------
  989|    538|	archive_entry_set_ino(entry, archive_le16dec(header + bin_ino_offset));
  ------------------
  |  |   51|    538|#define	bin_ino_offset 4
  ------------------
  990|    538|	archive_entry_set_mode(entry, archive_le16dec(header + bin_mode_offset));
  ------------------
  |  |   53|    538|#define	bin_mode_offset 6
  ------------------
  991|    538|	if (cpio->option_pwb) {
  ------------------
  |  Branch (991:6): [True: 0, False: 538]
  ------------------
  992|       |		/* turn off random bits left over from V6 inode */
  993|      0|		archive_entry_set_mode(entry, archive_entry_mode(entry) & 067777);
  994|      0|		if ((archive_entry_mode(entry) & AE_IFMT) == 0)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (994:7): [True: 0, False: 0]
  ------------------
  995|      0|			archive_entry_set_mode(entry, archive_entry_mode(entry) | AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  996|      0|	}
  997|    538|	archive_entry_set_uid(entry, archive_le16dec(header + bin_uid_offset));
  ------------------
  |  |   55|    538|#define	bin_uid_offset 8
  ------------------
  998|    538|	archive_entry_set_gid(entry, archive_le16dec(header + bin_gid_offset));
  ------------------
  |  |   57|    538|#define	bin_gid_offset 10
  ------------------
  999|    538|	archive_entry_set_nlink(entry, archive_le16dec(header + bin_nlink_offset));
  ------------------
  |  |   59|    538|#define	bin_nlink_offset 12
  ------------------
 1000|    538|	archive_entry_set_rdev(entry, archive_le16dec(header + bin_rdev_offset));
  ------------------
  |  |   61|    538|#define	bin_rdev_offset 14
  ------------------
 1001|    538|	archive_entry_set_mtime(entry, cpio_le32dec(header + bin_mtime_offset), 0);
  ------------------
  |  |   63|    538|#define	bin_mtime_offset 16
  ------------------
 1002|    538|	*namelength = archive_le16dec(header + bin_namesize_offset);
  ------------------
  |  |   65|    538|#define	bin_namesize_offset 20
  ------------------
 1003|    538|	*name_pad = *namelength & 1; /* Pad to even. */
 1004|       |
 1005|    538|	cpio->entry_bytes_remaining = cpio_le32dec(header + bin_filesize_offset);
  ------------------
  |  |   67|    538|#define	bin_filesize_offset 22
  ------------------
 1006|    538|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
 1007|    538|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
 1008|    538|	__archive_read_consume(a, bin_header_size);
  ------------------
  |  |   69|    538|#define	bin_header_size 26
  ------------------
 1009|    538|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    538|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1010|    546|}
archive_read_support_format_cpio.c:cpio_le32dec:
 1077|  1.07k|{
 1078|  1.07k|	return ((int64_t)archive_le16dec(p) << 16) | archive_le16dec(p + 2);
 1079|  1.07k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_header:
  364|  11.4k|{
  365|  11.4k|	struct cpio *cpio = a->format->data;
  366|  11.4k|	const void *h, *hl;
  367|  11.4k|	struct archive_string_conv *sconv;
  368|  11.4k|	size_t namelength;
  369|  11.4k|	size_t name_pad;
  370|  11.4k|	int is_trailer;
  371|  11.4k|	int r;
  372|       |
  373|  11.4k|	sconv = cpio->opt_sconv;
  374|  11.4k|	if (sconv == NULL) {
  ------------------
  |  Branch (374:6): [True: 11.4k, False: 0]
  ------------------
  375|  11.4k|		if (!cpio->init_default_conversion) {
  ------------------
  |  Branch (375:7): [True: 827, False: 10.6k]
  ------------------
  376|    827|			cpio->sconv_default =
  377|    827|			    archive_string_default_conversion_for_read(
  378|    827|			      &(a->archive));
  379|    827|			cpio->init_default_conversion = 1;
  380|    827|		}
  381|  11.4k|		sconv = cpio->sconv_default;
  382|  11.4k|	}
  383|       |	
  384|  11.4k|	r = (cpio->read_header(a, cpio, entry, &namelength, &name_pad));
  385|       |
  386|  11.4k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  236|  11.4k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (386:6): [True: 543, False: 10.9k]
  ------------------
  387|    543|		return (r);
  388|       |
  389|  10.9k|	if (namelength > CPIO_PATHNAME_MAX) {
  ------------------
  |  |  165|  10.9k|#define	CPIO_PATHNAME_MAX	(1024 * 1024)
  ------------------
  |  Branch (389:6): [True: 107, False: 10.7k]
  ------------------
  390|    107|		archive_set_error(&a->archive, ENOMEM,
  391|    107|		    "Rejecting malformed cpio archive: "
  392|    107|		    "pathname exceeds 1 megabyte");
  393|    107|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    107|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  394|    107|	}
  395|       |
  396|       |	/* Read name from buffer. */
  397|  10.7k|	h = __archive_read_ahead(a, namelength, NULL);
  398|  10.7k|	if (h == NULL) {
  ------------------
  |  Branch (398:6): [True: 44, False: 10.7k]
  ------------------
  399|     44|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     44|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  400|     44|		    "Truncated cpio file name");
  401|     44|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     44|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  402|     44|	}
  403|  10.7k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  10.7k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (403:6): [True: 0, False: 10.7k]
  ------------------
  404|  10.7k|	    (const char *)h, namelength, sconv) != 0) {
  405|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (405:7): [True: 0, False: 0]
  ------------------
  406|      0|			archive_set_error(&a->archive, ENOMEM,
  407|      0|			    "Can't allocate memory for Pathname");
  408|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  409|      0|		}
  410|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  411|      0|		    "Pathname can't be converted from %s to current locale",
  412|      0|		    archive_string_conversion_charset_name(sconv));
  413|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  414|      0|	}
  415|       |	/* Save this before consuming the name buffer below. */
  416|  10.7k|	is_trailer = (namelength == 11 &&
  ------------------
  |  Branch (416:16): [True: 4.39k, False: 6.35k]
  ------------------
  417|  4.39k|	    memcmp((const char *)h, "TRAILER!!!", 10) == 0);
  ------------------
  |  Branch (417:6): [True: 2, False: 4.39k]
  ------------------
  418|  10.7k|	cpio->entry_offset = 0;
  419|       |
  420|  10.7k|	__archive_read_consume(a, namelength);
  421|  10.7k|	__archive_read_consume(a, name_pad);
  422|       |
  423|       |	/* If this is a symlink, read the link contents. */
  424|  10.7k|	if (archive_entry_filetype(entry) == AE_IFLNK) {
  ------------------
  |  |  217|  10.7k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (424:6): [True: 1.20k, False: 9.54k]
  ------------------
  425|  1.20k|		if (cpio->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (425:7): [True: 8, False: 1.19k]
  ------------------
  426|      8|			archive_set_error(&a->archive, ENOMEM,
  427|      8|			    "Rejecting malformed cpio archive: symlink contents exceed 1 megabyte");
  428|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  429|      8|		}
  430|  1.19k|		hl = __archive_read_ahead(a,
  431|  1.19k|			(size_t)cpio->entry_bytes_remaining, NULL);
  432|  1.19k|		if (hl == NULL) {
  ------------------
  |  Branch (432:7): [True: 1, False: 1.19k]
  ------------------
  433|      1|			archive_set_error(&a->archive,
  434|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  435|      1|			    "Truncated cpio symlink target");
  436|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  437|      1|		}
  438|  1.19k|		if (archive_entry_copy_symlink_l(entry, (const char *)hl,
  ------------------
  |  |   83|  1.19k|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
  |  Branch (438:7): [True: 0, False: 1.19k]
  ------------------
  439|  1.19k|		    (size_t)cpio->entry_bytes_remaining, sconv) != 0) {
  440|      0|			if (errno == ENOMEM) {
  ------------------
  |  Branch (440:8): [True: 0, False: 0]
  ------------------
  441|      0|				archive_set_error(&a->archive, ENOMEM,
  442|      0|				    "Can't allocate memory for Linkname");
  443|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  444|      0|			}
  445|      0|			archive_set_error(&a->archive,
  446|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  447|      0|			    "Linkname can't be converted from %s to "
  448|      0|			    "current locale",
  449|      0|			    archive_string_conversion_charset_name(sconv));
  450|      0|			r = ARCHIVE_WARN;
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  451|      0|		}
  452|  1.19k|		__archive_read_consume(a, cpio->entry_bytes_remaining);
  453|  1.19k|		cpio->entry_bytes_remaining = 0;
  454|  1.19k|	}
  455|       |
  456|       |	/* XXX TODO: If the full mode is 0160200, then this is a Solaris
  457|       |	 * ACL description for the following entry.  Read this body
  458|       |	 * and parse it as a Solaris-style ACL, then read the next
  459|       |	 * header.  XXX */
  460|       |
  461|       |	/* Compare name to "TRAILER!!!" to test for end-of-archive. */
  462|  10.7k|	if (is_trailer) {
  ------------------
  |  Branch (462:6): [True: 2, False: 10.7k]
  ------------------
  463|       |		/* TODO: Store file location of start of block. */
  464|      2|		archive_clear_error(&a->archive);
  465|      2|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  466|      2|	}
  467|       |
  468|       |	/* Detect and record hardlinks to previously-extracted entries. */
  469|  10.7k|	if (record_hardlink(a, cpio, entry) != ARCHIVE_OK) {
  ------------------
  |  |  234|  10.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (469:6): [True: 0, False: 10.7k]
  ------------------
  470|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  471|      0|	}
  472|       |
  473|  10.7k|	return (r);
  474|  10.7k|}
archive_read_support_format_cpio.c:record_hardlink:
 1143|  10.7k|{
 1144|  10.7k|	struct links_entry      *le;
 1145|  10.7k|	dev_t dev;
 1146|  10.7k|	int64_t ino;
 1147|       |
 1148|  10.7k|	if (archive_entry_nlink(entry) <= 1)
  ------------------
  |  Branch (1148:6): [True: 2.19k, False: 8.54k]
  ------------------
 1149|  2.19k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  2.19k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1150|       |
 1151|  8.54k|	dev = archive_entry_dev(entry);
 1152|  8.54k|	ino = archive_entry_ino64(entry);
 1153|       |
 1154|       |	/*
 1155|       |	 * First look in the list of multiply-linked files.  If we've
 1156|       |	 * already dumped it, convert this entry to a hard link entry.
 1157|       |	 */
 1158|  20.7k|	for (le = cpio->links_head; le; le = le->next) {
  ------------------
  |  Branch (1158:30): [True: 17.9k, False: 2.87k]
  ------------------
 1159|  17.9k|		if (le->dev == dev && le->ino == ino) {
  ------------------
  |  Branch (1159:7): [True: 8.18k, False: 9.71k]
  |  Branch (1159:25): [True: 5.66k, False: 2.51k]
  ------------------
 1160|  5.66k|			archive_entry_copy_hardlink(entry, le->name);
 1161|       |
 1162|  5.66k|			if (--le->links <= 0) {
  ------------------
  |  Branch (1162:8): [True: 1.93k, False: 3.72k]
  ------------------
 1163|  1.93k|				if (le->previous != NULL)
  ------------------
  |  Branch (1163:9): [True: 237, False: 1.69k]
  ------------------
 1164|    237|					le->previous->next = le->next;
 1165|  1.93k|				if (le->next != NULL)
  ------------------
  |  Branch (1165:9): [True: 1.27k, False: 659]
  ------------------
 1166|  1.27k|					le->next->previous = le->previous;
 1167|  1.93k|				if (cpio->links_head == le)
  ------------------
  |  Branch (1167:9): [True: 1.69k, False: 237]
  ------------------
 1168|  1.69k|					cpio->links_head = le->next;
 1169|  1.93k|				free(le->name);
 1170|  1.93k|				free(le);
 1171|  1.93k|			}
 1172|       |
 1173|  5.66k|			return (ARCHIVE_OK);
  ------------------
  |  |  234|  5.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1174|  5.66k|		}
 1175|  17.9k|	}
 1176|       |
 1177|  2.87k|	le = malloc(sizeof(struct links_entry));
 1178|  2.87k|	if (le == NULL) {
  ------------------
  |  Branch (1178:6): [True: 0, False: 2.87k]
  ------------------
 1179|      0|		archive_set_error(&a->archive,
 1180|      0|		    ENOMEM, "Out of memory adding file to list");
 1181|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1182|      0|	}
 1183|       |
 1184|  2.87k|	const char *pathname = archive_entry_pathname(entry);
 1185|  2.87k|	if (pathname == NULL) {
  ------------------
  |  Branch (1185:6): [True: 0, False: 2.87k]
  ------------------
 1186|      0|		archive_set_error(&a->archive,
 1187|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1188|      0|		    "Invalid hardlink entry with no pathname");
 1189|      0|		free(le);
 1190|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1191|      0|	}
 1192|       |
 1193|  2.87k|	le->dev = dev;
 1194|  2.87k|	le->ino = ino;
 1195|  2.87k|	le->links = archive_entry_nlink(entry) - 1;
 1196|  2.87k|	le->name = strdup(pathname);
 1197|  2.87k|	if (le->name == NULL) {
  ------------------
  |  Branch (1197:6): [True: 0, False: 2.87k]
  ------------------
 1198|      0|		archive_set_error(&a->archive,
 1199|      0|		    ENOMEM, "Out of memory adding file to list");
 1200|      0|		free(le);
 1201|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1202|      0|	}
 1203|       |
 1204|  2.87k|	if (cpio->links_head != NULL)
  ------------------
  |  Branch (1204:6): [True: 1.91k, False: 968]
  ------------------
 1205|  1.91k|		cpio->links_head->previous = le;
 1206|  2.87k|	le->next = cpio->links_head;
 1207|  2.87k|	le->previous = NULL;
 1208|  2.87k|	cpio->links_head = le;
 1209|       |
 1210|  2.87k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  2.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1211|  2.87k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_data:
  479|  21.4k|{
  480|  21.4k|	struct cpio *cpio = a->format->data;
  481|  21.4k|	ssize_t bytes_read;
  482|       |
  483|  21.4k|	if (cpio->entry_bytes_unconsumed) {
  ------------------
  |  Branch (483:6): [True: 5.52k, False: 15.9k]
  ------------------
  484|  5.52k|		__archive_read_consume(a, cpio->entry_bytes_unconsumed);
  485|  5.52k|		cpio->entry_bytes_unconsumed = 0;
  486|  5.52k|	}
  487|       |
  488|  21.4k|	if (cpio->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (488:6): [True: 5.64k, False: 15.8k]
  ------------------
  489|  5.64k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  490|  5.64k|		if (bytes_read <= 0) {
  ------------------
  |  Branch (490:7): [True: 120, False: 5.52k]
  ------------------
  491|    120|			archive_set_error(&a->archive,
  492|    120|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    120|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  493|    120|			    "Truncated cpio file data");
  494|    120|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    120|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  495|    120|		}
  496|  5.52k|		if (bytes_read > cpio->entry_bytes_remaining)
  ------------------
  |  Branch (496:7): [True: 5.19k, False: 331]
  ------------------
  497|  5.19k|			bytes_read = (ssize_t)cpio->entry_bytes_remaining;
  498|  5.52k|		*size = bytes_read;
  499|  5.52k|		cpio->entry_bytes_unconsumed = bytes_read;
  500|  5.52k|		*offset = cpio->entry_offset;
  501|  5.52k|		cpio->entry_offset += bytes_read;
  502|  5.52k|		cpio->entry_bytes_remaining -= bytes_read;
  503|  5.52k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  5.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  504|  15.8k|	} else {
  505|  15.8k|		if (cpio->entry_padding !=
  ------------------
  |  Branch (505:7): [True: 2, False: 15.8k]
  ------------------
  506|  15.8k|			__archive_read_consume(a, cpio->entry_padding)) {
  507|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  508|      2|		}
  509|  15.8k|		cpio->entry_padding = 0;
  510|  15.8k|		*buff = NULL;
  511|  15.8k|		*size = 0;
  512|  15.8k|		*offset = cpio->entry_offset;
  513|  15.8k|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|  15.8k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  514|  15.8k|	}
  515|  21.4k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_skip:
  519|  10.6k|{
  520|  10.6k|	struct cpio *cpio = a->format->data;
  521|  10.6k|	int64_t to_skip = cpio->entry_bytes_remaining + cpio->entry_padding +
  522|  10.6k|		cpio->entry_bytes_unconsumed;
  523|       |
  524|  10.6k|	if (to_skip != __archive_read_consume(a, to_skip)) {
  ------------------
  |  Branch (524:6): [True: 0, False: 10.6k]
  ------------------
  525|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  526|      0|	}
  527|  10.6k|	cpio->entry_bytes_remaining = 0;
  528|  10.6k|	cpio->entry_padding = 0;
  529|  10.6k|	cpio->entry_bytes_unconsumed = 0;
  530|  10.6k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  10.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  531|  10.6k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_cleanup:
 1059|  20.1k|{
 1060|  20.1k|	struct cpio *cpio = a->format->data;
 1061|       |
 1062|       |        /* Free inode->name map */
 1063|  21.0k|        while (cpio->links_head != NULL) {
  ------------------
  |  Branch (1063:16): [True: 943, False: 20.1k]
  ------------------
 1064|    943|                struct links_entry *lp = cpio->links_head->next;
 1065|       |
 1066|    943|                free(cpio->links_head->name);
 1067|    943|                free(cpio->links_head);
 1068|    943|                cpio->links_head = lp;
 1069|    943|        }
 1070|  20.1k|	free(cpio);
 1071|  20.1k|	a->format->data = NULL;
 1072|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1073|  20.1k|}

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

archive_read_support_format_iso9660:
  455|  20.1k|{
  456|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  457|  20.1k|	struct iso9660 *iso9660;
  458|  20.1k|	int r;
  459|       |
  460|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  461|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  462|       |
  463|  20.1k|	iso9660 = calloc(1, sizeof(*iso9660));
  464|  20.1k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (464:6): [True: 0, False: 20.1k]
  ------------------
  465|      0|		archive_set_error(_a, ENOMEM, "Can't allocate iso9660 data");
  466|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  467|      0|	}
  468|  20.1k|	iso9660->cache_files.first = NULL;
  469|  20.1k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  470|  20.1k|	iso9660->re_files.first = NULL;
  471|  20.1k|	iso9660->re_files.last = &(iso9660->re_files.first);
  472|       |	/* Enable to support Joliet extensions by default.	*/
  473|  20.1k|	iso9660->opt_support_joliet = 1;
  474|       |	/* Enable to support Rock Ridge extensions by default.	*/
  475|  20.1k|	iso9660->opt_support_rockridge = 1;
  476|       |
  477|  20.1k|	r = __archive_read_register_format(a,
  478|  20.1k|	    iso9660,
  479|  20.1k|	    "iso9660",
  480|  20.1k|	    archive_read_format_iso9660_bid,
  481|  20.1k|	    archive_read_format_iso9660_options,
  482|  20.1k|	    archive_read_format_iso9660_read_header,
  483|  20.1k|	    archive_read_format_iso9660_read_data,
  484|  20.1k|	    archive_read_format_iso9660_read_data_skip,
  485|  20.1k|	    NULL,
  486|  20.1k|	    archive_read_format_iso9660_cleanup,
  487|  20.1k|	    NULL,
  488|  20.1k|	    NULL);
  489|       |
  490|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (490:6): [True: 0, False: 20.1k]
  ------------------
  491|      0|		free(iso9660);
  492|  20.1k|	return (r);
  493|  20.1k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  498|  19.8k|{
  499|  19.8k|	struct iso9660 *iso9660 = a->format->data;
  500|  19.8k|	ssize_t bytes_read;
  501|  19.8k|	const unsigned char *h;
  502|  19.8k|	int seenTerminator;
  503|       |
  504|       |	/* If there's already a better bid than we can ever
  505|       |	   make, don't bother testing. */
  506|  19.8k|	if (best_bid > 48)
  ------------------
  |  Branch (506:6): [True: 8.03k, False: 11.7k]
  ------------------
  507|  8.03k|		return (-1);
  508|       |
  509|       |	/*
  510|       |	 * Skip the first 32k (reserved area) and get the first
  511|       |	 * 8 sectors of the volume descriptor table.  Of course,
  512|       |	 * if the I/O layer gives us more, we'll take it.
  513|       |	 */
  514|  11.7k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  515|  11.7k|	h = __archive_read_ahead(a,
  516|  11.7k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  514|  11.7k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|  11.7k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  11.7k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   82|  11.7k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  517|  11.7k|	    &bytes_read);
  518|  11.7k|	if (h == NULL)
  ------------------
  |  Branch (518:6): [True: 10.8k, False: 901]
  ------------------
  519|  10.8k|	    return (-1);
  520|       |
  521|       |	/* Skip the reserved area. */
  522|    901|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  514|    901|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    901|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    901|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  523|    901|	h += RESERVED_AREA;
  ------------------
  |  |  514|    901|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    901|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    901|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  524|       |
  525|       |	/* Check each volume descriptor. */
  526|    901|	seenTerminator = 0;
  527|  1.27k|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   82|  1.27k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (527:9): [True: 1.27k, False: 0]
  ------------------
  528|  1.27k|	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    375|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    375|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  529|       |		/* Do not handle undefined Volume Descriptor Type. */
  530|  1.27k|		if (h[0] >= 4 && h[0] <= 254)
  ------------------
  |  Branch (530:7): [True: 688, False: 588]
  |  Branch (530:20): [True: 440, False: 248]
  ------------------
  531|    440|			return (0);
  532|       |		/* Standard Identifier must be "CD001" */
  533|    836|		if (memcmp(h + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (533:7): [True: 125, False: 711]
  ------------------
  534|    125|			return (0);
  535|    711|		if (isPVD(iso9660, h))
  ------------------
  |  Branch (535:7): [True: 228, False: 483]
  ------------------
  536|    228|			continue;
  537|    483|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (537:7): [True: 443, False: 40]
  ------------------
  538|    443|			if (isJolietSVD(iso9660, h))
  ------------------
  |  Branch (538:8): [True: 42, False: 401]
  ------------------
  539|     42|				continue;
  540|    443|		}
  541|    441|		if (isBootRecord(h))
  ------------------
  |  Branch (541:7): [True: 12, False: 429]
  ------------------
  542|     12|			continue;
  543|    429|		if (isEVD(h))
  ------------------
  |  Branch (543:7): [True: 0, False: 429]
  ------------------
  544|      0|			continue;
  545|    429|		if (isSVD(h))
  ------------------
  |  Branch (545:7): [True: 93, False: 336]
  ------------------
  546|     93|			continue;
  547|    336|		if (isVolumePartition(iso9660, h))
  ------------------
  |  Branch (547:7): [True: 0, False: 336]
  ------------------
  548|      0|			continue;
  549|    336|		if (isVDSetTerminator(h)) {
  ------------------
  |  Branch (549:7): [True: 199, False: 137]
  ------------------
  550|    199|			seenTerminator = 1;
  551|    199|			break;
  552|    199|		}
  553|    137|		return (0);
  554|    336|	}
  555|       |	/*
  556|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  557|       |	 * Volume Descriptor Set Terminator.
  558|       |	 */
  559|    199|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (559:6): [True: 199, False: 0]
  |  Branch (559:24): [True: 197, False: 2]
  ------------------
  560|    197|		return (48);
  561|       |
  562|       |	/* We didn't find a valid PVD; return a bid of zero. */
  563|      2|	return (0);
  564|    199|}
archive_read_support_format_iso9660.c:isPVD:
  866|    711|{
  867|    711|	const unsigned char *p;
  868|    711|	ssize_t logical_block_size;
  869|    711|	int32_t volume_block;
  870|    711|	int32_t location;
  871|    711|	int i;
  872|       |
  873|       |	/* Type of the Primary Volume Descriptor must be 1. */
  874|    711|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   86|    711|#define PVD_type_offset 0
  ------------------
  |  Branch (874:6): [True: 446, False: 265]
  ------------------
  875|    446|		return (0);
  876|       |
  877|       |	/* PVD version must be 1. */
  878|    265|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   90|    265|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    265|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    265|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    265|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    265|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (878:6): [True: 1, False: 264]
  ------------------
  879|      1|		return (0);
  880|       |
  881|       |	/* Reserved field must be 0. */
  882|    264|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|    264|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    264|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    264|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    264|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    264|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|    264|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|    264|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (882:6): [True: 1, False: 263]
  ------------------
  883|      1|		return (0);
  884|       |
  885|       |	/* Reserved field must be 0. */
  886|    263|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    263|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    263|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    263|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    263|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    263|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    263|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    263|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    263|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    263|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    263|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    263|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    263|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|    263|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|    263|#define PVD_reserved2_size 8
  ------------------
  |  Branch (886:6): [True: 2, False: 261]
  ------------------
  887|      2|		return (0);
  888|       |
  889|       |	/* Volume space size must be encoded according to 7.3.3 */
  890|    261|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |  100|    261|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    261|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    261|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    261|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    261|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    261|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    261|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    261|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    261|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    261|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    261|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    261|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    261|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    261|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    261|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (890:6): [True: 3, False: 258]
  ------------------
  891|      3|		return (0);
  892|      3|	}
  893|    258|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|    258|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    258|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    258|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    258|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    258|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    258|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    258|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    258|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    258|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    258|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    258|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    258|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    258|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    258|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    258|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  894|    258|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    258|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (894:6): [True: 1, False: 257]
  ------------------
  895|      1|		return (0);
  896|       |
  897|       |	/* Reserved field must be 0. */
  898|    257|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    257|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    257|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    257|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    257|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    257|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    257|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    257|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    257|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    257|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    257|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    257|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    257|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    257|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    257|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    257|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    257|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|    257|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|    257|#define PVD_reserved3_size 32
  ------------------
  |  Branch (898:6): [True: 2, False: 255]
  ------------------
  899|      2|		return (0);
  900|       |
  901|       |	/* Volume set size must be encoded according to 7.2.3 */
  902|    255|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  104|    255|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    255|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    255|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    255|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    255|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    255|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   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
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    255|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    255|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    255|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    255|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    255|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  103|    255|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (902:6): [True: 2, False: 253]
  ------------------
  903|      2|		return (0);
  904|      2|	}
  905|       |
  906|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  907|    253|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  106|    253|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    253|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    253|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  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
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    253|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    253|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  105|    253|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (907:6): [True: 2, False: 251]
  ------------------
  908|      2|		return (0);
  909|      2|	}
  910|       |
  911|       |	/* Logical block size must be encoded according to 7.2.3 */
  912|    251|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  108|    251|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    251|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    251|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    251|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    251|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    251|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    251|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    251|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    251|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    251|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    251|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    251|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    251|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    251|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    251|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    251|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    251|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    251|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    251|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    251|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    251|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    251|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    251|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (912:6): [True: 2, False: 249]
  ------------------
  913|      2|		return (0);
  914|      2|	}
  915|    249|	logical_block_size =
  916|    249|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|    249|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    249|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    249|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    249|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  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
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    249|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    249|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    249|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    249|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  917|    249|	if (!isValidLogicalBlockSize(logical_block_size))
  ------------------
  |  Branch (917:6): [True: 2, False: 247]
  ------------------
  918|      2|		return (0);
  919|       |
  920|       |	/* Path Table size must be encoded according to 7.3.3 */
  921|    247|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  110|    247|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    247|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    247|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    247|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    247|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    247|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    247|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    247|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    247|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    247|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    247|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    247|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    247|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    247|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    247|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    247|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    247|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    247|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    247|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    247|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    247|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    247|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    247|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    247|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  109|    247|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (921:6): [True: 3, False: 244]
  ------------------
  922|      3|		return (0);
  923|      3|	}
  924|       |
  925|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  926|    244|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  144|    244|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    244|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    244|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    244|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    244|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    244|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    244|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    244|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    244|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    244|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    244|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    244|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    244|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    244|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    244|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    244|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    244|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    244|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    244|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  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
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    244|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    244|#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|    244|#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|    244|#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|    244|#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|    244|#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|    244|#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|    244|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    244|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    244|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    244|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    244|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    244|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    244|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    244|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    244|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    244|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    244|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|    244|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (926:6): [True: 1, False: 243]
  ------------------
  927|      1|		return (0);
  928|       |
  929|       |	/* Location of Occurrence of Type L Path Table must be
  930|       |	 * available location,
  931|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  932|    243|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|    243|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    243|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    243|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    243|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    243|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    243|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    243|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    243|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    243|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    243|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    243|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    243|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    243|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    243|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    243|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    243|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    243|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    243|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    243|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    243|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    243|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    243|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|    243|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|    243|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    243|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    243|#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|    243|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  933|    243|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    243|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (933:6): [True: 1, False: 242]
  |  Branch (933:40): [True: 1, False: 241]
  ------------------
  934|      2|		return (0);
  935|       |
  936|       |	/* The Type M Path Table must also be at a valid location
  937|       |	 * (although ECMA 119 requires a Type M Path Table, WinISO and
  938|       |	 * probably other programs omit it, so we permit a zero here)
  939|       |	 *
  940|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  941|    241|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|    241|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|    241|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    241|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    241|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    241|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    241|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    241|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    241|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    241|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    241|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    241|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    241|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    241|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    241|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    241|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    241|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    241|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    241|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    241|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    241|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    241|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    241|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    241|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    241|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    241|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    241|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|    241|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|    241|#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|    241|#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|    241|#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|    241|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  942|    241|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    238|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (942:7): [True: 238, False: 3]
  |  Branch (942:23): [True: 1, False: 237]
  ------------------
  943|    240|	    || location >= volume_block)
  ------------------
  |  Branch (943:9): [True: 1, False: 239]
  ------------------
  944|      2|		return (0);
  945|       |
  946|       |	/* Reserved field must be 0. */
  947|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  948|    477|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  147|    477|#define PVD_reserved4_size 1
  ------------------
  |  Branch (948:14): [True: 239, False: 238]
  ------------------
  949|    239|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  146|    239|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    239|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    239|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    239|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    239|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    239|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    239|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    239|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    239|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    239|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    239|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    239|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    239|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    239|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    239|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    239|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    239|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    239|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  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
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    239|#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|    239|#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|    239|#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|    239|#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|    239|#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|    239|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    239|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    239|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    239|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    239|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    239|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    239|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    239|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|    239|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|    239|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|    239|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|    239|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|    239|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (949:7): [True: 86, False: 153]
  ------------------
  950|     86|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  146|     86|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     86|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     86|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     86|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     86|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     86|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     86|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     86|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     86|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     86|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     86|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     86|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     86|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     86|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     86|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     86|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     86|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     86|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     86|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     86|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     86|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     86|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     86|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     86|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     86|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     86|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     86|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     86|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     86|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     86|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     86|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     86|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     86|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     86|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     86|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     86|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     86|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     86|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     86|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     86|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     86|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     86|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     86|#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|     86|#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|     86|#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|     86|#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|     86|#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|     86|#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|     86|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     86|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     86|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     86|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     86|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     86|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     86|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     86|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     86|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     86|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     86|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     86|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     86|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (950:10): [True: 1, False: 85]
  ------------------
  951|      1|			return (0);
  952|       |
  953|       |	/* Reserved field must be 0. */
  954|    238|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    238|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    238|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    238|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    238|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    238|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    238|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    238|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    238|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    238|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    238|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    238|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    238|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    238|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    238|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    238|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    238|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    238|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    238|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    238|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    238|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    238|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    238|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    238|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    238|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    238|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    238|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    238|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    238|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    238|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    238|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    238|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    238|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    238|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    238|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    238|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    238|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    238|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    238|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    238|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    238|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    238|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    238|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    238|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    238|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    238|#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|    238|#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|    238|#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|    238|#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|    238|#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|    238|#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|    238|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    238|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    238|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    238|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    238|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    238|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    238|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    238|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    238|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    238|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    238|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    238|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    238|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    238|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|    238|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|    238|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|    238|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    238|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    238|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    238|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    238|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    238|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    238|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    238|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    238|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    238|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    238|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    238|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    238|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    238|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    238|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    238|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    238|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    238|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    238|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    238|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    238|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    238|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    238|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    238|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    238|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    238|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    238|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    238|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    238|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    238|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    238|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    238|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    238|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    238|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    238|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    238|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    238|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    238|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    238|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    238|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    238|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    238|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    238|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    238|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    238|#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|    238|#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|    238|#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|    238|#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|    238|#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|    238|#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|    238|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    238|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    238|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    238|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    238|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    238|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    238|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    238|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    238|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    238|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|    238|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|    238|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|    238|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|    238|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|    238|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (954:6): [True: 5, False: 233]
  ------------------
  955|      5|		return (0);
  956|       |
  957|       |	/* XXX TODO: Check other values for sanity; reject more
  958|       |	 * malformed PVDs. XXX */
  959|       |
  960|       |	/* Read Root Directory Record in Volume Descriptor. */
  961|    233|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|    233|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|    233|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    233|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|    233|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    233|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    233|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    233|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    233|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    233|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    233|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    233|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    233|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    233|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    233|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    233|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    233|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    233|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    233|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    233|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    233|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    233|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    233|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    233|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    233|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    233|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    233|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    233|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    233|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    233|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    233|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  111|    233|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  113|    233|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|    233|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    233|#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|    233|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  962|    233|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (962:6): [True: 5, False: 228]
  ------------------
  963|      5|		return (0);
  964|      5|	}
  965|       |
  966|    228|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (966:6): [True: 227, False: 1]
  ------------------
  967|    227|		iso9660->logical_block_size = logical_block_size;
  968|    227|		iso9660->volume_block = volume_block;
  969|    227|		iso9660->volume_size =
  970|    227|		    logical_block_size * (uint64_t)volume_block;
  971|    227|		iso9660->primary.location =
  972|    227|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|    227|#define DR_extent_offset 2
  ------------------
  973|    227|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|    227|#define DR_size_offset 10
  ------------------
  974|    227|	}
  975|       |
  976|    228|	return (48);
  977|    233|}
archive_read_support_format_iso9660.c:isNull:
  596|  2.15k|{
  597|  2.15k|	if (bytes == 0)
  ------------------
  |  Branch (597:6): [True: 0, False: 2.15k]
  ------------------
  598|      0|		return (1);
  599|       |
  600|       |	/*
  601|       |	 * If the first byte is zero and every byte equals the following
  602|       |	 * byte, the entire range is zero.
  603|       |	 */
  604|  2.15k|	return (h[offset] == 0 &&
  ------------------
  |  Branch (604:10): [True: 2.11k, False: 41]
  ------------------
  605|  2.11k|	    (bytes == 1 ||
  ------------------
  |  Branch (605:7): [True: 356, False: 1.75k]
  ------------------
  606|  1.75k|	    memcmp(h + offset, h + offset + 1, bytes - 1) == 0));
  ------------------
  |  Branch (606:6): [True: 1.69k, False: 62]
  ------------------
  607|  2.15k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3272|  1.46k|{
 3273|  1.46k|	return (p[0] == p[7]
  ------------------
  |  Branch (3273:10): [True: 1.46k, False: 4]
  ------------------
 3274|  1.46k|		&& p[1] == p[6]
  ------------------
  |  Branch (3274:6): [True: 1.45k, False: 10]
  ------------------
 3275|  1.45k|		&& p[2] == p[5]
  ------------------
  |  Branch (3275:6): [True: 1.44k, False: 5]
  ------------------
 3276|  1.44k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3276:6): [True: 1.44k, False: 2]
  ------------------
 3277|  1.46k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3266|  1.22k|isValid723Integer(const unsigned char *p) {
 3267|  1.22k|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3267:10): [True: 1.21k, False: 3]
  |  Branch (3267:26): [True: 1.21k, False: 5]
  ------------------
 3268|  1.22k|}
archive_read_support_format_iso9660.c:isValidLogicalBlockSize:
  676|    567|{
  677|    567|	return (logical_block_size == 512 || logical_block_size == 1024
  ------------------
  |  Branch (677:10): [True: 0, False: 567]
  |  Branch (677:39): [True: 0, False: 567]
  ------------------
  678|    567|	    || logical_block_size == 2048);
  ------------------
  |  Branch (678:9): [True: 497, False: 70]
  ------------------
  679|    567|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  980|    479|isRootDirectoryRecord(const unsigned char *p) {
  981|    479|	int flags;
  982|       |
  983|       |	/* ECMA119/ISO9660 requires that the root directory record be _exactly_ 34 bytes.
  984|       |	 * However, we've seen images that have root directory records up to 68 bytes. */
  985|    479|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    479|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    479|#define DR_length_offset 0
  ------------------
  |  Branch (985:6): [True: 0, False: 479]
  |  Branch (985:34): [True: 0, False: 479]
  ------------------
  986|      0|		return (0);
  987|      0|	}
  988|       |
  989|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
  990|    479|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  200|    479|#define DR_extent_offset 2
  ------------------
  |  Branch (990:6): [True: 1, False: 478]
  ------------------
  991|      1|		return (0);
  992|      1|	}
  993|       |
  994|       |	/* The root directory size must be a 7.3.3 integer. */
  995|    478|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  202|    478|#define DR_size_offset 10
  ------------------
  |  Branch (995:6): [True: 14, False: 464]
  ------------------
  996|     14|		return (0);
  997|     14|	}
  998|       |
  999|       |	/* According to the standard, certain bits must be one or zero:
 1000|       |	 * Bit 1: must be 1 (this is a directory)
 1001|       |	 * Bit 2: must be 0 (not an associated file)
 1002|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
 1003|       |	 * Bit 7: must be 0 (final directory record for this file)
 1004|       |	 */
 1005|    464|	flags = p[DR_flags_offset];
  ------------------
  |  |  206|    464|#define DR_flags_offset 25
  ------------------
 1006|    464|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1006:6): [True: 1, False: 463]
  ------------------
 1007|      1|		return (0);
 1008|      1|	}
 1009|       |
 1010|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1011|    463|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  212|    463|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1011:6): [True: 2, False: 461]
  ------------------
 1012|      2|		return (0);
 1013|      2|	}
 1014|       |
 1015|       |	/* Root directory name is a single zero byte... */
 1016|    461|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  214|    461|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  216|    459|#define DR_name_offset 33
  ------------------
  |  Branch (1016:6): [True: 2, False: 459]
  |  Branch (1016:36): [True: 3, False: 456]
  ------------------
 1017|      5|		return (0);
 1018|      5|	}
 1019|       |
 1020|       |	/* Nothing looked wrong, so let's accept it. */
 1021|    456|	return (1);
 1022|    461|}
archive_read_support_format_iso9660.c:isJolietSVD:
  683|    443|{
  684|    443|	const unsigned char *p;
  685|    443|	ssize_t logical_block_size;
  686|    443|	int32_t volume_block;
  687|       |
  688|       |	/* Check if current sector is a kind of Supplementary Volume
  689|       |	 * Descriptor. */
  690|    443|	if (!isSVD(h))
  ------------------
  |  Branch (690:6): [True: 308, False: 135]
  ------------------
  691|    308|		return (0);
  692|       |
  693|       |	/* FIXME: do more validations according to joliet spec. */
  694|       |
  695|       |	/* check if this SVD contains joliet extension! */
  696|    135|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  173|    135|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|    135|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  172|    135|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  697|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  698|    135|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (698:6): [True: 128, False: 7]
  |  Branch (698:21): [True: 49, False: 79]
  ------------------
  699|     49|		int level = 0;
  700|       |
  701|     49|		if (p[2] == '@')
  ------------------
  |  Branch (701:7): [True: 8, False: 41]
  ------------------
  702|      8|			level = 1;
  703|     41|		else if (p[2] == 'C')
  ------------------
  |  Branch (703:12): [True: 1, False: 40]
  ------------------
  704|      1|			level = 2;
  705|     40|		else if (p[2] == 'E')
  ------------------
  |  Branch (705:12): [True: 33, False: 7]
  ------------------
  706|     33|			level = 3;
  707|      7|		else /* not joliet */
  708|      7|			return (0);
  709|       |
  710|     42|		iso9660->seenJoliet = level;
  711|       |
  712|     42|	} else /* not joliet */
  713|     86|		return (0);
  714|       |
  715|     42|	logical_block_size =
  716|     42|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|     42|#define SVD_logical_block_size_offset 128
  ------------------
  717|     42|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|     42|#define SVD_volume_space_size_offset 80
  ------------------
  718|       |
  719|     42|	iso9660->logical_block_size = logical_block_size;
  720|     42|	iso9660->volume_block = volume_block;
  721|     42|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  722|       |	/* Read Root Directory Record in Volume Descriptor. */
  723|     42|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|     42|#define SVD_root_directory_record_offset 156
  ------------------
  724|     42|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|     42|#define DR_extent_offset 2
  ------------------
  725|     42|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|     42|#define DR_size_offset 10
  ------------------
  726|       |
  727|     42|	return (48);
  728|    135|}
archive_read_support_format_iso9660.c:isBootRecord:
  611|    441|{
  612|       |
  613|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  614|    441|	if (h[0] != 0)
  ------------------
  |  Branch (614:6): [True: 428, False: 13]
  ------------------
  615|    428|		return (0);
  616|       |
  617|       |	/* Volume Descriptor Version must be 1. */
  618|     13|	if (h[6] != 1)
  ------------------
  |  Branch (618:6): [True: 1, False: 12]
  ------------------
  619|      1|		return (0);
  620|       |
  621|     12|	return (1);
  622|     13|}
archive_read_support_format_iso9660.c:isEVD:
  791|    429|{
  792|    429|	const unsigned char *p;
  793|    429|	ssize_t logical_block_size;
  794|    429|	int32_t volume_block;
  795|    429|	int32_t location;
  796|       |
  797|       |
  798|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  799|    429|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   86|    429|#define PVD_type_offset 0
  ------------------
  |  Branch (799:6): [True: 257, False: 172]
  ------------------
  800|    257|		return (0);
  801|       |
  802|       |	/* EVD version must be 2. */
  803|    172|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   90|    172|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    172|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    172|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    172|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    172|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (803:6): [True: 133, False: 39]
  ------------------
  804|    133|		return (0);
  805|       |
  806|       |	/* Reserved field must be 0. */
  807|     39|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|     39|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|     39|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|     39|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|     39|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|     39|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|     39|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|     39|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (807:6): [True: 1, False: 38]
  ------------------
  808|      1|		return (0);
  809|       |
  810|       |	/* Reserved field must be 0. */
  811|     38|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|     38|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|     38|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|     38|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|     38|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|     38|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|     38|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     38|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     38|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|     38|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|     38|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|     38|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     38|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|     38|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|     38|#define PVD_reserved2_size 8
  ------------------
  |  Branch (811:6): [True: 1, False: 37]
  ------------------
  812|      1|		return (0);
  813|       |
  814|       |	/* Reserved field must be 0. */
  815|     37|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|     37|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|     37|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|     37|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|     37|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|     37|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|     37|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     37|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     37|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     37|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     37|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     37|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     37|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|     37|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|     37|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|     37|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     37|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|     37|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|     37|#define PVD_reserved3_size 32
  ------------------
  |  Branch (815:6): [True: 8, False: 29]
  ------------------
  816|      8|		return (0);
  817|       |
  818|     29|	logical_block_size =
  819|     29|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|     29|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|     29|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|     29|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|     29|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|     29|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|     29|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     29|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     29|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     29|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     29|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     29|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     29|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     29|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     29|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     29|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     29|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     29|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     29|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|     29|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|     29|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|     29|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|     29|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|     29|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  820|     29|	if (!isValidLogicalBlockSize(logical_block_size))
  ------------------
  |  Branch (820:6): [True: 29, False: 0]
  ------------------
  821|     29|		return (0);
  822|       |
  823|      0|	volume_block =
  824|      0|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  825|      0|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (825:6): [True: 0, False: 0]
  ------------------
  826|      0|		return (0);
  827|       |
  828|       |	/* File structure version must be 2 for ISO9660:1999. */
  829|      0|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (829:6): [True: 0, False: 0]
  ------------------
  830|      0|		return (0);
  831|       |
  832|       |	/* Location of Occurrence of Type L Path Table must be
  833|       |	 * available location,
  834|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  835|      0|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  836|      0|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (836:6): [True: 0, False: 0]
  |  Branch (836:40): [True: 0, False: 0]
  ------------------
  837|      0|		return (0);
  838|       |
  839|       |	/* Location of Occurrence of Type M Path Table must be
  840|       |	 * available location,
  841|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  842|      0|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  843|      0|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (843:7): [True: 0, False: 0]
  |  Branch (843:23): [True: 0, False: 0]
  ------------------
  844|      0|	    || location >= volume_block)
  ------------------
  |  Branch (844:9): [True: 0, False: 0]
  ------------------
  845|      0|		return (0);
  846|       |
  847|       |	/* Reserved field must be 0. */
  848|      0|	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  147|      0|#define PVD_reserved4_size 1
  ------------------
  |  Branch (848:6): [True: 0, False: 0]
  ------------------
  849|      0|		return (0);
  850|       |
  851|       |	/* Reserved field must be 0. */
  852|      0|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|      0|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (852:6): [True: 0, False: 0]
  ------------------
  853|      0|		return (0);
  854|       |
  855|       |	/* Read Root Directory Record in Volume Descriptor. */
  856|      0|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  857|      0|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (857:6): [True: 0, False: 0]
  ------------------
  858|      0|		return (0);
  859|      0|	}
  860|       |
  861|      0|	return (48);
  862|      0|}
archive_read_support_format_iso9660.c:isSVD:
  732|    872|{
  733|    872|	const unsigned char *p;
  734|    872|	ssize_t logical_block_size;
  735|    872|	int32_t volume_block;
  736|    872|	int32_t location;
  737|       |
  738|       |
  739|       |	/* Type 2 means it's a SVD. */
  740|    872|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  162|    872|#define SVD_type_offset 0
  ------------------
  |  Branch (740:6): [True: 494, False: 378]
  ------------------
  741|    494|		return (0);
  742|       |
  743|       |	/* Reserved field must be 0. */
  744|    378|	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    378|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  170|    378|#define SVD_reserved1_size	8
  ------------------
  |  Branch (744:6): [True: 5, False: 373]
  ------------------
  745|      5|		return (0);
  746|    373|	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    373|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  185|    373|#define SVD_reserved2_size	1
  ------------------
  |  Branch (746:6): [True: 17, False: 356]
  ------------------
  747|     17|		return (0);
  748|    356|	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    356|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  187|    356|#define SVD_reserved3_size	653
  ------------------
  |  Branch (748:6): [True: 48, False: 308]
  ------------------
  749|     48|		return (0);
  750|       |
  751|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  752|    308|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  183|    308|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (752:6): [True: 19, False: 289]
  ------------------
  753|     19|		return (0);
  754|       |
  755|    289|	logical_block_size =
  756|    289|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|    289|#define SVD_logical_block_size_offset 128
  ------------------
  757|    289|	if (!isValidLogicalBlockSize(logical_block_size))
  ------------------
  |  Branch (757:6): [True: 39, False: 250]
  ------------------
  758|     39|		return (0);
  759|       |
  760|    250|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|    250|#define SVD_volume_space_size_offset 80
  ------------------
  761|    250|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    250|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (761:6): [True: 0, False: 250]
  ------------------
  762|      0|		return (0);
  763|       |
  764|       |	/* Location of Occurrence of Type L Path Table must be
  765|       |	 * available location,
  766|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  767|    250|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  178|    250|#define SVD_type_L_path_table_offset 140
  ------------------
  768|    250|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    250|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (768:6): [True: 4, False: 246]
  |  Branch (768:40): [True: 0, False: 246]
  ------------------
  769|      4|		return (0);
  770|       |
  771|       |	/* The Type M Path Table must be at a valid location (WinISO
  772|       |	 * and probably other programs omit this, so we allow zero)
  773|       |	 *
  774|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  775|    246|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  179|    246|#define SVD_type_M_path_table_offset 148
  ------------------
  776|    246|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    246|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (776:7): [True: 246, False: 0]
  |  Branch (776:23): [True: 0, False: 246]
  ------------------
  777|    246|	    || location >= volume_block)
  ------------------
  |  Branch (777:9): [True: 0, False: 246]
  ------------------
  778|      0|		return (0);
  779|       |
  780|       |	/* Read Root Directory Record in Volume Descriptor. */
  781|    246|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|    246|#define SVD_root_directory_record_offset 156
  ------------------
  782|    246|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (782:6): [True: 18, False: 228]
  ------------------
  783|     18|		return (0);
  784|     18|	}
  785|       |
  786|    228|	return (48);
  787|    246|}
archive_read_support_format_iso9660.c:isVolumePartition:
  626|    336|{
  627|    336|	int32_t location;
  628|       |
  629|       |	/* Type of the Volume Partition Descriptor must be 3. */
  630|    336|	if (h[0] != 3)
  ------------------
  |  Branch (630:6): [True: 332, False: 4]
  ------------------
  631|    332|		return (0);
  632|       |
  633|       |	/* Volume Descriptor Version must be 1. */
  634|      4|	if (h[6] != 1)
  ------------------
  |  Branch (634:6): [True: 1, False: 3]
  ------------------
  635|      1|		return (0);
  636|       |	/* Unused Field */
  637|      3|	if (h[7] != 0)
  ------------------
  |  Branch (637:6): [True: 1, False: 2]
  ------------------
  638|      1|		return (0);
  639|       |
  640|      2|	location = archive_le32dec(h + 72);
  641|      2|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   83|      4|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (641:6): [True: 1, False: 1]
  ------------------
  642|      1|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (642:6): [True: 1, False: 0]
  ------------------
  643|      2|		return (0);
  644|      0|	if ((uint32_t)location != archive_be32dec(h + 76))
  ------------------
  |  Branch (644:6): [True: 0, False: 0]
  ------------------
  645|      0|		return (0);
  646|       |
  647|      0|	return (1);
  648|      0|}
archive_read_support_format_iso9660.c:isVDSetTerminator:
  652|    336|{
  653|       |
  654|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  655|    336|	if (h[0] != 255)
  ------------------
  |  Branch (655:6): [True: 121, False: 215]
  ------------------
  656|    121|		return (0);
  657|       |
  658|       |	/* Volume Descriptor Version must be 1. */
  659|    215|	if (h[6] != 1)
  ------------------
  |  Branch (659:6): [True: 1, False: 214]
  ------------------
  660|      1|		return (0);
  661|       |
  662|       |	/* Reserved field must be 0. */
  663|    214|	if (!isNull(h, 7, 2048-7))
  ------------------
  |  Branch (663:6): [True: 15, False: 199]
  ------------------
  664|     15|		return (0);
  665|       |
  666|    199|	return (1);
  667|    214|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1245|    937|{
 1246|    937|	struct iso9660 *iso9660 = a->format->data;
 1247|    937|	struct file_info *file;
 1248|    937|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  234|    937|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1249|       |
 1250|    937|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1250:6): [True: 197, False: 740]
  ------------------
 1251|    197|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  377|    197|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1252|    197|		a->archive.archive_format_name = "ISO9660";
 1253|    197|	}
 1254|       |
 1255|    937|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1255:6): [True: 197, False: 740]
  ------------------
 1256|    197|		r = choose_volume(a, iso9660);
 1257|    197|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    197|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1257:7): [True: 17, False: 180]
  ------------------
 1258|     17|			return (r);
 1259|    197|	}
 1260|       |
 1261|    920|	file = NULL;/* Eliminate a warning. */
 1262|       |	/* Get the next entry that appears after the current offset. */
 1263|    920|	r = next_entry_seek(a, iso9660, &file);
 1264|    920|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    920|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1264:6): [True: 247, False: 673]
  ------------------
 1265|    247|		return (r);
 1266|       |
 1267|    673|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1267:6): [True: 30, False: 643]
  ------------------
 1268|       |		/*
 1269|       |		 * Convert UTF-16BE of a filename to local locale MBS
 1270|       |		 * and store the result into a filename field.
 1271|       |		 */
 1272|     30|		if (iso9660->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1272:7): [True: 14, False: 16]
  ------------------
 1273|     14|			iso9660->sconv_utf16be =
 1274|     14|			    archive_string_conversion_from_charset(
 1275|     14|				&(a->archive), "UTF-16BE", 1);
 1276|     14|			if (iso9660->sconv_utf16be == NULL)
  ------------------
  |  Branch (1276:8): [True: 0, False: 14]
  ------------------
 1277|       |				/* Couldn't allocate memory */
 1278|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1279|     14|		}
 1280|     30|		if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1280:7): [True: 14, False: 16]
  ------------------
 1281|     14|			iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
  ------------------
  |  |  375|     14|#define UTF16_NAME_MAX	1024
  ------------------
 1282|     14|			if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1282:8): [True: 0, False: 14]
  ------------------
 1283|      0|				archive_set_error(&a->archive, ENOMEM,
 1284|      0|				    "No memory");
 1285|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1286|      0|			}
 1287|     14|		}
 1288|     30|		if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1288:7): [True: 14, False: 16]
  ------------------
 1289|     14|			iso9660->utf16be_previous_path = calloc(1, UTF16_NAME_MAX);
  ------------------
  |  |  375|     14|#define UTF16_NAME_MAX	1024
  ------------------
 1290|     14|			if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1290:8): [True: 0, False: 14]
  ------------------
 1291|      0|				archive_set_error(&a->archive, ENOMEM,
 1292|      0|				    "No memory");
 1293|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1294|      0|			}
 1295|     14|		}
 1296|       |
 1297|     30|		iso9660->utf16be_path_len = 0;
 1298|     30|		r = build_pathname_utf16be(iso9660->utf16be_path,
 1299|     30|		    UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file, 0);
  ------------------
  |  |  375|     30|#define UTF16_NAME_MAX	1024
  ------------------
 1300|     30|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  234|     30|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1300:7): [True: 0, False: 30]
  ------------------
 1301|      0|			archive_set_error(&a->archive,
 1302|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1303|      0|			    "Pathname is too long");
 1304|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1305|      0|		}
 1306|       |
 1307|     30|		r = archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     30|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
 1308|     30|		    (const char *)iso9660->utf16be_path,
 1309|     30|		    iso9660->utf16be_path_len,
 1310|     30|		    iso9660->sconv_utf16be);
 1311|     30|		if (r != 0) {
  ------------------
  |  Branch (1311:7): [True: 15, False: 15]
  ------------------
 1312|     15|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1312:8): [True: 0, False: 15]
  ------------------
 1313|      0|				archive_set_error(&a->archive, ENOMEM,
 1314|      0|				    "No memory for Pathname");
 1315|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1316|      0|			}
 1317|     15|			archive_set_error(&a->archive,
 1318|     15|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     15|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1319|     15|			    "Pathname cannot be converted "
 1320|     15|			    "from %s to current locale",
 1321|     15|			    archive_string_conversion_charset_name(
 1322|     15|			      iso9660->sconv_utf16be));
 1323|       |
 1324|     15|			rd_r = ARCHIVE_WARN;
  ------------------
  |  |  236|     15|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1325|     15|		}
 1326|    643|	} else {
 1327|    643|		archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    643|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1328|    643|		r = build_pathname(&iso9660->pathname, file, 0);
 1329|    643|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  234|    643|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1329:7): [True: 0, False: 643]
  ------------------
 1330|      0|			archive_set_error(&a->archive,
 1331|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1332|      0|			    "Pathname is too long");
 1333|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1334|      0|		}
 1335|    643|		archive_entry_set_pathname(entry, iso9660->pathname.s);
 1336|    643|	}
 1337|       |
 1338|    673|	iso9660->entry_bytes_remaining = file->size;
 1339|       |	/* Offset for sparse-file-aware clients. */
 1340|    673|	iso9660->entry_sparse_offset = 0;
 1341|       |
 1342|    673|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1342:6): [True: 81, False: 592]
  ------------------
 1343|     81|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     81|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1344|     81|		    "File is beyond end-of-media: %s",
 1345|     81|		    archive_entry_pathname(entry));
 1346|     81|		iso9660->entry_bytes_remaining = 0;
 1347|     81|		return (ARCHIVE_WARN);
  ------------------
  |  |  236|     81|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1348|     81|	}
 1349|       |
 1350|       |	/* Set up the entry structure with information about this entry. */
 1351|    592|	archive_entry_set_mode(entry, file->mode);
 1352|    592|	archive_entry_set_uid(entry, file->uid);
 1353|    592|	archive_entry_set_gid(entry, file->gid);
 1354|    592|	archive_entry_set_nlink(entry, file->nlinks);
 1355|    592|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  311|    592|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1355:6): [True: 7, False: 585]
  ------------------
 1356|      7|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1357|    585|	else
 1358|    585|		archive_entry_unset_birthtime(entry);
 1359|    592|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  312|    592|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1359:6): [True: 277, False: 315]
  ------------------
 1360|    277|		archive_entry_set_mtime(entry, file->mtime, 0);
 1361|    315|	else
 1362|    315|		archive_entry_unset_mtime(entry);
 1363|    592|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  314|    592|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1363:6): [True: 273, False: 319]
  ------------------
 1364|    273|		archive_entry_set_ctime(entry, file->ctime, 0);
 1365|    319|	else
 1366|    319|		archive_entry_unset_ctime(entry);
 1367|    592|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  313|    592|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1367:6): [True: 275, False: 317]
  ------------------
 1368|    275|		archive_entry_set_atime(entry, file->atime, 0);
 1369|    317|	else
 1370|    317|		archive_entry_unset_atime(entry);
 1371|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1372|    592|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1373|    592|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1374|    592|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1374:6): [True: 0, False: 592]
  ------------------
 1375|      0|		archive_entry_copy_symlink(entry, file->symlink.s);
 1376|       |
 1377|       |	/* Note: If the input isn't seekable, we can't rewind to
 1378|       |	 * return the same body again, so if the next entry refers to
 1379|       |	 * the same data, we have to return it as a hardlink to the
 1380|       |	 * original entry. */
 1381|    592|	if (file->number != -1 &&
  ------------------
  |  Branch (1381:6): [True: 439, False: 153]
  ------------------
 1382|    439|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1382:6): [True: 66, False: 373]
  ------------------
 1383|     66|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1383:7): [True: 1, False: 65]
  ------------------
 1384|      1|			r = archive_entry_copy_hardlink_l(entry,
  ------------------
  |  |   74|      1|#define archive_entry_copy_hardlink_l	__archive_entry_copy_hardlink_l
  ------------------
 1385|      1|			    (const char *)iso9660->utf16be_previous_path,
 1386|      1|			    iso9660->utf16be_previous_path_len,
 1387|      1|			    iso9660->sconv_utf16be);
 1388|      1|			if (r != 0) {
  ------------------
  |  Branch (1388:8): [True: 0, False: 1]
  ------------------
 1389|      0|				if (errno == ENOMEM) {
  ------------------
  |  Branch (1389:9): [True: 0, False: 0]
  ------------------
 1390|      0|					archive_set_error(&a->archive, ENOMEM,
 1391|      0|					    "No memory for Linkname");
 1392|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1393|      0|				}
 1394|      0|				archive_set_error(&a->archive,
 1395|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1396|      0|				    "Linkname cannot be converted "
 1397|      0|				    "from %s to current locale",
 1398|      0|				    archive_string_conversion_charset_name(
 1399|      0|				      iso9660->sconv_utf16be));
 1400|      0|				rd_r = ARCHIVE_WARN;
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1401|      0|			}
 1402|      1|		} else
 1403|     65|			archive_entry_set_hardlink(entry,
 1404|     65|			    iso9660->previous_pathname.s);
 1405|     66|		archive_entry_unset_size(entry);
 1406|     66|		iso9660->entry_bytes_remaining = 0;
 1407|     66|		return (rd_r);
 1408|     66|	}
 1409|       |
 1410|    526|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  215|    526|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  221|  1.05k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1410:6): [True: 349, False: 177]
  ------------------
 1411|    349|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1411:6): [True: 83, False: 266]
  ------------------
 1412|     83|		int64_t r64;
 1413|       |
 1414|     83|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1415|     83|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1415:7): [True: 0, False: 83]
  ------------------
 1416|       |			/* We can't seek backwards to extract it, so issue
 1417|       |			 * a warning.  Note that this can only happen if
 1418|       |			 * this entry was added to the heap after we passed
 1419|       |			 * this offset, that is, only if the directory
 1420|       |			 * mentioning this entry is later than the body of
 1421|       |			 * the entry. Such layouts are very unusual; most
 1422|       |			 * ISO9660 writers lay out and record all directory
 1423|       |			 * information first, then store all file bodies. */
 1424|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1425|      0|			    "Ignoring out-of-order file @%jx (%s) %jd < %jd",
 1426|      0|			    (uintmax_t)file->number,
 1427|      0|			    iso9660->pathname.s,
 1428|      0|			    (intmax_t)file->offset,
 1429|      0|			    (intmax_t)iso9660->current_position);
 1430|      0|			iso9660->entry_bytes_remaining = 0;
 1431|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1432|      0|		}
 1433|     83|		iso9660->current_position = (uint64_t)r64;
 1434|     83|	}
 1435|       |
 1436|       |	/* Initialize zisofs variables. */
 1437|    526|	iso9660->entry_zisofs.pz = file->pz;
 1438|    526|	if (file->pz) {
  ------------------
  |  Branch (1438:6): [True: 0, False: 526]
  ------------------
 1439|      0|#ifdef HAVE_ZLIB_H
 1440|      0|		struct zisofs  *zisofs;
 1441|       |
 1442|      0|		zisofs = &iso9660->entry_zisofs;
 1443|      0|		zisofs->initialized = 0;
 1444|      0|		zisofs->pz_log2_bs = file->pz_log2_bs;
 1445|      0|		zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
 1446|      0|		zisofs->pz_offset = 0;
 1447|      0|		zisofs->header_avail = 0;
 1448|      0|		zisofs->header_passed = 0;
 1449|      0|		zisofs->block_pointers_avail = 0;
 1450|      0|#endif
 1451|      0|		archive_entry_set_size(entry, file->pz_uncompressed_size);
 1452|      0|	}
 1453|       |
 1454|    526|	iso9660->previous_number = file->number;
 1455|    526|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1455:6): [True: 29, False: 497]
  ------------------
 1456|     29|		memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
 1457|     29|		    iso9660->utf16be_path_len);
 1458|     29|		iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
 1459|     29|	} else
 1460|    526|		archive_strcpy(
  ------------------
  |  |  165|    497|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    994|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 497]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1461|    526|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1462|       |
 1463|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1464|    526|	iso9660->entry_content = file->contents.first;
 1465|    526|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1465:6): [True: 30, False: 496]
  ------------------
 1466|     30|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1467|       |
 1468|    526|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    526|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1468:6): [True: 177, False: 349]
  ------------------
 1469|       |		/* Overwrite nlinks by proper link number which is
 1470|       |		 * calculated from number of sub directories. */
 1471|    177|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1472|       |		/* Directory data has been read completely. */
 1473|    177|		iso9660->entry_bytes_remaining = 0;
 1474|    177|	}
 1475|       |
 1476|    526|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  234|    526|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1476:6): [True: 15, False: 511]
  ------------------
 1477|     15|		return (rd_r);
 1478|    511|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    511|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1479|    526|}
archive_read_support_format_iso9660.c:choose_volume:
 1156|    197|{
 1157|    197|	struct file_info *file;
 1158|    197|	int64_t skipsize;
 1159|    197|	struct vd *vd;
 1160|    197|	const void *block;
 1161|    197|	char seenJoliet;
 1162|       |
 1163|    197|	vd = &(iso9660->primary);
 1164|    197|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1164:6): [True: 0, False: 197]
  ------------------
 1165|      0|		iso9660->seenJoliet = 0;
 1166|    197|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1166:6): [True: 31, False: 166]
  ------------------
 1167|     31|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1167:3): [True: 2, False: 29]
  ------------------
 1168|       |		/* This condition is unlikely; by way of caution. */
 1169|      2|		vd = &(iso9660->joliet);
 1170|       |
 1171|    197|	skipsize = iso9660->logical_block_size * (int64_t)vd->location;
 1172|    197|	skipsize = __archive_read_consume(a, skipsize);
 1173|    197|	if (skipsize < 0)
  ------------------
  |  Branch (1173:6): [True: 1, False: 196]
  ------------------
 1174|      1|		return ((int)skipsize);
 1175|    196|	iso9660->current_position = skipsize;
 1176|       |
 1177|    196|	block = __archive_read_ahead(a, vd->size, NULL);
 1178|    196|	if (block == NULL) {
  ------------------
  |  Branch (1178:6): [True: 1, False: 195]
  ------------------
 1179|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1180|      1|		    "Failed to read full block when scanning "
 1181|      1|		    "ISO9660 directory list");
 1182|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1183|      1|	}
 1184|       |
 1185|       |	/*
 1186|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1187|       |	 * avoid converting special name 0x00(Current Directory) and
 1188|       |	 * next byte to UCS2.
 1189|       |	 */
 1190|    195|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1191|    195|	iso9660->seenJoliet = 0;
 1192|    195|	file = parse_file_info(a, NULL, block, vd->size);
 1193|    195|	if (file == NULL)
  ------------------
  |  Branch (1193:6): [True: 11, False: 184]
  ------------------
 1194|     11|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1195|    184|	iso9660->seenJoliet = seenJoliet;
 1196|       |
 1197|       |	/*
 1198|       |	 * If the iso image has both RockRidge and Joliet, we preferentially
 1199|       |	 * use RockRidge Extensions rather than Joliet ones.
 1200|       |	 */
 1201|    184|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1201:6): [True: 183, False: 1]
  |  Branch (1201:35): [True: 52, False: 131]
  ------------------
 1202|     52|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1202:9): [True: 0, False: 52]
  ------------------
 1203|      0|		iso9660->seenJoliet = 0;
 1204|       |
 1205|    184|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1205:6): [True: 183, False: 1]
  |  Branch (1205:35): [True: 131, False: 52]
  ------------------
 1206|    131|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1206:9): [True: 28, False: 103]
  ------------------
 1207|       |		/* Switch reading data from primary to joliet. */
 1208|     28|		vd = &(iso9660->joliet);
 1209|     28|		skipsize = iso9660->logical_block_size * (int64_t)vd->location;
 1210|     28|		skipsize -= iso9660->current_position;
 1211|     28|		skipsize = __archive_read_consume(a, skipsize);
 1212|     28|		if (skipsize < 0)
  ------------------
  |  Branch (1212:7): [True: 2, False: 26]
  ------------------
 1213|      2|			return ((int)skipsize);
 1214|     26|		iso9660->current_position += skipsize;
 1215|       |
 1216|     26|		block = __archive_read_ahead(a, vd->size, NULL);
 1217|     26|		if (block == NULL) {
  ------------------
  |  Branch (1217:7): [True: 1, False: 25]
  ------------------
 1218|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1219|      1|			    "Failed to read full block when scanning "
 1220|      1|			    "ISO9660 directory list");
 1221|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1222|      1|		}
 1223|     25|		iso9660->seenJoliet = 0;
 1224|     25|		file = parse_file_info(a, NULL, block, vd->size);
 1225|     25|		if (file == NULL)
  ------------------
  |  Branch (1225:7): [True: 1, False: 24]
  ------------------
 1226|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1227|     24|		iso9660->seenJoliet = seenJoliet;
 1228|     24|	}
 1229|       |
 1230|       |	/* Store the root directory in the pending list. */
 1231|    180|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  449|    180|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  234|    180|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1231:6): [True: 0, False: 180]
  ------------------
 1232|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1233|    180|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1233:6): [True: 52, False: 128]
  ------------------
 1234|     52|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  378|     52|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  377|     52|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1235|     52|		a->archive.archive_format_name =
 1236|     52|		    "ISO9660 with Rockridge extensions";
 1237|     52|	}
 1238|       |
 1239|    180|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    180|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1240|    180|}
archive_read_support_format_iso9660.c:parse_file_info:
 1830|  1.18k|{
 1831|  1.18k|	struct iso9660 *iso9660 = a->format->data;
 1832|  1.18k|	struct file_info *file, *filep;
 1833|  1.18k|	size_t name_len;
 1834|  1.18k|	const unsigned char *rr_start, *rr_end;
 1835|  1.18k|	const unsigned char *p;
 1836|  1.18k|	size_t dr_len = 0;
 1837|  1.18k|	uint64_t fsize, offset;
 1838|  1.18k|	int32_t location;
 1839|  1.18k|	int flags;
 1840|       |
 1841|  1.18k|	if (reclen != 0)
  ------------------
  |  Branch (1841:6): [True: 1.18k, False: 1]
  ------------------
 1842|  1.18k|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  196|  1.18k|#define DR_length_offset 0
  ------------------
 1843|       |	/*
 1844|       |	 * Sanity check that reclen is not zero and dr_len is greater than
 1845|       |	 * reclen but at least 34
 1846|       |	 */
 1847|  1.18k|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1847:6): [True: 1, False: 1.18k]
  |  Branch (1847:21): [True: 0, False: 1.18k]
  |  Branch (1847:40): [True: 14, False: 1.17k]
  ------------------
 1848|     15|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     15|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1849|     15|			"Invalid length of directory record");
 1850|     15|		return (NULL);
 1851|     15|	}
 1852|  1.17k|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  214|  1.17k|#define DR_name_len_offset 32
  ------------------
 1853|  1.17k|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  200|  1.17k|#define DR_extent_offset 2
  ------------------
 1854|  1.17k|	fsize = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  202|  1.17k|#define DR_size_offset 10
  ------------------
 1855|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1856|  1.17k|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1856:6): [True: 7, False: 1.16k]
  |  Branch (1856:32): [True: 4, False: 1.15k]
  ------------------
 1857|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1858|     11|		    "Invalid length of file identifier");
 1859|     11|		return (NULL);
 1860|     11|	}
 1861|       |	/* Sanity check that location doesn't exceed volume block.
 1862|       |	 * Don't check lower limit of location; it's possibility
 1863|       |	 * the location has negative value when file type is symbolic
 1864|       |	 * link or file size is zero. As far as I know latest mkisofs
 1865|       |	 * do that.
 1866|       |	 */
 1867|  1.15k|	if (location > 0 &&
  ------------------
  |  Branch (1867:6): [True: 531, False: 628]
  ------------------
 1868|    531|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1868:6): [True: 3, False: 528]
  ------------------
 1869|    531|	       / iso9660->logical_block_size))
 1870|    531|			> (uint32_t)iso9660->volume_block) {
 1871|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1872|      3|		    "Invalid location of extent of file");
 1873|      3|		return (NULL);
 1874|      3|	}
 1875|       |	/* Sanity check that location doesn't have a negative value
 1876|       |	 * when the file is not empty. it's too large. */
 1877|  1.15k|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1877:6): [True: 669, False: 487]
  |  Branch (1877:20): [True: 6, False: 663]
  ------------------
 1878|      6|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1879|      6|		    "Invalid location of extent of file");
 1880|      6|		return (NULL);
 1881|      6|	}
 1882|       |
 1883|       |	/* Sanity check that this entry does not create a cycle. */
 1884|  1.15k|	offset = iso9660->logical_block_size * (uint64_t)location;
 1885|  2.32k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1885:23): [True: 1.17k, False: 1.14k]
  ------------------
 1886|  1.17k|		if (filep->offset == offset) {
  ------------------
  |  Branch (1886:7): [True: 1, False: 1.17k]
  ------------------
 1887|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1888|      1|			    "Directory structure contains loop");
 1889|      1|			return (NULL);
 1890|      1|		}
 1891|  1.17k|	}
 1892|       |
 1893|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1894|  1.14k|	file = calloc(1, sizeof(*file));
 1895|  1.14k|	if (file == NULL) {
  ------------------
  |  Branch (1895:6): [True: 0, False: 1.14k]
  ------------------
 1896|      0|		archive_set_error(&a->archive, ENOMEM,
 1897|      0|		    "No memory for file entry");
 1898|      0|		return (NULL);
 1899|      0|	}
 1900|  1.14k|	file->parent = parent;
 1901|  1.14k|	file->offset = offset;
 1902|  1.14k|	file->size = fsize;
 1903|  1.14k|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  204|  1.14k|#define DR_date_offset 18
  ------------------
  |  Branch (1903:6): [True: 485, False: 664]
  ------------------
 1904|    485|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    485|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    485|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  314|    485|#define CTIME_IS_SET 8
  ------------------
 1905|    485|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  204|    485|#define DR_date_offset 18
  ------------------
 1906|    485|		file->ctime = file->atime = file->mtime;
 1907|    485|	}
 1908|  1.14k|	file->rede_files.first = NULL;
 1909|  1.14k|	file->rede_files.last = &(file->rede_files.first);
 1910|       |
 1911|  1.14k|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  216|  1.14k|#define DR_name_offset 33
  ------------------
 1912|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1913|       |	 * before fidgeting the name_len below. */
 1914|  1.14k|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1914:29): [True: 311, False: 838]
  ------------------
 1915|  1.14k|	rr_end = isodirrec + dr_len;
 1916|       |
 1917|  1.14k|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1917:6): [True: 58, False: 1.09k]
  ------------------
 1918|       |		/* Joliet names are max 64 chars (128 bytes) according to spec,
 1919|       |		 * but authoring tools record longer ones: genisoimage/mkisofs
 1920|       |		 * up to 103 UCS2 characters (206 bytes) with '-joliet-long',
 1921|       |		 * Windows tools up to what the directory record holds. The
 1922|       |		 * record already bounds name_len (checked above), so the
 1923|       |		 * whole name is kept.
 1924|       |		 */
 1925|     58|		name_len &= ~1;
 1926|       |
 1927|       |		/* trim trailing first version and dot from filename.
 1928|       |		 *
 1929|       |		 * Remember we were in UTF-16BE land!
 1930|       |		 * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
 1931|       |		 * 16 bits big endian characters on Joliet.
 1932|       |		 *
 1933|       |		 * TODO: sanitize filename?
 1934|       |		 *       Joliet allows any UCS-2 char except:
 1935|       |		 *       *, /, :, ;, ? and \.
 1936|       |		 */
 1937|       |		/* Chop off trailing ';1' from files. */
 1938|     58|		if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
  ------------------
  |  Branch (1938:7): [True: 55, False: 3]
  |  Branch (1938:23): [True: 25, False: 30]
  |  Branch (1938:45): [True: 2, False: 23]
  ------------------
 1939|      2|		    && p[name_len-2] == 0 && p[name_len-1] == '1')
  ------------------
  |  Branch (1939:10): [True: 1, False: 1]
  |  Branch (1939:32): [True: 0, False: 1]
  ------------------
 1940|      0|			name_len -= 4;
 1941|       |#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
 1942|       |		/* Chop off trailing '.' from filenames. */
 1943|       |		if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
 1944|       |			name_len -= 2;
 1945|       |#endif
 1946|     58|		if ((file->utf16be_name = malloc(name_len)) == NULL) {
  ------------------
  |  Branch (1946:7): [True: 0, False: 58]
  ------------------
 1947|      0|			archive_set_error(&a->archive, ENOMEM,
 1948|      0|			    "No memory for file name");
 1949|      0|			goto fail;
 1950|      0|		}
 1951|     58|		memcpy(file->utf16be_name, p, name_len);
 1952|     58|		file->utf16be_bytes = name_len;
 1953|  1.09k|	} else {
 1954|       |		/* Chop off trailing ';1' from files. */
 1955|  1.09k|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1955:7): [True: 852, False: 239]
  |  Branch (1955:23): [True: 413, False: 439]
  ------------------
 1956|    413|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1956:5): [True: 357, False: 56]
  ------------------
 1957|    357|			name_len -= 2;
 1958|       |		/* Chop off trailing '.' from filenames. */
 1959|  1.09k|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1959:7): [True: 852, False: 239]
  |  Branch (1959:23): [True: 9, False: 843]
  ------------------
 1960|      9|			--name_len;
 1961|       |
 1962|  1.09k|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|  1.09k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1963|  1.09k|	}
 1964|       |
 1965|  1.14k|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  206|  1.14k|#define DR_flags_offset 25
  ------------------
 1966|  1.14k|	if (flags & 0x02)
  ------------------
  |  Branch (1966:6): [True: 511, False: 638]
  ------------------
 1967|    511|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    511|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1968|    638|	else
 1969|    638|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    638|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1970|  1.14k|	if (flags & 0x80)
  ------------------
  |  Branch (1970:6): [True: 114, False: 1.03k]
  ------------------
 1971|    114|		file->multi_extent = 1;
 1972|  1.03k|	else
 1973|  1.03k|		file->multi_extent = 0;
 1974|       |	/*
 1975|       |	 * Use a location for the file number, which is treated as an inode
 1976|       |	 * number to find out hardlink target. If Rockridge extensions is
 1977|       |	 * being used, the file number will be overwritten by FILE SERIAL
 1978|       |	 * NUMBER of RRIP "PX" extension.
 1979|       |	 * Note: Old mkisofs did not record that FILE SERIAL NUMBER
 1980|       |	 * in ISO images.
 1981|       |	 * Note2: xorriso set 0 to the location of a symlink file.
 1982|       |	 */
 1983|  1.14k|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1983:6): [True: 487, False: 662]
  |  Branch (1983:25): [True: 295, False: 192]
  ------------------
 1984|       |		/* If file->size is zero, its location points wrong place,
 1985|       |		 * and so we should not use it for the file number.
 1986|       |		 * When the location has negative value, it can be used
 1987|       |		 * for the file number.
 1988|       |		 */
 1989|    295|		file->number = -1;
 1990|       |		/* Do not appear before any directory entries. */
 1991|    295|		file->offset = -1;
 1992|    295|	} else
 1993|    854|		file->number = (int64_t)(uint32_t)location;
 1994|       |
 1995|       |	/* Rockridge extensions overwrite information from above. */
 1996|  1.14k|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (1996:6): [True: 185, False: 964]
  ------------------
 1997|    185|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (1997:7): [True: 185, False: 0]
  |  Branch (1997:25): [True: 68, False: 117]
  ------------------
 1998|     68|			p = rr_start;
 1999|     68|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (1999:8): [True: 64, False: 4]
  ------------------
 2000|       |				/*
 2001|       |				 * SP extension stores the suspOffset
 2002|       |				 * (Number of bytes to skip between
 2003|       |				 * filename and SUSP records.)
 2004|       |				 * It is mandatory by the SUSP standard
 2005|       |				 * (IEEE 1281).
 2006|       |				 *
 2007|       |				 * It allows SUSP to coexist with
 2008|       |				 * non-SUSP uses of the System
 2009|       |				 * Use Area by placing non-SUSP data
 2010|       |				 * before SUSP data.
 2011|       |				 *
 2012|       |				 * SP extension must be in the root
 2013|       |				 * directory entry, disable all SUSP
 2014|       |				 * processing if not found.
 2015|       |				 */
 2016|     64|				iso9660->suspOffset = p[6];
 2017|     64|				iso9660->seenSUSP = 1;
 2018|     64|				rr_start += 7;
 2019|     64|			}
 2020|     68|		}
 2021|    185|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2021:7): [True: 64, False: 121]
  ------------------
 2022|     64|			int r;
 2023|       |
 2024|     64|			file->name_continues = 0;
 2025|     64|			file->symlink_continues = 0;
 2026|     64|			rr_start += iso9660->suspOffset;
 2027|     64|			r = parse_rockridge(a, file, rr_start, rr_end);
 2028|     64|			if (r != ARCHIVE_OK)
  ------------------
  |  |  234|     64|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2028:8): [True: 1, False: 63]
  ------------------
 2029|      1|				goto fail;
 2030|       |			/*
 2031|       |			 * A file size of symbolic link files in ISO images
 2032|       |			 * made by makefs is not zero and its location is
 2033|       |			 * the same as those of next regular file. That is
 2034|       |			 * the same as hard like file and it causes unexpected
 2035|       |			 * error.
 2036|       |			 */
 2037|     63|			if (file->size > 0 &&
  ------------------
  |  Branch (2037:8): [True: 1, False: 62]
  ------------------
 2038|      1|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|      1|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|      1|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2038:8): [True: 0, False: 1]
  ------------------
 2039|      0|				file->size = 0;
 2040|      0|				file->number = -1;
 2041|      0|				file->offset = -1;
 2042|      0|			}
 2043|     63|		} else
 2044|       |			/* If there isn't SUSP, disable parsing
 2045|       |			 * rock ridge extensions. */
 2046|    121|			iso9660->opt_support_rockridge = 0;
 2047|    185|	}
 2048|       |
 2049|  1.14k|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2050|       |	/* Tell file's parent how many children that parent has. */
 2051|  1.14k|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2051:6): [True: 940, False: 208]
  |  Branch (2051:24): [True: 370, False: 570]
  ------------------
 2052|    370|		parent->subdirs++;
 2053|       |
 2054|  1.14k|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2054:6): [True: 52, False: 1.09k]
  ------------------
 2055|     52|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2055:7): [True: 0, False: 52]
  |  Branch (2055:25): [True: 0, False: 0]
  ------------------
 2056|      0|		    (flags & 0x02) && iso9660->rr_moved == NULL &&
  ------------------
  |  Branch (2056:7): [True: 0, False: 0]
  |  Branch (2056:25): [True: 0, False: 0]
  ------------------
 2057|      0|		    file->name.s &&
  ------------------
  |  Branch (2057:7): [True: 0, False: 0]
  ------------------
 2058|      0|		    (strcmp(file->name.s, "rr_moved") == 0 ||
  ------------------
  |  Branch (2058:8): [True: 0, False: 0]
  ------------------
 2059|      0|		     strcmp(file->name.s, ".rr_moved") == 0)) {
  ------------------
  |  Branch (2059:8): [True: 0, False: 0]
  ------------------
 2060|      0|			iso9660->rr_moved = file;
 2061|      0|			file->rr_moved = 1;
 2062|      0|			file->rr_moved_has_re_only = 1;
 2063|      0|			file->re = 0;
 2064|      0|			parent->subdirs--;
 2065|     52|		} else if (file->re) {
  ------------------
  |  Branch (2065:14): [True: 0, False: 52]
  ------------------
 2066|       |			/*
 2067|       |			 * Sanity check: file's parent is rr_moved.
 2068|       |			 */
 2069|      0|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2069:8): [True: 0, False: 0]
  |  Branch (2069:26): [True: 0, False: 0]
  ------------------
 2070|      0|				archive_set_error(&a->archive,
 2071|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2072|      0|				    "Invalid Rockridge RE");
 2073|      0|				goto fail;
 2074|      0|			}
 2075|       |			/*
 2076|       |			 * Sanity check: file does not have "CL" extension.
 2077|       |			 */
 2078|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2078:8): [True: 0, False: 0]
  ------------------
 2079|      0|				archive_set_error(&a->archive,
 2080|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2081|      0|				    "Invalid Rockridge RE and CL");
 2082|      0|				goto fail;
 2083|      0|			}
 2084|       |			/*
 2085|       |			 * Sanity check: The file type must be a directory.
 2086|       |			 */
 2087|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2087:8): [True: 0, False: 0]
  ------------------
 2088|      0|				archive_set_error(&a->archive,
 2089|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2090|      0|				    "Invalid Rockridge RE");
 2091|      0|				goto fail;
 2092|      0|			}
 2093|     52|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2093:14): [True: 0, False: 52]
  |  Branch (2093:32): [True: 0, False: 0]
  ------------------
 2094|      0|			file->rr_moved_has_re_only = 0;
 2095|     52|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2095:12): [True: 0, False: 52]
  |  Branch (2095:30): [True: 0, False: 0]
  ------------------
 2096|      0|		    (parent->re || parent->re_descendant))
  ------------------
  |  Branch (2096:8): [True: 0, False: 0]
  |  Branch (2096:22): [True: 0, False: 0]
  ------------------
 2097|      0|			file->re_descendant = 1;
 2098|     52|		if (file->cl_offset) {
  ------------------
  |  Branch (2098:7): [True: 0, False: 52]
  ------------------
 2099|      0|			struct file_info *r;
 2100|       |
 2101|      0|			if (parent == NULL || parent->parent == NULL) {
  ------------------
  |  Branch (2101:8): [True: 0, False: 0]
  |  Branch (2101:26): [True: 0, False: 0]
  ------------------
 2102|      0|				archive_set_error(&a->archive,
 2103|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2104|      0|				    "Invalid Rockridge CL");
 2105|      0|				goto fail;
 2106|      0|			}
 2107|       |			/*
 2108|       |			 * Sanity check: The file type must be a regular file.
 2109|       |			 */
 2110|      0|			if ((flags & 0x02) != 0) {
  ------------------
  |  Branch (2110:8): [True: 0, False: 0]
  ------------------
 2111|      0|				archive_set_error(&a->archive,
 2112|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2113|      0|				    "Invalid Rockridge CL");
 2114|      0|				goto fail;
 2115|      0|			}
 2116|      0|			parent->subdirs++;
 2117|       |			/* Overwrite an offset and a number of this "CL" entry
 2118|       |			 * to appear before other dirs. "+1" to those is to
 2119|       |			 * make sure to appear after "RE" entry which this
 2120|       |			 * "CL" entry should be connected with. */
 2121|      0|			file->offset = file->number = file->cl_offset + 1;
 2122|       |
 2123|       |			/*
 2124|       |			 * Sanity check: cl_offset does not point at its
 2125|       |			 * the parents or itself.
 2126|       |			 */
 2127|      0|			for (r = parent; r; r = r->parent) {
  ------------------
  |  Branch (2127:21): [True: 0, False: 0]
  ------------------
 2128|      0|				if (r->offset == file->cl_offset) {
  ------------------
  |  Branch (2128:9): [True: 0, False: 0]
  ------------------
 2129|      0|					archive_set_error(&a->archive,
 2130|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2131|      0|					    "Invalid Rockridge CL");
 2132|      0|					goto fail;
 2133|      0|				}
 2134|      0|			}
 2135|      0|			if (file->cl_offset == file->offset ||
  ------------------
  |  Branch (2135:8): [True: 0, False: 0]
  ------------------
 2136|      0|			    parent->rr_moved) {
  ------------------
  |  Branch (2136:8): [True: 0, False: 0]
  ------------------
 2137|      0|				archive_set_error(&a->archive,
 2138|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2139|      0|				    "Invalid Rockridge CL");
 2140|      0|				goto fail;
 2141|      0|			}
 2142|      0|		}
 2143|     52|	}
 2144|       |
 2145|       |#if DEBUG
 2146|       |	/* DEBUGGING: Warn about attributes I don't yet fully support. */
 2147|       |	if ((flags & ~0x02) != 0) {
 2148|       |		fprintf(stderr, "\n ** Unrecognized flag: ");
 2149|       |		dump_isodirrec(stderr, isodirrec);
 2150|       |		fprintf(stderr, "\n");
 2151|       |	} else if (archive_le16dec(isodirrec + DR_volume_sequence_number_offset) != 1) {
 2152|       |		fprintf(stderr, "\n ** Unrecognized sequence number: ");
 2153|       |		dump_isodirrec(stderr, isodirrec);
 2154|       |		fprintf(stderr, "\n");
 2155|       |	} else if (*(isodirrec + DR_file_unit_size_offset) != 0) {
 2156|       |		fprintf(stderr, "\n ** Unexpected file unit size: ");
 2157|       |		dump_isodirrec(stderr, isodirrec);
 2158|       |		fprintf(stderr, "\n");
 2159|       |	} else if (*(isodirrec + DR_interleave_offset) != 0) {
 2160|       |		fprintf(stderr, "\n ** Unexpected interleave: ");
 2161|       |		dump_isodirrec(stderr, isodirrec);
 2162|       |		fprintf(stderr, "\n");
 2163|       |	} else if (*(isodirrec + DR_ext_attr_length_offset) != 0) {
 2164|       |		fprintf(stderr, "\n ** Unexpected extended attribute length: ");
 2165|       |		dump_isodirrec(stderr, isodirrec);
 2166|       |		fprintf(stderr, "\n");
 2167|       |	}
 2168|       |#endif
 2169|  1.14k|	register_file(iso9660, file);
 2170|  1.14k|	return (file);
 2171|      1|fail:
 2172|      1|	release_file(file);
 2173|       |	return (NULL);
 2174|  1.14k|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3281|  1.20k|{
 3282|  1.20k|	int year = v[0];
 3283|  1.20k|	int month = v[1];
 3284|  1.20k|	int day = v[2];
 3285|  1.20k|	int hour = v[3];
 3286|  1.20k|	int minute = v[4];
 3287|  1.20k|	int second = v[5];
 3288|  1.20k|	int gmt_off = (signed char)v[6];
 3289|       |
 3290|       |	/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
 3291|       |	 * that the date is unspecified" */
 3292|  1.20k|	if (year == 0
  ------------------
  |  Branch (3292:6): [True: 460, False: 741]
  ------------------
 3293|    460|	    && month == 0
  ------------------
  |  Branch (3293:9): [True: 383, False: 77]
  ------------------
 3294|    383|	    && day == 0
  ------------------
  |  Branch (3294:9): [True: 345, False: 38]
  ------------------
 3295|    345|	    && hour == 0
  ------------------
  |  Branch (3295:9): [True: 331, False: 14]
  ------------------
 3296|    331|	    && minute == 0
  ------------------
  |  Branch (3296:9): [True: 301, False: 30]
  ------------------
 3297|    301|	    && second == 0
  ------------------
  |  Branch (3297:9): [True: 279, False: 22]
  ------------------
 3298|    279|	    && gmt_off == 0)
  ------------------
  |  Branch (3298:9): [True: 222, False: 57]
  ------------------
 3299|    222|		return 0;
 3300|       |	/*
 3301|       |	 * Sanity-test each individual field
 3302|       |	 */
 3303|       |	/* Year can have any value */
 3304|       |	/* Month must be 1-12 */
 3305|    979|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3305:6): [True: 181, False: 798]
  |  Branch (3305:19): [True: 63, False: 735]
  ------------------
 3306|    244|		return 0;
 3307|       |	/* Day must be 1-31 */
 3308|    735|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3308:6): [True: 99, False: 636]
  |  Branch (3308:17): [True: 73, False: 563]
  ------------------
 3309|    172|		return 0;
 3310|       |	/* Hour must be 0-23 */
 3311|    563|	if (hour > 23)
  ------------------
  |  Branch (3311:6): [True: 16, False: 547]
  ------------------
 3312|     16|		return 0;
 3313|       |	/* Minute must be 0-59 */
 3314|    547|	if (minute > 59)
  ------------------
  |  Branch (3314:6): [True: 14, False: 533]
  ------------------
 3315|     14|		return 0;
 3316|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3317|       |	/* BUT: we should probably allow for the time being in UTC, which
 3318|       |	   allows up to 61 seconds in a minute in certain cases */
 3319|    533|	if (second > 61)
  ------------------
  |  Branch (3319:6): [True: 17, False: 516]
  ------------------
 3320|     17|		return 0;
 3321|       |	/* Offset from GMT must be -48 to +52 */
 3322|    516|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3322:6): [True: 4, False: 512]
  |  Branch (3322:23): [True: 13, False: 499]
  ------------------
 3323|     17|		return 0;
 3324|       |
 3325|       |	/* All tests pass, this is OK */
 3326|    499|	return 1;
 3327|    516|}
archive_read_support_format_iso9660.c:isodate7:
 3331|    499|{
 3332|    499|	struct tm tm;
 3333|    499|	int offset;
 3334|    499|	time_t t;
 3335|       |
 3336|    499|	memset(&tm, 0, sizeof(tm));
 3337|    499|	tm.tm_year = v[0];
 3338|    499|	tm.tm_mon = v[1] - 1;
 3339|    499|	tm.tm_mday = v[2];
 3340|    499|	tm.tm_hour = v[3];
 3341|    499|	tm.tm_min = v[4];
 3342|    499|	tm.tm_sec = v[5];
 3343|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3344|    499|	offset = ((const signed char *)v)[6];
 3345|    499|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3345:6): [True: 499, False: 0]
  |  Branch (3345:22): [True: 490, False: 9]
  ------------------
 3346|    490|		tm.tm_hour -= offset / 4;
 3347|    490|		tm.tm_min -= (offset % 4) * 15;
 3348|    490|	}
 3349|    499|	t = time_from_tm(&tm);
 3350|    499|	if (t == (time_t)-1)
  ------------------
  |  Branch (3350:6): [True: 0, False: 499]
  ------------------
 3351|      0|		return ((time_t)0);
 3352|    499|	return (t);
 3353|    499|}
archive_read_support_format_iso9660.c:time_from_tm:
 3446|    508|{
 3447|       |#if HAVE__MKGMTIME
 3448|       |        return _mkgmtime(t);
 3449|       |#elif HAVE_TIMEGM
 3450|       |        /* Use platform timegm() if available. */
 3451|    508|        return (timegm(t));
 3452|       |#else
 3453|       |        /* Else use direct calculation using POSIX assumptions. */
 3454|       |        /* First, fix up tm_yday based on the year/month/day. */
 3455|       |        if (mktime(t) == (time_t)-1)
 3456|       |                return ((time_t)-1);
 3457|       |        /* Then we can compute timegm() from first principles. */
 3458|       |        return (t->tm_sec
 3459|       |            + t->tm_min * 60
 3460|       |            + t->tm_hour * 3600
 3461|       |            + t->tm_yday * 86400
 3462|       |            + (t->tm_year - 70) * 31536000
 3463|       |            + ((t->tm_year - 69) / 4) * 86400
 3464|       |            - ((t->tm_year - 1) / 100) * 86400
 3465|       |            + ((t->tm_year + 299) / 400) * 86400);
 3466|       |#endif
 3467|    508|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2179|     64|{
 2180|     64|	struct iso9660 *iso9660 = a->format->data;
 2181|     64|	int entry_seen = 0;
 2182|       |
 2183|    130|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2183:9): [True: 129, False: 1]
  ------------------
 2184|    129|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2184:9): [True: 87, False: 42]
  |  Branch (2184:24): [True: 72, False: 15]
  ------------------
 2185|     72|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2185:9): [True: 70, False: 2]
  |  Branch (2185:24): [True: 69, False: 1]
  ------------------
 2186|     69|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2186:9): [True: 69, False: 0]
  ------------------
 2187|     69|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2187:9): [True: 66, False: 3]
  ------------------
 2188|     66|		const unsigned char *data = p + 4;
 2189|     66|		int data_length = p[2] - 4;
 2190|     66|		int version = p[3];
 2191|       |
 2192|     66|		switch(p[0]) {
 2193|      1|		case 'C':
  ------------------
  |  Branch (2193:3): [True: 1, False: 65]
  ------------------
 2194|      1|			if (p[1] == 'E') {
  ------------------
  |  Branch (2194:8): [True: 0, False: 1]
  ------------------
 2195|      0|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2195:9): [True: 0, False: 0]
  |  Branch (2195:25): [True: 0, False: 0]
  ------------------
 2196|       |					/*
 2197|       |					 * CE extension comprises:
 2198|       |					 *   8 byte sector containing extension
 2199|       |					 *   8 byte offset w/in above sector
 2200|       |					 *   8 byte length of continuation
 2201|       |					 */
 2202|      0|					uint32_t location =
 2203|      0|					    archive_le32dec(data);
 2204|      0|					file->ce_offset =
 2205|      0|					    archive_le32dec(data+8);
 2206|      0|					file->ce_size =
 2207|      0|					    archive_le32dec(data+16);
 2208|      0|					if (register_CE(a, location, file)
  ------------------
  |  Branch (2208:10): [True: 0, False: 0]
  ------------------
 2209|      0|					    != ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2210|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2211|      0|				}
 2212|      0|			}
 2213|      1|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2213:13): [True: 0, False: 1]
  ------------------
 2214|      0|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2214:9): [True: 0, False: 0]
  |  Branch (2214:25): [True: 0, False: 0]
  ------------------
 2215|      0|					file->cl_offset = (uint64_t)
 2216|      0|					    iso9660->logical_block_size *
 2217|      0|					    (uint64_t)archive_le32dec(data);
 2218|      0|					iso9660->seenRockridge = 1;
 2219|      0|				}
 2220|      0|			}
 2221|      1|			break;
 2222|      1|		case 'N':
  ------------------
  |  Branch (2222:3): [True: 1, False: 65]
  ------------------
 2223|      1|			if (p[1] == 'M') {
  ------------------
  |  Branch (2223:8): [True: 0, False: 1]
  ------------------
 2224|      0|				if (version == 1) {
  ------------------
  |  Branch (2224:9): [True: 0, False: 0]
  ------------------
 2225|      0|					parse_rockridge_NM1(file,
 2226|      0|					    data, data_length);
 2227|      0|					iso9660->seenRockridge = 1;
 2228|      0|				}
 2229|      0|			}
 2230|      1|			break;
 2231|      3|		case 'P':
  ------------------
  |  Branch (2231:3): [True: 3, False: 63]
  ------------------
 2232|       |			/*
 2233|       |			 * PD extension is padding;
 2234|       |			 * contents are always ignored.
 2235|       |			 *
 2236|       |			 * PL extension won't appear;
 2237|       |			 * contents are always ignored.
 2238|       |			 */
 2239|      3|			if (p[1] == 'N') {
  ------------------
  |  Branch (2239:8): [True: 0, False: 3]
  ------------------
 2240|      0|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2240:9): [True: 0, False: 0]
  |  Branch (2240:25): [True: 0, False: 0]
  ------------------
 2241|      0|					file->rdev = archive_le32dec(data);
 2242|      0|					file->rdev <<= 32;
 2243|      0|					file->rdev |=
 2244|      0|					    archive_le32dec(data + 8);
 2245|      0|					iso9660->seenRockridge = 1;
 2246|      0|				}
 2247|      0|			}
 2248|      3|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2248:13): [True: 0, False: 3]
  ------------------
 2249|       |				/*
 2250|       |				 * PX extension comprises:
 2251|       |				 *   8 bytes for mode,
 2252|       |				 *   8 bytes for nlinks,
 2253|       |				 *   8 bytes for uid,
 2254|       |				 *   8 bytes for gid,
 2255|       |				 *   8 bytes for inode.
 2256|       |				 */
 2257|      0|				if (version == 1) {
  ------------------
  |  Branch (2257:9): [True: 0, False: 0]
  ------------------
 2258|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2258:10): [True: 0, False: 0]
  ------------------
 2259|      0|						file->mode = (__LA_MODE_T)
 2260|      0|						    archive_le32dec(data);
 2261|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2261:10): [True: 0, False: 0]
  ------------------
 2262|      0|						file->nlinks =
 2263|      0|						    archive_le32dec(data + 8);
 2264|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2264:10): [True: 0, False: 0]
  ------------------
 2265|      0|						file->uid =
 2266|      0|						    archive_le32dec(data + 16);
 2267|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2267:10): [True: 0, False: 0]
  ------------------
 2268|      0|						file->gid =
 2269|      0|						    archive_le32dec(data + 24);
 2270|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2270:10): [True: 0, False: 0]
  ------------------
 2271|      0|						file->number =
 2272|      0|						    archive_le32dec(data + 32);
 2273|      0|					iso9660->seenRockridge = 1;
 2274|      0|				}
 2275|      0|			}
 2276|      3|			break;
 2277|      1|		case 'R':
  ------------------
  |  Branch (2277:3): [True: 1, False: 65]
  ------------------
 2278|      1|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2278:8): [True: 0, False: 1]
  |  Branch (2278:23): [True: 0, False: 0]
  ------------------
 2279|      0|				file->re = 1;
 2280|      0|				iso9660->seenRockridge = 1;
 2281|      0|			}
 2282|      1|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2282:13): [True: 0, False: 1]
  |  Branch (2282:28): [True: 0, False: 0]
  ------------------
 2283|       |				/*
 2284|       |				 * RR extension comprises:
 2285|       |				 *    one byte flag value
 2286|       |				 * This extension is obsolete,
 2287|       |				 * so contents are always ignored.
 2288|       |				 */
 2289|      0|			}
 2290|      1|			break;
 2291|      1|		case 'S':
  ------------------
  |  Branch (2291:3): [True: 1, False: 65]
  ------------------
 2292|      1|			if (p[1] == 'L') {
  ------------------
  |  Branch (2292:8): [True: 0, False: 1]
  ------------------
 2293|      0|				if (version == 1) {
  ------------------
  |  Branch (2293:9): [True: 0, False: 0]
  ------------------
 2294|      0|					parse_rockridge_SL1(file,
 2295|      0|					    data, data_length);
 2296|      0|					iso9660->seenRockridge = 1;
 2297|      0|				}
 2298|      0|			}
 2299|      1|			else if (p[1] == 'T'
  ------------------
  |  Branch (2299:13): [True: 0, False: 1]
  ------------------
 2300|      0|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2300:11): [True: 0, False: 0]
  |  Branch (2300:31): [True: 0, False: 0]
  ------------------
 2301|       |				/*
 2302|       |				 * ST extension marks end of this
 2303|       |				 * block of SUSP entries.
 2304|       |				 *
 2305|       |				 * It allows SUSP to coexist with
 2306|       |				 * non-SUSP uses of the System
 2307|       |				 * Use Area by placing non-SUSP data
 2308|       |				 * after SUSP data.
 2309|       |				 */
 2310|      0|				iso9660->seenSUSP = 0;
 2311|      0|				iso9660->seenRockridge = 0;
 2312|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2313|      0|			}
 2314|      1|			break;
 2315|     53|		case 'T':
  ------------------
  |  Branch (2315:3): [True: 53, False: 13]
  ------------------
 2316|     53|			if (p[1] == 'F') {
  ------------------
  |  Branch (2316:8): [True: 53, False: 0]
  ------------------
 2317|     53|				if (version == 1) {
  ------------------
  |  Branch (2317:9): [True: 52, False: 1]
  ------------------
 2318|     52|					parse_rockridge_TF1(file,
 2319|     52|					    data, data_length);
 2320|     52|					iso9660->seenRockridge = 1;
 2321|     52|				}
 2322|     53|			}
 2323|     53|			break;
 2324|      3|		case 'Z':
  ------------------
  |  Branch (2324:3): [True: 3, False: 63]
  ------------------
 2325|      3|			if (p[1] == 'F') {
  ------------------
  |  Branch (2325:8): [True: 2, False: 1]
  ------------------
 2326|      2|				if (version == 1)
  ------------------
  |  Branch (2326:9): [True: 1, False: 1]
  ------------------
 2327|      1|					parse_rockridge_ZF1(file,
 2328|      1|					    data, data_length);
 2329|      2|			}
 2330|      3|			break;
 2331|      3|		default:
  ------------------
  |  Branch (2331:3): [True: 3, False: 63]
  ------------------
 2332|      3|			break;
 2333|     66|		}
 2334|       |
 2335|     66|		p += p[2];
 2336|     66|		entry_seen = 1;
 2337|     66|	}
 2338|       |
 2339|     64|	if (entry_seen)
  ------------------
  |  Branch (2339:6): [True: 63, False: 1]
  ------------------
 2340|     63|		return (ARCHIVE_OK);
  ------------------
  |  |  234|     63|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2341|      1|	else {
 2342|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2343|      1|				  "Tried to parse Rockridge extensions, but none found");
 2344|      1|		return (ARCHIVE_WARN);
  ------------------
  |  |  236|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2345|      1|	}
 2346|     64|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2566|     52|{
 2567|     52|	char flag;
 2568|       |	/*
 2569|       |	 * TF extension comprises:
 2570|       |	 *   one byte flag
 2571|       |	 *   create time (optional)
 2572|       |	 *   modify time (optional)
 2573|       |	 *   access time (optional)
 2574|       |	 *   attribute time (optional)
 2575|       |	 *  Time format and presence of fields
 2576|       |	 *  is controlled by flag bits.
 2577|       |	 */
 2578|     52|	if (data_length < 1)
  ------------------
  |  Branch (2578:6): [True: 1, False: 51]
  ------------------
 2579|      1|		return;
 2580|     51|	flag = data[0];
 2581|     51|	++data;
 2582|     51|	--data_length;
 2583|     51|	if (flag & 0x80) {
  ------------------
  |  Branch (2583:6): [True: 34, False: 17]
  ------------------
 2584|       |		/* Use 17-byte time format. */
 2585|     34|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2585:7): [True: 25, False: 9]
  |  Branch (2585:21): [True: 24, False: 1]
  ------------------
 2586|       |			/* Create time. */
 2587|     24|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2587:8): [True: 4, False: 20]
  ------------------
 2588|      4|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      4|#define BIRTHTIME_IS_SET 1
  ------------------
 2589|      4|				file->birthtime = isodate17(data);
 2590|      4|			}
 2591|     24|			data += 17;
 2592|     24|			data_length -= 17;
 2593|     24|		}
 2594|     34|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2594:7): [True: 33, False: 1]
  |  Branch (2594:21): [True: 32, False: 1]
  ------------------
 2595|       |			/* Modify time. */
 2596|     32|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2596:8): [True: 1, False: 31]
  ------------------
 2597|      1|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      1|#define MTIME_IS_SET 2
  ------------------
 2598|      1|				file->mtime = isodate17(data);
 2599|      1|			}
 2600|     32|			data += 17;
 2601|     32|			data_length -= 17;
 2602|     32|		}
 2603|     34|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2603:7): [True: 32, False: 2]
  |  Branch (2603:21): [True: 29, False: 3]
  ------------------
 2604|       |			/* Access time. */
 2605|     29|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2605:8): [True: 3, False: 26]
  ------------------
 2606|      3|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      3|#define ATIME_IS_SET 4
  ------------------
 2607|      3|				file->atime = isodate17(data);
 2608|      3|			}
 2609|     29|			data += 17;
 2610|     29|			data_length -= 17;
 2611|     29|		}
 2612|     34|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2612:7): [True: 33, False: 1]
  |  Branch (2612:21): [True: 29, False: 4]
  ------------------
 2613|       |			/* Attribute change time. */
 2614|     29|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2614:8): [True: 1, False: 28]
  ------------------
 2615|      1|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      1|#define CTIME_IS_SET 8
  ------------------
 2616|      1|				file->ctime = isodate17(data);
 2617|      1|			}
 2618|     29|		}
 2619|     34|	} else {
 2620|       |		/* Use 7-byte time format. */
 2621|     17|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2621:7): [True: 13, False: 4]
  |  Branch (2621:21): [True: 12, False: 1]
  ------------------
 2622|       |			/* Create time. */
 2623|     12|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2623:8): [True: 3, False: 9]
  ------------------
 2624|      3|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      3|#define BIRTHTIME_IS_SET 1
  ------------------
 2625|      3|				file->birthtime = isodate7(data);
 2626|      3|			}
 2627|     12|			data += 7;
 2628|     12|			data_length -= 7;
 2629|     12|		}
 2630|     17|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2630:7): [True: 14, False: 3]
  |  Branch (2630:21): [True: 13, False: 1]
  ------------------
 2631|       |			/* Modify time. */
 2632|     13|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2632:8): [True: 7, False: 6]
  ------------------
 2633|      7|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      7|#define MTIME_IS_SET 2
  ------------------
 2634|      7|				file->mtime = isodate7(data);
 2635|      7|			}
 2636|     13|			data += 7;
 2637|     13|			data_length -= 7;
 2638|     13|		}
 2639|     17|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2639:7): [True: 15, False: 2]
  |  Branch (2639:21): [True: 13, False: 2]
  ------------------
 2640|       |			/* Access time. */
 2641|     13|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2641:8): [True: 2, False: 11]
  ------------------
 2642|      2|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      2|#define ATIME_IS_SET 4
  ------------------
 2643|      2|				file->atime = isodate7(data);
 2644|      2|			}
 2645|     13|			data += 7;
 2646|     13|			data_length -= 7;
 2647|     13|		}
 2648|     17|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2648:7): [True: 16, False: 1]
  |  Branch (2648:21): [True: 14, False: 2]
  ------------------
 2649|       |			/* Attribute change time. */
 2650|     14|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2650:8): [True: 2, False: 12]
  ------------------
 2651|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      2|#define CTIME_IS_SET 8
  ------------------
 2652|      2|				file->ctime = isodate7(data);
 2653|      2|			}
 2654|     14|		}
 2655|     17|	}
 2656|     51|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3357|    114|{
 3358|       |	/* First 16 bytes are all ASCII digits */
 3359|  1.13k|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3359:18): [True: 1.09k, False: 42]
  ------------------
 3360|  1.09k|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3360:7): [True: 26, False: 1.07k]
  |  Branch (3360:21): [True: 46, False: 1.02k]
  ------------------
 3361|     72|			return 0;
 3362|  1.09k|	}
 3363|       |
 3364|     42|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3365|     42|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3366|     42|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3367|     42|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3368|     42|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3369|     42|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3370|     42|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3371|     42|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3372|     42|	int gmt_off = (signed char)v[16];
 3373|       |
 3374|     42|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3374:6): [True: 10, False: 32]
  |  Branch (3374:19): [True: 9, False: 1]
  |  Branch (3374:33): [True: 9, False: 0]
  ------------------
 3375|      9|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3375:9): [True: 9, False: 0]
  |  Branch (3375:22): [True: 7, False: 2]
  |  Branch (3375:37): [True: 7, False: 0]
  ------------------
 3376|      7|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3376:9): [True: 7, False: 0]
  |  Branch (3376:28): [True: 1, False: 6]
  ------------------
 3377|      1|		return 0;
 3378|       |	/*
 3379|       |	 * Sanity-test each individual field
 3380|       |	 */
 3381|       |
 3382|       |	/* Year must be 1900-2300 */
 3383|       |	/* (Not specified in ECMA-119, but these seem
 3384|       |	   like reasonable limits. */
 3385|     41|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3385:6): [True: 10, False: 31]
  |  Branch (3385:21): [True: 4, False: 27]
  ------------------
 3386|     14|		return 0;
 3387|       |	/* Month must be 1-12 */
 3388|     27|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3388:6): [True: 0, False: 27]
  |  Branch (3388:19): [True: 1, False: 26]
  ------------------
 3389|      1|		return 0;
 3390|       |	/* Day must be 1-31 */
 3391|     26|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3391:6): [True: 1, False: 25]
  |  Branch (3391:17): [True: 0, False: 25]
  ------------------
 3392|      1|		return 0;
 3393|       |	/* Hour must be 0-23 */
 3394|     25|	if (hour > 23)
  ------------------
  |  Branch (3394:6): [True: 10, False: 15]
  ------------------
 3395|     10|		return 0;
 3396|       |	/* Minute must be 0-59 */
 3397|     15|	if (minute > 59)
  ------------------
  |  Branch (3397:6): [True: 1, False: 14]
  ------------------
 3398|      1|		return 0;
 3399|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3400|       |	/* BUT: we should probably allow for the time being in UTC, which
 3401|       |	   allows up to 61 seconds in a minute in certain cases */
 3402|     14|	if (second > 61)
  ------------------
  |  Branch (3402:6): [True: 1, False: 13]
  ------------------
 3403|      1|		return 0;
 3404|       |	/* Hundredths must be 0-99 */
 3405|     13|	if (hundredths > 99)
  ------------------
  |  Branch (3405:6): [True: 0, False: 13]
  ------------------
 3406|      0|		return 0;
 3407|       |	/* Offset from GMT must be -48 to +52 */
 3408|     13|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3408:6): [True: 1, False: 12]
  |  Branch (3408:23): [True: 3, False: 9]
  ------------------
 3409|      4|		return 0;
 3410|       |
 3411|       |	/* All tests pass, this is OK */
 3412|      9|	return 1;
 3413|       |
 3414|     13|}
archive_read_support_format_iso9660.c:isodate17:
 3418|      9|{
 3419|      9|	struct tm tm;
 3420|      9|	int offset;
 3421|      9|	time_t t;
 3422|       |
 3423|      9|	memset(&tm, 0, sizeof(tm));
 3424|      9|	tm.tm_year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3425|      9|	    + (v[2] - '0') * 10 + (v[3] - '0')
 3426|      9|	    - 1900;
 3427|      9|	tm.tm_mon = (v[4] - '0') * 10 + (v[5] - '0') - 1;
 3428|      9|	tm.tm_mday = (v[6] - '0') * 10 + (v[7] - '0');
 3429|      9|	tm.tm_hour = (v[8] - '0') * 10 + (v[9] - '0');
 3430|      9|	tm.tm_min = (v[10] - '0') * 10 + (v[11] - '0');
 3431|      9|	tm.tm_sec = (v[12] - '0') * 10 + (v[13] - '0');
 3432|       |	/* v[16] is the signed timezone offset, in 1/4-hour increments. */
 3433|      9|	offset = ((const signed char *)v)[16];
 3434|      9|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3434:6): [True: 9, False: 0]
  |  Branch (3434:22): [True: 8, False: 1]
  ------------------
 3435|      8|		tm.tm_hour -= offset / 4;
 3436|      8|		tm.tm_min -= (offset % 4) * 15;
 3437|      8|	}
 3438|      9|	t = time_from_tm(&tm);
 3439|      9|	if (t == (time_t)-1)
  ------------------
  |  Branch (3439:6): [True: 0, False: 9]
  ------------------
 3440|      0|		return ((time_t)0);
 3441|      9|	return (t);
 3442|      9|}
archive_read_support_format_iso9660.c:parse_rockridge_ZF1:
 2748|      1|{
 2749|       |
 2750|      1|	if (data_length == 12 && data[0] == 0x70 && data[1] == 0x7a) {
  ------------------
  |  Branch (2750:6): [True: 0, False: 1]
  |  Branch (2750:27): [True: 0, False: 0]
  |  Branch (2750:46): [True: 0, False: 0]
  ------------------
 2751|       |        /* paged zlib */
 2752|      0|        file->pz = 1;
 2753|      0|        file->pz_log2_bs = data[3];
 2754|      0|        if (file->pz_log2_bs < 15 || file->pz_log2_bs > 17) {
  ------------------
  |  Branch (2754:13): [True: 0, False: 0]
  |  Branch (2754:38): [True: 0, False: 0]
  ------------------
 2755|       |            /* TODO: Return an error here instead of silently
 2756|       |             * disabling zisofs. That requires propagating an
 2757|       |             * error return through parse_rockridge() and its
 2758|       |             * callers. */
 2759|      0|            file->pz = 0;
 2760|      0|            return;
 2761|      0|        }
 2762|      0|        file->pz_uncompressed_size = archive_le32dec(&data[4]);
 2763|      0|    }
 2764|      1|}
archive_read_support_format_iso9660.c:register_file:
 2768|  1.14k|{
 2769|       |
 2770|  1.14k|	file->use_next = iso9660->use_files;
 2771|  1.14k|	iso9660->use_files = file;
 2772|  1.14k|}
archive_read_support_format_iso9660.c:release_file:
 2776|  1.14k|{
 2777|  1.14k|	struct content *con, *connext;
 2778|       |
 2779|  1.14k|	archive_string_free(&file->name);
 2780|  1.14k|	archive_string_free(&file->symlink);
 2781|  1.14k|	free(file->utf16be_name);
 2782|  1.14k|	con = file->contents.first;
 2783|  1.31k|	while (con != NULL) {
  ------------------
  |  Branch (2783:9): [True: 167, False: 1.14k]
  ------------------
 2784|    167|		connext = con->next;
 2785|    167|		free(con);
 2786|    167|		con = connext;
 2787|    167|	}
 2788|  1.14k|	free(file);
 2789|  1.14k|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3147|  1.03k|{
 3148|  1.03k|	uint64_t file_key, parent_key;
 3149|  1.03k|	size_t hole, parent;
 3150|       |
 3151|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3152|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3153|  1.03k|	key <<= 16;
 3154|  1.03k|	key += heap->used & 0xFFFF;
 3155|       |
 3156|       |	/* Expand our pending files list as necessary. */
 3157|  1.03k|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3157:6): [True: 180, False: 852]
  ------------------
 3158|    180|		struct file_info **new_pending_files;
 3159|    180|		size_t new_size;
 3160|       |
 3161|    180|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3161:7): [True: 180, False: 0]
  ------------------
 3162|    180|			new_size = 1024;
 3163|      0|		else if (archive_ckd_mul_size(&new_size, heap->allocated, 2)) {
  ------------------
  |  Branch (3163:12): [True: 0, False: 0]
  ------------------
 3164|       |			/* Overflow keeps us from growing the list. */
 3165|      0|			archive_set_error(&a->archive,
 3166|      0|			    ENOMEM, "Out of memory");
 3167|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3168|      0|		}
 3169|    180|		new_pending_files = (struct file_info **)
 3170|    180|		    calloc(new_size, sizeof(new_pending_files[0]));
 3171|    180|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3171:7): [True: 0, False: 180]
  ------------------
 3172|      0|			archive_set_error(&a->archive,
 3173|      0|			    ENOMEM, "Out of memory");
 3174|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3175|      0|		}
 3176|    180|		if (heap->allocated)
  ------------------
  |  Branch (3176:7): [True: 0, False: 180]
  ------------------
 3177|      0|			memcpy(new_pending_files, heap->files,
 3178|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3179|    180|		free(heap->files);
 3180|    180|		heap->files = new_pending_files;
 3181|    180|		heap->allocated = new_size;
 3182|    180|	}
 3183|       |
 3184|  1.03k|	file_key = file->key = key;
 3185|       |
 3186|       |	/*
 3187|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3188|       |	 */
 3189|  1.03k|	hole = heap->used++;
 3190|  1.52k|	while (hole > 0) {
  ------------------
  |  Branch (3190:9): [True: 1.11k, False: 417]
  ------------------
 3191|  1.11k|		parent = (hole - 1) / 2;
 3192|  1.11k|		parent_key = heap->files[parent]->key;
 3193|  1.11k|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3193:7): [True: 615, False: 495]
  ------------------
 3194|    615|			heap->files[hole] = file;
 3195|    615|			return (ARCHIVE_OK);
  ------------------
  |  |  234|    615|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3196|    615|		}
 3197|       |		/* Move parent into hole <==> move hole up tree. */
 3198|    495|		heap->files[hole] = heap->files[parent];
 3199|    495|		hole = parent;
 3200|    495|	}
 3201|    417|	heap->files[0] = file;
 3202|       |
 3203|    417|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    417|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3204|  1.03k|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2807|    920|{
 2808|    920|	struct file_info *file;
 2809|    920|	int r;
 2810|       |
 2811|    920|	r = next_cache_entry(a, iso9660, pfile);
 2812|    920|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    920|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2812:6): [True: 225, False: 695]
  ------------------
 2813|    225|		return (r);
 2814|    695|	file = *pfile;
 2815|       |
 2816|       |	/* Don't waste time seeking for zero-length bodies. */
 2817|    695|	if (file->size == 0)
  ------------------
  |  Branch (2817:6): [True: 257, False: 438]
  ------------------
 2818|    257|		file->offset = iso9660->current_position;
 2819|       |
 2820|       |	/* flush any remaining bytes from the last round to ensure
 2821|       |	 * we're positioned */
 2822|    695|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2822:6): [True: 0, False: 695]
  ------------------
 2823|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2824|      0|		iso9660->entry_bytes_unconsumed = 0;
 2825|      0|	}
 2826|       |
 2827|       |	/* Seek forward to the start of the entry. */
 2828|    695|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2828:6): [True: 50, False: 645]
  ------------------
 2829|     50|		int64_t step;
 2830|       |
 2831|     50|		step = file->offset - iso9660->current_position;
 2832|     50|		step = __archive_read_consume(a, step);
 2833|     50|		if (step < 0)
  ------------------
  |  Branch (2833:7): [True: 22, False: 28]
  ------------------
 2834|     22|			return ((int)step);
 2835|     28|		iso9660->current_position = file->offset;
 2836|     28|	}
 2837|       |
 2838|       |	/* We found body of file; handle it now. */
 2839|    673|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    673|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2840|    695|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2845|    920|{
 2846|    920|	struct file_info *file;
 2847|    920|	struct {
 2848|    920|		struct file_info	*first;
 2849|    920|		struct file_info	**last;
 2850|    920|	}	empty_files;
 2851|    920|	int64_t number;
 2852|    920|	int count;
 2853|       |
 2854|    920|	file = cache_get_entry(iso9660);
 2855|    920|	if (file != NULL) {
  ------------------
  |  Branch (2855:6): [True: 245, False: 675]
  ------------------
 2856|    245|		*pfile = file;
 2857|    245|		return (ARCHIVE_OK);
  ------------------
  |  |  234|    245|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2858|    245|	}
 2859|       |
 2860|    675|	for (;;) {
 2861|    675|		struct file_info *re, *d;
 2862|       |
 2863|    675|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  451|    675|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2864|    675|		if (file == NULL) {
  ------------------
  |  Branch (2864:7): [True: 111, False: 564]
  ------------------
 2865|       |			/*
 2866|       |			 * If directory entries all which are descendant of
 2867|       |			 * rr_moved are still remaining, expose their.
 2868|       |			 */
 2869|    111|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2869:8): [True: 0, False: 111]
  ------------------
 2870|      0|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2870:8): [True: 0, False: 0]
  ------------------
 2871|      0|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2871:8): [True: 0, False: 0]
  ------------------
 2872|       |				/* Expose "rr_moved" entry. */
 2873|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2874|    111|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2874:11): [True: 0, False: 111]
  ------------------
 2875|       |				/* Expose its descendant dirs. */
 2876|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2876:12): [True: 0, False: 0]
  ------------------
 2877|      0|					cache_add_entry(iso9660, d);
 2878|      0|			}
 2879|    111|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2879:8): [True: 0, False: 111]
  ------------------
 2880|      0|				return (next_cache_entry(a, iso9660, pfile));
 2881|    111|			return (ARCHIVE_EOF);
  ------------------
  |  |  233|    111|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2882|    111|		}
 2883|       |
 2884|    564|		if (file->cl_offset) {
  ------------------
  |  Branch (2884:7): [True: 0, False: 564]
  ------------------
 2885|      0|			struct file_info *first_re = NULL;
 2886|      0|			int nexted_re = 0;
 2887|       |
 2888|       |			/*
 2889|       |			 * Find "RE" dir for the current file, which
 2890|       |			 * has "CL" flag.
 2891|       |			 */
 2892|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2892:11): [True: 0, False: 0]
  ------------------
 2893|      0|			    != first_re) {
 2894|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2894:9): [True: 0, False: 0]
  ------------------
 2895|      0|					first_re = re;
 2896|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2896:9): [True: 0, False: 0]
  ------------------
 2897|      0|					re->parent->subdirs--;
 2898|      0|					re->parent = file->parent;
 2899|      0|					re->re = 0;
 2900|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2900:10): [True: 0, False: 0]
  ------------------
 2901|      0|						nexted_re = 1;
 2902|      0|						re->re_descendant = 1;
 2903|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2903:11): [True: 0, False: 0]
  ------------------
 2904|      0|							goto fatal_rr;
 2905|       |						/* Move a list of descendants
 2906|       |						 * to a new ancestor. */
 2907|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2907:14): [True: 0, False: 0]
  ------------------
 2908|      0|						    re)) != NULL)
 2909|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2909:12): [True: 0, False: 0]
  ------------------
 2910|      0|							    < 0)
 2911|      0|								goto fatal_rr;
 2912|      0|						break;
 2913|      0|					}
 2914|       |					/* Replace the current file
 2915|       |					 * with "RE" dir */
 2916|      0|					*pfile = file = re;
 2917|       |					/* Expose its descendant */
 2918|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2918:13): [True: 0, False: 0]
  ------------------
 2919|      0|					    file)) != NULL)
 2920|      0|						cache_add_entry(
 2921|      0|						    iso9660, d);
 2922|      0|					break;
 2923|      0|				} else
 2924|      0|					re_add_entry(iso9660, re);
 2925|      0|			}
 2926|      0|			if (nexted_re) {
  ------------------
  |  Branch (2926:8): [True: 0, False: 0]
  ------------------
 2927|       |				/*
 2928|       |				 * Do not expose this at this time
 2929|       |				 * because we have not gotten its full-path
 2930|       |				 * name yet.
 2931|       |				 */
 2932|      0|				continue;
 2933|      0|			}
 2934|    564|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|    564|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|    564|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2934:14): [True: 270, False: 294]
  ------------------
 2935|    270|			int r;
 2936|       |
 2937|       |			/* Read file entries in this dir. */
 2938|    270|			r = read_children(a, file);
 2939|    270|			if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    270|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2939:8): [True: 114, False: 156]
  ------------------
 2940|    114|				return (r);
 2941|       |
 2942|       |			/*
 2943|       |			 * Handle a special dir of Rockridge extensions,
 2944|       |			 * "rr_moved".
 2945|       |			 */
 2946|    156|			if (file->rr_moved) {
  ------------------
  |  Branch (2946:8): [True: 0, False: 156]
  ------------------
 2947|       |				/*
 2948|       |				 * If this has only the subdirectories which
 2949|       |				 * have "RE" flags, do not expose at this time.
 2950|       |				 */
 2951|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2951:9): [True: 0, False: 0]
  ------------------
 2952|      0|					continue;
 2953|       |				/* Otherwise expose "rr_moved" entry. */
 2954|    156|			} else if (file->re) {
  ------------------
  |  Branch (2954:15): [True: 0, False: 156]
  ------------------
 2955|       |				/*
 2956|       |				 * Do not expose this at this time
 2957|       |				 * because we have not gotten its full-path
 2958|       |				 * name yet.
 2959|       |				 */
 2960|      0|				re_add_entry(iso9660, file);
 2961|      0|				continue;
 2962|    156|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2962:15): [True: 0, False: 156]
  ------------------
 2963|       |				/*
 2964|       |				 * If the top level "RE" entry of this entry
 2965|       |				 * is not exposed, we, accordingly, should not
 2966|       |				 * expose this entry at this time because
 2967|       |				 * we cannot make its proper full-path name.
 2968|       |				 */
 2969|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2969:9): [True: 0, False: 0]
  ------------------
 2970|      0|					continue;
 2971|       |				/* Otherwise we can expose this entry because
 2972|       |				 * it seems its top level "RE" has already been
 2973|       |				 * exposed. */
 2974|      0|			}
 2975|    156|		}
 2976|    450|		break;
 2977|    564|	}
 2978|       |
 2979|    450|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  215|    450|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  216|    900|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2979:6): [True: 156, False: 294]
  |  Branch (2979:44): [True: 40, False: 254]
  ------------------
 2980|    196|		return (ARCHIVE_OK);
  ------------------
  |  |  234|    196|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2981|       |
 2982|    254|	count = 0;
 2983|    254|	number = file->number;
 2984|    254|	iso9660->cache_files.first = NULL;
 2985|    254|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2986|    254|	empty_files.first = NULL;
 2987|    254|	empty_files.last = &empty_files.first;
 2988|       |	/* Collect files which has the same file serial number.
 2989|       |	 * Peek pending_files so that file which number is different
 2990|       |	 * is not put back. */
 2991|    531|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2991:9): [True: 424, False: 107]
  ------------------
 2992|    424|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2992:7): [True: 128, False: 296]
  ------------------
 2993|    296|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2993:7): [True: 149, False: 147]
  ------------------
 2994|    277|		if (file->number == -1) {
  ------------------
  |  Branch (2994:7): [True: 95, False: 182]
  ------------------
 2995|       |			/* This file has the same offset
 2996|       |			 * but it's wrong offset which empty files
 2997|       |			 * and symlink files have.
 2998|       |			 * NOTE: This wrong offset was recorded by
 2999|       |			 * old mkisofs utility. If ISO images is
 3000|       |			 * created by latest mkisofs, this does not
 3001|       |			 * happen.
 3002|       |			 */
 3003|     95|			file->next = NULL;
 3004|     95|			*empty_files.last = file;
 3005|     95|			empty_files.last = &(file->next);
 3006|    182|		} else {
 3007|    182|			count++;
 3008|    182|			cache_add_entry(iso9660, file);
 3009|    182|		}
 3010|    277|		file = next_entry(iso9660);
  ------------------
  |  |  451|    277|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 3011|    277|	}
 3012|       |
 3013|    254|	if (count == 0) {
  ------------------
  |  Branch (3013:6): [True: 152, False: 102]
  ------------------
 3014|    152|		*pfile = file;
 3015|    152|		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  234|    152|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3015:11): [True: 0, False: 152]
  ------------------
 3016|    152|	}
 3017|    102|	if (file->number == -1) {
  ------------------
  |  Branch (3017:6): [True: 33, False: 69]
  ------------------
 3018|     33|		file->next = NULL;
 3019|     33|		*empty_files.last = file;
 3020|     33|		empty_files.last = &(file->next);
 3021|     69|	} else {
 3022|     69|		count++;
 3023|     69|		cache_add_entry(iso9660, file);
 3024|     69|	}
 3025|       |
 3026|    102|	if (count > 1) {
  ------------------
  |  Branch (3026:6): [True: 79, False: 23]
  ------------------
 3027|       |		/* The count is the same as number of hardlink,
 3028|       |		 * so much so that each nlinks of files in cache_file
 3029|       |		 * is overwritten by value of the count.
 3030|       |		 */
 3031|     79|		for (file = iso9660->cache_files.first;
 3032|    307|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3032:7): [True: 228, False: 79]
  ------------------
 3033|    228|			file->nlinks = count;
 3034|     79|	}
 3035|       |	/* If there are empty files, that files are added
 3036|       |	 * to the tail of the cache_files. */
 3037|    102|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3037:6): [True: 33, False: 69]
  ------------------
 3038|     33|		*iso9660->cache_files.last = empty_files.first;
 3039|     33|		iso9660->cache_files.last = empty_files.last;
 3040|     33|	}
 3041|    102|	*pfile = cache_get_entry(iso9660);
 3042|    102|	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  234|    102|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3042:10): [True: 0, False: 102]
  ------------------
 3043|       |
 3044|      0|fatal_rr:
 3045|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3046|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3047|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3048|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3049|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3050|    254|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3132|  1.02k|{
 3133|  1.02k|	struct file_info *file;
 3134|       |
 3135|  1.02k|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3135:6): [True: 347, False: 675]
  ------------------
 3136|    347|		iso9660->cache_files.first = file->next;
 3137|    347|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3137:7): [True: 83, False: 264]
  ------------------
 3138|     83|			iso9660->cache_files.last =
 3139|     83|			    &(iso9660->cache_files.first);
 3140|    347|	}
 3141|  1.02k|	return (file);
 3142|  1.02k|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3208|    952|{
 3209|    952|	uint64_t a_key, b_key, c_key;
 3210|    952|	size_t a, b, c;
 3211|    952|	struct file_info *r, *tmp;
 3212|       |
 3213|    952|	if (heap->used < 1)
  ------------------
  |  Branch (3213:6): [True: 111, False: 841]
  ------------------
 3214|    111|		return (NULL);
 3215|       |
 3216|       |	/*
 3217|       |	 * The first file in the list is the earliest; we'll return this.
 3218|       |	 */
 3219|    841|	r = heap->files[0];
 3220|       |
 3221|       |	/*
 3222|       |	 * Move the last item in the heap to the root of the tree
 3223|       |	 */
 3224|    841|	heap->files[0] = heap->files[--(heap->used)];
 3225|       |
 3226|       |	/*
 3227|       |	 * Rebalance the heap.
 3228|       |	 */
 3229|    841|	a = 0; /* Starting element and its heap key */
 3230|    841|	a_key = heap->files[a]->key;
 3231|  1.75k|	for (;;) {
 3232|  1.75k|		b = a + a + 1; /* First child */
 3233|  1.75k|		if (b >= heap->used)
  ------------------
  |  Branch (3233:7): [True: 725, False: 1.02k]
  ------------------
 3234|    725|			return (r);
 3235|  1.02k|		b_key = heap->files[b]->key;
 3236|  1.02k|		c = b + 1; /* Use second child if it is smaller. */
 3237|  1.02k|		if (c < heap->used) {
  ------------------
  |  Branch (3237:7): [True: 861, False: 165]
  ------------------
 3238|    861|			c_key = heap->files[c]->key;
 3239|    861|			if (c_key < b_key) {
  ------------------
  |  Branch (3239:8): [True: 365, False: 496]
  ------------------
 3240|    365|				b = c;
 3241|    365|				b_key = c_key;
 3242|    365|			}
 3243|    861|		}
 3244|  1.02k|		if (a_key <= b_key)
  ------------------
  |  Branch (3244:7): [True: 116, False: 910]
  ------------------
 3245|    116|			return (r);
 3246|    910|		tmp = heap->files[a];
 3247|    910|		heap->files[a] = heap->files[b];
 3248|    910|		heap->files[b] = tmp;
 3249|    910|		a = b;
 3250|    910|	}
 3251|    841|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3124|    251|{
 3125|       |	file->next = NULL;
 3126|    251|	*iso9660->cache_files.last = file;
 3127|    251|	iso9660->cache_files.last = &(file->next);
 3128|    251|}
archive_read_support_format_iso9660.c:re_get_entry:
 3062|    111|{
 3063|    111|	struct file_info *file;
 3064|       |
 3065|    111|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3065:6): [True: 0, False: 111]
  ------------------
 3066|      0|		iso9660->re_files.first = file->re_next;
 3067|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3067:7): [True: 0, False: 0]
  ------------------
 3068|      0|			iso9660->re_files.last =
 3069|      0|			    &(iso9660->re_files.first);
 3070|      0|	}
 3071|    111|	return (file);
 3072|    111|}
archive_read_support_format_iso9660.c:read_children:
 1026|    270|{
 1027|    270|	struct iso9660 *iso9660 = a->format->data;
 1028|    270|	const unsigned char *b, *p;
 1029|    270|	struct file_info *multi;
 1030|    270|	size_t step, skip_size;
 1031|       |
 1032|       |	/* flush any remaining bytes from the last round to ensure
 1033|       |	 * we're positioned */
 1034|    270|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1034:6): [True: 0, False: 270]
  ------------------
 1035|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1036|      0|		iso9660->entry_bytes_unconsumed = 0;
 1037|      0|	}
 1038|    270|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1038:6): [True: 22, False: 248]
  ------------------
 1039|     22|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     22|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1040|     22|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1041|     22|		    parent->name.s,
 1042|     22|		    (intmax_t)iso9660->current_position,
 1043|     22|		    (intmax_t)parent->offset);
 1044|     22|		return (ARCHIVE_WARN);
  ------------------
  |  |  236|     22|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1045|     22|	}
 1046|    248|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1046:6): [True: 54, False: 194]
  ------------------
 1047|     54|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     54|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1048|     54|		    "Directory is beyond end-of-media: %s",
 1049|     54|		    parent->name.s);
 1050|     54|		return (ARCHIVE_WARN);
  ------------------
  |  |  236|     54|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1051|     54|	}
 1052|    194|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1052:6): [True: 70, False: 124]
  ------------------
 1053|     70|		int64_t skipsize;
 1054|       |
 1055|     70|		skipsize = parent->offset - iso9660->current_position;
 1056|     70|		skipsize = __archive_read_consume(a, skipsize);
 1057|     70|		if (skipsize < 0)
  ------------------
  |  Branch (1057:7): [True: 3, False: 67]
  ------------------
 1058|      3|			return ((int)skipsize);
 1059|     67|		iso9660->current_position = parent->offset;
 1060|     67|	}
 1061|       |
 1062|       |	/* Round directory size up to a whole number of blocks */
 1063|    191|	if (parent->size > SIZE_MAX
  ------------------
  |  Branch (1063:6): [True: 0, False: 191]
  ------------------
 1064|    191|	    || archive_ckd_add_size(&step, (size_t)parent->size,
  ------------------
  |  Branch (1064:9): [True: 0, False: 191]
  ------------------
 1065|    191|		iso9660->logical_block_size - 1)) {
 1066|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1067|      0|		    "Directory is too large: %s", parent->name.s);
 1068|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1069|      0|	}
 1070|    191|	step &= ~((size_t)iso9660->logical_block_size - 1);
 1071|    191|	b = __archive_read_ahead(a, step, NULL);
 1072|    191|	if (b == NULL) {
  ------------------
  |  Branch (1072:6): [True: 10, False: 181]
  ------------------
 1073|     10|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1074|     10|		    "Failed to read full block when scanning "
 1075|     10|		    "ISO9660 directory list");
 1076|     10|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1077|     10|	}
 1078|    181|	iso9660->current_position += step;
 1079|    181|	multi = NULL;
 1080|    181|	skip_size = step;
 1081|    581|	while (step) {
  ------------------
  |  Branch (1081:9): [True: 425, False: 156]
  ------------------
 1082|    425|		p = b;
 1083|    425|		b += iso9660->logical_block_size;
 1084|    425|		step -= iso9660->logical_block_size;
 1085|   242k|		for (; p < b && b - p > DR_name_offset && *p != 0 && *p <= b - p;
  ------------------
  |  |  216|   484k|#define DR_name_offset 33
  ------------------
  |  Branch (1085:10): [True: 242k, False: 0]
  |  Branch (1085:19): [True: 242k, False: 117]
  |  Branch (1085:45): [True: 241k, False: 283]
  |  Branch (1085:56): [True: 241k, False: 0]
  ------------------
 1086|   241k|			p += *p) {
 1087|   241k|			struct file_info *child;
 1088|       |
 1089|       |			/* N.B.: these special directory identifiers
 1090|       |			 * are 8 bit "values" even on a
 1091|       |			 * Joliet CD with UCS-2 (16bit) encoding.
 1092|       |			 */
 1093|       |
 1094|       |			/* Skip '.' entry. */
 1095|   241k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   241k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1095:8): [True: 240k, False: 857]
  ------------------
 1096|   240k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  216|   240k|#define DR_name_offset 33
  ------------------
  |  Branch (1096:11): [True: 116, False: 240k]
  ------------------
 1097|    116|				continue;
 1098|       |			/* Skip '..' entry. */
 1099|   241k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   241k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1099:8): [True: 240k, False: 857]
  ------------------
 1100|   240k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  216|   240k|#define DR_name_offset 33
  ------------------
  |  Branch (1100:11): [True: 240k, False: 108]
  ------------------
 1101|   240k|				continue;
 1102|    965|			child = parse_file_info(a, parent, p, b - p);
 1103|    965|			if (child == NULL) {
  ------------------
  |  Branch (1103:8): [True: 25, False: 940]
  ------------------
 1104|     25|				__archive_read_consume(a, skip_size);
 1105|     25|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     25|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1106|     25|			}
 1107|    940|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1107:8): [True: 940, False: 0]
  ------------------
 1108|    940|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1108:9): [True: 114, False: 826]
  |  Branch (1108:32): [True: 53, False: 773]
  ------------------
 1109|    167|				struct content *con;
 1110|       |
 1111|    167|				if (multi == NULL) {
  ------------------
  |  Branch (1111:9): [True: 79, False: 88]
  ------------------
 1112|     79|					multi = child;
 1113|     79|					multi->contents.first = NULL;
 1114|     79|					multi->contents.last =
 1115|     79|					    &(multi->contents.first);
 1116|     79|				}
 1117|    167|				con = malloc(sizeof(struct content));
 1118|    167|				if (con == NULL) {
  ------------------
  |  Branch (1118:9): [True: 0, False: 167]
  ------------------
 1119|      0|					archive_set_error(
 1120|      0|					    &a->archive, ENOMEM,
 1121|      0|					    "No memory for multi extent");
 1122|      0|					__archive_read_consume(a, skip_size);
 1123|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1124|      0|				}
 1125|    167|				con->offset = child->offset;
 1126|    167|				con->size = child->size;
 1127|    167|				con->next = NULL;
 1128|    167|				*multi->contents.last = con;
 1129|    167|				multi->contents.last = &(con->next);
 1130|    167|				if (multi == child) {
  ------------------
  |  Branch (1130:9): [True: 79, False: 88]
  ------------------
 1131|     79|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  449|     79|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1131:10): [True: 0, False: 79]
  ------------------
 1132|     79|					    != ARCHIVE_OK)
  ------------------
  |  |  234|     79|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1133|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1134|     88|				} else {
 1135|     88|					multi->size += child->size;
 1136|     88|					if (!child->multi_extent)
  ------------------
  |  Branch (1136:10): [True: 53, False: 35]
  ------------------
 1137|     53|						multi = NULL;
 1138|     88|				}
 1139|    167|			} else
 1140|    773|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  449|    773|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  234|    773|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1140:9): [True: 0, False: 773]
  ------------------
 1141|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1142|    940|		}
 1143|    425|	}
 1144|       |
 1145|    156|	__archive_read_consume(a, skip_size);
 1146|       |
 1147|       |	/* Read data which recorded by RRIP "CE" extension. */
 1148|    156|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  234|    156|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1148:6): [True: 0, False: 156]
  ------------------
 1149|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1150|       |
 1151|    156|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    156|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1152|    156|}
archive_read_support_format_iso9660.c:read_CE:
 2464|    156|{
 2465|    156|	struct read_ce_queue *heap;
 2466|    156|	const unsigned char *b, *p, *end;
 2467|    156|	struct file_info *file;
 2468|    156|	size_t step;
 2469|    156|	uint64_t ce_start, ce_end;
 2470|    156|	int r;
 2471|       |
 2472|       |	/* Read data which RRIP "CE" extension points. */
 2473|    156|	heap = &(iso9660->read_ce_req);
 2474|    156|	step = iso9660->logical_block_size;
 2475|    156|	while (heap->cnt &&
  ------------------
  |  Branch (2475:9): [True: 0, False: 156]
  ------------------
 2476|      0|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2476:6): [True: 0, False: 0]
  ------------------
 2477|      0|		b = __archive_read_ahead(a, step, NULL);
 2478|      0|		if (b == NULL) {
  ------------------
  |  Branch (2478:7): [True: 0, False: 0]
  ------------------
 2479|      0|			archive_set_error(&a->archive,
 2480|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2481|      0|			    "Failed to read full block when scanning "
 2482|      0|			    "ISO9660 directory list");
 2483|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2484|      0|		}
 2485|      0|		do {
 2486|      0|			file = heap->reqs[0].file;
 2487|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2487:8): [True: 0, False: 0]
  ------------------
 2488|      0|				archive_set_error(&a->archive,
 2489|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2490|      0|				    "Malformed CE information");
 2491|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2492|      0|			}
 2493|      0|			ce_start = heap->reqs[0].offset + file->ce_offset;
 2494|      0|			ce_end = ce_start + file->ce_size;
 2495|      0|			if (ce_start < file->ce_processed_end) {
  ------------------
  |  Branch (2495:8): [True: 0, False: 0]
  ------------------
 2496|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2497|      0|				    "Invalid parameter in SUSP \"CE\" extension");
 2498|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2499|      0|			}
 2500|      0|			p = b + file->ce_offset;
 2501|      0|			end = p + file->ce_size;
 2502|      0|			file->ce_processed_end = ce_end;
 2503|      0|			next_CE(heap);
 2504|      0|			r = parse_rockridge(a, file, p, end);
 2505|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2505:8): [True: 0, False: 0]
  ------------------
 2506|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2507|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2507:12): [True: 0, False: 0]
  ------------------
 2508|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2508:7): [True: 0, False: 0]
  ------------------
 2509|       |		/* NOTE: Do not move this consume's code to front of
 2510|       |		 * do-while loop. Registration of nested CE extension
 2511|       |		 * might cause error because of current position. */
 2512|      0|		__archive_read_consume(a, step);
 2513|      0|		iso9660->current_position += step;
 2514|      0|	}
 2515|    156|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    156|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2516|    156|}
archive_read_support_format_iso9660.c:build_pathname_utf16be:
 3493|     30|{
 3494|       |	/*
 3495|       |	 * Plain ISO9660 only allows 8 dir levels; if we get
 3496|       |	 * to 1000, then something is very, very wrong.  A malformed
 3497|       |	 * image can also form a cycle in the parent chain via Rock
 3498|       |	 * Ridge "CL"/"RE" relocation, which without this limit would
 3499|       |	 * recurse until the stack is exhausted.  Mirrors the cap in
 3500|       |	 * build_pathname().
 3501|       |	 */
 3502|     30|	if (depth > 1000)
  ------------------
  |  Branch (3502:6): [True: 0, False: 30]
  ------------------
 3503|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3504|     30|	if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
  ------------------
  |  Branch (3504:6): [True: 16, False: 14]
  |  Branch (3504:30): [True: 0, False: 16]
  ------------------
 3505|      0|		if (build_pathname_utf16be(p, max, len, file->parent,
  ------------------
  |  Branch (3505:7): [True: 0, False: 0]
  ------------------
 3506|      0|		    depth + 1) != ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3507|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3508|      0|		if (*len + 2 > max)
  ------------------
  |  Branch (3508:7): [True: 0, False: 0]
  ------------------
 3509|      0|			return (ARCHIVE_FATAL);/* Path is too long! */
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3510|      0|		p[*len] = 0;
 3511|      0|		p[*len + 1] = '/';
 3512|      0|		*len += 2;
 3513|      0|	}
 3514|     30|	if (file->utf16be_bytes == 0) {
  ------------------
  |  Branch (3514:6): [True: 15, False: 15]
  ------------------
 3515|     15|		if (*len + 2 > max)
  ------------------
  |  Branch (3515:7): [True: 0, False: 15]
  ------------------
 3516|      0|			return (ARCHIVE_FATAL);/* Path is too long! */
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3517|     15|		p[*len] = 0;
 3518|     15|		p[*len + 1] = '.';
 3519|     15|		*len += 2;
 3520|     15|	} else {
 3521|     15|		if (*len + file->utf16be_bytes > max)
  ------------------
  |  Branch (3521:7): [True: 0, False: 15]
  ------------------
 3522|      0|			return (ARCHIVE_FATAL);/* Path is too long! */
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3523|     15|		memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
 3524|     15|		*len += file->utf16be_bytes;
 3525|     15|	}
 3526|     30|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     30|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3527|     30|}
archive_read_support_format_iso9660.c:build_pathname:
 3471|    826|{
 3472|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3473|       |	// to 1000, then something is very, very wrong.
 3474|    826|	if (depth > 1000)
  ------------------
  |  Branch (3474:6): [True: 0, False: 826]
  ------------------
 3475|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3476|    826|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    630|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3476:6): [True: 630, False: 196]
  |  Branch (3476:30): [True: 183, False: 447]
  ------------------
 3477|    183|		int r = build_pathname(as, file->parent, depth + 1);
 3478|       |
 3479|    183|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    183|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3479:7): [True: 0, False: 183]
  ------------------
 3480|      0|			return (r);
 3481|    183|		archive_strcat(as, "/");
 3482|    183|	}
 3483|    826|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    826|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3483:6): [True: 71, False: 755]
  ------------------
 3484|     71|		archive_strcat(as, ".");
 3485|    755|	else
 3486|    755|		archive_string_concat(as, &file->name);
 3487|    826|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    826|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3488|    826|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1483|    740|{
 1484|       |	/* Because read_next_header always does an explicit skip
 1485|       |	 * to the next entry, we don't need to do anything here. */
 1486|    740|	(void)a; /* UNUSED */
 1487|    740|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    740|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1488|    740|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1731|  1.01k|{
 1732|  1.01k|	struct iso9660 *iso9660 = a->format->data;
 1733|  1.01k|	ssize_t bytes_read;
 1734|       |
 1735|  1.01k|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1735:6): [True: 129, False: 888]
  ------------------
 1736|    129|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1737|    129|		iso9660->entry_bytes_unconsumed = 0;
 1738|    129|	}
 1739|       |
 1740|  1.01k|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1740:6): [True: 894, False: 123]
  ------------------
 1741|    894|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1741:7): [True: 41, False: 853]
  ------------------
 1742|     41|			iso9660->entry_content = iso9660->entry_content->next;
 1743|    894|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1743:7): [True: 869, False: 25]
  ------------------
 1744|    869|			*buff = NULL;
 1745|    869|			*size = 0;
 1746|    869|			*offset = iso9660->entry_sparse_offset;
 1747|    869|			return (ARCHIVE_EOF);
  ------------------
  |  |  233|    869|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1748|    869|		}
 1749|       |		/* Seek forward to the start of the entry. */
 1750|     25|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1750:7): [True: 15, False: 10]
  ------------------
 1751|     15|			int64_t step;
 1752|       |
 1753|     15|			step = iso9660->entry_content->offset -
 1754|     15|			    iso9660->current_position;
 1755|     15|			step = __archive_read_consume(a, step);
 1756|     15|			if (step < 0)
  ------------------
  |  Branch (1756:8): [True: 1, False: 14]
  ------------------
 1757|      1|				return ((int)step);
 1758|     14|			iso9660->current_position =
 1759|     14|			    iso9660->entry_content->offset;
 1760|     14|		}
 1761|     24|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1761:7): [True: 10, False: 14]
  ------------------
 1762|     10|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1763|     10|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1764|     10|			    iso9660->pathname.s,
 1765|     10|			    (intmax_t)iso9660->entry_content->offset,
 1766|     10|			    (intmax_t)iso9660->current_position);
 1767|     10|			*buff = NULL;
 1768|     10|			*size = 0;
 1769|     10|			*offset = iso9660->entry_sparse_offset;
 1770|     10|			return (ARCHIVE_WARN);
  ------------------
  |  |  236|     10|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1771|     10|		}
 1772|     14|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1773|     14|	}
 1774|    137|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1774:6): [True: 0, False: 137]
  ------------------
 1775|      0|		return (zisofs_read_data(a, buff, size, offset));
 1776|       |
 1777|    137|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1778|    137|	if (bytes_read == 0)
  ------------------
  |  Branch (1778:6): [True: 8, False: 129]
  ------------------
 1779|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1780|      8|		    "Truncated input file");
 1781|    137|	if (*buff == NULL)
  ------------------
  |  Branch (1781:6): [True: 8, False: 129]
  ------------------
 1782|      8|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1783|    129|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1783:6): [True: 123, False: 6]
  ------------------
 1784|    123|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1785|    129|	*size = bytes_read;
 1786|    129|	*offset = iso9660->entry_sparse_offset;
 1787|    129|	iso9660->entry_sparse_offset += bytes_read;
 1788|    129|	iso9660->entry_bytes_remaining -= bytes_read;
 1789|    129|	iso9660->entry_bytes_unconsumed = bytes_read;
 1790|    129|	iso9660->current_position += bytes_read;
 1791|    129|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    129|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1792|    137|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1796|  20.1k|{
 1797|  20.1k|	struct iso9660 *iso9660 = a->format->data;
 1798|  20.1k|	int r = ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1799|       |
 1800|  20.1k|	release_files(iso9660);
 1801|  20.1k|	free(iso9660->read_ce_req.reqs);
 1802|  20.1k|	archive_string_free(&iso9660->pathname);
 1803|  20.1k|	archive_string_free(&iso9660->previous_pathname);
 1804|  20.1k|	free(iso9660->pending_files.files);
 1805|  20.1k|#ifdef HAVE_ZLIB_H
 1806|  20.1k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1807|  20.1k|	free(iso9660->entry_zisofs.block_pointers);
 1808|  20.1k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1808:6): [True: 0, False: 20.1k]
  ------------------
 1809|      0|		if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
  ------------------
  |  Branch (1809:7): [True: 0, False: 0]
  ------------------
 1810|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1811|      0|			    "Failed to clean up zlib decompressor");
 1812|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1813|      0|		}
 1814|      0|	}
 1815|  20.1k|#endif
 1816|  20.1k|	free(iso9660->utf16be_path);
 1817|  20.1k|	free(iso9660->utf16be_previous_path);
 1818|  20.1k|	free(iso9660);
 1819|       |	a->format->data = NULL;
 1820|  20.1k|	return (r);
 1821|  20.1k|}
archive_read_support_format_iso9660.c:release_files:
 2793|  20.1k|{
 2794|  20.1k|	struct file_info *file;
 2795|       |
 2796|  20.1k|	file = iso9660->use_files;
 2797|  21.2k|	while (file != NULL) {
  ------------------
  |  Branch (2797:9): [True: 1.14k, False: 20.1k]
  ------------------
 2798|  1.14k|		struct file_info *next = file->use_next;
 2799|  1.14k|		release_file(file);
 2800|  1.14k|		file = next;
 2801|  1.14k|	}
 2802|  20.1k|}

archive_read_support_format_lha:
  259|  20.1k|{
  260|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  261|  20.1k|	struct lha *lha;
  262|  20.1k|	int r;
  263|       |
  264|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  265|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_lha");
  266|       |
  267|  20.1k|	lha = calloc(1, sizeof(*lha));
  268|  20.1k|	if (lha == NULL) {
  ------------------
  |  Branch (268:6): [True: 0, False: 20.1k]
  ------------------
  269|      0|		archive_set_error(_a, ENOMEM, "Can't allocate lha data");
  270|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  271|      0|	}
  272|  20.1k|	archive_string_init(&lha->ws);
  ------------------
  |  |   71|  20.1k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  273|       |
  274|  20.1k|	r = __archive_read_register_format(a,
  275|  20.1k|	    lha,
  276|  20.1k|	    "lha",
  277|  20.1k|	    archive_read_format_lha_bid,
  278|  20.1k|	    archive_read_format_lha_options,
  279|  20.1k|	    archive_read_format_lha_read_header,
  280|  20.1k|	    archive_read_format_lha_read_data,
  281|  20.1k|	    archive_read_format_lha_read_data_skip,
  282|  20.1k|	    NULL,
  283|  20.1k|	    archive_read_format_lha_cleanup,
  284|  20.1k|	    NULL,
  285|  20.1k|	    NULL);
  286|       |
  287|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (287:6): [True: 0, False: 20.1k]
  ------------------
  288|      0|		free(lha);
  289|  20.1k|	return (r);
  290|  20.1k|}
archive_read_support_format_lha.c:archive_read_format_lha_bid:
  344|  19.8k|{
  345|  19.8k|	const char *h;
  346|       |
  347|       |	/* If there's already a better bid than we can ever
  348|       |	   make, don't bother testing. */
  349|  19.8k|	if (best_bid > 30)
  ------------------
  |  Branch (349:6): [True: 982, False: 18.8k]
  ------------------
  350|    982|		return (-1);
  351|       |
  352|  18.8k|	if ((h = __archive_read_ahead(a, H_SIZE, NULL)) == NULL)
  ------------------
  |  |  211|  18.8k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (352:6): [True: 66, False: 18.8k]
  ------------------
  353|     66|		return (-1);
  354|       |
  355|  18.8k|	if (lha_check_header_format(h) == 0)
  ------------------
  |  Branch (355:6): [True: 549, False: 18.2k]
  ------------------
  356|    549|		return (30);
  357|       |
  358|  18.2k|	if (h[0] == 'M' && h[1] == 'Z') {
  ------------------
  |  Branch (358:6): [True: 1.33k, False: 16.9k]
  |  Branch (358:21): [True: 648, False: 688]
  ------------------
  359|    648|		ssize_t offset, window;
  360|       |
  361|       |		/* PE file */
  362|    648|		offset = 0;
  363|    648|		window = 4096;
  364|  3.89k|		while (offset + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  213|  3.89k|#define SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  |  Branch (364:10): [True: 3.87k, False: 23]
  ------------------
  365|  3.87k|			ssize_t bytes_avail;
  366|       |
  367|  3.87k|			h = __archive_read_ahead(a, offset + window,
  368|  3.87k|			    &bytes_avail);
  369|  3.87k|			if (h == NULL) {
  ------------------
  |  Branch (369:8): [True: 869, False: 3.00k]
  ------------------
  370|    869|				if (bytes_avail >= offset + H_SIZE) {
  ------------------
  |  |  211|    869|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (370:9): [True: 502, False: 367]
  ------------------
  371|       |					/* Remaining bytes are less than window. */
  372|    502|					window = bytes_avail - offset;
  373|    502|					continue;
  374|    502|				}
  375|    367|				return (0);
  376|    869|			}
  377|  3.00k|			if (bytes_avail > SFX_MAX_READAHEAD)
  ------------------
  |  |  213|  3.00k|#define SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  |  Branch (377:8): [True: 8, False: 2.99k]
  ------------------
  378|      8|				bytes_avail = SFX_MAX_READAHEAD;
  ------------------
  |  |  213|      8|#define SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  379|  6.10M|			while (offset <= bytes_avail - H_SIZE) {
  ------------------
  |  |  211|  6.10M|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (379:11): [True: 6.10M, False: 2.74k]
  ------------------
  380|  6.10M|				size_t next = lha_check_header_format(h + offset);
  381|  6.10M|				if (next == 0)
  ------------------
  |  Branch (381:9): [True: 258, False: 6.10M]
  ------------------
  382|    258|					return (30);
  383|  6.10M|				offset += next;
  384|  6.10M|			}
  385|  3.00k|		}
  386|    648|	}
  387|  17.6k|	return (0);
  388|  18.2k|}
archive_read_support_format_lha.c:lha_check_header_format:
  294|  6.23M|{
  295|  6.23M|	size_t next_skip_bytes;
  296|       |
  297|  6.23M|	switch (h[H_METHOD_OFFSET + 3]) {
  ------------------
  |  |  208|  6.23M|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  298|       |	/*
  299|       |	 * "-lh0-" ... "-lh7-" "-lhd-"
  300|       |	 * "-lzs-" "-lz5-"
  301|       |	 */
  302|   227k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (302:2): [True: 30.5k, False: 6.20M]
  |  Branch (302:12): [True: 123k, False: 6.10M]
  |  Branch (302:22): [True: 67.7k, False: 6.16M]
  |  Branch (302:32): [True: 5.32k, False: 6.22M]
  ------------------
  303|   418k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (303:2): [True: 10.0k, False: 6.22M]
  |  Branch (303:12): [True: 148k, False: 6.08M]
  |  Branch (303:22): [True: 8.21k, False: 6.22M]
  |  Branch (303:32): [True: 24.8k, False: 6.20M]
  ------------------
  304|   530k|	case 'd':
  ------------------
  |  Branch (304:2): [True: 112k, False: 6.12M]
  ------------------
  305|   567k|	case 's':
  ------------------
  |  Branch (305:2): [True: 37.0k, False: 6.19M]
  ------------------
  306|   567k|		next_skip_bytes = 4;
  307|       |
  308|       |		/* 0 means the end of an LHa archive file. */
  309|   567k|		if (h[0] == 0)
  ------------------
  |  Branch (309:7): [True: 10.7k, False: 557k]
  ------------------
  310|  10.7k|			break;
  311|   557k|		if (h[H_METHOD_OFFSET] != '-' || h[H_METHOD_OFFSET + 1] != 'l'
  ------------------
  |  |  208|   557k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
              		if (h[H_METHOD_OFFSET] != '-' || h[H_METHOD_OFFSET + 1] != 'l'
  ------------------
  |  |  208|  30.7k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (311:7): [True: 526k, False: 30.7k]
  |  Branch (311:36): [True: 1.19k, False: 29.5k]
  ------------------
  312|  29.5k|		    ||  h[H_METHOD_OFFSET + 4] != '-')
  ------------------
  |  |  208|  29.5k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (312:11): [True: 10.9k, False: 18.5k]
  ------------------
  313|   538k|			break;
  314|       |
  315|  18.5k|		if (h[H_METHOD_OFFSET + 2] == 'h') {
  ------------------
  |  |  208|  18.5k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (315:7): [True: 17.7k, False: 839]
  ------------------
  316|       |			/* "-lh?-" */
  317|  17.7k|			if (h[H_METHOD_OFFSET + 3] == 's')
  ------------------
  |  |  208|  17.7k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (317:8): [True: 4.94k, False: 12.7k]
  ------------------
  318|  4.94k|				break;
  319|  12.7k|			if (h[H_LEVEL_OFFSET] <= 3)
  ------------------
  |  |  210|  12.7k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (319:8): [True: 5.65k, False: 7.11k]
  ------------------
  320|  5.65k|				return (0);
  321|  12.7k|		}
  322|  7.95k|		if (h[H_METHOD_OFFSET + 2] == 'z') {
  ------------------
  |  |  208|  7.95k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (322:7): [True: 705, False: 7.25k]
  ------------------
  323|       |			/* LArc extensions: -lzs-,-lz4- and -lz5- */
  324|    705|			if (h[H_LEVEL_OFFSET] != 0)
  ------------------
  |  |  210|    705|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (324:8): [True: 414, False: 291]
  ------------------
  325|    414|				break;
  326|    291|			if (h[H_METHOD_OFFSET + 3] == 's'
  ------------------
  |  |  208|    291|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (326:8): [True: 22, False: 269]
  ------------------
  327|    269|			    || h[H_METHOD_OFFSET + 3] == '4'
  ------------------
  |  |  208|    269|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (327:11): [True: 12, False: 257]
  ------------------
  328|    257|			    || h[H_METHOD_OFFSET + 3] == '5')
  ------------------
  |  |  208|    257|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (328:11): [True: 15, False: 242]
  ------------------
  329|     49|				return (0);
  330|    291|		}
  331|  7.49k|		break;
  332|   165k|	case 'h': next_skip_bytes = 1; break;
  ------------------
  |  Branch (332:2): [True: 165k, False: 6.06M]
  ------------------
  333|  4.48k|	case 'z': next_skip_bytes = 1; break;
  ------------------
  |  Branch (333:2): [True: 4.48k, False: 6.22M]
  ------------------
  334|   157k|	case 'l': next_skip_bytes = 2; break;
  ------------------
  |  Branch (334:2): [True: 157k, False: 6.07M]
  ------------------
  335|  22.1k|	case '-': next_skip_bytes = 3; break;
  ------------------
  |  Branch (335:2): [True: 22.1k, False: 6.21M]
  ------------------
  336|  5.31M|	default : next_skip_bytes = 4; break;
  ------------------
  |  Branch (336:2): [True: 5.31M, False: 917k]
  ------------------
  337|  6.23M|	}
  338|       |
  339|  6.22M|	return (next_skip_bytes);
  340|  6.23M|}
archive_read_support_format_lha.c:archive_read_format_lha_read_header:
  474|  4.86k|{
  475|  4.86k|	struct lha *lha = a->format->data;
  476|  4.86k|	struct archive_wstring linkname;
  477|  4.86k|	struct archive_wstring pathname;
  478|  4.86k|	const char *p;
  479|  4.86k|	const char *signature;
  480|  4.86k|	int err;
  481|  4.86k|	struct archive_mstring conv_buffer;
  482|  4.86k|	const wchar_t *conv_buffer_p;
  483|       |
  484|  4.86k|	a->archive.archive_format = ARCHIVE_FORMAT_LHA;
  ------------------
  |  |  387|  4.86k|#define	ARCHIVE_FORMAT_LHA			0xB0000
  ------------------
  485|  4.86k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (485:6): [True: 789, False: 4.08k]
  ------------------
  486|    789|		a->archive.archive_format_name = "lha";
  487|       |
  488|  4.86k|	lha->decompress_init = 0;
  489|  4.86k|	lha->end_of_entry = 0;
  490|  4.86k|	lha->end_of_entry_cleanup = 0;
  491|  4.86k|	lha->entry_unconsumed = 0;
  492|       |
  493|  4.86k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL) {
  ------------------
  |  |  211|  4.86k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (493:6): [True: 116, False: 4.75k]
  ------------------
  494|       |		/*
  495|       |		 * LHa archiver added 0 to the tail of its archive file as
  496|       |		 * the mark of the end of the archive.
  497|       |		 */
  498|    116|		signature = __archive_read_ahead(a, sizeof(signature[0]), NULL);
  499|    116|		if (signature == NULL || signature[0] == 0)
  ------------------
  |  Branch (499:7): [True: 31, False: 85]
  |  Branch (499:28): [True: 10, False: 75]
  ------------------
  500|     41|			return (ARCHIVE_EOF);
  ------------------
  |  |  233|     41|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  501|     75|		return (truncated_error(a));
  502|    116|	}
  503|       |
  504|  4.75k|	signature = p;
  505|  4.75k|	if (lha->found_first_header == 0 &&
  ------------------
  |  Branch (505:6): [True: 774, False: 3.97k]
  ------------------
  506|    774|	    signature[0] == 'M' && signature[1] == 'Z') {
  ------------------
  |  Branch (506:6): [True: 241, False: 533]
  |  Branch (506:29): [True: 228, False: 13]
  ------------------
  507|       |                /* This is an executable?  Must be self-extracting... 	*/
  508|    228|		err = lha_skip_sfx(a);
  509|    228|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  236|    228|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (509:7): [True: 0, False: 228]
  ------------------
  510|      0|			return (err);
  511|       |
  512|    228|		if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
  ------------------
  |  Branch (512:7): [True: 0, False: 228]
  ------------------
  513|      0|			return (truncated_error(a));
  514|    228|		signature = p;
  515|    228|	}
  516|       |	/* signature[0] == 0 means the end of an LHa archive file. */
  517|  4.75k|	if (signature[0] == 0)
  ------------------
  |  Branch (517:6): [True: 8, False: 4.74k]
  ------------------
  518|      8|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  519|       |
  520|       |	/*
  521|       |	 * Check the header format and method type.
  522|       |	 */
  523|  4.74k|	if (lha_check_header_format(p) != 0) {
  ------------------
  |  Branch (523:6): [True: 73, False: 4.67k]
  ------------------
  524|     73|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     73|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  525|     73|		    "Bad LHa file");
  526|     73|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     73|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  527|     73|	}
  528|       |
  529|       |	/* We've found the first header. */
  530|  4.67k|	lha->found_first_header = 1;
  531|       |	/* Set a default value and common data */
  532|  4.67k|	lha->header_size = 0;
  533|  4.67k|	lha->level = p[H_LEVEL_OFFSET];
  ------------------
  |  |  210|  4.67k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  534|  4.67k|	lha->method[0] = p[H_METHOD_OFFSET+1];
  ------------------
  |  |  208|  4.67k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  535|  4.67k|	lha->method[1] = p[H_METHOD_OFFSET+2];
  ------------------
  |  |  208|  4.67k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  536|  4.67k|	lha->method[2] = p[H_METHOD_OFFSET+3];
  ------------------
  |  |  208|  4.67k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  537|  4.67k|	if (memcmp(lha->method, "lhd", 3) == 0)
  ------------------
  |  Branch (537:6): [True: 486, False: 4.18k]
  ------------------
  538|    486|		lha->directory = 1;
  539|  4.18k|	else
  540|  4.18k|		lha->directory = 0;
  541|  4.67k|	if (memcmp(lha->method, "lh0", 3) == 0 ||
  ------------------
  |  Branch (541:6): [True: 328, False: 4.34k]
  ------------------
  542|  4.34k|	    memcmp(lha->method, "lz4", 3) == 0)
  ------------------
  |  Branch (542:6): [True: 4, False: 4.34k]
  ------------------
  543|    332|		lha->entry_is_compressed = 0;
  544|  4.34k|	else
  545|  4.34k|		lha->entry_is_compressed = 1;
  546|       |
  547|  4.67k|	lha->compsize = 0;
  548|  4.67k|	lha->origsize = 0;
  549|  4.67k|	lha->setflag = 0;
  550|  4.67k|	lha->birthtime = 0;
  551|  4.67k|	lha->birthtime_tv_nsec = 0;
  552|  4.67k|	lha->mtime = 0;
  553|  4.67k|	lha->mtime_tv_nsec = 0;
  554|  4.67k|	lha->atime = 0;
  555|  4.67k|	lha->atime_tv_nsec = 0;
  556|  4.67k|	lha->mode = (lha->directory)? 0777 : 0666;
  ------------------
  |  Branch (556:14): [True: 486, False: 4.18k]
  ------------------
  557|  4.67k|	lha->uid = 0;
  558|  4.67k|	lha->gid = 0;
  559|  4.67k|	archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|  4.67k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  560|  4.67k|	archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  4.67k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  561|  4.67k|	lha->dos_attr = 0;
  562|  4.67k|	if (lha->opt_sconv != NULL) {
  ------------------
  |  Branch (562:6): [True: 0, False: 4.67k]
  ------------------
  563|      0|		lha->sconv_dir = lha->opt_sconv;
  564|      0|		lha->sconv_fname = lha->opt_sconv;
  565|  4.67k|	} else {
  566|  4.67k|		lha->sconv_dir = NULL;
  567|  4.67k|		lha->sconv_fname = NULL;
  568|  4.67k|	}
  569|       |
  570|  4.67k|	switch (p[H_LEVEL_OFFSET]) {
  ------------------
  |  |  210|  4.67k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  571|    472|	case 0:
  ------------------
  |  Branch (571:2): [True: 472, False: 4.20k]
  ------------------
  572|    472|		err = lha_read_file_header_0(a, lha);
  573|    472|		break;
  574|    133|	case 1:
  ------------------
  |  Branch (574:2): [True: 133, False: 4.53k]
  ------------------
  575|    133|		err = lha_read_file_header_1(a, lha);
  576|    133|		break;
  577|  3.99k|	case 2:
  ------------------
  |  Branch (577:2): [True: 3.99k, False: 680]
  ------------------
  578|  3.99k|		err = lha_read_file_header_2(a, lha);
  579|  3.99k|		break;
  580|     62|	case 3:
  ------------------
  |  Branch (580:2): [True: 62, False: 4.61k]
  ------------------
  581|     62|		err = lha_read_file_header_3(a, lha);
  582|     62|		break;
  583|     13|	default:
  ------------------
  |  Branch (583:2): [True: 13, False: 4.65k]
  ------------------
  584|     13|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  585|     13|		    "Unsupported LHa header level %d", p[H_LEVEL_OFFSET]);
  ------------------
  |  |  210|     13|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  586|     13|		err = ARCHIVE_FATAL;
  ------------------
  |  |  240|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  587|     13|		break;
  588|  4.67k|	}
  589|  4.67k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  236|  4.67k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (589:6): [True: 349, False: 4.32k]
  ------------------
  590|    349|		return (err);
  591|       |
  592|  4.32k|	if (!lha->directory && archive_strlen(&lha->filename) == 0)
  ------------------
  |  |  178|  3.87k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (592:6): [True: 3.87k, False: 445]
  |  Branch (592:25): [True: 7, False: 3.87k]
  ------------------
  593|      7|		if (memcmp(lha->method, "lh0", 3) == 0 && archive_strlen(&lha->dirname) > 0)
  ------------------
  |  |  178|      6|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (593:7): [True: 6, False: 1]
  |  Branch (593:45): [True: 4, False: 2]
  ------------------
  594|      4|			lha->directory = 1; /* empty directory entry */
  595|       |
  596|  4.32k|	if (!lha->directory && archive_strlen(&lha->filename) == 0)
  ------------------
  |  |  178|  3.87k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (596:6): [True: 3.87k, False: 449]
  |  Branch (596:25): [True: 3, False: 3.87k]
  ------------------
  597|       |		/* The filename has not been set */
  598|      3|		return (truncated_error(a));
  599|       |
  600|       |	/*
  601|       |	 * Make a pathname from a dirname and a filename, after converting to Unicode.
  602|       |	 * This is because codepages might differ between dirname and filename.
  603|       |	*/
  604|  4.32k|	archive_string_init(&pathname);
  ------------------
  |  |   71|  4.32k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  605|  4.32k|	archive_string_init(&linkname);
  ------------------
  |  |   71|  4.32k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  606|  4.32k|	archive_string_init(&conv_buffer.aes_mbs);
  ------------------
  |  |   71|  4.32k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  607|  4.32k|	archive_string_init(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |   71|  4.32k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  608|  4.32k|	archive_string_init(&conv_buffer.aes_utf8);
  ------------------
  |  |   71|  4.32k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  609|  4.32k|	archive_string_init(&conv_buffer.aes_wcs);
  ------------------
  |  |   71|  4.32k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  610|  4.32k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->dirname.s, lha->dirname.length, lha->sconv_dir) ||
  ------------------
  |  Branch (610:6): [True: 7, False: 4.31k]
  ------------------
  611|  4.31k|	    0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p)) {
  ------------------
  |  Branch (611:6): [True: 1, False: 4.31k]
  ------------------
  612|      8|		archive_set_error(&a->archive,
  613|      8|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  614|      8|			"Pathname cannot be converted "
  615|      8|			"from %s to Unicode",
  616|      8|			archive_string_conversion_charset_name(lha->sconv_dir));
  617|      8|		err = ARCHIVE_FATAL;
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  618|      8|	}
  619|  4.32k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  240|  4.32k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (619:6): [True: 8, False: 4.31k]
  ------------------
  620|      8|		archive_mstring_clean(&conv_buffer);
  621|      8|		archive_wstring_free(&pathname);
  622|      8|		archive_wstring_free(&linkname);
  623|      8|		return (err);
  624|      8|	}
  625|  4.31k|	archive_wstring_copy(&pathname, &conv_buffer.aes_wcs);
  ------------------
  |  |  135|  4.31k|	((dest)->length = 0, archive_wstring_concat((dest), (src)))
  ------------------
  626|       |
  627|  4.31k|	archive_string_empty(&conv_buffer.aes_mbs);
  ------------------
  |  |  181|  4.31k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  628|  4.31k|	archive_string_empty(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |  181|  4.31k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  629|  4.31k|	archive_string_empty(&conv_buffer.aes_utf8);
  ------------------
  |  |  181|  4.31k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  630|  4.31k|	archive_wstring_empty(&conv_buffer.aes_wcs);
  ------------------
  |  |  182|  4.31k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
  631|  4.31k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->filename.s, lha->filename.length, lha->sconv_fname) ||
  ------------------
  |  Branch (631:6): [True: 12, False: 4.30k]
  ------------------
  632|  4.30k|	    0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p)) {
  ------------------
  |  Branch (632:6): [True: 1, False: 4.29k]
  ------------------
  633|     13|		archive_set_error(&a->archive,
  634|     13|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  635|     13|			"Pathname cannot be converted "
  636|     13|			"from %s to Unicode",
  637|     13|			archive_string_conversion_charset_name(lha->sconv_fname));
  638|     13|		err = ARCHIVE_FATAL;
  ------------------
  |  |  240|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  639|     13|	}
  640|  4.31k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  240|  4.31k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (640:6): [True: 13, False: 4.29k]
  ------------------
  641|     13|		archive_mstring_clean(&conv_buffer);
  642|     13|		archive_wstring_free(&pathname);
  643|     13|		archive_wstring_free(&linkname);
  644|     13|		return (err);
  645|     13|	}
  646|  4.29k|	archive_wstring_concat(&pathname, &conv_buffer.aes_wcs);
  647|  4.29k|	archive_mstring_clean(&conv_buffer);
  648|       |
  649|  4.29k|	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  4.29k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  4.29k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (649:6): [True: 14, False: 4.28k]
  ------------------
  650|       |		/*
  651|       |	 	 * Extract the symlink-name if it's included in the pathname.
  652|       |	 	 */
  653|     14|		if (!lha_parse_linkname(&linkname, &pathname)) {
  ------------------
  |  Branch (653:7): [True: 0, False: 14]
  ------------------
  654|       |			/* We couldn't get the symlink-name. */
  655|      0|			archive_set_error(&a->archive,
  656|      0|		    	    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  657|      0|			    "Unknown symlink-name");
  658|      0|			archive_wstring_free(&pathname);
  659|      0|			archive_wstring_free(&linkname);
  660|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  661|      0|		}
  662|  4.28k|	} else {
  663|       |		/*
  664|       |		 * Make sure a file-type is set.
  665|       |		 * The mode has been overridden if it is in the extended data.
  666|       |		 */
  667|  4.28k|		lha->mode = (lha->mode & ~AE_IFMT) |
  ------------------
  |  |  215|  4.28k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  668|  4.28k|		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  221|    445|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
              		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  216|  3.84k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (668:8): [True: 445, False: 3.84k]
  ------------------
  669|  4.28k|	}
  670|  4.29k|	if ((lha->setflag & UNIX_MODE_IS_SET) == 0 &&
  ------------------
  |  |  163|  4.29k|#define UNIX_MODE_IS_SET	4
  ------------------
  |  Branch (670:6): [True: 4.22k, False: 70]
  ------------------
  671|  4.22k|	    (lha->dos_attr & 1) != 0)
  ------------------
  |  Branch (671:6): [True: 25, False: 4.20k]
  ------------------
  672|     25|		lha->mode &= ~(0222);/* read only. */
  673|       |
  674|       |	/*
  675|       |	 * Set basic file parameters.
  676|       |	 */
  677|  4.29k|	archive_entry_copy_pathname_w(entry, pathname.s);
  678|  4.29k|	archive_wstring_free(&pathname);
  679|  4.29k|	if (archive_strlen(&linkname) > 0) {
  ------------------
  |  |  178|  4.29k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (679:6): [True: 14, False: 4.28k]
  ------------------
  680|     14|		archive_entry_copy_symlink_w(entry, linkname.s);
  681|     14|	} else
  682|  4.28k|		archive_entry_set_symlink(entry, NULL);
  683|  4.29k|	archive_wstring_free(&linkname);
  684|       |	/*
  685|       |	 * When a header level is 0, there is a possibility that
  686|       |	 * a pathname and a symlink has '\' character, a directory
  687|       |	 * separator in DOS/Windows. So we should convert it to '/'.
  688|       |	 */
  689|  4.29k|	if (lha->level == 0)
  ------------------
  |  Branch (689:6): [True: 429, False: 3.87k]
  ------------------
  690|    429|		lha_replace_path_separator(lha, entry);
  691|       |
  692|  4.29k|	archive_entry_set_mode(entry, lha->mode);
  693|  4.29k|	archive_entry_set_uid(entry, lha->uid);
  694|  4.29k|	archive_entry_set_gid(entry, lha->gid);
  695|  4.29k|	if (archive_strlen(&lha->uname) > 0)
  ------------------
  |  |  178|  4.29k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (695:6): [True: 383, False: 3.91k]
  ------------------
  696|    383|		archive_entry_set_uname(entry, lha->uname.s);
  697|  4.29k|	if (archive_strlen(&lha->gname) > 0)
  ------------------
  |  |  178|  4.29k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (697:6): [True: 190, False: 4.10k]
  ------------------
  698|    190|		archive_entry_set_gname(entry, lha->gname.s);
  699|  4.29k|	if (lha->setflag & BIRTHTIME_IS_SET) {
  ------------------
  |  |  161|  4.29k|#define BIRTHTIME_IS_SET	1
  ------------------
  |  Branch (699:6): [True: 1, False: 4.29k]
  ------------------
  700|      1|		archive_entry_set_birthtime(entry, lha->birthtime,
  701|      1|		    lha->birthtime_tv_nsec);
  702|      1|		archive_entry_set_ctime(entry, lha->birthtime,
  703|      1|		    lha->birthtime_tv_nsec);
  704|  4.29k|	} else {
  705|  4.29k|		archive_entry_unset_birthtime(entry);
  706|  4.29k|		archive_entry_unset_ctime(entry);
  707|  4.29k|	}
  708|  4.29k|	archive_entry_set_mtime(entry, lha->mtime, lha->mtime_tv_nsec);
  709|  4.29k|	if (lha->setflag & ATIME_IS_SET)
  ------------------
  |  |  162|  4.29k|#define ATIME_IS_SET		2
  ------------------
  |  Branch (709:6): [True: 1, False: 4.29k]
  ------------------
  710|      1|		archive_entry_set_atime(entry, lha->atime,
  711|      1|		    lha->atime_tv_nsec);
  712|  4.29k|	else
  713|  4.29k|		archive_entry_unset_atime(entry);
  714|  4.29k|	if (lha->directory || archive_entry_symlink(entry) != NULL)
  ------------------
  |  Branch (714:6): [True: 445, False: 3.85k]
  |  Branch (714:24): [True: 14, False: 3.84k]
  ------------------
  715|    459|		archive_entry_unset_size(entry);
  716|  3.84k|	else
  717|  3.84k|		archive_entry_set_size(entry, lha->origsize);
  718|       |
  719|       |	/*
  720|       |	 * Prepare variables used to read a file content.
  721|       |	 */
  722|  4.29k|	lha->entry_bytes_remaining = lha->compsize;
  723|  4.29k|	if (lha->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (723:6): [True: 0, False: 4.29k]
  ------------------
  724|      0|		archive_set_error(&a->archive,
  725|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  726|      0|		    "Invalid LHa entry size");
  727|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  728|      0|	}
  729|  4.29k|	lha->entry_offset = 0;
  730|  4.29k|	lha->entry_crc_calculated = 0;
  731|       |
  732|       |	/*
  733|       |	 * This file does not have a content.
  734|       |	 */
  735|  4.29k|	if (lha->directory || lha->compsize == 0)
  ------------------
  |  Branch (735:6): [True: 445, False: 3.85k]
  |  Branch (735:24): [True: 14, False: 3.84k]
  ------------------
  736|    459|		lha->end_of_entry = 1;
  737|       |
  738|  4.29k|	snprintf(lha->format_name, sizeof(lha->format_name), "lha -%c%c%c-",
  739|  4.29k|	    lha->method[0], lha->method[1], lha->method[2]);
  740|  4.29k|	a->archive.archive_format_name = lha->format_name;
  741|       |
  742|  4.29k|	return (err);
  743|  4.29k|}
archive_read_support_format_lha.c:truncated_error:
  465|    238|{
  466|    238|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    238|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  467|    238|	    "Truncated LHa header");
  468|    238|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|    238|}
archive_read_support_format_lha.c:lha_skip_sfx:
  421|    228|{
  422|    228|	const void *h;
  423|    228|	const char *p, *q;
  424|    228|	size_t next, skip;
  425|    228|	ssize_t bytes, window;
  426|       |
  427|    228|	window = 4096;
  428|    941|	for (;;) {
  429|    941|		h = __archive_read_ahead(a, window, &bytes);
  430|    941|		if (h == NULL) {
  ------------------
  |  Branch (430:7): [True: 713, False: 228]
  ------------------
  431|       |			/* Remaining bytes are less than window. */
  432|    713|			window >>= 1;
  433|    713|			if (window < (H_SIZE + 3))
  ------------------
  |  |  211|    713|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (433:8): [True: 0, False: 713]
  ------------------
  434|      0|				goto fatal;
  435|    713|			continue;
  436|    713|		}
  437|    228|		if (bytes < H_SIZE)
  ------------------
  |  |  211|    228|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (437:7): [True: 0, False: 228]
  ------------------
  438|      0|			goto fatal;
  439|    228|		p = h;
  440|    228|		q = p + bytes;
  441|       |
  442|       |		/*
  443|       |		 * Scan ahead until we find something that looks
  444|       |		 * like the lha header.
  445|       |		 */
  446|   104k|		while (p + H_SIZE < q) {
  ------------------
  |  |  211|   104k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (446:10): [True: 104k, False: 0]
  ------------------
  447|   104k|			if ((next = lha_check_header_format(p)) == 0) {
  ------------------
  |  Branch (447:8): [True: 228, False: 103k]
  ------------------
  448|    228|				skip = p - (const char *)h;
  449|    228|				__archive_read_consume(a, skip);
  450|    228|				return (ARCHIVE_OK);
  ------------------
  |  |  234|    228|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  451|    228|			}
  452|   103k|			p += next;
  453|   103k|		}
  454|      0|		skip = p - (const char *)h;
  455|      0|		__archive_read_consume(a, skip);
  456|      0|	}
  457|      0|fatal:
  458|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  459|      0|	    "Couldn't find out LHa header");
  460|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  461|    228|}
archive_read_support_format_lha.c:lha_read_file_header_0:
  807|    472|{
  808|    472|	const unsigned char *p;
  809|    472|	int extdsize, namelen;
  810|    472|	unsigned char headersum, sum_calculated;
  811|       |
  812|    472|	if ((p = __archive_read_ahead(a, H0_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  804|    472|#define H0_FIXED_SIZE		24
  ------------------
  |  Branch (812:6): [True: 0, False: 472]
  ------------------
  813|      0|		return (truncated_error(a));
  814|    472|	lha->header_size = p[H0_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  797|    472|#define H0_HEADER_SIZE_OFFSET	0
  ------------------
  815|    472|	headersum = p[H0_HEADER_SUM_OFFSET];
  ------------------
  |  |  798|    472|#define H0_HEADER_SUM_OFFSET	1
  ------------------
  816|    472|	lha->compsize = archive_le32dec(p + H0_COMP_SIZE_OFFSET);
  ------------------
  |  |  799|    472|#define H0_COMP_SIZE_OFFSET	7
  ------------------
  817|    472|	lha->origsize = archive_le32dec(p + H0_ORIG_SIZE_OFFSET);
  ------------------
  |  |  800|    472|#define H0_ORIG_SIZE_OFFSET	11
  ------------------
  818|    472|	lha->mtime = __archive_dos_to_unix(archive_le32dec(p + H0_DOS_TIME_OFFSET));
  ------------------
  |  |  801|    472|#define H0_DOS_TIME_OFFSET	15
  ------------------
  819|    472|	namelen = p[H0_NAME_LEN_OFFSET];
  ------------------
  |  |  802|    472|#define H0_NAME_LEN_OFFSET	21
  ------------------
  820|    472|	extdsize = (int)lha->header_size - H0_FIXED_SIZE - namelen;
  ------------------
  |  |  804|    472|#define H0_FIXED_SIZE		24
  ------------------
  821|    472|	if ((namelen > 221 || extdsize < 0) && extdsize != -2) {
  ------------------
  |  Branch (821:7): [True: 4, False: 468]
  |  Branch (821:24): [True: 300, False: 168]
  |  Branch (821:41): [True: 14, False: 290]
  ------------------
  822|     14|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     14|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  823|     14|		    "Invalid LHa header");
  824|     14|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  825|     14|	}
  826|    458|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (826:6): [True: 14, False: 444]
  ------------------
  827|     14|		return (truncated_error(a));
  828|       |
  829|    444|	archive_strncpy(&lha->filename, p + H0_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|    444|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  830|       |	/* When extdsize == -2, A CRC16 value is not present in the header. */
  831|    444|	if (extdsize >= 0) {
  ------------------
  |  Branch (831:6): [True: 154, False: 290]
  ------------------
  832|    154|		lha->crc = archive_le16dec(p + H0_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  803|    154|#define H0_FILE_NAME_OFFSET	22
  ------------------
  833|    154|		lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|    154|#define CRC_IS_SET		8
  ------------------
  834|    154|	}
  835|    444|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  836|       |
  837|       |	/* Read an extended header */
  838|    444|	if (extdsize > 0) {
  ------------------
  |  Branch (838:6): [True: 154, False: 290]
  ------------------
  839|       |		/* This extended data is set by 'LHa for UNIX' only.
  840|       |		 * Maybe fixed size.
  841|       |		 */
  842|    154|		p += H0_FILE_NAME_OFFSET + namelen + 2;
  ------------------
  |  |  803|    154|#define H0_FILE_NAME_OFFSET	22
  ------------------
  843|    154|		if (p[0] == 'U' && extdsize == 12) {
  ------------------
  |  Branch (843:7): [True: 57, False: 97]
  |  Branch (843:22): [True: 56, False: 1]
  ------------------
  844|       |			/* p[1] is a minor version. */
  845|     56|			lha->mtime = archive_le32dec(&p[2]);
  846|     56|			lha->mode = archive_le16dec(&p[6]);
  847|     56|			lha->uid = archive_le16dec(&p[8]);
  848|     56|			lha->gid = archive_le16dec(&p[10]);
  849|     56|			lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|     56|#define UNIX_MODE_IS_SET	4
  ------------------
  850|     56|		}
  851|    154|	}
  852|    444|	__archive_read_consume(a, lha->header_size);
  853|       |
  854|    444|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (854:6): [True: 15, False: 429]
  ------------------
  855|     15|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     15|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  856|     15|		    "LHa header sum error");
  857|     15|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     15|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  858|     15|	}
  859|       |
  860|    429|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    429|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  861|    444|}
archive_read_support_format_lha.c:lha_calcsum:
 1739|    571|{
 1740|    571|	unsigned char const *p = (unsigned char const *)pp;
 1741|       |
 1742|    571|	p += offset;
 1743|  17.2k|	for (;size > 0; --size)
  ------------------
  |  Branch (1743:8): [True: 16.7k, False: 571]
  ------------------
 1744|  16.7k|		sum += *p++;
 1745|    571|	return (sum);
 1746|    571|}
archive_read_support_format_lha.c:lha_read_file_header_1:
  901|    133|{
  902|    133|	const unsigned char *p;
  903|    133|	size_t extdsize;
  904|    133|	int err, err2;
  905|    133|	int namelen, padding;
  906|    133|	unsigned char headersum, sum_calculated;
  907|       |
  908|    133|	err = ARCHIVE_OK;
  ------------------
  |  |  234|    133|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  909|       |
  910|    133|	if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  898|    133|#define H1_FIXED_SIZE		27
  ------------------
  |  Branch (910:6): [True: 0, False: 133]
  ------------------
  911|      0|		return (truncated_error(a));
  912|       |
  913|    133|	lha->header_size = p[H1_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  891|    133|#define H1_HEADER_SIZE_OFFSET	0
  ------------------
  914|    133|	headersum = p[H1_HEADER_SUM_OFFSET];
  ------------------
  |  |  892|    133|#define H1_HEADER_SUM_OFFSET	1
  ------------------
  915|       |	/* Note: An extended header size is included in a compsize. */
  916|    133|	lha->compsize = archive_le32dec(p + H1_COMP_SIZE_OFFSET);
  ------------------
  |  |  893|    133|#define H1_COMP_SIZE_OFFSET	7
  ------------------
  917|    133|	lha->origsize = archive_le32dec(p + H1_ORIG_SIZE_OFFSET);
  ------------------
  |  |  894|    133|#define H1_ORIG_SIZE_OFFSET	11
  ------------------
  918|    133|	lha->mtime = __archive_dos_to_unix(archive_le32dec(p + H1_DOS_TIME_OFFSET));
  ------------------
  |  |  895|    133|#define H1_DOS_TIME_OFFSET	15
  ------------------
  919|    133|	namelen = p[H1_NAME_LEN_OFFSET];
  ------------------
  |  |  896|    133|#define H1_NAME_LEN_OFFSET	21
  ------------------
  920|       |	/* Calculate a padding size. The result will be normally 0 only(?) */
  921|    133|	padding = ((int)lha->header_size) - H1_FIXED_SIZE - namelen;
  ------------------
  |  |  898|    133|#define H1_FIXED_SIZE		27
  ------------------
  922|       |
  923|    133|	if (namelen > 230 || padding < 0)
  ------------------
  |  Branch (923:6): [True: 0, False: 133]
  |  Branch (923:23): [True: 2, False: 131]
  ------------------
  924|      2|		goto invalid;
  925|       |
  926|    131|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (926:6): [True: 4, False: 127]
  ------------------
  927|      4|		return (truncated_error(a));
  928|       |
  929|    127|	if (memchr(p + H1_FILE_NAME_OFFSET, 0xff,
  ------------------
  |  |  897|    127|#define H1_FILE_NAME_OFFSET	22
  ------------------
  |  Branch (929:6): [True: 0, False: 127]
  ------------------
  930|    127|	    (size_t)namelen) != NULL)
  931|      0|		goto invalid; /* Invalid filename. */
  932|    127|	archive_strncpy(&lha->filename, p + H1_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|    127|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  933|    127|	lha->crc = archive_le16dec(p + H1_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  897|    127|#define H1_FILE_NAME_OFFSET	22
  ------------------
  934|    127|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|    127|#define CRC_IS_SET		8
  ------------------
  935|       |
  936|    127|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  937|       |	/* Consume used bytes but not include `next header size' data
  938|       |	 * since it will be consumed in lha_read_file_extended_header(). */
  939|    127|	__archive_read_consume(a, lha->header_size - 2);
  940|       |
  941|       |	/* Read extended headers */
  942|    127|	err2 = lha_read_file_extended_header(a, lha, NULL, 2,
  943|    127|	    (uint64_t)(lha->compsize + 2), &extdsize);
  944|    127|	if (err2 < ARCHIVE_WARN)
  ------------------
  |  |  236|    127|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (944:6): [True: 76, False: 51]
  ------------------
  945|     76|		return (err2);
  946|     51|	if (err2 < err)
  ------------------
  |  Branch (946:6): [True: 0, False: 51]
  ------------------
  947|      0|		err = err2;
  948|       |	/* Get a real compressed file size. */
  949|     51|	lha->compsize -= extdsize - 2;
  950|       |
  951|     51|	if (lha->compsize < 0)
  ------------------
  |  Branch (951:6): [True: 1, False: 50]
  ------------------
  952|      1|		goto invalid;	/* Invalid compressed file size */
  953|       |
  954|     50|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (954:6): [True: 12, False: 38]
  ------------------
  955|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  956|     12|		    "LHa header sum error");
  957|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  958|     12|	}
  959|     38|	return (err);
  960|      3|invalid:
  961|      3|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  962|      3|	    "Invalid LHa header");
  963|      3|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  964|     50|}
archive_read_support_format_lha.c:lha_read_file_extended_header:
 1144|  4.16k|{
 1145|  4.16k|	const void *h;
 1146|  4.16k|	const unsigned char *extdheader;
 1147|  4.16k|	size_t	extdsize;
 1148|  4.16k|	size_t	datasize;
 1149|  4.16k|	unsigned int i;
 1150|  4.16k|	unsigned char extdtype;
 1151|       |
 1152|  4.16k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
 1153|  4.16k|#define EXT_FILENAME		0x01		/* Filename 		    */
 1154|  4.16k|#define EXT_DIRECTORY		0x02		/* Directory name	    */
 1155|  4.16k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
 1156|  4.16k|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
 1157|  4.16k|#define EXT_FILESIZE		0x42		/* Large file size	    */
 1158|  4.16k|#define EXT_TIMEZONE		0x43		/* Time zone		    */
 1159|  4.16k|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
 1160|  4.16k|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
 1161|  4.16k|#define EXT_CODEPAGE		0x46		/* Codepage		    */
 1162|  4.16k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
 1163|  4.16k|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
 1164|  4.16k|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
 1165|  4.16k|#define EXT_UNIX_UNAME		0x53		/* User name		    */
 1166|  4.16k|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
 1167|  4.16k|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
 1168|  4.16k|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
 1169|       |
 1170|  4.16k|	*total_size = sizefield_length;
 1171|       |
 1172|  20.8k|	for (;;) {
 1173|       |		/* Read an extended header size. */
 1174|  20.8k|		if ((h =
  ------------------
  |  Branch (1174:7): [True: 40, False: 20.8k]
  ------------------
 1175|  20.8k|		    __archive_read_ahead(a, sizefield_length, NULL)) == NULL)
 1176|     40|			return (truncated_error(a));
 1177|       |		/* Check if the size is the zero indicates the end of the
 1178|       |		 * extended header. */
 1179|  20.8k|		if (sizefield_length == sizeof(uint16_t))
  ------------------
  |  Branch (1179:7): [True: 20.8k, False: 49]
  ------------------
 1180|  20.8k|			extdsize = archive_le16dec(h);
 1181|     49|		else
 1182|     49|			extdsize = archive_le32dec(h);
 1183|  20.8k|		if (extdsize == 0) {
  ------------------
  |  Branch (1183:7): [True: 3.91k, False: 16.9k]
  ------------------
 1184|       |			/* End of extended header */
 1185|  3.91k|			if (crc != NULL)
  ------------------
  |  Branch (1185:8): [True: 3.86k, False: 51]
  ------------------
 1186|  3.86k|				*crc = lha_crc16(*crc, h, sizefield_length);
 1187|  3.91k|			__archive_read_consume(a, sizefield_length);
 1188|  3.91k|			return (ARCHIVE_OK);
  ------------------
  |  |  234|  3.91k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1189|  3.91k|		}
 1190|       |
 1191|       |		/* Sanity check to the extended header size. */
 1192|  16.9k|		if (((uint64_t)*total_size + extdsize) > limitsize ||
  ------------------
  |  Branch (1192:7): [True: 65, False: 16.8k]
  ------------------
 1193|  16.8k|		    extdsize <= (size_t)sizefield_length)
  ------------------
  |  Branch (1193:7): [True: 2, False: 16.8k]
  ------------------
 1194|     67|			goto invalid;
 1195|       |
 1196|       |		/* Read the extended header. */
 1197|  16.8k|		if ((h = __archive_read_ahead(a, extdsize, NULL)) == NULL)
  ------------------
  |  Branch (1197:7): [True: 95, False: 16.7k]
  ------------------
 1198|     95|			return (truncated_error(a));
 1199|  16.7k|		*total_size += extdsize;
 1200|       |
 1201|  16.7k|		extdheader = (const unsigned char *)h;
 1202|       |		/* Get the extended header type. */
 1203|  16.7k|		extdtype = extdheader[sizefield_length];
 1204|       |		/* Calculate an extended data size. */
 1205|  16.7k|		datasize = extdsize - (1 + sizefield_length);
 1206|       |		/* Skip an extended header size field and type field. */
 1207|  16.7k|		extdheader += sizefield_length + 1;
 1208|       |
 1209|  16.7k|		if (crc != NULL && extdtype != EXT_HEADER_CRC)
  ------------------
  |  | 1152|  15.4k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1209:7): [True: 15.4k, False: 1.32k]
  |  Branch (1209:22): [True: 11.7k, False: 3.70k]
  ------------------
 1210|  11.7k|			*crc = lha_crc16(*crc, h, extdsize);
 1211|  16.7k|		switch (extdtype) {
 1212|  4.21k|		case EXT_HEADER_CRC:
  ------------------
  |  | 1152|  4.21k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1212:3): [True: 4.21k, False: 12.5k]
  ------------------
 1213|       |			/* We only use a header CRC. Following data will not
 1214|       |			 * be used. */
 1215|  4.21k|			if (datasize >= 2) {
  ------------------
  |  Branch (1215:8): [True: 4.10k, False: 113]
  ------------------
 1216|  4.10k|				lha->header_crc = archive_le16dec(extdheader);
 1217|  4.10k|				if (crc != NULL) {
  ------------------
  |  Branch (1217:9): [True: 3.60k, False: 500]
  ------------------
 1218|  3.60k|					static const char zeros[2] = {0, 0};
 1219|  3.60k|					*crc = lha_crc16(*crc, h,
 1220|  3.60k|					    extdsize - datasize);
 1221|       |					/* CRC value itself as zero */
 1222|  3.60k|					*crc = lha_crc16(*crc, zeros, 2);
 1223|  3.60k|					*crc = lha_crc16(*crc,
 1224|  3.60k|					    extdheader+2, datasize - 2);
 1225|  3.60k|				}
 1226|  4.10k|			}
 1227|  4.21k|			break;
 1228|  5.05k|		case EXT_FILENAME:
  ------------------
  |  | 1153|  5.05k|#define EXT_FILENAME		0x01		/* Filename 		    */
  ------------------
  |  Branch (1228:3): [True: 5.05k, False: 11.7k]
  ------------------
 1229|  5.05k|			if (datasize == 0) {
  ------------------
  |  Branch (1229:8): [True: 1.07k, False: 3.98k]
  ------------------
 1230|       |				/* maybe directory header */
 1231|  1.07k|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  1.07k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1232|  1.07k|				break;
 1233|  1.07k|			}
 1234|  3.98k|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1234:8): [True: 2, False: 3.98k]
  ------------------
 1235|      2|				goto invalid;
 1236|  3.98k|			archive_strncpy(&lha->filename,
  ------------------
  |  |  173|  3.98k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1237|  3.98k|			    (const char *)extdheader, datasize);
 1238|  3.98k|			break;
 1239|    729|		case EXT_UTF16_FILENAME:
  ------------------
  |  | 1159|    729|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
  ------------------
  |  Branch (1239:3): [True: 729, False: 16.0k]
  ------------------
 1240|    729|			if (datasize == 0) {
  ------------------
  |  Branch (1240:8): [True: 409, False: 320]
  ------------------
 1241|       |				/* maybe directory header */
 1242|    409|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|    409|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1243|    409|				break;
 1244|    409|			} else if (datasize & 1) {
  ------------------
  |  Branch (1244:15): [True: 1, False: 319]
  ------------------
 1245|       |				/* UTF-16 characters take always 2 or 4 bytes */
 1246|      1|				goto invalid;
 1247|      1|			}
 1248|    319|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1248:8): [True: 0, False: 319]
  ------------------
 1249|      0|				goto invalid;
 1250|    319|			archive_string_empty(&lha->filename);
  ------------------
  |  |  181|    319|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1251|    319|			archive_array_append(&lha->filename,
 1252|    319|				(const char *)extdheader, datasize);
 1253|       |			/* Setup a string conversion for a filename. */
 1254|    319|			lha->sconv_fname =
 1255|    319|			    archive_string_conversion_from_charset(&a->archive,
 1256|    319|			        "UTF-16LE", 1);
 1257|    319|			if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1257:8): [True: 0, False: 319]
  ------------------
 1258|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1259|    319|			break;
 1260|    319|		case EXT_DIRECTORY:
  ------------------
  |  | 1154|     43|#define EXT_DIRECTORY		0x02		/* Directory name	    */
  ------------------
  |  Branch (1260:3): [True: 43, False: 16.7k]
  ------------------
 1261|     43|			if (datasize == 0 || extdheader[0] == '\0')
  ------------------
  |  Branch (1261:8): [True: 1, False: 42]
  |  Branch (1261:25): [True: 0, False: 42]
  ------------------
 1262|       |				/* no directory name data. exit this case. */
 1263|      1|				goto invalid;
 1264|       |
 1265|     42|			archive_strncpy(&lha->dirname,
  ------------------
  |  |  173|     42|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1266|     42|		  	    (const char *)extdheader, datasize);
 1267|       |			/*
 1268|       |			 * Convert directory delimiter from 0xFF
 1269|       |			 * to '/' for local system.
 1270|       |	 		 */
 1271|    695|			for (i = 0; i < lha->dirname.length; i++) {
  ------------------
  |  Branch (1271:16): [True: 653, False: 42]
  ------------------
 1272|    653|				if ((unsigned char)lha->dirname.s[i] == 0xFF)
  ------------------
  |  Branch (1272:9): [True: 290, False: 363]
  ------------------
 1273|    290|					lha->dirname.s[i] = '/';
 1274|    653|			}
 1275|       |			/* Is last character directory separator? */
 1276|     42|			if (lha->dirname.s[lha->dirname.length-1] != '/')
  ------------------
  |  Branch (1276:8): [True: 5, False: 37]
  ------------------
 1277|       |				/* invalid directory data */
 1278|      5|				goto invalid;
 1279|     37|			break;
 1280|     45|		case EXT_UTF16_DIRECTORY:
  ------------------
  |  | 1160|     45|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
  ------------------
  |  Branch (1280:3): [True: 45, False: 16.7k]
  ------------------
 1281|       |			/* UTF-16 characters take always 2 or 4 bytes */
 1282|     45|			if (datasize == 0 || (datasize & 1) ||
  ------------------
  |  Branch (1282:8): [True: 1, False: 44]
  |  Branch (1282:25): [True: 1, False: 43]
  ------------------
 1283|     43|			    extdheader[0] == '\0') {
  ------------------
  |  Branch (1283:8): [True: 0, False: 43]
  ------------------
 1284|       |				/* no directory name data. exit this case. */
 1285|      2|				goto invalid;
 1286|      2|			}
 1287|       |
 1288|     43|			archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|     43|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1289|     43|			archive_array_append(&lha->dirname,
 1290|     43|				(const char *)extdheader, datasize);
 1291|     43|			lha->sconv_dir =
 1292|     43|			    archive_string_conversion_from_charset(&a->archive,
 1293|     43|			        "UTF-16LE", 1);
 1294|     43|			if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1294:8): [True: 0, False: 43]
  ------------------
 1295|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1296|     43|			else {
 1297|       |				/*
 1298|       |				 * Convert directory delimiter from 0xFFFF
 1299|       |				 * to '/' for local system.
 1300|       |				 */
 1301|     43|				uint16_t dirSep;
 1302|     43|				uint16_t d = 1;
 1303|     43|				if (archive_be16dec(&d) == 1)
  ------------------
  |  Branch (1303:9): [True: 0, False: 43]
  ------------------
 1304|      0|					dirSep = 0x2F00;
 1305|     43|				else
 1306|     43|					dirSep = 0x002F;
 1307|       |
 1308|       |				/* UTF-16LE character */
 1309|     43|				uint16_t *utf16name =
 1310|     43|				    (uint16_t *)lha->dirname.s;
 1311|  18.3k|				for (i = 0; i < lha->dirname.length / 2; i++) {
  ------------------
  |  Branch (1311:17): [True: 18.2k, False: 43]
  ------------------
 1312|  18.2k|					if (utf16name[i] == 0xFFFF) {
  ------------------
  |  Branch (1312:10): [True: 512, False: 17.7k]
  ------------------
 1313|    512|						utf16name[i] = dirSep;
 1314|    512|					}
 1315|  18.2k|				}
 1316|       |				/* Is last character directory separator? */
 1317|     43|				if (utf16name[lha->dirname.length / 2 - 1] !=
  ------------------
  |  Branch (1317:9): [True: 14, False: 29]
  ------------------
 1318|     43|				    dirSep) {
 1319|       |					/* invalid directory data */
 1320|     14|					goto invalid;
 1321|     14|				}
 1322|     43|			}
 1323|     29|			break;
 1324|  1.17k|		case EXT_DOS_ATTR:
  ------------------
  |  | 1155|  1.17k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
  ------------------
  |  Branch (1324:3): [True: 1.17k, False: 15.6k]
  ------------------
 1325|  1.17k|			if (datasize == 2)
  ------------------
  |  Branch (1325:8): [True: 137, False: 1.03k]
  ------------------
 1326|    137|				lha->dos_attr = (unsigned char)
 1327|    137|				    (archive_le16dec(extdheader) & 0xff);
 1328|  1.17k|			break;
 1329|    201|		case EXT_TIMESTAMP:
  ------------------
  |  | 1156|    201|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
  ------------------
  |  Branch (1329:3): [True: 201, False: 16.5k]
  ------------------
 1330|    201|			if (datasize == (sizeof(uint64_t) * 3)) {
  ------------------
  |  Branch (1330:8): [True: 73, False: 128]
  ------------------
 1331|     73|				__archive_ntfs_to_unix(archive_le64dec(extdheader),
 1332|     73|					&lha->birthtime,
 1333|     73|				    &lha->birthtime_tv_nsec);
 1334|     73|				extdheader += sizeof(uint64_t);
 1335|     73|				__archive_ntfs_to_unix(archive_le64dec(extdheader),
 1336|     73|					&lha->mtime,
 1337|     73|				    &lha->mtime_tv_nsec);
 1338|     73|				extdheader += sizeof(uint64_t);
 1339|     73|				__archive_ntfs_to_unix(archive_le64dec(extdheader),
 1340|     73|					&lha->atime,
 1341|     73|				    &lha->atime_tv_nsec);
 1342|     73|				lha->setflag |= BIRTHTIME_IS_SET |
  ------------------
  |  |  161|     73|#define BIRTHTIME_IS_SET	1
  ------------------
 1343|     73|				    ATIME_IS_SET;
  ------------------
  |  |  162|     73|#define ATIME_IS_SET		2
  ------------------
 1344|     73|			}
 1345|    201|			break;
 1346|    141|		case EXT_FILESIZE:
  ------------------
  |  | 1157|    141|#define EXT_FILESIZE		0x42		/* Large file size	    */
  ------------------
  |  Branch (1346:3): [True: 141, False: 16.6k]
  ------------------
 1347|    141|			if (datasize == sizeof(uint64_t) * 2) {
  ------------------
  |  Branch (1347:8): [True: 61, False: 80]
  ------------------
 1348|     61|				uint64_t compsize, origsize;
 1349|       |
 1350|       |				/* Range-check before the conversion to the
 1351|       |				 * signed type rather than relying on the
 1352|       |				 * implementation-defined result of it. */
 1353|     61|				compsize = archive_le64dec(extdheader);
 1354|     61|				extdheader += sizeof(uint64_t);
 1355|     61|				origsize = archive_le64dec(extdheader);
 1356|     61|				if (compsize > INT64_MAX ||
  ------------------
  |  Branch (1356:9): [True: 14, False: 47]
  ------------------
 1357|     47|				    origsize > INT64_MAX)
  ------------------
  |  Branch (1357:9): [True: 13, False: 34]
  ------------------
 1358|     27|					goto invalid;
 1359|     34|				lha->compsize = (int64_t)compsize;
 1360|     34|				lha->origsize = (int64_t)origsize;
 1361|     34|			}
 1362|    114|			break;
 1363|    713|		case EXT_CODEPAGE:
  ------------------
  |  | 1161|    713|#define EXT_CODEPAGE		0x46		/* Codepage		    */
  ------------------
  |  Branch (1363:3): [True: 713, False: 16.0k]
  ------------------
 1364|       |			/* Get an archived filename charset from codepage.
 1365|       |			 * This overwrites the charset specified by
 1366|       |			 * hdrcharset option. */
 1367|    713|			if (datasize == sizeof(uint32_t)) {
  ------------------
  |  Branch (1367:8): [True: 673, False: 40]
  ------------------
 1368|    673|				struct archive_string cp;
 1369|    673|				const char *charset;
 1370|       |
 1371|    673|				archive_string_init(&cp);
  ------------------
  |  |   71|    673|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 673]
  |  |  ------------------
  ------------------
 1372|    673|				switch (archive_le32dec(extdheader)) {
 1373|    137|				case 65001: /* UTF-8 */
  ------------------
  |  Branch (1373:5): [True: 137, False: 536]
  ------------------
 1374|    137|					charset = "UTF-8";
 1375|    137|					break;
 1376|    536|				default:
  ------------------
  |  Branch (1376:5): [True: 536, False: 137]
  ------------------
 1377|    536|					archive_string_sprintf(&cp, "CP%d",
 1378|    536|					    (int)archive_le32dec(extdheader));
 1379|    536|					charset = cp.s;
 1380|    536|					break;
 1381|    673|				}
 1382|    673|				lha->sconv_dir =
 1383|    673|				    archive_string_conversion_from_charset(
 1384|    673|					&(a->archive), charset, 1);
 1385|    673|				lha->sconv_fname =
 1386|    673|				    archive_string_conversion_from_charset(
 1387|    673|					&(a->archive), charset, 1);
 1388|    673|				archive_string_free(&cp);
 1389|    673|				if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1389:9): [True: 0, False: 673]
  ------------------
 1390|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1391|    673|				if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1391:9): [True: 0, False: 673]
  ------------------
 1392|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1393|    673|			}
 1394|    713|			break;
 1395|  1.64k|		case EXT_UNIX_MODE:
  ------------------
  |  | 1162|  1.64k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
  ------------------
  |  Branch (1395:3): [True: 1.64k, False: 15.1k]
  ------------------
 1396|  1.64k|			if (datasize == sizeof(uint16_t)) {
  ------------------
  |  Branch (1396:8): [True: 1.57k, False: 78]
  ------------------
 1397|  1.57k|				lha->mode = archive_le16dec(extdheader);
 1398|  1.57k|				lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|  1.57k|#define UNIX_MODE_IS_SET	4
  ------------------
 1399|  1.57k|			}
 1400|  1.64k|			break;
 1401|    200|		case EXT_UNIX_GID_UID:
  ------------------
  |  | 1163|    200|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
  ------------------
  |  Branch (1401:3): [True: 200, False: 16.5k]
  ------------------
 1402|    200|			if (datasize == (sizeof(uint16_t) * 2)) {
  ------------------
  |  Branch (1402:8): [True: 137, False: 63]
  ------------------
 1403|    137|				lha->gid = archive_le16dec(extdheader);
 1404|    137|				lha->uid = archive_le16dec(extdheader+2);
 1405|    137|			}
 1406|    200|			break;
 1407|    248|		case EXT_UNIX_GNAME:
  ------------------
  |  | 1164|    248|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
  ------------------
  |  Branch (1407:3): [True: 248, False: 16.5k]
  ------------------
 1408|    248|			if (datasize > 0)
  ------------------
  |  Branch (1408:8): [True: 134, False: 114]
  ------------------
 1409|    134|				archive_strncpy(&lha->gname,
  ------------------
  |  |  173|    134|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1410|    248|				    (const char *)extdheader, datasize);
 1411|    248|			break;
 1412|    491|		case EXT_UNIX_UNAME:
  ------------------
  |  | 1165|    491|#define EXT_UNIX_UNAME		0x53		/* User name		    */
  ------------------
  |  Branch (1412:3): [True: 491, False: 16.2k]
  ------------------
 1413|    491|			if (datasize > 0)
  ------------------
  |  Branch (1413:8): [True: 205, False: 286]
  ------------------
 1414|    205|				archive_strncpy(&lha->uname,
  ------------------
  |  |  173|    205|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1415|    491|				    (const char *)extdheader, datasize);
 1416|    491|			break;
 1417|    323|		case EXT_UNIX_MTIME:
  ------------------
  |  | 1166|    323|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
  ------------------
  |  Branch (1417:3): [True: 323, False: 16.4k]
  ------------------
 1418|    323|			if (datasize == sizeof(uint32_t))
  ------------------
  |  Branch (1418:8): [True: 70, False: 253]
  ------------------
 1419|     70|				lha->mtime = archive_le32dec(extdheader);
 1420|    323|			break;
 1421|    250|		case EXT_OS2_NEW_ATTR:
  ------------------
  |  | 1167|    250|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
  ------------------
  |  Branch (1421:3): [True: 250, False: 16.5k]
  ------------------
 1422|       |			/* This extended header is OS/2 depend. */
 1423|    250|			if (datasize == 16) {
  ------------------
  |  Branch (1423:8): [True: 18, False: 232]
  ------------------
 1424|     18|				lha->dos_attr = (unsigned char)
 1425|     18|				    (archive_le16dec(extdheader) & 0xff);
 1426|     18|				lha->mode = archive_le16dec(extdheader+2);
 1427|     18|				lha->gid = archive_le16dec(extdheader+4);
 1428|     18|				lha->uid = archive_le16dec(extdheader+6);
 1429|     18|				lha->birthtime = archive_le32dec(extdheader+8);
 1430|     18|				lha->atime = archive_le32dec(extdheader+12);
 1431|     18|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|     18|#define UNIX_MODE_IS_SET	4
  ------------------
 1432|     18|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|     18|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|     18|#define ATIME_IS_SET		2
  ------------------
 1433|     18|			}
 1434|    250|			break;
 1435|    279|		case EXT_NEW_ATTR:
  ------------------
  |  | 1168|    279|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
  ------------------
  |  Branch (1435:3): [True: 279, False: 16.5k]
  ------------------
 1436|    279|			if (datasize == 20) {
  ------------------
  |  Branch (1436:8): [True: 21, False: 258]
  ------------------
 1437|     21|				lha->mode = (mode_t)archive_le32dec(extdheader);
 1438|     21|				lha->gid = archive_le32dec(extdheader+4);
 1439|     21|				lha->uid = archive_le32dec(extdheader+8);
 1440|     21|				lha->birthtime = archive_le32dec(extdheader+12);
 1441|     21|				lha->atime = archive_le32dec(extdheader+16);
 1442|     21|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|     21|#define UNIX_MODE_IS_SET	4
  ------------------
 1443|     21|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|     21|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|     21|#define ATIME_IS_SET		2
  ------------------
 1444|     21|			}
 1445|    279|			break;
 1446|      0|		case EXT_TIMEZONE:		/* Not supported */
  ------------------
  |  | 1158|      0|#define EXT_TIMEZONE		0x43		/* Time zone		    */
  ------------------
  |  Branch (1446:3): [True: 0, False: 16.7k]
  ------------------
 1447|      0|			break;
 1448|  1.02k|		default:
  ------------------
  |  Branch (1448:3): [True: 1.02k, False: 15.7k]
  ------------------
 1449|  1.02k|			break;
 1450|  16.7k|		}
 1451|       |
 1452|  16.7k|		__archive_read_consume(a, extdsize);
 1453|  16.7k|	}
 1454|    119|invalid:
 1455|    119|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    119|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1456|    119|	    "Invalid extended LHa header");
 1457|    119|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    119|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1458|  4.16k|}
archive_read_support_format_lha.c:lha_crc16:
 1831|  38.3k|{
 1832|  38.3k|	const unsigned char *p = (const unsigned char *)pp;
 1833|  38.3k|	const uint16_t *buff;
 1834|  38.3k|	const union {
 1835|  38.3k|		uint32_t i;
 1836|  38.3k|		char c[4];
 1837|  38.3k|	} u = { 0x01020304 };
 1838|       |
 1839|  38.3k|	if (len == 0)
  ------------------
  |  Branch (1839:6): [True: 3.57k, False: 34.7k]
  ------------------
 1840|  3.57k|		return crc;
 1841|       |
 1842|       |	/* Process unaligned address. */
 1843|  34.7k|	if (((uintptr_t)p) & (uintptr_t)0x1) {
  ------------------
  |  Branch (1843:6): [True: 14.0k, False: 20.6k]
  ------------------
 1844|  14.0k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1845|  14.0k|		len--;
 1846|  14.0k|	}
 1847|  34.7k|	buff = (const uint16_t *)p;
 1848|       |	/*
 1849|       |	 * Modern C compiler such as GCC does not unroll automatically yet
 1850|       |	 * without unrolling pragma, and Clang is so. So we should
 1851|       |	 * unroll this loop for its performance.
 1852|       |	 */
 1853|   122M|	for (;len >= 8; len -= 8) {
  ------------------
  |  Branch (1853:8): [True: 122M, False: 34.7k]
  ------------------
 1854|       |		/* This if statement expects compiler optimization will
 1855|       |		 * remove the statement which will not be executed. */
 1856|   122M|#undef bswap16
 1857|       |#ifndef __has_builtin
 1858|       |#define __has_builtin(x) 0
 1859|       |#endif
 1860|       |#if defined(_MSC_VER) && _MSC_VER >= 1400  /* Visual Studio */
 1861|       |#  define bswap16(x) _byteswap_ushort(x)
 1862|       |#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
 1863|       |/* GCC 4.8 and later has __builtin_bswap16() */
 1864|       |#  define bswap16(x) __builtin_bswap16(x)
 1865|       |#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
 1866|       |/* Newer clang versions have __builtin_bswap16() */
 1867|   122M|#  define bswap16(x) __builtin_bswap16(x)
 1868|       |#else
 1869|       |#  define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
 1870|       |#endif
 1871|   122M|#define CRC16W	do { 	\
 1872|   122M|		if(u.c[0] == 1) { /* Big endian */		\
 1873|   122M|			crc ^= bswap16(*buff); buff++;		\
 1874|   122M|		} else						\
 1875|   122M|			crc ^= *buff++;				\
 1876|   122M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
 1877|   122M|} while (0)
 1878|   122M|		CRC16W;
  ------------------
  |  | 1871|   122M|#define CRC16W	do { 	\
  |  | 1872|   122M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1872:6): [True: 0, False: 122M]
  |  |  ------------------
  |  | 1873|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1867|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1874|      0|		} else						\
  |  | 1875|   122M|			crc ^= *buff++;				\
  |  | 1876|   122M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1877|   122M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1877:10): [Folded, False: 122M]
  |  |  ------------------
  ------------------
 1879|   122M|		CRC16W;
  ------------------
  |  | 1871|   122M|#define CRC16W	do { 	\
  |  | 1872|   122M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1872:6): [True: 0, False: 122M]
  |  |  ------------------
  |  | 1873|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1867|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1874|      0|		} else						\
  |  | 1875|   122M|			crc ^= *buff++;				\
  |  | 1876|   122M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1877|   122M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1877:10): [Folded, False: 122M]
  |  |  ------------------
  ------------------
 1880|   122M|		CRC16W;
  ------------------
  |  | 1871|   122M|#define CRC16W	do { 	\
  |  | 1872|   122M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1872:6): [True: 0, False: 122M]
  |  |  ------------------
  |  | 1873|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1867|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1874|      0|		} else						\
  |  | 1875|   122M|			crc ^= *buff++;				\
  |  | 1876|   122M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1877|   122M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1877:10): [Folded, False: 122M]
  |  |  ------------------
  ------------------
 1881|   122M|		CRC16W;
  ------------------
  |  | 1871|   122M|#define CRC16W	do { 	\
  |  | 1872|   122M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1872:6): [True: 0, False: 122M]
  |  |  ------------------
  |  | 1873|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1867|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1874|      0|		} else						\
  |  | 1875|   122M|			crc ^= *buff++;				\
  |  | 1876|   122M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1877|   122M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1877:10): [Folded, False: 122M]
  |  |  ------------------
  ------------------
 1882|   122M|#undef CRC16W
 1883|   122M|#undef bswap16
 1884|   122M|	}
 1885|       |
 1886|  34.7k|	p = (const unsigned char *)buff;
 1887|   120k|	for (;len; len--) {
  ------------------
  |  Branch (1887:8): [True: 85.6k, False: 34.7k]
  ------------------
 1888|  85.6k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1889|  85.6k|	}
 1890|  34.7k|	return crc;
 1891|  38.3k|}
archive_read_support_format_lha.c:lha_read_file_header_2:
  996|  3.99k|{
  997|  3.99k|	const unsigned char *p;
  998|  3.99k|	size_t extdsize;
  999|  3.99k|	int err, padding;
 1000|  3.99k|	uint16_t header_crc;
 1001|       |
 1002|  3.99k|	if ((p = __archive_read_ahead(a, H2_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  993|  3.99k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1002:6): [True: 1, False: 3.99k]
  ------------------
 1003|      1|		return (truncated_error(a));
 1004|       |
 1005|  3.99k|	lha->header_size =archive_le16dec(p + H2_HEADER_SIZE_OFFSET);
  ------------------
  |  |  988|  3.99k|#define H2_HEADER_SIZE_OFFSET	0
  ------------------
 1006|  3.99k|	lha->compsize = archive_le32dec(p + H2_COMP_SIZE_OFFSET);
  ------------------
  |  |  989|  3.99k|#define H2_COMP_SIZE_OFFSET	7
  ------------------
 1007|  3.99k|	lha->origsize = archive_le32dec(p + H2_ORIG_SIZE_OFFSET);
  ------------------
  |  |  990|  3.99k|#define H2_ORIG_SIZE_OFFSET	11
  ------------------
 1008|  3.99k|	lha->mtime = archive_le32dec(p + H2_TIME_OFFSET);
  ------------------
  |  |  991|  3.99k|#define H2_TIME_OFFSET		15
  ------------------
 1009|  3.99k|	lha->crc = archive_le16dec(p + H2_CRC_OFFSET);
  ------------------
  |  |  992|  3.99k|#define H2_CRC_OFFSET		21
  ------------------
 1010|  3.99k|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|  3.99k|#define CRC_IS_SET		8
  ------------------
 1011|       |
 1012|  3.99k|	if (lha->header_size < H2_FIXED_SIZE) {
  ------------------
  |  |  993|  3.99k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1012:6): [True: 0, False: 3.99k]
  ------------------
 1013|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1014|      0|		    "Invalid LHa header size");
 1015|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1016|      0|	}
 1017|       |
 1018|  3.99k|	header_crc = lha_crc16(0, p, H2_FIXED_SIZE);
  ------------------
  |  |  993|  3.99k|#define H2_FIXED_SIZE		24
  ------------------
 1019|  3.99k|	__archive_read_consume(a, H2_FIXED_SIZE);
  ------------------
  |  |  993|  3.99k|#define H2_FIXED_SIZE		24
  ------------------
 1020|       |
 1021|       |	/* Read extended headers */
 1022|  3.99k|	err = lha_read_file_extended_header(a, lha, &header_crc, 2,
 1023|  3.99k|		  lha->header_size - H2_FIXED_SIZE, &extdsize);
  ------------------
  |  |  993|  3.99k|#define H2_FIXED_SIZE		24
  ------------------
 1024|  3.99k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  236|  3.99k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1024:6): [True: 174, False: 3.81k]
  ------------------
 1025|    174|		return (err);
 1026|       |
 1027|       |	/* Calculate a padding size. The result will be normally 0 or 1. */
 1028|  3.81k|	padding = (int)lha->header_size - (int)(H2_FIXED_SIZE + extdsize);
  ------------------
  |  |  993|  3.81k|#define H2_FIXED_SIZE		24
  ------------------
 1029|  3.81k|	if (padding > 0) {
  ------------------
  |  Branch (1029:6): [True: 69, False: 3.74k]
  ------------------
 1030|     69|		if ((p = __archive_read_ahead(a, padding, NULL)) == NULL)
  ------------------
  |  Branch (1030:7): [True: 6, False: 63]
  ------------------
 1031|      6|			return (truncated_error(a));
 1032|     63|		header_crc = lha_crc16(header_crc, p, padding);
 1033|     63|		__archive_read_consume(a, padding);
 1034|     63|	}
 1035|       |
 1036|  3.81k|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1036:6): [True: 2.98k, False: 829]
  ------------------
 1037|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1038|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1039|       |		    "LHa header CRC error");
 1040|       |		return (ARCHIVE_FATAL);
 1041|       |#endif
 1042|  2.98k|	}
 1043|  3.81k|	return (err);
 1044|  3.81k|}
archive_read_support_format_lha.c:lha_read_file_header_3:
 1077|     62|{
 1078|     62|	const unsigned char *p;
 1079|     62|	size_t extdsize;
 1080|     62|	int err;
 1081|     62|	uint16_t header_crc;
 1082|       |
 1083|     62|	if ((p = __archive_read_ahead(a, H3_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  | 1074|     62|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1083:6): [True: 0, False: 62]
  ------------------
 1084|      0|		return (truncated_error(a));
 1085|       |
 1086|     62|	if (archive_le16dec(p + H3_FIELD_LEN_OFFSET) != 4)
  ------------------
  |  | 1068|     62|#define H3_FIELD_LEN_OFFSET	0
  ------------------
  |  Branch (1086:6): [True: 5, False: 57]
  ------------------
 1087|      5|		goto invalid;
 1088|     57|	lha->header_size = archive_le32dec(p + H3_HEADER_SIZE_OFFSET);
  ------------------
  |  | 1073|     57|#define H3_HEADER_SIZE_OFFSET	24
  ------------------
 1089|     57|	lha->compsize = archive_le32dec(p + H3_COMP_SIZE_OFFSET);
  ------------------
  |  | 1069|     57|#define H3_COMP_SIZE_OFFSET	7
  ------------------
 1090|     57|	lha->origsize = archive_le32dec(p + H3_ORIG_SIZE_OFFSET);
  ------------------
  |  | 1070|     57|#define H3_ORIG_SIZE_OFFSET	11
  ------------------
 1091|     57|	lha->mtime = archive_le32dec(p + H3_TIME_OFFSET);
  ------------------
  |  | 1071|     57|#define H3_TIME_OFFSET		15
  ------------------
 1092|     57|	lha->crc = archive_le16dec(p + H3_CRC_OFFSET);
  ------------------
  |  | 1072|     57|#define H3_CRC_OFFSET		21
  ------------------
 1093|     57|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|     57|#define CRC_IS_SET		8
  ------------------
 1094|       |
 1095|     57|	if (lha->header_size < H3_FIXED_SIZE + 4)
  ------------------
  |  | 1074|     57|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1095:6): [True: 0, False: 57]
  ------------------
 1096|      0|		goto invalid;
 1097|     57|	header_crc = lha_crc16(0, p, H3_FIXED_SIZE);
  ------------------
  |  | 1074|     57|#define H3_FIXED_SIZE		28
  ------------------
 1098|     57|	__archive_read_consume(a, H3_FIXED_SIZE);
  ------------------
  |  | 1074|     57|#define H3_FIXED_SIZE		28
  ------------------
 1099|       |
 1100|       |	/* Reject ridiculously large header */
 1101|     57|	if (lha->header_size > 65536) {
  ------------------
  |  Branch (1101:6): [True: 8, False: 49]
  ------------------
 1102|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1103|      8|		    "LHa header size too large");
 1104|      8|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1105|      8|	}
 1106|       |
 1107|       |	/* Read extended headers */
 1108|     49|	err = lha_read_file_extended_header(a, lha, &header_crc, 4,
 1109|     49|		  lha->header_size - H3_FIXED_SIZE, &extdsize);
  ------------------
  |  | 1074|     49|#define H3_FIXED_SIZE		28
  ------------------
 1110|     49|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  236|     49|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1110:6): [True: 4, False: 45]
  ------------------
 1111|      4|		return (err);
 1112|       |
 1113|     45|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1113:6): [True: 45, False: 0]
  ------------------
 1114|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1115|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1116|       |		    "LHa header CRC error");
 1117|       |		return (ARCHIVE_FATAL);
 1118|       |#endif
 1119|     45|	}
 1120|     45|	return (err);
 1121|      5|invalid:
 1122|      5|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1123|      5|	    "Invalid LHa header");
 1124|      5|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1125|     49|}
archive_read_support_format_lha.c:lha_parse_linkname:
 1720|     14|{
 1721|     14|	wchar_t *	linkptr;
 1722|     14|	size_t 	symlen;
 1723|       |
 1724|     14|	linkptr = wcschr(pathname->s, L'|');
 1725|     14|	if (linkptr != NULL) {
  ------------------
  |  Branch (1725:6): [True: 14, False: 0]
  ------------------
 1726|     14|		symlen = wcslen(linkptr + 1);
 1727|     14|		archive_wstrncpy(linkname, linkptr+1, symlen);
  ------------------
  |  |  175|     14|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 1728|       |
 1729|     14|		*linkptr = 0;
 1730|     14|		pathname->length = wcslen(pathname->s);
 1731|       |
 1732|     14|		return (1);
 1733|     14|	}
 1734|      0|	return (0);
 1735|     14|}
archive_read_support_format_lha.c:lha_replace_path_separator:
  751|    429|{
  752|    429|	const wchar_t *wp;
  753|    429|	size_t i;
  754|       |
  755|    429|	if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (755:6): [True: 429, False: 0]
  ------------------
  756|    429|		archive_wstrcpy(&(lha->ws), wp);
  ------------------
  |  |  167|    429|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|    858|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 429]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|    976|		for (i = 0; i < archive_strlen(&(lha->ws)); i++) {
  ------------------
  |  |  178|    976|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (757:15): [True: 547, False: 429]
  ------------------
  758|    547|			if (lha->ws.s[i] == L'\\')
  ------------------
  |  Branch (758:8): [True: 94, False: 453]
  ------------------
  759|     94|				lha->ws.s[i] = L'/';
  760|    547|		}
  761|    429|		archive_entry_copy_pathname_w(entry, lha->ws.s);
  762|    429|	}
  763|       |
  764|    429|	if ((wp = archive_entry_symlink_w(entry)) != NULL) {
  ------------------
  |  Branch (764:6): [True: 0, False: 429]
  ------------------
  765|      0|		archive_wstrcpy(&(lha->ws), wp);
  ------------------
  |  |  167|      0|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|      0|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|      0|		for (i = 0; i < archive_strlen(&(lha->ws)); i++) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (766:15): [True: 0, False: 0]
  ------------------
  767|      0|			if (lha->ws.s[i] == L'\\')
  ------------------
  |  Branch (767:8): [True: 0, False: 0]
  ------------------
  768|      0|				lha->ws.s[i] = L'/';
  769|      0|		}
  770|      0|		archive_entry_copy_symlink_w(entry, lha->ws.s);
  771|      0|	}
  772|    429|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data:
 1483|  12.1k|{
 1484|  12.1k|	struct lha *lha = a->format->data;
 1485|  12.1k|	int r;
 1486|       |
 1487|  12.1k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1487:6): [True: 783, False: 11.4k]
  ------------------
 1488|       |		/* Consume as much as the decompressor actually used. */
 1489|    783|		__archive_read_consume(a, lha->entry_unconsumed);
 1490|    783|		lha->entry_unconsumed = 0;
 1491|    783|	}
 1492|  12.1k|	if (lha->end_of_entry) {
  ------------------
  |  Branch (1492:6): [True: 643, False: 11.5k]
  ------------------
 1493|    643|		*offset = lha->entry_offset;
 1494|    643|		*size = 0;
 1495|    643|		*buff = NULL;
 1496|    643|		return (lha_end_of_entry(a));
 1497|    643|	}
 1498|       |
 1499|  11.5k|	if (lha->entry_is_compressed)
  ------------------
  |  Branch (1499:6): [True: 11.3k, False: 237]
  ------------------
 1500|  11.3k|		r =  lha_read_data_lzh(a, buff, size, offset);
 1501|    237|	else
 1502|       |		/* No compression. */
 1503|    237|		r =  lha_read_data_none(a, buff, size, offset);
 1504|  11.5k|	return (r);
 1505|  12.1k|}
archive_read_support_format_lha.c:lha_end_of_entry:
 1462|    750|{
 1463|    750|	struct lha *lha = a->format->data;
 1464|    750|	int r = ARCHIVE_EOF;
  ------------------
  |  |  233|    750|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1465|       |
 1466|    750|	if (!lha->end_of_entry_cleanup) {
  ------------------
  |  Branch (1466:6): [True: 727, False: 23]
  ------------------
 1467|    727|		if ((lha->setflag & CRC_IS_SET) &&
  ------------------
  |  |  164|    727|#define CRC_IS_SET		8
  ------------------
  |  Branch (1467:7): [True: 440, False: 287]
  ------------------
 1468|    440|		    lha->crc != lha->entry_crc_calculated) {
  ------------------
  |  Branch (1468:7): [True: 411, False: 29]
  ------------------
 1469|    411|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    411|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1470|    411|			    "LHa data CRC error");
 1471|    411|			r = ARCHIVE_WARN;
  ------------------
  |  |  236|    411|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1472|    411|		}
 1473|       |
 1474|       |		/* End-of-entry cleanup done. */
 1475|    727|		lha->end_of_entry_cleanup = 1;
 1476|    727|	}
 1477|    750|	return (r);
 1478|    750|}
archive_read_support_format_lha.c:lha_read_data_lzh:
 1563|  11.3k|{
 1564|  11.3k|	struct lha *lha = a->format->data;
 1565|  11.3k|	ssize_t bytes_avail, max_in;
 1566|  11.3k|	int r;
 1567|       |
 1568|       |	/* If we haven't yet read any data, initialize the decompressor. */
 1569|  11.3k|	if (!lha->decompress_init) {
  ------------------
  |  Branch (1569:6): [True: 3.64k, False: 7.67k]
  ------------------
 1570|  3.64k|		r = lzh_decode_init(&(lha->strm), lha->method);
 1571|  3.64k|		switch (r) {
 1572|  3.37k|		case ARCHIVE_OK:
  ------------------
  |  |  234|  3.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1572:3): [True: 3.37k, False: 264]
  ------------------
 1573|  3.37k|			break;
 1574|    264|		case ARCHIVE_FAILED:
  ------------------
  |  |  238|    264|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1574:3): [True: 264, False: 3.37k]
  ------------------
 1575|       |        		/* Unsupported compression. */
 1576|    264|			*buff = NULL;
 1577|    264|			*size = 0;
 1578|    264|			*offset = 0;
 1579|    264|			archive_set_error(&a->archive,
 1580|    264|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    264|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1581|    264|			    "Unsupported lzh compression method -%c%c%c-",
 1582|    264|			    lha->method[0], lha->method[1], lha->method[2]);
 1583|       |			/* We know compressed size; just skip it. */
 1584|    264|			archive_read_format_lha_read_data_skip(a);
 1585|    264|			return (ARCHIVE_WARN);
  ------------------
  |  |  236|    264|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1586|      0|		default:
  ------------------
  |  Branch (1586:3): [True: 0, False: 3.64k]
  ------------------
 1587|      0|			archive_set_error(&a->archive, ENOMEM,
 1588|      0|			    "Couldn't allocate memory "
 1589|      0|			    "for lzh decompression");
 1590|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1591|  3.64k|		}
 1592|       |		/* We've initialized decompression for this stream. */
 1593|  3.37k|		lha->decompress_init = 1;
 1594|  3.37k|		lha->strm.avail_out = 0;
 1595|  3.37k|	}
 1596|       |
 1597|       |	/*
 1598|       |	 * Note: '1' here is a performance optimization.
 1599|       |	 * Recall that the decompression layer returns a count of
 1600|       |	 * available bytes; asking for more than that forces the
 1601|       |	 * decompressor to combine reads by copying data.
 1602|       |	 */
 1603|  11.0k|	lha->strm.next_in = __archive_read_ahead(a, 1, &bytes_avail);
 1604|  11.0k|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1604:6): [True: 93, False: 10.9k]
  ------------------
 1605|     93|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     93|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1606|     93|		    "Truncated LHa file body");
 1607|     93|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     93|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1608|     93|	}
 1609|  10.9k|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1609:6): [True: 10.1k, False: 775]
  ------------------
 1610|  10.1k|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1611|       |
 1612|       |	/* Setup buffer boundaries.  strm.avail_in is an int, and the
 1613|       |	 * compressed size it is bounded by comes straight from the LHa
 1614|       |	 * header, so clamp the available byte count before the
 1615|       |	 * assignment. */
 1616|  10.9k|	if (INT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (1616:6): [Folded, False: 10.9k]
  ------------------
 1617|      0|		max_in = SSIZE_MAX;
 1618|  10.9k|	else
 1619|  10.9k|		max_in = INT_MAX;
 1620|  10.9k|	if (bytes_avail > max_in)
  ------------------
  |  Branch (1620:6): [True: 0, False: 10.9k]
  ------------------
 1621|      0|		bytes_avail = max_in;
 1622|       |
 1623|  10.9k|	lha->strm.avail_in = (int)bytes_avail;
 1624|  10.9k|	lha->strm.total_in = 0;
 1625|  10.9k|	lha->strm.avail_out = 0;
 1626|       |
 1627|  10.9k|	r = lzh_decode(&(lha->strm), bytes_avail == lha->entry_bytes_remaining);
 1628|  10.9k|	switch (r) {
 1629|  7.67k|	case ARCHIVE_OK:
  ------------------
  |  |  234|  7.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1629:2): [True: 7.67k, False: 3.28k]
  ------------------
 1630|  7.67k|		break;
 1631|    107|	case ARCHIVE_EOF:
  ------------------
  |  |  233|    107|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1631:2): [True: 107, False: 10.8k]
  ------------------
 1632|    107|		lha->end_of_entry = 1;
 1633|    107|		break;
 1634|  3.17k|	default:
  ------------------
  |  Branch (1634:2): [True: 3.17k, False: 7.77k]
  ------------------
 1635|  3.17k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.17k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1636|  3.17k|		    "Bad lzh data");
 1637|  3.17k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  3.17k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1638|  10.9k|	}
 1639|  7.77k|	lha->entry_unconsumed = lha->strm.total_in;
 1640|  7.77k|	lha->entry_bytes_remaining -= lha->strm.total_in;
 1641|       |
 1642|  7.77k|	if (lha->strm.avail_out) {
  ------------------
  |  Branch (1642:6): [True: 7.57k, False: 200]
  ------------------
 1643|  7.57k|		*offset = lha->entry_offset;
 1644|  7.57k|		*size = lha->strm.avail_out;
 1645|  7.57k|		*buff = lha->strm.ref_ptr;
 1646|  7.57k|		lha->entry_crc_calculated =
 1647|  7.57k|		    lha_crc16(lha->entry_crc_calculated, *buff, *size);
 1648|  7.57k|		lha->entry_offset += *size;
 1649|  7.57k|	} else {
 1650|    200|		*offset = lha->entry_offset;
 1651|    200|		*size = 0;
 1652|    200|		*buff = NULL;
 1653|    200|		if (lha->end_of_entry)
  ------------------
  |  Branch (1653:7): [True: 107, False: 93]
  ------------------
 1654|    107|			return (lha_end_of_entry(a));
 1655|    200|	}
 1656|  7.67k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  7.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1657|  7.77k|}
archive_read_support_format_lha.c:lzh_decode_init:
 1903|  3.64k|{
 1904|  3.64k|	struct lzh_dec *ds;
 1905|  3.64k|	int w_bits, w_size;
 1906|       |
 1907|  3.64k|	if (strm->ds == NULL) {
  ------------------
  |  Branch (1907:6): [True: 379, False: 3.26k]
  ------------------
 1908|    379|		strm->ds = calloc(1, sizeof(*strm->ds));
 1909|    379|		if (strm->ds == NULL)
  ------------------
  |  Branch (1909:7): [True: 0, False: 379]
  ------------------
 1910|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1911|    379|	}
 1912|  3.64k|	ds = strm->ds;
 1913|  3.64k|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  238|  3.64k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1914|  3.64k|	if (method == NULL || method[0] != 'l' || method[1] != 'h')
  ------------------
  |  Branch (1914:6): [True: 0, False: 3.64k]
  |  Branch (1914:24): [True: 0, False: 3.64k]
  |  Branch (1914:44): [True: 5, False: 3.63k]
  ------------------
 1915|      5|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1916|  3.63k|	switch (method[2]) {
 1917|  3.08k|	case '5':
  ------------------
  |  Branch (1917:2): [True: 3.08k, False: 548]
  ------------------
 1918|  3.08k|		w_bits = 13;/* 8KiB for window */
 1919|  3.08k|		break;
 1920|     83|	case '6':
  ------------------
  |  Branch (1920:2): [True: 83, False: 3.55k]
  ------------------
 1921|     83|		w_bits = 15;/* 32KiB for window */
 1922|     83|		break;
 1923|    206|	case '7':
  ------------------
  |  Branch (1923:2): [True: 206, False: 3.43k]
  ------------------
 1924|    206|		w_bits = 16;/* 64KiB for window */
 1925|    206|		break;
 1926|    259|	default:
  ------------------
  |  Branch (1926:2): [True: 259, False: 3.37k]
  ------------------
 1927|    259|		return (ARCHIVE_FAILED);/* Not supported. */
  ------------------
  |  |  238|    259|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1928|  3.63k|	}
 1929|  3.37k|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  240|  3.37k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1930|       |	/* Expand a window size up to 128 KiB for decompressing process
 1931|       |	 * performance whatever its original window size is. */
 1932|  3.37k|	ds->w_size = 1U << 17;
 1933|  3.37k|	ds->w_mask = ds->w_size -1;
 1934|  3.37k|	if (ds->w_buff == NULL) {
  ------------------
  |  Branch (1934:6): [True: 357, False: 3.02k]
  ------------------
 1935|    357|		ds->w_buff = malloc(ds->w_size);
 1936|    357|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (1936:7): [True: 0, False: 357]
  ------------------
 1937|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1938|    357|	}
 1939|  3.37k|	w_size = 1U << w_bits;
 1940|  3.37k|	memset(ds->w_buff + ds->w_size - w_size, 0x20, w_size);
 1941|  3.37k|	ds->w_pos = 0;
 1942|  3.37k|	ds->state = 0;
 1943|  3.37k|	ds->pos_pt_len_size = w_bits + 1;
 1944|  3.37k|	ds->pos_pt_len_bits = (w_bits == 15 || w_bits == 16)? 5: 4;
  ------------------
  |  Branch (1944:25): [True: 83, False: 3.29k]
  |  Branch (1944:41): [True: 206, False: 3.08k]
  ------------------
 1945|  3.37k|	ds->literal_pt_len_size = PT_BITLEN_SIZE;
  ------------------
  |  |   65|  3.37k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
 1946|  3.37k|	ds->literal_pt_len_bits = 5;
 1947|  3.37k|	ds->br.cache_buffer = 0;
 1948|  3.37k|	ds->br.cache_avail = 0;
 1949|       |
 1950|  3.37k|	if (lzh_huffman_init(&(ds->lt), LT_BITLEN_SIZE, 16)
  ------------------
  |  |   62|  3.37k|#define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   50|  3.37k|#define MAXMATCH		256	/* Maximum match length. */
  |  |  ------------------
  |  |               #define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   51|  3.37k|#define MINMATCH		3	/* Minimum match length. */
  |  |  ------------------
  ------------------
  |  Branch (1950:6): [True: 0, False: 3.37k]
  ------------------
 1951|  3.37k|	    != ARCHIVE_OK)
  ------------------
  |  |  234|  3.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1952|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1953|  3.37k|	ds->lt.len_bits = 9;
 1954|  3.37k|	if (lzh_huffman_init(&(ds->pt), PT_BITLEN_SIZE, 16)
  ------------------
  |  |   65|  3.37k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
  |  Branch (1954:6): [True: 0, False: 3.37k]
  ------------------
 1955|  3.37k|	    != ARCHIVE_OK)
  ------------------
  |  |  234|  3.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1956|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1957|  3.37k|	ds->error = 0;
 1958|       |
 1959|  3.37k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  3.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1960|  3.37k|}
archive_read_support_format_lha.c:lzh_huffman_init:
 2584|  6.75k|{
 2585|  6.75k|	int bits;
 2586|       |
 2587|  6.75k|	if (hf->bitlen == NULL) {
  ------------------
  |  Branch (2587:6): [True: 714, False: 6.04k]
  ------------------
 2588|    714|		hf->bitlen = malloc(len_size * sizeof(hf->bitlen[0]));
 2589|    714|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (2589:7): [True: 0, False: 714]
  ------------------
 2590|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2591|    714|	}
 2592|  6.75k|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (2592:6): [True: 714, False: 6.04k]
  ------------------
 2593|    714|		if (tbl_bits < HTBL_BITS)
  ------------------
  |  |  114|    714|#define HTBL_BITS	10
  ------------------
  |  Branch (2593:7): [True: 0, False: 714]
  ------------------
 2594|      0|			bits = tbl_bits;
 2595|    714|		else
 2596|    714|			bits = HTBL_BITS;
  ------------------
  |  |  114|    714|#define HTBL_BITS	10
  ------------------
 2597|    714|		hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
 2598|    714|		if (hf->tbl == NULL)
  ------------------
  |  Branch (2598:7): [True: 0, False: 714]
  ------------------
 2599|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2600|    714|	}
 2601|  6.75k|	if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
  ------------------
  |  |  114|    714|#define HTBL_BITS	10
  ------------------
  |  Branch (2601:6): [True: 714, False: 6.04k]
  |  Branch (2601:26): [True: 714, False: 0]
  ------------------
 2602|    714|		hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
  ------------------
  |  |  114|    714|#define HTBL_BITS	10
  ------------------
 2603|    714|		hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
 2604|    714|		if (hf->tree == NULL)
  ------------------
  |  Branch (2604:7): [True: 0, False: 714]
  ------------------
 2605|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2606|    714|	}
 2607|  6.75k|	hf->len_size = (int)len_size;
 2608|  6.75k|	hf->tbl_bits = tbl_bits;
 2609|  6.75k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  6.75k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2610|  6.75k|}
archive_read_support_format_lha.c:lzh_decode:
 2131|  10.9k|{
 2132|  10.9k|	struct lzh_dec *ds = strm->ds;
 2133|  10.9k|	int avail_in;
 2134|  10.9k|	int r;
 2135|       |
 2136|  10.9k|	if (ds->error)
  ------------------
  |  Branch (2136:6): [True: 0, False: 10.9k]
  ------------------
 2137|      0|		return (ds->error);
 2138|       |
 2139|  10.9k|	avail_in = strm->avail_in;
 2140|  16.0k|	do {
 2141|  16.0k|		if (ds->state < ST_GET_LITERAL)
  ------------------
  |  | 2124|  16.0k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2141:7): [True: 5.68k, False: 10.3k]
  ------------------
 2142|  5.68k|			r = lzh_read_blocks(strm, last);
 2143|  10.3k|		else
 2144|  10.3k|			r = lzh_decode_blocks(strm, last);
 2145|  16.0k|	} while (r == 100);
  ------------------
  |  Branch (2145:11): [True: 5.05k, False: 10.9k]
  ------------------
 2146|  10.9k|	strm->total_in += avail_in - strm->avail_in;
 2147|  10.9k|	return (r);
 2148|  10.9k|}
archive_read_support_format_lha.c:lzh_read_blocks:
 2159|  5.68k|{
 2160|  5.68k|	struct lzh_dec *ds = strm->ds;
 2161|  5.68k|	struct lzh_br *br = &(ds->br);
 2162|  5.68k|	int c = 0, i;
 2163|  5.68k|	unsigned rbits;
 2164|       |
 2165|  15.9k|	for (;;) {
 2166|  15.9k|		switch (ds->state) {
  ------------------
  |  Branch (2166:11): [True: 15.9k, False: 0]
  ------------------
 2167|  5.68k|		case ST_RD_BLOCK:
  ------------------
  |  | 2115|  5.68k|#define ST_RD_BLOCK		0
  ------------------
  |  Branch (2167:3): [True: 5.68k, False: 10.3k]
  ------------------
 2168|       |			/*
 2169|       |			 * Read a block number indicates how many blocks
 2170|       |			 * we will handle. The block is composed of a
 2171|       |			 * literal and a match, sometimes a literal only
 2172|       |			 * in particular, there are no reference data at
 2173|       |			 * the beginning of the decompression.
 2174|       |			 */
 2175|  5.68k|			if (!lzh_br_read_ahead_0(strm, br, 16)) {
  ------------------
  |  | 1996|  5.68k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  ------------------
  |  |  |  | 1982|  11.3k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 1.72k, False: 3.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1996:26): [True: 3.61k, False: 342]
  |  |  ------------------
  ------------------
 2176|    342|				if (!last)
  ------------------
  |  Branch (2176:9): [True: 15, False: 327]
  ------------------
 2177|       |					/* We need following data. */
 2178|     15|					return (ARCHIVE_OK);
  ------------------
  |  |  234|     15|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2179|    327|				if (lzh_br_has(br, 8)) {
  ------------------
  |  | 1982|    327|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (1982:27): [True: 113, False: 214]
  |  |  ------------------
  ------------------
 2180|       |					/*
 2181|       |					 * It seems there are extra bits.
 2182|       |					 *  1. Compressed data is broken.
 2183|       |					 *  2. `last' flag does not properly
 2184|       |					 *     set.
 2185|       |					 */
 2186|    113|					goto failed;
 2187|    113|				}
 2188|    214|				if (ds->w_pos > 0) {
  ------------------
  |  Branch (2188:9): [True: 107, False: 107]
  ------------------
 2189|    107|					lzh_emit_window(strm, ds->w_pos);
 2190|    107|					ds->w_pos = 0;
 2191|    107|					return (ARCHIVE_OK);
  ------------------
  |  |  234|    107|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2192|    107|				}
 2193|       |				/* End of compressed data; we have completely
 2194|       |				 * handled all compressed data. */
 2195|    107|				return (ARCHIVE_EOF);
  ------------------
  |  |  233|    107|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2196|    214|			}
 2197|  5.34k|			ds->blocks_avail = lzh_br_bits(br, 16);
  ------------------
  |  | 1985|  5.34k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  5.34k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2198|  5.34k|			if (ds->blocks_avail == 0)
  ------------------
  |  Branch (2198:8): [True: 73, False: 5.27k]
  ------------------
 2199|     73|				goto failed;
 2200|  5.27k|			lzh_br_consume(br, 16);
  ------------------
  |  | 2004|  5.27k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2201|       |			/*
 2202|       |			 * Read a literal table compressed in huffman
 2203|       |			 * coding.
 2204|       |			 */
 2205|  5.27k|			ds->pt.len_size = ds->literal_pt_len_size;
 2206|  5.27k|			ds->pt.len_bits = ds->literal_pt_len_bits;
 2207|  5.27k|			ds->reading_position = 0;
 2208|       |			/* FALL THROUGH */
 2209|  8.41k|		case ST_RD_PT_1:
  ------------------
  |  | 2116|  8.41k|#define ST_RD_PT_1		1
  ------------------
  |  Branch (2209:3): [True: 3.13k, False: 12.8k]
  ------------------
 2210|       |			/* Note: ST_RD_PT_1, ST_RD_PT_2 and ST_RD_PT_4 are
 2211|       |			 * used in reading both a literal table and a
 2212|       |			 * position table. */
 2213|  8.41k|			if (!lzh_br_read_ahead(strm, br, ds->pt.len_bits)) {
  ------------------
  |  | 2001|  8.41k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  16.8k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  16.8k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 8.33k, False: 77]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 33, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|     44|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 26, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2214|     18|				if (last)
  ------------------
  |  Branch (2214:9): [True: 17, False: 1]
  ------------------
 2215|     17|					goto failed;/* Truncated data. */
 2216|      1|				ds->state = ST_RD_PT_1;
  ------------------
  |  | 2116|      1|#define ST_RD_PT_1		1
  ------------------
 2217|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  234|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2218|     18|			}
 2219|  8.39k|			ds->pt.len_avail = lzh_br_bits(br, ds->pt.len_bits);
  ------------------
  |  | 1985|  8.39k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  8.39k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2220|  8.39k|			lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 2004|  8.39k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2221|       |			/* FALL THROUGH */
 2222|  8.39k|		case ST_RD_PT_2:
  ------------------
  |  | 2117|  8.39k|#define ST_RD_PT_2		2
  ------------------
  |  Branch (2222:3): [True: 0, False: 15.9k]
  ------------------
 2223|  8.39k|			if (ds->pt.len_avail == 0) {
  ------------------
  |  Branch (2223:8): [True: 1.51k, False: 6.88k]
  ------------------
 2224|       |				/* There is no bitlen. */
 2225|  1.51k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 2001|  1.51k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  3.02k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  3.02k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 1.48k, False: 32]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 4, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|     28|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 18, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2226|  1.51k|				    ds->pt.len_bits)) {
 2227|     10|					if (last)
  ------------------
  |  Branch (2227:10): [True: 10, False: 0]
  ------------------
 2228|     10|						goto failed;/* Truncated data.*/
 2229|      0|					ds->state = ST_RD_PT_2;
  ------------------
  |  | 2117|      0|#define ST_RD_PT_2		2
  ------------------
 2230|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2231|     10|				}
 2232|  1.50k|				if (!lzh_make_fake_table(&(ds->pt),
  ------------------
  |  Branch (2232:9): [True: 20, False: 1.48k]
  ------------------
 2233|  1.50k|				    lzh_br_bits(br, ds->pt.len_bits)))
  ------------------
  |  | 1985|  1.50k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  1.50k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2234|     20|					goto failed;/* Invalid data. */
 2235|  1.48k|				lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 2004|  1.48k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2236|  1.48k|				if (ds->reading_position)
  ------------------
  |  Branch (2236:9): [True: 494, False: 989]
  ------------------
 2237|    494|					ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2124|    494|#define ST_GET_LITERAL		9
  ------------------
 2238|    989|				else
 2239|    989|					ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2120|    989|#define ST_RD_LITERAL_1		5
  ------------------
 2240|  1.48k|				break;
 2241|  6.88k|			} else if (ds->pt.len_avail > ds->pt.len_size)
  ------------------
  |  Branch (2241:15): [True: 136, False: 6.74k]
  ------------------
 2242|    136|				goto failed;/* Invalid data. */
 2243|  6.74k|			ds->loop = 0;
 2244|  6.74k|			memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 2245|  6.74k|			if (ds->pt.len_avail < 3 ||
  ------------------
  |  Branch (2245:8): [True: 120, False: 6.62k]
  ------------------
 2246|  6.62k|			    ds->pt.len_size == ds->pos_pt_len_size) {
  ------------------
  |  Branch (2246:8): [True: 2.51k, False: 4.10k]
  ------------------
 2247|  2.63k|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2119|  2.63k|#define ST_RD_PT_4		4
  ------------------
 2248|  2.63k|				break;
 2249|  2.63k|			}
 2250|       |			/* FALL THROUGH */
 2251|  4.10k|		case ST_RD_PT_3:
  ------------------
  |  | 2118|  4.10k|#define ST_RD_PT_3		3
  ------------------
  |  Branch (2251:3): [True: 0, False: 15.9k]
  ------------------
 2252|  4.10k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop, 3);
 2253|  4.10k|			if (ds->loop < 3) {
  ------------------
  |  Branch (2253:8): [True: 18, False: 4.09k]
  ------------------
 2254|     18|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2254:9): [True: 10, False: 8]
  |  Branch (2254:25): [True: 6, False: 2]
  ------------------
 2255|     16|					goto failed;/* Invalid data. */
 2256|       |				/* Not completed, get following data. */
 2257|      2|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2118|      2|#define ST_RD_PT_3		3
  ------------------
 2258|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  234|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2259|     18|			}
 2260|       |			/* There are some null in bitlen of the literal. */
 2261|  4.09k|			if (!lzh_br_read_ahead(strm, br, 2)) {
  ------------------
  |  | 2001|  4.09k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  8.18k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  8.18k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 3.98k, False: 110]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 1, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    109|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 106, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2262|      3|				if (last)
  ------------------
  |  Branch (2262:9): [True: 2, False: 1]
  ------------------
 2263|      2|					goto failed;/* Truncated data. */
 2264|      1|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2118|      1|#define ST_RD_PT_3		3
  ------------------
 2265|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  234|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2266|      3|			}
 2267|  4.08k|			c = lzh_br_bits(br, 2);
  ------------------
  |  | 1985|  4.08k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  4.08k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2268|  4.08k|			lzh_br_consume(br, 2);
  ------------------
  |  | 2004|  4.08k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2269|  4.08k|			if (c > ds->pt.len_avail - 3)
  ------------------
  |  Branch (2269:8): [True: 14, False: 4.07k]
  ------------------
 2270|     14|				goto failed;/* Invalid data. */
 2271|  11.1k|			for (i = 3; c-- > 0 ;)
  ------------------
  |  Branch (2271:16): [True: 7.11k, False: 4.07k]
  ------------------
 2272|  7.11k|				ds->pt.bitlen[i++] = 0;
 2273|  4.07k|			ds->loop = i;
 2274|       |			/* FALL THROUGH */
 2275|  6.71k|		case ST_RD_PT_4:
  ------------------
  |  | 2119|  6.71k|#define ST_RD_PT_4		4
  ------------------
  |  Branch (2275:3): [True: 2.63k, False: 13.3k]
  ------------------
 2276|  6.71k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop,
 2277|  6.71k|			    ds->pt.len_avail);
 2278|  6.71k|			if (ds->loop < ds->pt.len_avail) {
  ------------------
  |  Branch (2278:8): [True: 547, False: 6.16k]
  ------------------
 2279|    547|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2279:9): [True: 316, False: 231]
  |  Branch (2279:25): [True: 230, False: 1]
  ------------------
 2280|    546|					goto failed;/* Invalid data. */
 2281|       |				/* Not completed, get following data. */
 2282|      1|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2119|      1|#define ST_RD_PT_4		4
  ------------------
 2283|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  234|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2284|    547|			}
 2285|  6.16k|			if (!lzh_make_huffman_table(&(ds->pt)))
  ------------------
  |  Branch (2285:8): [True: 717, False: 5.44k]
  ------------------
 2286|    717|				goto failed;/* Invalid data */
 2287|  5.44k|			if (ds->reading_position) {
  ------------------
  |  Branch (2287:8): [True: 2.35k, False: 3.09k]
  ------------------
 2288|  2.35k|				ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2124|  2.35k|#define ST_GET_LITERAL		9
  ------------------
 2289|  2.35k|				break;
 2290|  2.35k|			}
 2291|       |			/* FALL THROUGH */
 2292|  4.07k|		case ST_RD_LITERAL_1:
  ------------------
  |  | 2120|  4.07k|#define ST_RD_LITERAL_1		5
  ------------------
  |  Branch (2292:3): [True: 989, False: 15.0k]
  ------------------
 2293|  4.07k|			if (!lzh_br_read_ahead(strm, br, ds->lt.len_bits)) {
  ------------------
  |  | 2001|  4.07k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  8.15k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  8.15k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 3.93k, False: 145]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 9, False: 136]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    136|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 99, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2294|     37|				if (last)
  ------------------
  |  Branch (2294:9): [True: 37, False: 0]
  ------------------
 2295|     37|					goto failed;/* Truncated data. */
 2296|      0|				ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2120|      0|#define ST_RD_LITERAL_1		5
  ------------------
 2297|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2298|     37|			}
 2299|  4.04k|			ds->lt.len_avail = lzh_br_bits(br, ds->lt.len_bits);
  ------------------
  |  | 1985|  4.04k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  4.04k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2300|  4.04k|			lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 2004|  4.04k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2301|       |			/* FALL THROUGH */
 2302|  4.04k|		case ST_RD_LITERAL_2:
  ------------------
  |  | 2121|  4.04k|#define ST_RD_LITERAL_2		6
  ------------------
  |  Branch (2302:3): [True: 0, False: 15.9k]
  ------------------
 2303|  4.04k|			if (ds->lt.len_avail == 0) {
  ------------------
  |  Branch (2303:8): [True: 731, False: 3.31k]
  ------------------
 2304|       |				/* There is no bitlen. */
 2305|    731|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 2001|    731|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  1.46k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  1.46k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 534, False: 197]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 93, False: 104]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    104|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 94, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2306|    731|				    ds->lt.len_bits)) {
 2307|     10|					if (last)
  ------------------
  |  Branch (2307:10): [True: 10, False: 0]
  ------------------
 2308|     10|						goto failed;/* Truncated data.*/
 2309|      0|					ds->state = ST_RD_LITERAL_2;
  ------------------
  |  | 2121|      0|#define ST_RD_LITERAL_2		6
  ------------------
 2310|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2311|     10|				}
 2312|    721|				if (!lzh_make_fake_table(&(ds->lt),
  ------------------
  |  Branch (2312:9): [True: 29, False: 692]
  ------------------
 2313|    721|				    lzh_br_bits(br, ds->lt.len_bits)))
  ------------------
  |  | 1985|    721|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|    721|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2314|     29|					goto failed;/* Invalid data */
 2315|    692|				lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 2004|    692|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2316|    692|				ds->state = ST_RD_POS_DATA_1;
  ------------------
  |  | 2123|    692|#define ST_RD_POS_DATA_1	8
  ------------------
 2317|    692|				break;
 2318|  3.31k|			} else if (ds->lt.len_avail > ds->lt.len_size)
  ------------------
  |  Branch (2318:15): [True: 21, False: 3.29k]
  ------------------
 2319|     21|				goto failed;/* Invalid data */
 2320|  3.29k|			ds->loop = 0;
 2321|  3.29k|			memset(ds->lt.freq, 0, sizeof(ds->lt.freq));
 2322|       |			/* FALL THROUGH */
 2323|  3.29k|		case ST_RD_LITERAL_3:
  ------------------
  |  | 2122|  3.29k|#define ST_RD_LITERAL_3		7
  ------------------
  |  Branch (2323:3): [True: 0, False: 15.9k]
  ------------------
 2324|  3.29k|			i = ds->loop;
 2325|   153k|			while (i < ds->lt.len_avail) {
  ------------------
  |  Branch (2325:11): [True: 151k, False: 2.52k]
  ------------------
 2326|   151k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 2001|   151k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|   302k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|   302k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 142k, False: 8.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 8.18k, False: 258]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    258|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 52, False: 206]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2327|   151k|				    ds->pt.max_bits)) {
 2328|    206|					if (last)
  ------------------
  |  Branch (2328:10): [True: 203, False: 3]
  ------------------
 2329|    203|						goto failed;/* Truncated data.*/
 2330|      3|					ds->loop = i;
 2331|      3|					ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2122|      3|#define ST_RD_LITERAL_3		7
  ------------------
 2332|      3|					return (ARCHIVE_OK);
  ------------------
  |  |  234|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2333|    206|				}
 2334|   150k|				rbits = lzh_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 1985|   150k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|   150k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2335|   150k|				c = lzh_decode_huffman(&(ds->pt), rbits);
 2336|   150k|				if (c > 2) {
  ------------------
  |  Branch (2336:9): [True: 99.1k, False: 51.6k]
  ------------------
 2337|       |					/* Note: 'c' will never be more than
 2338|       |					 * eighteen since it's limited by
 2339|       |					 * PT_BITLEN_SIZE, which is being set
 2340|       |					 * to ds->pt.len_size through
 2341|       |					 * ds->literal_pt_len_size. */
 2342|  99.1k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2004|  99.1k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2343|  99.1k|					c -= 2;
 2344|  99.1k|					ds->lt.freq[c]++;
 2345|  99.1k|					ds->lt.bitlen[i++] = c;
 2346|  99.1k|				} else if (c == 0) {
  ------------------
  |  Branch (2346:16): [True: 20.8k, False: 30.7k]
  ------------------
 2347|  20.8k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2004|  20.8k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2348|  20.8k|					ds->lt.bitlen[i++] = 0;
 2349|  30.7k|				} else {
 2350|       |					/* c == 1 or c == 2 */
 2351|  30.7k|					int n = (c == 1)?4:9;
  ------------------
  |  Branch (2351:14): [True: 25.0k, False: 5.75k]
  ------------------
 2352|  30.7k|					if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 2001|  30.7k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  61.5k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  61.5k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 29.9k, False: 788]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 78, False: 710]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    710|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 359, False: 351]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2353|  30.7k|					     ds->pt.bitlen[c] + n)) {
 2354|    351|						if (last) /* Truncated data. */
  ------------------
  |  Branch (2354:11): [True: 347, False: 4]
  ------------------
 2355|    347|							goto failed;
 2356|      4|						ds->loop = i;
 2357|      4|						ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2122|      4|#define ST_RD_LITERAL_3		7
  ------------------
 2358|      4|						return (ARCHIVE_OK);
  ------------------
  |  |  234|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2359|    351|					}
 2360|  30.4k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2004|  30.4k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2361|  30.4k|					c = lzh_br_bits(br, n);
  ------------------
  |  | 1985|  30.4k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  30.4k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2362|  30.4k|					lzh_br_consume(br, n);
  ------------------
  |  | 2004|  30.4k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2363|  30.4k|					c += (n == 4)?3:20;
  ------------------
  |  Branch (2363:11): [True: 24.8k, False: 5.60k]
  ------------------
 2364|  30.4k|					if (i + c > ds->lt.len_avail)
  ------------------
  |  Branch (2364:10): [True: 210, False: 30.2k]
  ------------------
 2365|    210|						goto failed;/* Invalid data */
 2366|  30.2k|					memset(&(ds->lt.bitlen[i]), 0, c);
 2367|  30.2k|					i += c;
 2368|  30.2k|				}
 2369|   150k|			}
 2370|  2.52k|			if (i > ds->lt.len_avail ||
  ------------------
  |  Branch (2370:8): [True: 0, False: 2.52k]
  ------------------
 2371|  2.52k|			    !lzh_make_huffman_table(&(ds->lt)))
  ------------------
  |  Branch (2371:8): [True: 76, False: 2.44k]
  ------------------
 2372|     76|				goto failed;/* Invalid data */
 2373|       |			/* FALL THROUGH */
 2374|  3.13k|		case ST_RD_POS_DATA_1:
  ------------------
  |  | 2123|  3.13k|#define ST_RD_POS_DATA_1	8
  ------------------
  |  Branch (2374:3): [True: 692, False: 15.3k]
  ------------------
 2375|       |			/*
 2376|       |			 * Read a position table compressed in huffman
 2377|       |			 * coding.
 2378|       |			 */
 2379|  3.13k|			ds->pt.len_size = ds->pos_pt_len_size;
 2380|  3.13k|			ds->pt.len_bits = ds->pos_pt_len_bits;
 2381|  3.13k|			ds->reading_position = 1;
 2382|  3.13k|			ds->state = ST_RD_PT_1;
  ------------------
  |  | 2116|  3.13k|#define ST_RD_PT_1		1
  ------------------
 2383|  3.13k|			break;
 2384|  2.85k|		case ST_GET_LITERAL:
  ------------------
  |  | 2124|  2.85k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2384:3): [True: 2.85k, False: 13.1k]
  ------------------
 2385|  2.85k|			return (100);
 2386|  15.9k|		}
 2387|  15.9k|	}
 2388|  2.59k|failed:
 2389|  2.59k|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  238|  2.59k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2390|  5.68k|}
archive_read_support_format_lha.c:lzh_br_fillup:
 2024|  43.2k|{
 2025|  43.2k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   92|  43.2k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2026|       |
 2027|  51.3k|	for (;;) {
 2028|  51.3k|		const int x = n >> 3;
 2029|  51.3k|		if (strm->avail_in >= x) {
  ------------------
  |  Branch (2029:7): [True: 37.7k, False: 13.5k]
  ------------------
 2030|  37.7k|			switch (x) {
 2031|  8.49k|			case 8:
  ------------------
  |  Branch (2031:4): [True: 8.49k, False: 29.2k]
  ------------------
 2032|  8.49k|				br->cache_buffer =
 2033|  8.49k|				    ((uint64_t)strm->next_in[0]) << 56 |
 2034|  8.49k|				    ((uint64_t)strm->next_in[1]) << 48 |
 2035|  8.49k|				    ((uint64_t)strm->next_in[2]) << 40 |
 2036|  8.49k|				    ((uint64_t)strm->next_in[3]) << 32 |
 2037|  8.49k|				    ((uint32_t)strm->next_in[4]) << 24 |
 2038|  8.49k|				    ((uint32_t)strm->next_in[5]) << 16 |
 2039|  8.49k|				    ((uint32_t)strm->next_in[6]) << 8 |
 2040|  8.49k|				     (uint32_t)strm->next_in[7];
 2041|  8.49k|				strm->next_in += 8;
 2042|  8.49k|				strm->avail_in -= 8;
 2043|  8.49k|				br->cache_avail += 8 * 8;
 2044|  8.49k|				return (1);
 2045|  28.7k|			case 7:
  ------------------
  |  Branch (2045:4): [True: 28.7k, False: 9.06k]
  ------------------
 2046|  28.7k|				br->cache_buffer =
 2047|  28.7k|		 		   (br->cache_buffer << 56) |
 2048|  28.7k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2049|  28.7k|				    ((uint64_t)strm->next_in[1]) << 40 |
 2050|  28.7k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2051|  28.7k|				    ((uint64_t)strm->next_in[3]) << 24 |
 2052|  28.7k|				    ((uint64_t)strm->next_in[4]) << 16 |
 2053|  28.7k|				    ((uint64_t)strm->next_in[5]) << 8 |
 2054|  28.7k|				     (uint64_t)strm->next_in[6];
 2055|  28.7k|				strm->next_in += 7;
 2056|  28.7k|				strm->avail_in -= 7;
 2057|  28.7k|				br->cache_avail += 7 * 8;
 2058|  28.7k|				return (1);
 2059|    564|			case 6:
  ------------------
  |  Branch (2059:4): [True: 564, False: 37.2k]
  ------------------
 2060|    564|				br->cache_buffer =
 2061|    564|		 		   (br->cache_buffer << 48) |
 2062|    564|				    ((uint64_t)strm->next_in[0]) << 40 |
 2063|    564|				    ((uint64_t)strm->next_in[1]) << 32 |
 2064|    564|				    ((uint64_t)strm->next_in[2]) << 24 |
 2065|    564|				    ((uint64_t)strm->next_in[3]) << 16 |
 2066|    564|				    ((uint64_t)strm->next_in[4]) << 8 |
 2067|    564|				     (uint64_t)strm->next_in[5];
 2068|    564|				strm->next_in += 6;
 2069|    564|				strm->avail_in -= 6;
 2070|    564|				br->cache_avail += 6 * 8;
 2071|    564|				return (1);
 2072|      0|			case 0:
  ------------------
  |  Branch (2072:4): [True: 0, False: 37.7k]
  ------------------
 2073|       |				/* We have enough compressed data in
 2074|       |				 * the cache buffer.*/
 2075|      0|				return (1);
 2076|      0|			default:
  ------------------
  |  Branch (2076:4): [True: 0, False: 37.7k]
  ------------------
 2077|      0|				break;
 2078|  37.7k|			}
 2079|  37.7k|		}
 2080|  13.5k|		if (strm->avail_in == 0) {
  ------------------
  |  Branch (2080:7): [True: 5.45k, False: 8.08k]
  ------------------
 2081|       |			/* There is not enough compressed data to fill up the
 2082|       |			 * cache buffer. */
 2083|  5.45k|			return (0);
 2084|  5.45k|		}
 2085|  8.08k|		br->cache_buffer =
 2086|  8.08k|		   (br->cache_buffer << 8) | *strm->next_in++;
 2087|  8.08k|		strm->avail_in--;
 2088|  8.08k|		br->cache_avail += 8;
 2089|  8.08k|		n -= 8;
 2090|  8.08k|	}
 2091|  43.2k|}
archive_read_support_format_lha.c:lzh_emit_window:
 2152|  7.57k|{
 2153|  7.57k|	strm->ref_ptr = strm->ds->w_buff;
 2154|  7.57k|	strm->avail_out = (int)s;
 2155|  7.57k|}
archive_read_support_format_lha.c:lzh_make_fake_table:
 2726|  2.22k|{
 2727|  2.22k|	if (c >= hf->len_size)
  ------------------
  |  Branch (2727:6): [True: 49, False: 2.17k]
  ------------------
 2728|     49|		return (0);
 2729|  2.17k|	hf->tbl[0] = c;
 2730|  2.17k|	hf->max_bits = 0;
 2731|  2.17k|	hf->shift_bits = 0;
 2732|  2.17k|	hf->bitlen[hf->tbl[0]] = 0;
 2733|  2.17k|	return (1);
 2734|  2.22k|}
archive_read_support_format_lha.c:lzh_read_pt_bitlen:
 2688|  10.8k|{
 2689|  10.8k|	struct lzh_dec *ds = strm->ds;
 2690|  10.8k|	struct lzh_br *br = &(ds->br);
 2691|  10.8k|	int c, i;
 2692|       |
 2693|  64.6k|	for (i = start; i < end; ) {
  ------------------
  |  Branch (2693:18): [True: 54.3k, False: 10.2k]
  ------------------
 2694|       |		/*
 2695|       |		 *  bit pattern     the number we need
 2696|       |		 *     000           ->  0
 2697|       |		 *     001           ->  1
 2698|       |		 *     010           ->  2
 2699|       |		 *     ...
 2700|       |		 *     110           ->  6
 2701|       |		 *     1110          ->  7
 2702|       |		 *     11110         ->  8
 2703|       |		 *     ...
 2704|       |		 *     1111111111110 ->  16
 2705|       |		 */
 2706|  54.3k|		if (!lzh_br_read_ahead(strm, br, 3))
  ------------------
  |  | 2001|  54.3k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|   108k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|   108k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 51.2k, False: 3.06k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 2.43k, False: 632]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    632|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 579, False: 53]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2707|     53|			return (i);
 2708|  54.3k|		if ((c = lzh_br_bits(br, 3)) == 7) {
  ------------------
  |  | 1985|  54.3k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  54.3k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2708:7): [True: 1.81k, False: 52.4k]
  ------------------
 2709|  1.81k|			if (!lzh_br_read_ahead(strm, br, 13))
  ------------------
  |  | 2001|  1.81k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  3.63k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  3.63k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 1.13k, False: 685]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 189, False: 496]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    496|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 310, False: 186]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2710|    186|				return (i);
 2711|  1.62k|			c = bitlen_tbl[lzh_br_bits(br, 13) & 0x3FF];
  ------------------
  |  | 1985|  1.62k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  1.62k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2712|  1.62k|			if (c)
  ------------------
  |  Branch (2712:8): [True: 1.30k, False: 326]
  ------------------
 2713|  1.30k|				lzh_br_consume(br, c - 3);
  ------------------
  |  | 2004|  1.30k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2714|    326|			else
 2715|    326|				return (-1);/* Invalid data. */
 2716|  1.62k|		} else
 2717|  52.4k|			lzh_br_consume(br, 3);
  ------------------
  |  | 2004|  52.4k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2718|  53.7k|		ds->pt.bitlen[i++] = c;
 2719|  53.7k|		ds->pt.freq[c]++;
 2720|  53.7k|	}
 2721|  10.2k|	return (i);
 2722|  10.8k|}
archive_read_support_format_lha.c:lzh_make_huffman_table:
 2741|  8.68k|{
 2742|  8.68k|	uint16_t *tbl;
 2743|  8.68k|	const unsigned char *bitlen;
 2744|  8.68k|	int bitptn[17], weight[17];
 2745|  8.68k|	int i, maxbits = 0, ptn, tbl_size, w;
 2746|  8.68k|	int diffbits, len_avail;
 2747|       |
 2748|       |	/*
 2749|       |	 * Initialize bit patterns.
 2750|       |	 */
 2751|  8.68k|	ptn = 0;
 2752|   147k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (2752:27): [True: 138k, False: 8.68k]
  ------------------
 2753|   138k|		bitptn[i] = ptn;
 2754|   138k|		weight[i] = w;
 2755|   138k|		if (hf->freq[i]) {
  ------------------
  |  Branch (2755:7): [True: 30.1k, False: 108k]
  ------------------
 2756|  30.1k|			ptn += hf->freq[i] * w;
 2757|  30.1k|			maxbits = i;
 2758|  30.1k|		}
 2759|   138k|	}
 2760|  8.68k|	if (ptn != 0x10000 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (2760:6): [True: 793, False: 7.89k]
  |  Branch (2760:24): [True: 0, False: 7.89k]
  ------------------
 2761|    793|		return (0);/* Invalid */
 2762|       |
 2763|  7.89k|	hf->max_bits = maxbits;
 2764|       |
 2765|       |	/*
 2766|       |	 * Cut out extra bits which we won't house in the table.
 2767|       |	 * This preparation reduces the same calculation in the for-loop
 2768|       |	 * making the table.
 2769|       |	 */
 2770|  7.89k|	if (maxbits < 16) {
  ------------------
  |  Branch (2770:6): [True: 7.89k, False: 0]
  ------------------
 2771|  7.89k|		int ebits = 16 - maxbits;
 2772|  43.9k|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (2772:15): [True: 36.0k, False: 7.89k]
  ------------------
 2773|  36.0k|			bitptn[i] >>= ebits;
 2774|  36.0k|			weight[i] >>= ebits;
 2775|  36.0k|		}
 2776|  7.89k|	}
 2777|  7.89k|	if (maxbits > HTBL_BITS) {
  ------------------
  |  |  114|  7.89k|#define HTBL_BITS	10
  ------------------
  |  Branch (2777:6): [True: 0, False: 7.89k]
  ------------------
 2778|      0|		unsigned htbl_max;
 2779|      0|		uint16_t *p;
 2780|       |
 2781|      0|		diffbits = maxbits - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2782|      0|		for (i = 1; i <= HTBL_BITS; i++) {
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2782:15): [True: 0, False: 0]
  ------------------
 2783|      0|			bitptn[i] >>= diffbits;
 2784|      0|			weight[i] >>= diffbits;
 2785|      0|		}
 2786|      0|		htbl_max = bitptn[HTBL_BITS] +
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2787|      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
  ------------------
 2788|      0|		p = &(hf->tbl[htbl_max]);
 2789|      0|		while (p < &hf->tbl[1U<<HTBL_BITS])
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2789:10): [True: 0, False: 0]
  ------------------
 2790|      0|			*p++ = 0;
 2791|      0|	} else
 2792|  7.89k|		diffbits = 0;
 2793|  7.89k|	hf->shift_bits = diffbits;
 2794|       |
 2795|       |	/*
 2796|       |	 * Make the table.
 2797|       |	 */
 2798|  7.89k|	tbl_size = 1 << HTBL_BITS;
  ------------------
  |  |  114|  7.89k|#define HTBL_BITS	10
  ------------------
 2799|  7.89k|	tbl = hf->tbl;
 2800|  7.89k|	bitlen = hf->bitlen;
 2801|  7.89k|	len_avail = hf->len_avail;
 2802|  7.89k|	hf->tree_used = 0;
 2803|   692k|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (2803:14): [True: 684k, False: 7.89k]
  ------------------
 2804|   684k|		uint16_t *p;
 2805|   684k|		int len, cnt;
 2806|   684k|		uint16_t bit;
 2807|   684k|		int extlen;
 2808|   684k|		struct htree_t *ht;
 2809|       |
 2810|   684k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (2810:7): [True: 573k, False: 111k]
  ------------------
 2811|   573k|			continue;
 2812|       |		/* Get a bit pattern */
 2813|   111k|		len = bitlen[i];
 2814|   111k|		ptn = bitptn[len];
 2815|   111k|		cnt = weight[len];
 2816|   111k|		if (len <= HTBL_BITS) {
  ------------------
  |  |  114|   111k|#define HTBL_BITS	10
  ------------------
  |  Branch (2816:7): [True: 111k, False: 0]
  ------------------
 2817|       |			/* Calculate next bit pattern */
 2818|   111k|			if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (2818:8): [True: 0, False: 111k]
  ------------------
 2819|      0|				return (0);/* Invalid */
 2820|       |			/* Update the table */
 2821|   111k|			p = &(tbl[ptn]);
 2822|   111k|			if (cnt > 7) {
  ------------------
  |  Branch (2822:8): [True: 17.3k, False: 93.8k]
  ------------------
 2823|  17.3k|				uint16_t *pc;
 2824|       |
 2825|  17.3k|				cnt -= 8;
 2826|  17.3k|				pc = &p[cnt];
 2827|  17.3k|				pc[0] = (uint16_t)i;
 2828|  17.3k|				pc[1] = (uint16_t)i;
 2829|  17.3k|				pc[2] = (uint16_t)i;
 2830|  17.3k|				pc[3] = (uint16_t)i;
 2831|  17.3k|				pc[4] = (uint16_t)i;
 2832|  17.3k|				pc[5] = (uint16_t)i;
 2833|  17.3k|				pc[6] = (uint16_t)i;
 2834|  17.3k|				pc[7] = (uint16_t)i;
 2835|  17.3k|				if (cnt > 7) {
  ------------------
  |  Branch (2835:9): [True: 7.61k, False: 9.76k]
  ------------------
 2836|  7.61k|					cnt -= 8;
 2837|  7.61k|					memcpy(&p[cnt], pc,
 2838|  7.61k|						8 * sizeof(uint16_t));
 2839|  7.61k|					pc = &p[cnt];
 2840|  7.63k|					while (cnt > 15) {
  ------------------
  |  Branch (2840:13): [True: 18, False: 7.61k]
  ------------------
 2841|     18|						cnt -= 16;
 2842|     18|						memcpy(&p[cnt], pc,
 2843|     18|							16 * sizeof(uint16_t));
 2844|     18|					}
 2845|  7.61k|				}
 2846|  17.3k|				if (cnt)
  ------------------
  |  Branch (2846:9): [True: 0, False: 17.3k]
  ------------------
 2847|      0|					memcpy(p, pc, cnt * sizeof(uint16_t));
 2848|  93.8k|			} else {
 2849|   190k|				while (cnt > 1) {
  ------------------
  |  Branch (2849:12): [True: 97.0k, False: 93.8k]
  ------------------
 2850|  97.0k|					p[--cnt] = (uint16_t)i;
 2851|  97.0k|					p[--cnt] = (uint16_t)i;
 2852|  97.0k|				}
 2853|  93.8k|				if (cnt)
  ------------------
  |  Branch (2853:9): [True: 16.8k, False: 77.0k]
  ------------------
 2854|  16.8k|					p[--cnt] = (uint16_t)i;
 2855|  93.8k|			}
 2856|   111k|			continue;
 2857|   111k|		}
 2858|       |
 2859|       |		/*
 2860|       |		 * A bit length is too big to be housed to a direct table,
 2861|       |		 * so we use a tree model for its extra bits.
 2862|       |		 */
 2863|      0|		bitptn[len] = ptn + cnt;
 2864|      0|		bit = 1U << (diffbits -1);
 2865|      0|		extlen = len - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2866|       |		
 2867|      0|		p = &(tbl[ptn >> diffbits]);
 2868|      0|		if (*p == 0) {
  ------------------
  |  Branch (2868:7): [True: 0, False: 0]
  ------------------
 2869|      0|			*p = len_avail + hf->tree_used;
 2870|      0|			ht = &(hf->tree[hf->tree_used++]);
 2871|      0|			if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2871:8): [True: 0, False: 0]
  ------------------
 2872|      0|				return (0);/* Invalid */
 2873|      0|			ht->left = 0;
 2874|      0|			ht->right = 0;
 2875|      0|		} else {
 2876|      0|			if (*p < len_avail ||
  ------------------
  |  Branch (2876:8): [True: 0, False: 0]
  ------------------
 2877|      0|			    *p >= (len_avail + hf->tree_used))
  ------------------
  |  Branch (2877:8): [True: 0, False: 0]
  ------------------
 2878|      0|				return (0);/* Invalid */
 2879|      0|			ht = &(hf->tree[*p - len_avail]);
 2880|      0|		}
 2881|      0|		while (--extlen > 0) {
  ------------------
  |  Branch (2881:10): [True: 0, False: 0]
  ------------------
 2882|      0|			if (ptn & bit) {
  ------------------
  |  Branch (2882:8): [True: 0, False: 0]
  ------------------
 2883|      0|				if (ht->left < len_avail) {
  ------------------
  |  Branch (2883:9): [True: 0, False: 0]
  ------------------
 2884|      0|					ht->left = len_avail + hf->tree_used;
 2885|      0|					ht = &(hf->tree[hf->tree_used++]);
 2886|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2886:10): [True: 0, False: 0]
  ------------------
 2887|      0|						return (0);/* Invalid */
 2888|      0|					ht->left = 0;
 2889|      0|					ht->right = 0;
 2890|      0|				} else {
 2891|      0|					ht = &(hf->tree[ht->left - len_avail]);
 2892|      0|				}
 2893|      0|			} else {
 2894|      0|				if (ht->right < len_avail) {
  ------------------
  |  Branch (2894:9): [True: 0, False: 0]
  ------------------
 2895|      0|					ht->right = len_avail + hf->tree_used;
 2896|      0|					ht = &(hf->tree[hf->tree_used++]);
 2897|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2897:10): [True: 0, False: 0]
  ------------------
 2898|      0|						return (0);/* Invalid */
 2899|      0|					ht->left = 0;
 2900|      0|					ht->right = 0;
 2901|      0|				} else {
 2902|      0|					ht = &(hf->tree[ht->right - len_avail]);
 2903|      0|				}
 2904|      0|			}
 2905|      0|			bit >>= 1;
 2906|      0|		}
 2907|      0|		if (ptn & bit) {
  ------------------
  |  Branch (2907:7): [True: 0, False: 0]
  ------------------
 2908|      0|			if (ht->left != 0)
  ------------------
  |  Branch (2908:8): [True: 0, False: 0]
  ------------------
 2909|      0|				return (0);/* Invalid */
 2910|      0|			ht->left = (uint16_t)i;
 2911|      0|		} else {
 2912|      0|			if (ht->right != 0)
  ------------------
  |  Branch (2912:8): [True: 0, False: 0]
  ------------------
 2913|      0|				return (0);/* Invalid */
 2914|      0|			ht->right = (uint16_t)i;
 2915|      0|		}
 2916|      0|	}
 2917|  7.89k|	return (1);
 2918|  7.89k|}
archive_read_support_format_lha.c:lzh_decode_huffman:
 2942|  22.3M|{
 2943|  22.3M|	int c;
 2944|       |	/*
 2945|       |	 * At first search an index table for a bit pattern.
 2946|       |	 * If it fails, search a huffman tree for.
 2947|       |	 */
 2948|  22.3M|	c = hf->tbl[rbits >> hf->shift_bits];
 2949|  22.3M|	if (c < hf->len_avail || hf->len_avail == 0)
  ------------------
  |  Branch (2949:6): [True: 592k, False: 21.7M]
  |  Branch (2949:27): [True: 21.7M, False: 0]
  ------------------
 2950|  22.3M|		return (c);
 2951|       |	/* This bit pattern needs to be found out at a huffman tree. */
 2952|      0|	return (lzh_decode_huffman_tree(hf, rbits, c));
 2953|  22.3M|}
archive_read_support_format_lha.c:lzh_decode_blocks:
 2394|  10.3k|{
 2395|  10.3k|	struct lzh_dec *ds = strm->ds;
 2396|  10.3k|	struct lzh_br bre = ds->br;
 2397|  10.3k|	struct huffman *lt = &(ds->lt);
 2398|  10.3k|	struct huffman *pt = &(ds->pt);
 2399|  10.3k|	unsigned char *w_buff = ds->w_buff;
 2400|  10.3k|	unsigned char *lt_bitlen = lt->bitlen;
 2401|  10.3k|	unsigned char *pt_bitlen = pt->bitlen;
 2402|  10.3k|	int blocks_avail = ds->blocks_avail, c = 0;
 2403|  10.3k|	int copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2404|  10.3k|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2405|  10.3k|	int lt_max_bits = lt->max_bits, pt_max_bits = pt->max_bits;
 2406|  10.3k|	int state = ds->state;
 2407|       |
 2408|  7.19M|	for (;;) {
 2409|  7.19M|		switch (state) {
  ------------------
  |  Branch (2409:11): [True: 7.19M, False: 0]
  ------------------
 2410|  7.18M|		case ST_GET_LITERAL:
  ------------------
  |  | 2124|  7.18M|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2410:3): [True: 7.18M, False: 7.26k]
  ------------------
 2411|  14.9M|			for (;;) {
 2412|  14.9M|				if (blocks_avail == 0) {
  ------------------
  |  Branch (2412:9): [True: 2.20k, False: 14.9M]
  ------------------
 2413|       |					/* We have decoded all blocks.
 2414|       |					 * Let's handle next blocks. */
 2415|  2.20k|					ds->state = ST_RD_BLOCK;
  ------------------
  |  | 2115|  2.20k|#define ST_RD_BLOCK		0
  ------------------
 2416|  2.20k|					ds->br = bre;
 2417|  2.20k|					ds->blocks_avail = 0;
 2418|  2.20k|					ds->w_pos = w_pos;
 2419|  2.20k|					ds->copy_pos = 0;
 2420|  2.20k|					return (100);
 2421|  2.20k|				}
 2422|       |
 2423|       |				/* lzh_br_read_ahead() always tries to fill the
 2424|       |				 * cache buffer up. In specific situation we
 2425|       |				 * are close to the end of the data, the cache
 2426|       |				 * buffer will not be full and thus we have to
 2427|       |				 * determine if the cache buffer has some bits
 2428|       |				 * as much as we need after lzh_br_read_ahead()
 2429|       |				 * failed. */
 2430|  14.9M|				if (!lzh_br_read_ahead(strm, &bre,
  ------------------
  |  | 2001|  14.9M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  29.9M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  29.9M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 14.9M, False: 17.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 15.4k, False: 2.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|  2.34k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 674, False: 1.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2431|  14.9M|				    lt_max_bits)) {
 2432|  1.66k|					if (!last)
  ------------------
  |  Branch (2432:10): [True: 37, False: 1.63k]
  ------------------
 2433|     37|						goto next_data;
 2434|       |					/* Remaining bits are less than
 2435|       |					 * maximum bits(lt.max_bits) but maybe
 2436|       |					 * it still remains as much as we need,
 2437|       |					 * so we should try to use it with
 2438|       |					 * dummy bits. */
 2439|  1.63k|					c = lzh_decode_huffman(lt,
 2440|  1.63k|					      lzh_br_bits_forced(&bre,
  ------------------
  |  | 1988|  1.63k|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1989|  1.63k|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2441|  1.63k|					        lt_max_bits));
 2442|  1.63k|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2004|  1.63k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2443|  1.63k|					if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1982|  1.63k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2443:10): [True: 526, False: 1.10k]
  ------------------
 2444|    526|						goto failed;/* Over read. */
 2445|  14.9M|				} else {
 2446|  14.9M|					c = lzh_decode_huffman(lt,
 2447|  14.9M|					      lzh_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 1985|  14.9M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  14.9M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2448|  14.9M|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2004|  14.9M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2449|  14.9M|				}
 2450|  14.9M|				blocks_avail--;
 2451|  14.9M|				if ((unsigned int)c > UCHAR_MAX)
  ------------------
  |  Branch (2451:9): [True: 7.18M, False: 7.79M]
  ------------------
 2452|       |					/* Current block is a match data. */
 2453|  7.18M|					break;
 2454|       |				/*
 2455|       |				 * 'c' is exactly a literal code.
 2456|       |				 */
 2457|       |				/* Save a decoded code to reference it
 2458|       |				 * afterward. */
 2459|  7.79M|				w_buff[w_pos] = c;
 2460|  7.79M|				if (++w_pos >= w_size) {
  ------------------
  |  Branch (2460:9): [True: 38, False: 7.79M]
  ------------------
 2461|     38|					w_pos = 0;
 2462|     38|					lzh_emit_window(strm, w_size);
 2463|     38|					goto next_data;
 2464|     38|				}
 2465|  7.79M|			}
 2466|       |			/* 'c' is the length of a match pattern we have
 2467|       |			 * already extracted, which has be stored in
 2468|       |			 * window(ds->w_buff). */
 2469|  7.18M|			copy_len = c - (UCHAR_MAX + 1) + MINMATCH;
  ------------------
  |  |   51|  7.18M|#define MINMATCH		3	/* Minimum match length. */
  ------------------
 2470|       |			/* FALL THROUGH */
 2471|  7.18M|		case ST_GET_POS_1:
  ------------------
  |  | 2125|  7.18M|#define ST_GET_POS_1		10
  ------------------
  |  Branch (2471:3): [True: 0, False: 7.19M]
  ------------------
 2472|       |			/*
 2473|       |			 * Get a reference position. 
 2474|       |			 */
 2475|  7.18M|			if (!lzh_br_read_ahead(strm, &bre, pt_max_bits)) {
  ------------------
  |  | 2001|  7.18M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  14.3M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  14.3M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 7.17M, False: 5.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 5.36k, False: 190]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|    190|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 140, False: 50]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2476|     50|				if (!last) {
  ------------------
  |  Branch (2476:9): [True: 16, False: 34]
  ------------------
 2477|     16|					state = ST_GET_POS_1;
  ------------------
  |  | 2125|     16|#define ST_GET_POS_1		10
  ------------------
 2478|     16|					ds->copy_len = copy_len;
 2479|     16|					goto next_data;
 2480|     16|				}
 2481|     34|				copy_pos = lzh_decode_huffman(pt,
 2482|     34|				    lzh_br_bits_forced(&bre, pt_max_bits));
  ------------------
  |  | 1988|     34|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1989|     34|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2483|     34|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 2004|     34|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2484|     34|				if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1982|     34|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2484:9): [True: 24, False: 10]
  ------------------
 2485|     24|					goto failed;/* Over read. */
 2486|  7.18M|			} else {
 2487|  7.18M|				copy_pos = lzh_decode_huffman(pt,
 2488|  7.18M|				    lzh_br_bits(&bre, pt_max_bits));
  ------------------
  |  | 1985|  7.18M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  7.18M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2489|  7.18M|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 2004|  7.18M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2490|  7.18M|			}
 2491|       |			/* FALL THROUGH */
 2492|  7.18M|		case ST_GET_POS_2:
  ------------------
  |  | 2126|  7.18M|#define ST_GET_POS_2		11
  ------------------
  |  Branch (2492:3): [True: 0, False: 7.19M]
  ------------------
 2493|  7.18M|			if (copy_pos > 1) {
  ------------------
  |  Branch (2493:8): [True: 48.6k, False: 7.13M]
  ------------------
 2494|       |				/* We need an additional adjustment number to
 2495|       |				 * the position. */
 2496|  48.6k|				int p = copy_pos - 1;
 2497|  48.6k|				if (!lzh_br_read_ahead(strm, &bre, p)) {
  ------------------
  |  | 2001|  48.6k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1996|  97.2k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1982|  97.2k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1982:27): [True: 46.2k, False: 2.36k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1996:26): [True: 2.29k, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1982|     67|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:27): [True: 24, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2498|     43|					if (last)
  ------------------
  |  Branch (2498:10): [True: 30, False: 13]
  ------------------
 2499|     30|						goto failed;/* Truncated data.*/
 2500|     13|					state = ST_GET_POS_2;
  ------------------
  |  | 2126|     13|#define ST_GET_POS_2		11
  ------------------
 2501|     13|					ds->copy_len = copy_len;
 2502|     13|					ds->copy_pos = copy_pos;
 2503|     13|					goto next_data;
 2504|     43|				}
 2505|  48.6k|				copy_pos = (1 << p) + lzh_br_bits(&bre, p);
  ------------------
  |  | 1985|  48.6k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1986|  48.6k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2506|  48.6k|				lzh_br_consume(&bre, p);
  ------------------
  |  | 2004|  48.6k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2507|  48.6k|			}
 2508|       |			/* The position is actually a distance from the last
 2509|       |			 * code we had extracted and thus we have to convert
 2510|       |			 * it to a position of the window. */
 2511|  7.18M|			copy_pos = (w_pos - copy_pos - 1) & w_mask;
 2512|       |			/* FALL THROUGH */
 2513|  7.19M|		case ST_COPY_DATA:
  ------------------
  |  | 2127|  7.19M|#define ST_COPY_DATA		12
  ------------------
  |  Branch (2513:3): [True: 7.26k, False: 7.18M]
  ------------------
 2514|       |			/*
 2515|       |			 * Copy `copy_len' bytes as extracted data from
 2516|       |			 * the window into the output buffer.
 2517|       |			 */
 2518|  7.19M|			for (;;) {
 2519|  7.19M|				int l;
 2520|       |
 2521|  7.19M|				l = copy_len;
 2522|  7.19M|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2522:9): [True: 9.84k, False: 7.18M]
  ------------------
 2523|  9.84k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2523:10): [True: 8.06k, False: 1.78k]
  ------------------
 2524|  8.06k|						l = w_size - copy_pos;
 2525|  7.18M|				} else {
 2526|  7.18M|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2526:10): [True: 7.26k, False: 7.18M]
  ------------------
 2527|  7.26k|						l = w_size - w_pos;
 2528|  7.18M|				}
 2529|  7.19M|				if ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2529:9): [True: 7.82k, False: 7.19M]
  ------------------
 2530|  7.19M|				    || (w_pos + l < copy_pos)) {
  ------------------
  |  Branch (2530:12): [True: 9.84k, False: 7.18M]
  ------------------
 2531|       |					/* No overlap. */
 2532|  17.6k|					memcpy(w_buff + w_pos,
 2533|  17.6k|					    w_buff + copy_pos, l);
 2534|  7.18M|				} else {
 2535|  7.18M|					const unsigned char *s;
 2536|  7.18M|					unsigned char *d;
 2537|  7.18M|					int li;
 2538|       |
 2539|  7.18M|					d = w_buff + w_pos;
 2540|  7.18M|					s = w_buff + copy_pos;
 2541|   495M|					for (li = 0; li < l-1;) {
  ------------------
  |  Branch (2541:19): [True: 487M, False: 7.18M]
  ------------------
 2542|   487M|						d[li] = s[li];li++;
 2543|   487M|						d[li] = s[li];li++;
 2544|   487M|					}
 2545|  7.18M|					if (li < l)
  ------------------
  |  Branch (2545:10): [True: 6.99M, False: 189k]
  ------------------
 2546|  6.99M|						d[li] = s[li];
 2547|  7.18M|				}
 2548|  7.19M|				w_pos += l;
 2549|  7.19M|				if (w_pos == w_size) {
  ------------------
  |  Branch (2549:9): [True: 7.43k, False: 7.19M]
  ------------------
 2550|  7.43k|					w_pos = 0;
 2551|  7.43k|					lzh_emit_window(strm, w_size);
 2552|  7.43k|					if (copy_len <= l)
  ------------------
  |  Branch (2552:10): [True: 163, False: 7.26k]
  ------------------
 2553|    163|						state = ST_GET_LITERAL;
  ------------------
  |  | 2124|    163|#define ST_GET_LITERAL		9
  ------------------
 2554|  7.26k|					else {
 2555|  7.26k|						state = ST_COPY_DATA;
  ------------------
  |  | 2127|  7.26k|#define ST_COPY_DATA		12
  ------------------
 2556|  7.26k|						ds->copy_len = copy_len - l;
 2557|  7.26k|						ds->copy_pos =
 2558|  7.26k|						    (copy_pos + l) & w_mask;
 2559|  7.26k|					}
 2560|  7.43k|					goto next_data;
 2561|  7.43k|				}
 2562|  7.19M|				if (copy_len <= l)
  ------------------
  |  Branch (2562:9): [True: 7.18M, False: 8.06k]
  ------------------
 2563|       |					/* A copy of current pattern ended. */
 2564|  7.18M|					break;
 2565|  8.06k|				copy_len -= l;
 2566|  8.06k|				copy_pos = (copy_pos + l) & w_mask;
 2567|  8.06k|			}
 2568|  7.18M|			state = ST_GET_LITERAL;
  ------------------
  |  | 2124|  7.18M|#define ST_GET_LITERAL		9
  ------------------
 2569|  7.18M|			break;
 2570|  7.19M|		}
 2571|  7.19M|	}
 2572|    580|failed:
 2573|    580|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  238|    580|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2574|  7.53k|next_data:
 2575|  7.53k|	ds->br = bre;
 2576|  7.53k|	ds->blocks_avail = blocks_avail;
 2577|  7.53k|	ds->state = state;
 2578|  7.53k|	ds->w_pos = w_pos;
 2579|  7.53k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  7.53k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2580|  10.3k|}
archive_read_support_format_lha.c:lha_read_data_none:
 1516|    237|{
 1517|    237|	struct lha *lha = a->format->data;
 1518|    237|	ssize_t bytes_avail;
 1519|       |
 1520|    237|	if (lha->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1520:6): [True: 0, False: 237]
  ------------------
 1521|      0|		*buff = NULL;
 1522|      0|		*size = 0;
 1523|      0|		*offset = lha->entry_offset;
 1524|      0|		lha->end_of_entry = 1;
 1525|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1526|      0|	}
 1527|       |	/*
 1528|       |	 * Note: '1' here is a performance optimization.
 1529|       |	 * Recall that the decompression layer returns a count of
 1530|       |	 * available bytes; asking for more than that forces the
 1531|       |	 * decompressor to combine reads by copying data.
 1532|       |	 */
 1533|    237|	*buff = __archive_read_ahead(a, 1, &bytes_avail);
 1534|    237|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1534:6): [True: 38, False: 199]
  ------------------
 1535|     38|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     38|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1536|     38|		    "Truncated LHa file data");
 1537|     38|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     38|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|     38|	}
 1539|    199|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1539:6): [True: 161, False: 38]
  ------------------
 1540|    161|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1541|    199|	lha->entry_crc_calculated =
 1542|    199|	    lha_crc16(lha->entry_crc_calculated, *buff, bytes_avail);
 1543|    199|	*size = bytes_avail;
 1544|    199|	*offset = lha->entry_offset;
 1545|    199|	lha->entry_offset += bytes_avail;
 1546|    199|	lha->entry_bytes_remaining -= bytes_avail;
 1547|    199|	if (lha->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1547:6): [True: 161, False: 38]
  ------------------
 1548|    161|		lha->end_of_entry = 1;
 1549|    199|	lha->entry_unconsumed = bytes_avail;
 1550|    199|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    199|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1551|    237|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data_skip:
 1664|  4.43k|{
 1665|  4.43k|	struct lha *lha = a->format->data;
 1666|  4.43k|	int64_t bytes_skipped;
 1667|       |
 1668|  4.43k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1668:6): [True: 0, False: 4.43k]
  ------------------
 1669|       |		/* Consume as much as the decompressor actually used. */
 1670|      0|		__archive_read_consume(a, lha->entry_unconsumed);
 1671|      0|		lha->entry_unconsumed = 0;
 1672|      0|	}
 1673|       |
 1674|       |	/* if we've already read to end of data, we're done. */
 1675|  4.43k|	if (lha->end_of_entry_cleanup)
  ------------------
  |  Branch (1675:6): [True: 980, False: 3.45k]
  ------------------
 1676|    980|		return (ARCHIVE_OK);
  ------------------
  |  |  234|    980|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1677|       |
 1678|       |	/*
 1679|       |	 * If the length is at the beginning, we can skip the
 1680|       |	 * compressed data much more quickly.
 1681|       |	 */
 1682|  3.45k|	bytes_skipped = __archive_read_consume(a, lha->entry_bytes_remaining);
 1683|  3.45k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1683:6): [True: 99, False: 3.35k]
  ------------------
 1684|     99|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     99|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1685|       |
 1686|       |	/* This entry is finished and done. */
 1687|  3.35k|	lha->end_of_entry_cleanup = lha->end_of_entry = 1;
 1688|  3.35k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  3.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1689|  3.45k|}
archive_read_support_format_lha.c:archive_read_format_lha_cleanup:
 1693|  20.1k|{
 1694|  20.1k|	struct lha *lha = a->format->data;
 1695|       |
 1696|  20.1k|	lzh_decode_free(&(lha->strm));
 1697|  20.1k|	archive_string_free(&(lha->dirname));
 1698|  20.1k|	archive_string_free(&(lha->filename));
 1699|  20.1k|	archive_string_free(&(lha->uname));
 1700|  20.1k|	archive_string_free(&(lha->gname));
 1701|  20.1k|	archive_wstring_free(&(lha->ws));
 1702|  20.1k|	free(lha);
 1703|  20.1k|	a->format->data = NULL;
 1704|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1705|  20.1k|}
archive_read_support_format_lha.c:lzh_decode_free:
 1967|  20.1k|{
 1968|       |
 1969|  20.1k|	if (strm->ds == NULL)
  ------------------
  |  Branch (1969:6): [True: 19.7k, False: 379]
  ------------------
 1970|  19.7k|		return;
 1971|    379|	free(strm->ds->w_buff);
 1972|    379|	lzh_huffman_free(&(strm->ds->lt));
 1973|    379|	lzh_huffman_free(&(strm->ds->pt));
 1974|    379|	free(strm->ds);
 1975|       |	strm->ds = NULL;
 1976|    379|}
archive_read_support_format_lha.c:lzh_huffman_free:
 2614|    758|{
 2615|    758|	free(hf->bitlen);
 2616|    758|	free(hf->tbl);
 2617|    758|	free(hf->tree);
 2618|    758|}

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

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

archive_read_support_format_rar5:
 4663|  20.1k|int archive_read_support_format_rar5(struct archive *_a) {
 4664|  20.1k|	struct archive_read* ar = (struct archive_read*)_a;
 4665|  20.1k|	struct rar5 *rar5;
 4666|  20.1k|	int r;
 4667|       |
 4668|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
 4669|  20.1k|	    "archive_read_support_format_rar5");
 4670|       |
 4671|  20.1k|	rar5 = malloc(sizeof(*rar5));
 4672|  20.1k|	if(rar5 == NULL) {
  ------------------
  |  Branch (4672:5): [True: 0, False: 20.1k]
  ------------------
 4673|      0|		archive_set_error(&ar->archive, ENOMEM,
 4674|      0|		    "Can't allocate rar5 data");
 4675|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4676|      0|	}
 4677|       |
 4678|  20.1k|	if(ARCHIVE_OK != rar5_init(rar5)) {
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4678:5): [True: 0, False: 20.1k]
  ------------------
 4679|      0|		archive_set_error(&ar->archive, ENOMEM,
 4680|      0|		    "Can't allocate rar5 filter buffer");
 4681|      0|		free(rar5);
 4682|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4683|      0|	}
 4684|       |
 4685|  20.1k|	r = __archive_read_register_format(ar,
 4686|  20.1k|	    rar5,
 4687|  20.1k|	    "rar5",
 4688|  20.1k|	    rar5_bid,
 4689|  20.1k|	    rar5_options,
 4690|  20.1k|	    rar5_read_header,
 4691|  20.1k|	    rar5_read_data,
 4692|  20.1k|	    rar5_read_data_skip,
 4693|  20.1k|	    rar5_seek_data,
 4694|  20.1k|	    rar5_cleanup,
 4695|  20.1k|	    rar5_capabilities,
 4696|  20.1k|	    rar5_has_encrypted_entries);
 4697|       |
 4698|  20.1k|	if(r != ARCHIVE_OK) {
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4698:5): [True: 0, False: 20.1k]
  ------------------
 4699|      0|		rar5_deinit(rar5);
 4700|      0|		free(rar5);
 4701|      0|	}
 4702|  20.1k|	return r;
 4703|  20.1k|}
archive_read_support_format_rar5.c:rar5_init:
 4643|  20.1k|static int rar5_init(struct rar5 *rar5) {
 4644|  20.1k|	memset(rar5, 0, sizeof(struct rar5));
 4645|       |
 4646|  20.1k|	if(CDE_OK != cdeque_init(&rar5->cstate.filters, 8192))
  ------------------
  |  Branch (4646:5): [True: 0, False: 20.1k]
  ------------------
 4647|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4648|       |
 4649|       |	/*
 4650|       |	 * Until enough data has been read, we cannot tell about
 4651|       |	 * any encrypted entries yet.
 4652|       |	 */
 4653|  20.1k|	rar5->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|  20.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4654|       |
 4655|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4656|  20.1k|}
archive_read_support_format_rar5.c:cdeque_init:
  409|  20.1k|static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) {
  410|  20.1k|	if(d == NULL || max_capacity_power_of_2 == 0)
  ------------------
  |  Branch (410:5): [True: 0, False: 20.1k]
  |  Branch (410:18): [True: 0, False: 20.1k]
  ------------------
  411|      0|		return CDE_PARAM;
  412|       |
  413|  20.1k|	d->cap_mask = max_capacity_power_of_2 - 1;
  414|  20.1k|	d->arr = NULL;
  415|       |
  416|  20.1k|	if((max_capacity_power_of_2 & d->cap_mask) != 0)
  ------------------
  |  Branch (416:5): [True: 0, False: 20.1k]
  ------------------
  417|      0|		return CDE_PARAM;
  418|       |
  419|  20.1k|	cdeque_clear(d);
  420|  20.1k|	d->arr = malloc(sizeof(size_t*) * max_capacity_power_of_2);
  421|       |
  422|  20.1k|	return d->arr ? CDE_OK : CDE_ALLOC;
  ------------------
  |  Branch (422:9): [True: 20.1k, False: 0]
  ------------------
  423|  20.1k|}
archive_read_support_format_rar5.c:cdeque_clear:
  400|  59.4k|static void cdeque_clear(struct cdeque* d) {
  401|  59.4k|	d->size = 0;
  402|  59.4k|	d->beg_pos = 0;
  403|  59.4k|	d->end_pos = 0;
  404|  59.4k|}
archive_read_support_format_rar5.c:rar5_bid:
 1204|  19.8k|static int rar5_bid(struct archive_read* a, int best_bid) {
 1205|  19.8k|	int my_bid;
 1206|       |
 1207|  19.8k|	if(best_bid >= RAR5_SIGNATURE_BID)
  ------------------
  |  |   96|  19.8k|#define RAR5_SIGNATURE_BID ((int)(8 * sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1207:5): [True: 3.46k, False: 16.3k]
  ------------------
 1208|  3.46k|		return -1;
 1209|       |
 1210|  16.3k|	my_bid = bid_standard(a);
 1211|  16.3k|	if(my_bid > -1) {
  ------------------
  |  Branch (1211:5): [True: 2.36k, False: 13.9k]
  ------------------
 1212|  2.36k|		return my_bid;
 1213|  2.36k|	}
 1214|  13.9k|	my_bid = bid_sfx(a);
 1215|  13.9k|	if (my_bid > -1) {
  ------------------
  |  Branch (1215:6): [True: 13.8k, False: 130]
  ------------------
 1216|  13.8k|		return my_bid;
 1217|  13.8k|	}
 1218|       |
 1219|    130|	return -1;
 1220|  13.9k|}
archive_read_support_format_rar5.c:bid_standard:
 1148|  16.3k|static int bid_standard(struct archive_read* a) {
 1149|  16.3k|	const uint8_t* h;
 1150|  16.3k|	char signature[sizeof(rar5_signature_xor)];
 1151|       |
 1152|  16.3k|	rar5_signature(signature);
 1153|       |
 1154|  16.3k|	if(!read_ahead(a, sizeof(rar5_signature_xor), &h))
  ------------------
  |  Branch (1154:5): [True: 130, False: 16.2k]
  ------------------
 1155|    130|		return -1;
 1156|       |
 1157|  16.2k|	if(!memcmp(h, signature, sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1157:5): [True: 2.36k, False: 13.8k]
  ------------------
 1158|  2.36k|		return RAR5_SIGNATURE_BID;
  ------------------
  |  |   96|  2.36k|#define RAR5_SIGNATURE_BID ((int)(8 * sizeof(rar5_signature_xor)))
  ------------------
 1159|       |
 1160|  13.8k|	return -1;
 1161|  16.2k|}
archive_read_support_format_rar5.c:rar5_signature:
 4458|  33.1k|static void rar5_signature(char *buf) {
 4459|  33.1k|		size_t i;
 4460|       |
 4461|   298k|		for(i = 0; i < sizeof(rar5_signature_xor); i++) {
  ------------------
  |  Branch (4461:14): [True: 265k, False: 33.1k]
  ------------------
 4462|   265k|			buf[i] = rar5_signature_xor[i] ^ 0xA1;
 4463|   265k|		}
 4464|  33.1k|}
archive_read_support_format_rar5.c:read_ahead:
  907|   284k|{
  908|   284k|	if(!ptr)
  ------------------
  |  Branch (908:5): [True: 0, False: 284k]
  ------------------
  909|      0|		return 0;
  910|       |
  911|   284k|	*ptr = __archive_read_ahead(a, how_many, NULL);
  912|   284k|	if(*ptr == NULL) {
  ------------------
  |  Branch (912:5): [True: 2.68k, False: 282k]
  ------------------
  913|  2.68k|		return 0;
  914|  2.68k|	}
  915|       |
  916|   282k|	return 1;
  917|   284k|}
archive_read_support_format_rar5.c:bid_sfx:
 1164|  13.9k|{
 1165|  13.9k|	const char *h;
 1166|       |
 1167|  13.9k|	if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1167:6): [True: 130, False: 13.8k]
  ------------------
 1168|    130|		return -1;
 1169|       |
 1170|  13.8k|	if ((h[0] == 'M' && h[1] == 'Z') || memcmp(h, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (1170:7): [True: 573, False: 13.2k]
  |  Branch (1170:22): [True: 455, False: 118]
  |  Branch (1170:38): [True: 286, False: 13.1k]
  ------------------
 1171|       |		/* This is a PE file */
 1172|    741|		char signature[sizeof(rar5_signature_xor)];
 1173|    741|		ssize_t offset = 0x10000;
 1174|    741|		ssize_t window = 4096;
 1175|       |
 1176|    741|		rar5_signature(signature);
 1177|       |
 1178|    840|		while (offset + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  164|    840|#define	SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  |  Branch (1178:10): [True: 817, False: 23]
  ------------------
 1179|    817|			ssize_t bytes_avail;
 1180|       |
 1181|    817|			h = __archive_read_ahead(a, offset + window, &bytes_avail);
 1182|    817|			if (h == NULL) {
  ------------------
  |  Branch (1182:8): [True: 725, False: 92]
  ------------------
 1183|    725|				if (bytes_avail >= offset + 0x10) {
  ------------------
  |  Branch (1183:9): [True: 20, False: 705]
  ------------------
 1184|       |					/* Remaining bytes are less than window. */
 1185|     20|					window = bytes_avail - offset;
 1186|     20|					continue;
 1187|     20|				}
 1188|    705|				return 0;
 1189|    725|			}
 1190|     92|			if (bytes_avail > SFX_MAX_READAHEAD)
  ------------------
  |  |  164|     92|#define	SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  |  Branch (1190:8): [True: 11, False: 81]
  ------------------
 1191|     11|				bytes_avail = SFX_MAX_READAHEAD;
  ------------------
  |  |  164|     11|#define	SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
 1192|  1.04M|			while (offset <= bytes_avail - 8) {
  ------------------
  |  Branch (1192:11): [True: 1.04M, False: 79]
  ------------------
 1193|  1.04M|				if (memcmp(h + offset, signature,
  ------------------
  |  Branch (1193:9): [True: 13, False: 1.04M]
  ------------------
 1194|  1.04M|				    sizeof(signature)) == 0)
 1195|     13|					return 30;
 1196|  1.04M|				offset += 0x10;
 1197|  1.04M|			}
 1198|     92|		}
 1199|    741|	}
 1200|       |
 1201|  13.1k|	return 0;
 1202|  13.8k|}
archive_read_support_format_rar5.c:rar5_read_header:
 2700|  10.8k|{
 2701|  10.8k|	struct rar5 *rar5 = a->format->data;
 2702|  10.8k|	int ret;
 2703|       |
 2704|       |	/*
 2705|       |	 * It should be sufficient to call archive_read_next_header() for
 2706|       |	 * a reader to determine if an entry is encrypted or not.
 2707|       |	 */
 2708|  10.8k|	if (rar5->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  416|  10.8k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (2708:6): [True: 2.37k, False: 8.51k]
  ------------------
 2709|  2.37k|		rar5->has_encrypted_entries = 0;
 2710|  2.37k|	}
 2711|       |
 2712|  10.8k|	if(rar5->header_initialized == 0) {
  ------------------
  |  Branch (2712:5): [True: 2.37k, False: 8.51k]
  ------------------
 2713|  2.37k|		init_header(a);
 2714|  2.37k|		if ((ret = try_skip_sfx(a)) < ARCHIVE_WARN)
  ------------------
  |  |  236|  2.37k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2714:7): [True: 0, False: 2.37k]
  ------------------
 2715|      0|			return ret;
 2716|  2.37k|		rar5->header_initialized = 1;
 2717|  2.37k|	}
 2718|       |
 2719|  10.8k|	if(rar5->skipped_magic == 0) {
  ------------------
  |  Branch (2719:5): [True: 2.37k, False: 8.51k]
  ------------------
 2720|  2.37k|		if(ARCHIVE_OK != consume(a, sizeof(rar5_signature_xor))) {
  ------------------
  |  |  234|  2.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2720:6): [True: 0, False: 2.37k]
  ------------------
 2721|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2722|      0|		}
 2723|       |
 2724|  2.37k|		rar5->skipped_magic = 1;
 2725|  2.37k|	}
 2726|       |
 2727|  20.5k|	do {
 2728|  20.5k|		ret = process_base_block(a, entry);
 2729|  20.5k|	} while(ret == ARCHIVE_RETRY ||
  ------------------
  |  |  235|  41.1k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (2729:10): [True: 4.88k, False: 15.6k]
  ------------------
 2730|  15.6k|			(rar5->main.endarc > 0 && ret == ARCHIVE_OK));
  ------------------
  |  |  234|  4.84k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2730:5): [True: 4.84k, False: 10.8k]
  |  Branch (2730:30): [True: 4.80k, False: 39]
  ------------------
 2731|       |
 2732|  10.8k|	return ret;
 2733|  10.8k|}
archive_read_support_format_rar5.c:init_header:
 1235|  2.37k|static void init_header(struct archive_read* a) {
 1236|  2.37k|	a->archive.archive_format = ARCHIVE_FORMAT_RAR_V5;
  ------------------
  |  |  392|  2.37k|#define	ARCHIVE_FORMAT_RAR_V5			0x100000
  ------------------
 1237|  2.37k|	a->archive.archive_format_name = "RAR5";
 1238|  2.37k|}
archive_read_support_format_rar5.c:try_skip_sfx:
 2643|  2.37k|{
 2644|  2.37k|	const char *p;
 2645|       |
 2646|  2.37k|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (2646:6): [True: 0, False: 2.37k]
  ------------------
 2647|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2648|       |
 2649|  2.37k|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (2649:7): [True: 7, False: 2.36k]
  |  Branch (2649:22): [True: 7, False: 0]
  |  Branch (2649:38): [True: 5, False: 2.36k]
  ------------------
 2650|     12|	{
 2651|     12|		char signature[sizeof(rar5_signature_xor)];
 2652|     12|		const void *h;
 2653|     12|		const char *q;
 2654|     12|		size_t skip, total = 0;
 2655|     12|		ssize_t bytes, window = 4096;
 2656|       |
 2657|     12|		rar5_signature(signature);
 2658|       |
 2659|     12|		while (total + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  164|     12|#define	SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  |  Branch (2659:10): [True: 12, False: 0]
  ------------------
 2660|     12|			h = __archive_read_ahead(a, window, &bytes);
 2661|     12|			if (h == NULL) {
  ------------------
  |  Branch (2661:8): [True: 0, False: 12]
  ------------------
 2662|       |				/* Remaining bytes are less than window. */
 2663|      0|				window >>= 1;
 2664|      0|				if (window < 0x40)
  ------------------
  |  Branch (2664:9): [True: 0, False: 0]
  ------------------
 2665|      0|					goto fatal;
 2666|      0|				continue;
 2667|      0|			}
 2668|     12|			if (bytes < 0x40)
  ------------------
  |  Branch (2668:8): [True: 0, False: 12]
  ------------------
 2669|      0|				goto fatal;
 2670|     12|			p = h;
 2671|     12|			q = p + bytes;
 2672|       |
 2673|       |			/*
 2674|       |			 * Scan ahead until we find something that looks
 2675|       |			 * like the RAR header.
 2676|       |			 */
 2677|  20.0k|			while (p + 8 < q) {
  ------------------
  |  Branch (2677:11): [True: 20.0k, False: 0]
  ------------------
 2678|  20.0k|				if (memcmp(p, signature, sizeof(signature)) == 0) {
  ------------------
  |  Branch (2678:9): [True: 12, False: 20.0k]
  ------------------
 2679|     12|					skip = p - (const char *)h;
 2680|     12|					__archive_read_consume(a, skip);
 2681|     12|					return (ARCHIVE_OK);
  ------------------
  |  |  234|     12|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2682|     12|				}
 2683|  20.0k|				p += 0x10;
 2684|  20.0k|			}
 2685|      0|			skip = p - (const char *)h;
 2686|      0|			__archive_read_consume(a, skip);
 2687|      0|			total += skip;
 2688|      0|		}
 2689|     12|	}
 2690|       |
 2691|  2.36k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  2.36k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2692|      0|fatal:
 2693|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2694|      0|			"Couldn't find out RAR header");
 2695|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2696|  2.37k|}
archive_read_support_format_rar5.c:consume:
  919|   715k|static int consume(struct archive_read* a, int64_t how_many) {
  920|   715k|	if(__archive_read_consume(a, how_many) < 0)
  ------------------
  |  Branch (920:5): [True: 467, False: 714k]
  ------------------
  921|    467|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    467|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  922|       |
  923|   714k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|   714k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  924|   715k|}
archive_read_support_format_rar5.c:process_base_block:
 2432|  56.2k|{
 2433|  56.2k|	const size_t SMALLEST_RAR5_BLOCK_SIZE = 3;
 2434|       |
 2435|  56.2k|	struct rar5 *rar5 = a->format->data;
 2436|  56.2k|	uint32_t hdr_crc, computed_crc;
 2437|  56.2k|	size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
 2438|  56.2k|	size_t header_id = 0;
 2439|  56.2k|	size_t header_flags = 0;
 2440|  56.2k|	const uint8_t* p;
 2441|  56.2k|	const uint8_t* body_start;
 2442|  56.2k|	int ret;
 2443|       |
 2444|  56.2k|	enum HEADER_TYPE {
 2445|  56.2k|		HEAD_MARK    = 0x00, HEAD_MAIN  = 0x01, HEAD_FILE   = 0x02,
 2446|  56.2k|		HEAD_SERVICE = 0x03, HEAD_CRYPT = 0x04, HEAD_ENDARC = 0x05,
 2447|  56.2k|		HEAD_UNKNOWN = 0xff,
 2448|  56.2k|	};
 2449|       |
 2450|       |	/* Skip any unprocessed data for this file. */
 2451|  56.2k|	ret = skip_unprocessed_bytes(a);
 2452|  56.2k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  56.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2452:5): [True: 8.84k, False: 47.4k]
  ------------------
 2453|  8.84k|		return ret;
 2454|       |
 2455|       |	/* Read the expected CRC32 checksum. */
 2456|  47.4k|	if(!read_u32(a, &hdr_crc)) {
  ------------------
  |  Branch (2456:5): [True: 140, False: 47.3k]
  ------------------
 2457|    140|		return ARCHIVE_EOF;
  ------------------
  |  |  233|    140|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2458|    140|	}
 2459|       |
 2460|       |	/* Read header size. */
 2461|  47.3k|	ret = read_var_sized(a, &raw_hdr_size, &hdr_size_len);
 2462|  47.3k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  47.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2462:5): [True: 115, False: 47.2k]
  ------------------
 2463|    115|		return ret;
 2464|    115|	}
 2465|       |
 2466|       |	/* Sanity check.  Bounding raw_hdr_size (instead of the sum) also
 2467|       |	 * ensures that adding hdr_size_len below cannot wrap hdr_size
 2468|       |	 * around SIZE_MAX. */
 2469|  47.2k|	if(raw_hdr_size > MAX_HEADER_SIZE - hdr_size_len) {
  ------------------
  |  |  104|  47.2k|#define MAX_HEADER_SIZE (2 * 1024 * 1024)
  ------------------
  |  Branch (2469:5): [True: 44, False: 47.1k]
  ------------------
 2470|     44|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     44|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2471|     44|		    "Base block header is too large");
 2472|       |
 2473|     44|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     44|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2474|     44|	}
 2475|       |
 2476|  47.1k|	hdr_size = raw_hdr_size + hdr_size_len;
 2477|       |
 2478|       |	/* Additional sanity checks to weed out invalid files. */
 2479|  47.1k|	if(raw_hdr_size == 0 || hdr_size_len == 0 ||
  ------------------
  |  Branch (2479:5): [True: 92, False: 47.0k]
  |  Branch (2479:26): [True: 0, False: 47.0k]
  ------------------
 2480|  47.0k|		hdr_size < SMALLEST_RAR5_BLOCK_SIZE)
  ------------------
  |  Branch (2480:3): [True: 17, False: 47.0k]
  ------------------
 2481|    109|	{
 2482|    109|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    109|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2483|    109|		    "Too small block encountered (%zu bytes)",
 2484|    109|		    raw_hdr_size);
 2485|       |
 2486|    109|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|    109|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2487|    109|	}
 2488|       |
 2489|       |	/* Read the whole header data into memory, maximum memory use here is
 2490|       |	 * 2MB. */
 2491|  47.0k|	if(!read_ahead(a, hdr_size, &p)) {
  ------------------
  |  Branch (2491:5): [True: 353, False: 46.6k]
  ------------------
 2492|    353|		return ARCHIVE_EOF;
  ------------------
  |  |  233|    353|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2493|    353|	}
 2494|       |
 2495|       |	/* Verify the CRC32 of the header data. */
 2496|  46.6k|	computed_crc = __archive_crc32(0, p, hdr_size);
 2497|  46.6k|	if(computed_crc != hdr_crc) {
  ------------------
  |  Branch (2497:5): [True: 45.3k, False: 1.35k]
  ------------------
 2498|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2499|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2500|       |		    "Header CRC error");
 2501|       |
 2502|       |		return ARCHIVE_FATAL;
 2503|       |#endif
 2504|  45.3k|	}
 2505|       |
 2506|       |	/* Remember the first byte of the block body so we can later skip
 2507|       |	 * any bytes the sub-parser leaves unconsumed. */
 2508|  46.6k|	body_start = p + hdr_size_len;
 2509|       |
 2510|       |	/* If the checksum is OK, we proceed with parsing. */
 2511|  46.6k|	if(ARCHIVE_OK != consume(a, hdr_size_len)) {
  ------------------
  |  |  234|  46.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2511:5): [True: 0, False: 46.6k]
  ------------------
 2512|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2513|      0|	}
 2514|       |
 2515|  46.6k|	ret = read_var_sized(a, &header_id, NULL);
 2516|  46.6k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  46.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2516:5): [True: 3, False: 46.6k]
  ------------------
 2517|      3|		return ret;
 2518|       |
 2519|  46.6k|	ret = read_var_sized(a, &header_flags, NULL);
 2520|  46.6k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  46.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2520:5): [True: 6, False: 46.6k]
  ------------------
 2521|      6|		return ret;
 2522|       |
 2523|  46.6k|	rar5->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
 2524|  46.6k|	rar5->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
 2525|  46.6k|	rar5->generic.size = (int)hdr_size;
 2526|  46.6k|	rar5->generic.last_header_id = (int)header_id;
 2527|  46.6k|	rar5->main.endarc = 0;
 2528|       |
 2529|       |	/* Those are possible header ids in RARv5. */
 2530|  46.6k|	switch(header_id) {
 2531|  3.51k|		case HEAD_MAIN:
  ------------------
  |  Branch (2531:3): [True: 3.51k, False: 43.1k]
  ------------------
 2532|  3.51k|			ret = process_head_main(a, rar5, entry, header_flags);
 2533|       |
 2534|       |			/* Main header doesn't have any files in it, so it's
 2535|       |			 * pointless to return to the caller. Retry to next
 2536|       |			 * header, which should be HEAD_FILE/HEAD_SERVICE. */
 2537|  3.51k|			if(ret == ARCHIVE_OK) {
  ------------------
  |  |  234|  3.51k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2537:7): [True: 3.44k, False: 63]
  ------------------
 2538|  3.44k|				rar5_skip_remaining_block(a, body_start,
 2539|  3.44k|				    raw_hdr_size);
 2540|  3.44k|				return ARCHIVE_RETRY;
  ------------------
  |  |  235|  3.44k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2541|  3.44k|			}
 2542|       |
 2543|     63|			return ret;
 2544|  1.66k|		case HEAD_SERVICE:
  ------------------
  |  Branch (2544:3): [True: 1.66k, False: 45.0k]
  ------------------
 2545|  1.66k|			ret = process_head_service(a, rar5, entry, header_flags);
 2546|  1.66k|			return ret;
 2547|  22.6k|		case HEAD_FILE:
  ------------------
  |  Branch (2547:3): [True: 22.6k, False: 24.0k]
  ------------------
 2548|  22.6k|			ret = process_head_file(a, rar5, entry, header_flags);
 2549|  22.6k|			return ret;
 2550|     11|		case HEAD_CRYPT:
  ------------------
  |  Branch (2550:3): [True: 11, False: 46.6k]
  ------------------
 2551|     11|			archive_entry_set_is_metadata_encrypted(entry, 1);
 2552|     11|			archive_entry_set_is_data_encrypted(entry, 1);
 2553|     11|			rar5->has_encrypted_entries = 1;
 2554|     11|			rar5->headers_are_encrypted = 1;
 2555|     11|			archive_set_error(&a->archive,
 2556|     11|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     11|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2557|     11|			    "Encryption is not supported");
 2558|     11|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2559|  16.0k|		case HEAD_ENDARC:
  ------------------
  |  Branch (2559:3): [True: 16.0k, False: 30.6k]
  ------------------
 2560|  16.0k|			rar5->main.endarc = 1;
 2561|       |
 2562|       |			/* After encountering an end of file marker, we need
 2563|       |			 * to take into consideration if this archive is
 2564|       |			 * continued in another file (i.e. is it part01.rar:
 2565|       |			 * is there a part02.rar?) */
 2566|  16.0k|			if(rar5->main.volume) {
  ------------------
  |  Branch (2566:7): [True: 16.0k, False: 21]
  ------------------
 2567|       |				/* In case there is part02.rar, position the
 2568|       |				 * read pointer in a proper place, so we can
 2569|       |				 * resume parsing. */
 2570|  16.0k|				ret = scan_for_signature(a);
 2571|  16.0k|				if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  240|  16.0k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2571:8): [True: 0, False: 16.0k]
  ------------------
 2572|      0|					return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2573|  16.0k|				} else {
 2574|  16.0k|					if(rar5->vol.expected_vol_no ==
  ------------------
  |  Branch (2574:9): [True: 1, False: 16.0k]
  ------------------
 2575|  16.0k|					    UINT_MAX) {
 2576|      1|						archive_set_error(&a->archive,
 2577|      1|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2578|      1|						    "Header error");
 2579|      1|							return ARCHIVE_FATAL;
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2580|      1|					}
 2581|       |
 2582|  16.0k|					rar5->vol.expected_vol_no =
 2583|  16.0k|					    rar5->main.vol_no + 1;
 2584|  16.0k|					return ARCHIVE_OK;
  ------------------
  |  |  234|  16.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2585|  16.0k|				}
 2586|  16.0k|			} else {
 2587|     21|				return ARCHIVE_EOF;
  ------------------
  |  |  233|     21|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2588|     21|			}
 2589|     24|		case HEAD_MARK:
  ------------------
  |  Branch (2589:3): [True: 24, False: 46.6k]
  ------------------
 2590|     24|			return ARCHIVE_EOF;
  ------------------
  |  |  233|     24|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2591|  2.75k|		default:
  ------------------
  |  Branch (2591:3): [True: 2.75k, False: 43.9k]
  ------------------
 2592|  2.75k|			if((header_flags & HFL_SKIP_IF_UNKNOWN) == 0) {
  ------------------
  |  Branch (2592:7): [True: 97, False: 2.66k]
  ------------------
 2593|     97|				archive_set_error(&a->archive,
 2594|     97|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     97|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2595|     97|				    "Header type error");
 2596|     97|				return ARCHIVE_FATAL;
  ------------------
  |  |  240|     97|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2597|  2.66k|			} else {
 2598|       |				/* If the block is marked as 'skip if unknown',
 2599|       |				 * do as the flag says: skip the block
 2600|       |				 * instead on failing on it. */
 2601|  2.66k|				rar5_skip_remaining_block(a, body_start,
 2602|  2.66k|				    raw_hdr_size);
 2603|  2.66k|				return ARCHIVE_RETRY;
  ------------------
  |  |  235|  2.66k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2604|  2.66k|			}
 2605|  46.6k|	}
 2606|       |
 2607|      0|#if !defined WIN32
 2608|       |	// Not reached.
 2609|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2610|      0|	    "Internal unpacker error");
 2611|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2612|  46.6k|#endif
 2613|  46.6k|}
archive_read_support_format_rar5.c:skip_unprocessed_bytes:
 2322|  56.2k|static int skip_unprocessed_bytes(struct archive_read* a) {
 2323|  56.2k|	struct rar5 *rar5 = a->format->data;
 2324|  56.2k|	int ret;
 2325|       |
 2326|  56.2k|	if(rar5->file.bytes_remaining) {
  ------------------
  |  Branch (2326:5): [True: 11.2k, False: 45.0k]
  ------------------
 2327|       |		/* Use different skipping method in block merging mode than in
 2328|       |		 * normal mode. If merge mode is active, rar5_read_data_skip
 2329|       |		 * can't be used, because it could allow recursive use of
 2330|       |		 * merge_block() * function, and this function doesn't support
 2331|       |		 * recursive use. */
 2332|  11.2k|		if(rar5->merge_mode) {
  ------------------
  |  Branch (2332:6): [True: 892, False: 10.3k]
  ------------------
 2333|       |			/* Discard whole merged block. This is valid in solid
 2334|       |			 * mode as well, because the code will discard blocks
 2335|       |			 * only if those blocks are safe to discard (i.e.
 2336|       |			 * they're not FILE blocks).  */
 2337|    892|			ret = consume(a, rar5->file.bytes_remaining);
 2338|    892|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|    892|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2338:7): [True: 5, False: 887]
  ------------------
 2339|      5|				return ret;
 2340|      5|			}
 2341|    887|			rar5->file.bytes_remaining = 0;
 2342|  10.3k|		} else {
 2343|       |			/* If we're not in merge mode, use safe skipping code.
 2344|       |			 * This will ensure we'll handle solid archives
 2345|       |			 * properly. */
 2346|  10.3k|			ret = rar5_read_data_skip(a);
 2347|  10.3k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  10.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2347:7): [True: 8.83k, False: 1.52k]
  ------------------
 2348|  8.83k|				return ret;
 2349|  8.83k|			}
 2350|  10.3k|		}
 2351|  11.2k|	}
 2352|       |
 2353|  47.4k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  47.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2354|  56.2k|}
archive_read_support_format_rar5.c:read_u32:
 1130|  75.3k|static char read_u32(struct archive_read* a, uint32_t* pvalue) {
 1131|  75.3k|	const uint8_t* p;
 1132|  75.3k|	if(!read_ahead(a, 4, &p))
  ------------------
  |  Branch (1132:5): [True: 156, False: 75.1k]
  ------------------
 1133|    156|		return 0;
 1134|       |
 1135|  75.1k|	*pvalue = archive_le32dec(p);
 1136|  75.1k|	return ARCHIVE_OK == consume(a, 4);
  ------------------
  |  |  234|  75.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1137|  75.3k|}
archive_read_support_format_rar5.c:read_var_sized:
 1037|   366k|{
 1038|   366k|	uint64_t v;
 1039|   366k|	uint64_t v_size = 0;
 1040|       |
 1041|   366k|	int ret = pvalue_len ? read_var(a, &v, &v_size)
  ------------------
  |  Branch (1041:12): [True: 118k, False: 247k]
  ------------------
 1042|   366k|			     : read_var(a, &v, NULL);
 1043|       |#if UINT64_MAX > SIZE_MAX
 1044|       |	if(ret == ARCHIVE_OK && v > SIZE_MAX) {
 1045|       |		archive_set_error(&a->archive,
 1046|       |		    ARCHIVE_ERRNO_FILE_FORMAT, "Number too large");
 1047|       |		ret = ARCHIVE_FATAL;
 1048|       |	}
 1049|       |#endif
 1050|       |
 1051|   366k|	if(ret == ARCHIVE_OK && pvalue) {
  ------------------
  |  |  234|   733k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1051:5): [True: 366k, False: 243]
  |  Branch (1051:26): [True: 366k, False: 0]
  ------------------
 1052|   366k|		*pvalue = (size_t) v;
 1053|   366k|	}
 1054|       |
 1055|   366k|	if(pvalue_len) {
  ------------------
  |  Branch (1055:5): [True: 118k, False: 247k]
  ------------------
 1056|       |		/* Possible data truncation should be safe. */
 1057|   118k|		*pvalue_len = (size_t) v_size;
 1058|   118k|	}
 1059|       |
 1060|   366k|	return ret;
 1061|   366k|}
archive_read_support_format_rar5.c:read_var:
  947|   508k|{
  948|   508k|	uint64_t multiplier;
  949|   508k|	uint64_t result = 0;
  950|   508k|	size_t i, max_bytes;
  951|   508k|	ssize_t avail;
  952|   508k|	const uint8_t* p;
  953|       |
  954|       |	/* We will read a maximum of 10 bytes, since that's the longest a
  955|       |	 * RAR5 varint can legally be. Ask for a full 10-byte lookahead
  956|       |	 * first, since that's the common case. However, a varint is
  957|       |	 * self-terminating (a byte with the MSB clear ends the value, so
  958|       |	 * most varints take far fewer than 10 bytes), and it's legal for
  959|       |	 * one to end fewer than 10 bytes before the end of the archive --
  960|       |	 * e.g. a file header's extra field butting up against ENDARC with
  961|       |	 * no padding. If a full 10-byte lookahead isn't available, fall
  962|       |	 * back to however many bytes actually remain and decode within
  963|       |	 * that instead of failing outright; only reaching the real end of
  964|       |	 * the archive with zero bytes left, or exhausting the available
  965|       |	 * bytes without hitting a terminator, is a genuine error. */
  966|   508k|	max_bytes = 10;
  967|   508k|	p = __archive_read_ahead(a, max_bytes, &avail);
  968|   508k|	if(p == NULL) {
  ------------------
  |  Branch (968:5): [True: 3.32k, False: 504k]
  ------------------
  969|  3.32k|		if(avail == 0)
  ------------------
  |  Branch (969:6): [True: 324, False: 2.99k]
  ------------------
  970|    324|			return ARCHIVE_EOF;
  ------------------
  |  |  233|    324|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  971|  2.99k|		if(avail < 1)
  ------------------
  |  Branch (971:6): [True: 0, False: 2.99k]
  ------------------
  972|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  973|  2.99k|		max_bytes = (size_t)avail;
  974|  2.99k|		p = __archive_read_ahead(a, max_bytes, NULL);
  975|  2.99k|		if(p == NULL)
  ------------------
  |  Branch (975:6): [True: 0, False: 2.99k]
  ------------------
  976|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  977|  2.99k|	}
  978|       |
  979|   624k|	for(multiplier = 1, i = 0; i < max_bytes; i++, multiplier *= 128) {
  ------------------
  |  Branch (979:29): [True: 624k, False: 74]
  ------------------
  980|   624k|		uint64_t val;
  981|   624k|		uint8_t b;
  982|       |
  983|   624k|		b = p[i];
  984|       |
  985|       |		/* Strip the MSB from the input byte and add the resulting
  986|       |		 * number to the `result`. */
  987|   624k|		if(archive_ckd_mul_u64(&val, b & 0x7F, multiplier) ||
  ------------------
  |  Branch (987:6): [True: 58, False: 624k]
  ------------------
  988|   624k|		   archive_ckd_add_u64(&result, result, val)) {
  ------------------
  |  Branch (988:6): [True: 0, False: 624k]
  ------------------
  989|       |			/* Integer overflow occurred. */
  990|     58|			archive_set_error(&a->archive,
  991|     58|			    ARCHIVE_ERRNO_FILE_FORMAT, "Number too large");
  ------------------
  |  |  192|     58|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  992|     58|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     58|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  993|     58|		}
  994|       |
  995|       |		/* MSB set to 1 means we need to continue decoding process.
  996|       |		 * MSB set to 0 means we're done.
  997|       |		 *
  998|       |		 * This conditional checks for the second case. */
  999|   624k|		if((b & 0x80) == 0) {
  ------------------
  |  Branch (999:6): [True: 507k, False: 116k]
  ------------------
 1000|   507k|			if(pvalue) {
  ------------------
  |  Branch (1000:7): [True: 507k, False: 0]
  ------------------
 1001|   507k|				*pvalue = result;
 1002|   507k|			}
 1003|       |
 1004|       |			/* If the caller has passed the `pvalue_len` pointer,
 1005|       |			 * store the number of consumed bytes in it and do NOT
 1006|       |			 * consume those bytes, since the caller has all the
 1007|       |			 * information it needs to perform */
 1008|   507k|			if(pvalue_len) {
  ------------------
  |  Branch (1008:7): [True: 222k, False: 285k]
  ------------------
 1009|   222k|				*pvalue_len = 1 + i;
 1010|   285k|			} else {
 1011|       |				/* If the caller did not provide the
 1012|       |				 * `pvalue_len` pointer, it will not have the
 1013|       |				 * possibility to advance the file pointer,
 1014|       |				 * because it will not know how many bytes it
 1015|       |				 * needs to consume. This is why we handle
 1016|       |				 * such situation here automatically. */
 1017|   285k|				if(ARCHIVE_OK != consume(a, 1 + i)) {
  ------------------
  |  |  234|   285k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1017:8): [True: 0, False: 285k]
  ------------------
 1018|      0|					return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1019|      0|				}
 1020|   285k|			}
 1021|       |
 1022|       |			/* End of decoding process, return success. */
 1023|   507k|			return ARCHIVE_OK;
  ------------------
  |  |  234|   507k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1024|   507k|		}
 1025|   624k|	}
 1026|       |
 1027|       |	/* Either all 10 bytes had their continuation bit set (a malformed
 1028|       |	 * varint), or fewer than 10 bytes were available and none of them
 1029|       |	 * terminated the value (a truncated archive). Both are errors. */
 1030|     74|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     74|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1031|     74|	    "Truncated or invalid number");
 1032|     74|	return ARCHIVE_FATAL;
  ------------------
  |  |  240|     74|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1033|   507k|}
archive_read_support_format_rar5.c:process_head_main:
 2210|  3.51k|{
 2211|  3.51k|	int ret;
 2212|  3.51k|	uint64_t extra_data_size = 0;
 2213|  3.51k|	size_t extra_field_size = 0;
 2214|  3.51k|	size_t extra_field_id = 0;
 2215|  3.51k|	size_t archive_flags = 0;
 2216|       |
 2217|  3.51k|	enum MAIN_FLAGS {
 2218|  3.51k|		VOLUME = 0x0001,         /* multi-volume archive */
 2219|  3.51k|		VOLUME_NUMBER = 0x0002,  /* volume number, first vol doesn't
 2220|       |					  * have it */
 2221|  3.51k|		SOLID = 0x0004,          /* solid archive */
 2222|  3.51k|		PROTECT = 0x0008,        /* contains Recovery info */
 2223|  3.51k|		LOCK = 0x0010,           /* readonly flag, not used */
 2224|  3.51k|	};
 2225|       |
 2226|  3.51k|	enum MAIN_EXTRA {
 2227|       |		// Just one attribute here.
 2228|  3.51k|		LOCATOR = 0x01,
 2229|  3.51k|	};
 2230|       |
 2231|  3.51k|	(void) entry;
 2232|       |
 2233|  3.51k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (2233:5): [True: 2.15k, False: 1.35k]
  ------------------
 2234|  2.15k|		int r;
 2235|  2.15k|		r = read_var(a, &extra_data_size, NULL);
 2236|  2.15k|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  2.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2236:6): [True: 2, False: 2.15k]
  ------------------
 2237|      2|			return r;
 2238|  2.15k|	} else {
 2239|  1.35k|		extra_data_size = 0;
 2240|  1.35k|	}
 2241|       |
 2242|  3.50k|	ret = read_var_sized(a, &archive_flags, NULL);
 2243|  3.50k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  3.50k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2243:5): [True: 3, False: 3.50k]
  ------------------
 2244|      3|		return ret;
 2245|      3|	}
 2246|       |
 2247|  3.50k|	rar5->main.volume = (archive_flags & VOLUME) > 0;
 2248|  3.50k|	rar5->main.solid = (archive_flags & SOLID) > 0;
 2249|       |
 2250|  3.50k|	if(archive_flags & VOLUME_NUMBER) {
  ------------------
  |  Branch (2250:5): [True: 1.47k, False: 2.03k]
  ------------------
 2251|  1.47k|		size_t v = 0;
 2252|  1.47k|		ret = read_var_sized(a, &v, NULL);
 2253|  1.47k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  1.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2253:6): [True: 0, False: 1.47k]
  ------------------
 2254|      0|			return ret;
 2255|      0|		}
 2256|       |
 2257|  1.47k|		if (v > UINT_MAX) {
  ------------------
  |  Branch (2257:7): [True: 2, False: 1.47k]
  ------------------
 2258|      2|			archive_set_error(&a->archive,
 2259|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2260|      2|			    "Invalid volume number");
 2261|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2262|      2|		}
 2263|       |
 2264|  1.47k|		rar5->main.vol_no = (unsigned int) v;
 2265|  2.03k|	} else {
 2266|  2.03k|		rar5->main.vol_no = 0;
 2267|  2.03k|	}
 2268|       |
 2269|  3.50k|	if(rar5->vol.expected_vol_no > 0 &&
  ------------------
  |  Branch (2269:5): [True: 123, False: 3.38k]
  ------------------
 2270|    123|		rar5->main.vol_no != rar5->vol.expected_vol_no)
  ------------------
  |  Branch (2270:3): [True: 31, False: 92]
  ------------------
 2271|     31|	{
 2272|       |		/* Returning EOF instead of FATAL because of strange
 2273|       |		 * libarchive behavior. When opening multiple files via
 2274|       |		 * archive_read_open_filenames(), after reading up the whole
 2275|       |		 * last file, the __archive_read_ahead function wraps up to
 2276|       |		 * the first archive instead of returning EOF. */
 2277|     31|		return ARCHIVE_EOF;
  ------------------
  |  |  233|     31|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2278|     31|	}
 2279|       |
 2280|  3.47k|	if(extra_data_size == 0) {
  ------------------
  |  Branch (2280:5): [True: 1.33k, False: 2.13k]
  ------------------
 2281|       |		/* Early return. */
 2282|  1.33k|		return ARCHIVE_OK;
  ------------------
  |  |  234|  1.33k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2283|  1.33k|	}
 2284|       |
 2285|  2.13k|	ret = read_var_sized(a, &extra_field_size, NULL);
 2286|  2.13k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2286:5): [True: 0, False: 2.13k]
  ------------------
 2287|      0|		return ret;
 2288|      0|	}
 2289|       |
 2290|  2.13k|	ret = read_var_sized(a, &extra_field_id, NULL);
 2291|  2.13k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2291:5): [True: 0, False: 2.13k]
  ------------------
 2292|      0|		return ret;
 2293|      0|	}
 2294|       |
 2295|  2.13k|	if(extra_field_size == 0) {
  ------------------
  |  Branch (2295:5): [True: 1, False: 2.13k]
  ------------------
 2296|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2297|      1|		    "Invalid extra field size");
 2298|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2299|      1|	}
 2300|       |
 2301|  2.13k|	switch(extra_field_id) {
 2302|  2.11k|		case LOCATOR:
  ------------------
  |  Branch (2302:3): [True: 2.11k, False: 24]
  ------------------
 2303|  2.11k|			ret = process_main_locator_extra_block(a, rar5);
 2304|  2.11k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2304:7): [True: 0, False: 2.11k]
  ------------------
 2305|       |				/* Error while parsing main locator extra
 2306|       |				 * block. */
 2307|      0|				return ret;
 2308|      0|			}
 2309|       |
 2310|  2.11k|			break;
 2311|  2.11k|		default:
  ------------------
  |  Branch (2311:3): [True: 24, False: 2.11k]
  ------------------
 2312|     24|			archive_set_error(&a->archive,
 2313|     24|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2314|     24|			    "Unsupported extra type (0x%jx)",
 2315|     24|			    (uintmax_t)extra_field_id);
 2316|     24|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2317|  2.13k|	}
 2318|       |
 2319|  2.11k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  2.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2320|  2.13k|}
archive_read_support_format_rar5.c:process_main_locator_extra_block:
 1259|  2.11k|{
 1260|  2.11k|	uint64_t locator_flags;
 1261|  2.11k|	int r;
 1262|       |
 1263|  2.11k|	enum LOCATOR_FLAGS {
 1264|  2.11k|		QLIST = 0x01, RECOVERY = 0x02,
 1265|  2.11k|	};
 1266|       |
 1267|  2.11k|	r = read_var(a, &locator_flags, NULL);
 1268|  2.11k|	if(r != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1268:5): [True: 0, False: 2.11k]
  ------------------
 1269|      0|		return r;
 1270|      0|	}
 1271|       |
 1272|  2.11k|	if(locator_flags & QLIST) {
  ------------------
  |  Branch (1272:5): [True: 407, False: 1.70k]
  ------------------
 1273|    407|		r = read_var(a, &rar5->qlist_offset, NULL);
 1274|    407|		if(r != ARCHIVE_OK) {
  ------------------
  |  |  234|    407|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1274:6): [True: 0, False: 407]
  ------------------
 1275|      0|			return r;
 1276|      0|		}
 1277|       |
 1278|       |		/* qlist is not used */
 1279|    407|	}
 1280|       |
 1281|  2.11k|	if(locator_flags & RECOVERY) {
  ------------------
  |  Branch (1281:5): [True: 351, False: 1.75k]
  ------------------
 1282|    351|		r = read_var(a, &rar5->rr_offset, NULL);
 1283|    351|		if(r != ARCHIVE_OK) {
  ------------------
  |  |  234|    351|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1283:6): [True: 0, False: 351]
  ------------------
 1284|      0|			return r;
 1285|      0|		}
 1286|       |
 1287|       |		/* rr is not used */
 1288|    351|	}
 1289|       |
 1290|  2.11k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  2.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1291|  2.11k|}
archive_read_support_format_rar5.c:rar5_skip_remaining_block:
 2419|  6.10k|{
 2420|  6.10k|	const uint8_t* cur;
 2421|       |
 2422|  6.10k|	if(read_ahead(a, 1, &cur)) {
  ------------------
  |  Branch (2422:5): [True: 6.10k, False: 4]
  ------------------
 2423|  6.10k|		size_t body_used = (size_t)(cur - body_start);
 2424|       |
 2425|  6.10k|		if(body_used < raw_hdr_size)
  ------------------
  |  Branch (2425:6): [True: 3.00k, False: 3.10k]
  ------------------
 2426|  3.00k|			(void)consume(a, raw_hdr_size - body_used);
 2427|  6.10k|	}
 2428|  6.10k|}
archive_read_support_format_rar5.c:process_head_service:
 2189|  1.66k|{
 2190|       |	/* Process this SERVICE block the same way as FILE blocks. */
 2191|  1.66k|	int ret = process_head_file(a, rar5, entry, block_flags);
 2192|  1.66k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  1.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2192:5): [True: 513, False: 1.15k]
  ------------------
 2193|    513|		return ret;
 2194|       |
 2195|  1.15k|	rar5->file.service = 1;
 2196|       |
 2197|       |	/* But skip the data part automatically. It's no use for the user
 2198|       |	 * anyway.  It contains only service data, not even needed to
 2199|       |	 * properly unpack the file. */
 2200|  1.15k|	ret = rar5_read_data_skip(a);
 2201|  1.15k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  1.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2201:5): [True: 8, False: 1.14k]
  ------------------
 2202|      8|		return ret;
 2203|       |
 2204|       |	/* After skipping, try parsing another block automatically. */
 2205|  1.14k|	return ARCHIVE_RETRY;
  ------------------
  |  |  235|  1.14k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2206|  1.15k|}
archive_read_support_format_rar5.c:process_head_file:
 1830|  24.3k|{
 1831|  24.3k|	int64_t extra_data_size = 0;
 1832|  24.3k|	size_t data_size = 0;
 1833|  24.3k|	size_t file_flags = 0;
 1834|  24.3k|	size_t file_attr = 0;
 1835|  24.3k|	size_t compression_info = 0;
 1836|  24.3k|	size_t host_os = 0;
 1837|  24.3k|	size_t name_size = 0;
 1838|  24.3k|	uint64_t unpacked_size, window_size;
 1839|  24.3k|	uint32_t mtime = 0, crc = 0;
 1840|  24.3k|	int c_method = 0, c_version = 0;
 1841|  24.3k|	char name_utf8_buf[MAX_NAME_IN_BYTES];
 1842|  24.3k|	const uint8_t* p;
 1843|  24.3k|	int sanity_ret;
 1844|  24.3k|	int r;
 1845|       |
 1846|  24.3k|	enum FILE_FLAGS {
 1847|  24.3k|		DIRECTORY = 0x0001, UTIME = 0x0002, CRC32 = 0x0004,
 1848|  24.3k|		UNKNOWN_UNPACKED_SIZE = 0x0008,
 1849|  24.3k|	};
 1850|       |
 1851|  24.3k|	enum FILE_ATTRS {
 1852|  24.3k|		ATTR_READONLY = 0x1, ATTR_HIDDEN = 0x2, ATTR_SYSTEM = 0x4,
 1853|  24.3k|		ATTR_DIRECTORY = 0x10,
 1854|  24.3k|	};
 1855|       |
 1856|  24.3k|	enum COMP_INFO_FLAGS {
 1857|  24.3k|		SOLID = 0x0040,
 1858|  24.3k|	};
 1859|       |
 1860|  24.3k|	enum HOST_OS {
 1861|  24.3k|		HOST_WINDOWS = 0,
 1862|  24.3k|		HOST_UNIX = 1,
 1863|  24.3k|	};
 1864|       |
 1865|  24.3k|	archive_entry_clear(entry);
 1866|       |
 1867|       |	/* Do not reset file context if we're switching archives. */
 1868|  24.3k|	if(!rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (1868:5): [True: 19.1k, False: 5.19k]
  ------------------
 1869|  19.1k|		reset_file_context(rar5);
 1870|  19.1k|	}
 1871|       |
 1872|  24.3k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (1872:5): [True: 8.07k, False: 16.2k]
  ------------------
 1873|  8.07k|		uint64_t edata_size = 0;
 1874|  8.07k|		r = read_var(a, &edata_size, NULL);
 1875|  8.07k|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  8.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1875:6): [True: 0, False: 8.07k]
  ------------------
 1876|      0|			return r;
 1877|       |
 1878|       |		/* The extra area is part of the file header, which
 1879|       |		 * process_base_block() has already bounded to MAX_HEADER_SIZE.
 1880|       |		 * A declared extra-area size larger than that cannot be valid,
 1881|       |		 * and if left unchecked it is later used as the ceiling for
 1882|       |		 * the owner/group name length in parse_file_extra_owner(),
 1883|       |		 * letting a crafted archive drive read_ahead() into an
 1884|       |		 * attacker-controlled allocation. Reject it here. */
 1885|  8.07k|		if(edata_size > MAX_HEADER_SIZE) {
  ------------------
  |  |  104|  8.07k|#define MAX_HEADER_SIZE (2 * 1024 * 1024)
  ------------------
  |  Branch (1885:6): [True: 9, False: 8.06k]
  ------------------
 1886|      9|			archive_set_error(&a->archive,
 1887|      9|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1888|      9|			    "File extra data size is too large");
 1889|      9|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1890|      9|		}
 1891|       |
 1892|       |		/* Intentional type cast from unsigned to signed. */
 1893|  8.06k|		extra_data_size = (int64_t) edata_size;
 1894|  8.06k|	}
 1895|       |
 1896|  24.2k|	if(block_flags & HFL_DATA) {
  ------------------
  |  Branch (1896:5): [True: 24.0k, False: 269]
  ------------------
 1897|  24.0k|		r = read_var_sized(a, &data_size, NULL);
 1898|  24.0k|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  24.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1898:6): [True: 8, False: 24.0k]
  ------------------
 1899|      8|			return r;
 1900|       |
 1901|  24.0k|		if(data_size > SSIZE_MAX) {
  ------------------
  |  Branch (1901:6): [True: 3, False: 24.0k]
  ------------------
 1902|      3|			archive_set_error(&a->archive,
 1903|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1904|      3|			    "File data size is too large");
 1905|      3|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1906|      3|		}
 1907|       |
 1908|  24.0k|		rar5->file.bytes_remaining = data_size;
 1909|  24.0k|	} else {
 1910|    269|		rar5->file.bytes_remaining = 0;
 1911|    269|	}
 1912|       |
 1913|  24.2k|	r = read_var_sized(a, &file_flags, NULL);
 1914|  24.2k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  24.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1914:5): [True: 3, False: 24.2k]
  ------------------
 1915|      3|		return r;
 1916|       |
 1917|  24.2k|	r = read_var(a, &unpacked_size, NULL);
 1918|  24.2k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  24.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1918:5): [True: 6, False: 24.2k]
  ------------------
 1919|      6|		return r;
 1920|       |
 1921|  24.2k|	if(file_flags & UNKNOWN_UNPACKED_SIZE) {
  ------------------
  |  Branch (1921:5): [True: 9, False: 24.2k]
  ------------------
 1922|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      9|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1923|      9|		    "Files with unknown unpacked size are not supported");
 1924|      9|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1925|      9|	}
 1926|       |
 1927|  24.2k|	rar5->file.dir = (uint8_t) ((file_flags & DIRECTORY) > 0);
 1928|       |
 1929|  24.2k|	sanity_ret = file_entry_sanity_checks(a, block_flags, rar5->file.dir,
 1930|  24.2k|		unpacked_size, data_size);
 1931|       |
 1932|  24.2k|	if (sanity_ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  24.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1932:6): [True: 33, False: 24.2k]
  ------------------
 1933|     33|		return sanity_ret;
 1934|     33|	}
 1935|       |
 1936|  24.2k|	r = read_var_sized(a, &file_attr, NULL);
 1937|  24.2k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  24.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1937:5): [True: 3, False: 24.2k]
  ------------------
 1938|      3|		return r;
 1939|       |
 1940|  24.2k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1940:5): [True: 12.4k, False: 11.7k]
  ------------------
 1941|  12.4k|		if(!read_u32(a, &mtime))
  ------------------
  |  Branch (1941:6): [True: 2, False: 12.4k]
  ------------------
 1942|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1943|  12.4k|	}
 1944|       |
 1945|  24.2k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1945:5): [True: 7.76k, False: 16.4k]
  ------------------
 1946|  7.76k|		if(!read_u32(a, &crc))
  ------------------
  |  Branch (1946:6): [True: 2, False: 7.75k]
  ------------------
 1947|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1948|  7.76k|	}
 1949|       |
 1950|  24.2k|	r = read_var_sized(a, &compression_info, NULL);
 1951|  24.2k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  24.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1951:5): [True: 4, False: 24.2k]
  ------------------
 1952|      4|		return r;
 1953|       |
 1954|  24.2k|	c_method = (int) (compression_info >> 7) & 0x7;
 1955|  24.2k|	c_version = (int) (compression_info & 0x3f);
 1956|       |
 1957|       |	/* RAR5 seems to limit the dictionary size to 64MB. */
 1958|  24.2k|	window_size = (rar5->file.dir > 0) ?
  ------------------
  |  Branch (1958:16): [True: 535, False: 23.6k]
  ------------------
 1959|    535|		0 :
 1960|  24.2k|		g_unpack_window_size << ((compression_info >> 10) & 15);
 1961|  24.2k|	rar5->cstate.method = c_method;
 1962|  24.2k|	rar5->cstate.version = c_version + 50;
 1963|  24.2k|	rar5->file.solid = (compression_info & SOLID) > 0;
 1964|       |
 1965|       |	/* Archives which declare solid files without initializing the window
 1966|       |	 * buffer first are invalid, unless previous data was encrypted, in
 1967|       |	 * which case we may never have had the chance */
 1968|       |
 1969|  24.2k|	if(rar5->file.solid > 0 && rar5->cstate.data_encrypted == 0 &&
  ------------------
  |  Branch (1969:5): [True: 1.69k, False: 22.5k]
  |  Branch (1969:29): [True: 990, False: 703]
  ------------------
 1970|    990|	    rar5->cstate.window_buf == NULL) {
  ------------------
  |  Branch (1970:6): [True: 5, False: 985]
  ------------------
 1971|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1972|      5|				  "Declared solid file, but no window buffer "
 1973|      5|				  "initialized yet");
 1974|      5|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1975|      5|	}
 1976|       |
 1977|       |	/* Check if window_size is a sane value. Also, if the file is not
 1978|       |	 * declared as a directory, disallow window_size == 0. */
 1979|  24.2k|	if(window_size > (64 * 1024 * 1024) ||
  ------------------
  |  Branch (1979:5): [True: 3, False: 24.2k]
  ------------------
 1980|  24.2k|	    (rar5->file.dir == 0 && window_size == 0))
  ------------------
  |  Branch (1980:7): [True: 23.6k, False: 535]
  |  Branch (1980:30): [True: 0, False: 23.6k]
  ------------------
 1981|      3|	{
 1982|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1983|      3|		    "Declared dictionary size is not supported");
 1984|      3|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1985|      3|	}
 1986|       |
 1987|  24.2k|	if(rar5->file.solid == 0)
  ------------------
  |  Branch (1987:5): [True: 22.5k, False: 1.68k]
  ------------------
 1988|  22.5k|		rar5->cstate.data_encrypted = 0; /* Reset for new buffer */
 1989|       |
 1990|       |	/* In a solid archive, the window carries history from earlier
 1991|       |	 * entries, and positions in it are computed with the window mask.
 1992|       |	 * Never shrink the window: a smaller mask would look up that
 1993|       |	 * history at the wrong positions. */
 1994|  24.2k|	if(rar5->main.solid && rar5->cstate.window_buf &&
  ------------------
  |  Branch (1994:5): [True: 13.5k, False: 10.6k]
  |  Branch (1994:25): [True: 10.4k, False: 3.09k]
  ------------------
 1995|  10.4k|	    window_size < rar5->cstate.window_buf_size)
  ------------------
  |  Branch (1995:6): [True: 150, False: 10.3k]
  ------------------
 1996|    150|		window_size = rar5->cstate.window_buf_size;
 1997|       |
 1998|  24.2k|	if(rar5->cstate.window_buf_size < (size_t) window_size &&
  ------------------
  |  Branch (1998:5): [True: 7.26k, False: 16.9k]
  ------------------
 1999|  7.26k|	    rar5->cstate.window_buf)
  ------------------
  |  Branch (1999:6): [True: 415, False: 6.85k]
  ------------------
 2000|    415|	{
 2001|    415|		uint8_t* new_window_buf;
 2002|       |
 2003|       |		/* The `data_ready` stack contains pointers to the `window_buf` or
 2004|       |		 * `filtered_buf` buffers.  Since we're about to replace the first
 2005|       |		 * buffer, some of those pointers could become invalid. Therefore, we
 2006|       |		 * need to dispose of all entries from the stack before replacing
 2007|       |		 * it. */
 2008|    415|		clear_data_ready_stack(rar5);
 2009|       |
 2010|       |		/* Allocate a zeroed buffer: in a solid stream, the window
 2011|       |		 * is not reinitialized for the next entry, so uninitialized
 2012|       |		 * bytes would be reachable through back-references. */
 2013|    415|		new_window_buf = calloc(1, (size_t) window_size);
 2014|    415|		if(!new_window_buf) {
  ------------------
  |  Branch (2014:6): [True: 0, False: 415]
  ------------------
 2015|      0|			archive_set_error(&a->archive, ENOMEM,
 2016|      0|				"Not enough memory when trying to grow the window "
 2017|      0|				"buffer");
 2018|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2019|      0|		}
 2020|       |
 2021|    415|		if(rar5->main.solid) {
  ------------------
  |  Branch (2021:6): [True: 6, False: 409]
  ------------------
 2022|       |			/* Byte at absolute position p is stored at
 2023|       |			 * p & mask.  Move the history to where the new,
 2024|       |			 * larger mask expects it. */
 2025|      6|			const uint64_t pos = (uint64_t) rar5->cstate.solid_offset
 2026|      6|			    + (uint64_t) rar5->cstate.write_ptr;
 2027|      6|			const uint64_t old_mask =
 2028|      6|			    rar5->cstate.window_buf_size - 1;
 2029|      6|			const uint64_t new_mask = window_size - 1;
 2030|      6|			uint64_t i;
 2031|       |
 2032|   786k|			for(i = 1; i <= rar5->cstate.window_buf_size; i++) {
  ------------------
  |  Branch (2032:15): [True: 786k, False: 6]
  ------------------
 2033|   786k|				new_window_buf[(pos - i) & new_mask] =
 2034|   786k|				    rar5->cstate.window_buf[(pos - i) & old_mask];
 2035|   786k|			}
 2036|      6|		}
 2037|       |
 2038|    415|		free(rar5->cstate.window_buf);
 2039|    415|		rar5->cstate.window_buf = new_window_buf;
 2040|    415|		rar5->cstate.window_buf_size = (size_t) window_size;
 2041|    415|	}
 2042|       |
 2043|       |	/* Values up to 64M should fit into ssize_t on every
 2044|       |	 * architecture. */
 2045|  24.2k|	rar5->cstate.window_size = (ssize_t) window_size;
 2046|       |
 2047|  24.2k|	init_window_mask(rar5);
 2048|       |
 2049|  24.2k|	rar5->file.service = 0;
 2050|       |
 2051|  24.2k|	r = read_var_sized(a, &host_os, NULL);
 2052|  24.2k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  24.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2052:5): [True: 3, False: 24.2k]
  ------------------
 2053|      3|		return r;
 2054|       |
 2055|  24.2k|	if(host_os == HOST_WINDOWS) {
  ------------------
  |  Branch (2055:5): [True: 20.3k, False: 3.88k]
  ------------------
 2056|       |		/* Host OS is Windows */
 2057|       |
 2058|  20.3k|		__LA_MODE_T mode;
  ------------------
  |  |  102|  20.3k|# define	__LA_MODE_T	mode_t
  ------------------
 2059|       |
 2060|  20.3k|		if(file_attr & ATTR_DIRECTORY) {
  ------------------
  |  Branch (2060:6): [True: 13.0k, False: 7.30k]
  ------------------
 2061|  13.0k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (2061:8): [True: 8.50k, False: 4.51k]
  ------------------
 2062|  8.50k|				mode = 0555 | AE_IFDIR;
  ------------------
  |  |  221|  8.50k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 2063|  8.50k|			} else {
 2064|  4.51k|				mode = 0755 | AE_IFDIR;
  ------------------
  |  |  221|  4.51k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 2065|  4.51k|			}
 2066|  13.0k|		} else {
 2067|  7.30k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (2067:8): [True: 1.91k, False: 5.38k]
  ------------------
 2068|  1.91k|				mode = 0444 | AE_IFREG;
  ------------------
  |  |  216|  1.91k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 2069|  5.38k|			} else {
 2070|  5.38k|				mode = 0644 | AE_IFREG;
  ------------------
  |  |  216|  5.38k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 2071|  5.38k|			}
 2072|  7.30k|		}
 2073|       |
 2074|  20.3k|		archive_entry_set_mode(entry, mode);
 2075|       |
 2076|  20.3k|		if (file_attr & (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM)) {
  ------------------
  |  Branch (2076:7): [True: 15.3k, False: 4.94k]
  ------------------
 2077|  15.3k|			char buf[sizeof(",rdonly,hidden,system")];
 2078|  15.3k|			const char *fflags[3] = { "", "", "" };
 2079|  15.3k|			const char **flag = fflags;
 2080|       |
 2081|  15.3k|			if (file_attr & ATTR_READONLY)
  ------------------
  |  Branch (2081:8): [True: 10.4k, False: 4.95k]
  ------------------
 2082|  10.4k|				*flag++ = ",rdonly";
 2083|  15.3k|			if (file_attr & ATTR_HIDDEN)
  ------------------
  |  Branch (2083:8): [True: 13.5k, False: 1.79k]
  ------------------
 2084|  13.5k|				*flag++ = ",hidden";
 2085|  15.3k|			if (file_attr & ATTR_SYSTEM)
  ------------------
  |  Branch (2085:8): [True: 9.54k, False: 5.83k]
  ------------------
 2086|  9.54k|				*flag++ = ",system";
 2087|       |
 2088|  15.3k|			snprintf(buf, sizeof(buf), "%s%s%s",
 2089|  15.3k|			    fflags[0], fflags[1], fflags[2]);
 2090|  15.3k|			archive_entry_copy_fflags_text(entry, buf + 1);
 2091|  15.3k|		}
 2092|  20.3k|	} else if(host_os == HOST_UNIX) {
  ------------------
  |  Branch (2092:12): [True: 3.81k, False: 67]
  ------------------
 2093|       |		/* Host OS is Unix */
 2094|  3.81k|		archive_entry_set_mode(entry, (__LA_MODE_T) file_attr);
 2095|  3.81k|	} else {
 2096|       |		/* Unknown host OS */
 2097|     67|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     67|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2098|     67|				"Unsupported Host OS: 0x%jx",
 2099|     67|				(uintmax_t)host_os);
 2100|       |
 2101|     67|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     67|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2102|     67|	}
 2103|       |
 2104|  24.1k|	r = read_var_sized(a, &name_size, NULL);
 2105|  24.1k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  24.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2105:5): [True: 8, False: 24.1k]
  ------------------
 2106|      8|		return r;
 2107|       |
 2108|  24.1k|	if(name_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |  100|  24.1k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (2108:5): [True: 7, False: 24.1k]
  ------------------
 2109|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2110|      7|				"Filename is too long");
 2111|       |
 2112|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2113|      7|	}
 2114|       |
 2115|  24.1k|	if(name_size == 0) {
  ------------------
  |  Branch (2115:5): [True: 12, False: 24.1k]
  ------------------
 2116|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2117|     12|				"No filename specified");
 2118|       |
 2119|     12|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2120|     12|	}
 2121|       |
 2122|  24.1k|	if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (2122:5): [True: 56, False: 24.0k]
  ------------------
 2123|     56|		return ARCHIVE_EOF;
  ------------------
  |  |  233|     56|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2124|       |
 2125|  24.0k|	memcpy(name_utf8_buf, p, name_size);
 2126|  24.0k|	name_utf8_buf[name_size] = 0;
 2127|  24.0k|	if(ARCHIVE_OK != consume(a, name_size)) {
  ------------------
  |  |  234|  24.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2127:5): [True: 0, False: 24.0k]
  ------------------
 2128|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2129|      0|	}
 2130|       |
 2131|  24.0k|	archive_entry_update_pathname_utf8(entry, name_utf8_buf);
 2132|       |
 2133|  24.0k|	if(extra_data_size > 0) {
  ------------------
  |  Branch (2133:5): [True: 6.35k, False: 17.7k]
  ------------------
 2134|  6.35k|		int ret = process_head_file_extra(a, entry, rar5,
 2135|  6.35k|		    extra_data_size);
 2136|       |
 2137|       |		/*
 2138|       |		 * TODO: rewrite or remove useless sanity check
 2139|       |		 *       as extra_data_size is not passed as a pointer
 2140|       |		 *
 2141|       |		if(extra_data_size < 0) {
 2142|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
 2143|       |			    "File extra data size is not zero");
 2144|       |			return ARCHIVE_FATAL;
 2145|       |		}
 2146|       |		 */
 2147|       |
 2148|  6.35k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  6.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2148:6): [True: 636, False: 5.71k]
  ------------------
 2149|    636|			return ret;
 2150|  6.35k|	}
 2151|       |
 2152|  23.4k|	if((file_flags & UNKNOWN_UNPACKED_SIZE) == 0) {
  ------------------
  |  Branch (2152:5): [True: 23.4k, False: 0]
  ------------------
 2153|  23.4k|		rar5->file.unpacked_size = (ssize_t) unpacked_size;
 2154|  23.4k|		if(rar5->file.redir_type == REDIR_TYPE_NONE)
  ------------------
  |  Branch (2154:6): [True: 22.4k, False: 943]
  ------------------
 2155|  22.4k|			archive_entry_set_size(entry, unpacked_size);
 2156|  23.4k|	}
 2157|       |
 2158|  23.4k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (2158:5): [True: 12.3k, False: 11.0k]
  ------------------
 2159|  12.3k|		archive_entry_set_mtime(entry, (time_t) mtime, 0);
 2160|  12.3k|	}
 2161|       |
 2162|  23.4k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (2162:5): [True: 7.69k, False: 15.7k]
  ------------------
 2163|  7.69k|		rar5->file.stored_crc32 = crc;
 2164|  7.69k|	}
 2165|       |
 2166|  23.4k|	if(!rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (2166:5): [True: 18.3k, False: 5.08k]
  ------------------
 2167|       |		/* Do not reinitialize unpacking state if we're switching
 2168|       |		 * archives. */
 2169|  18.3k|		rar5->cstate.block_parsing_finished = 1;
 2170|  18.3k|		rar5->cstate.all_filters_applied = 1;
 2171|  18.3k|		rar5->cstate.initialized = 0;
 2172|  18.3k|	}
 2173|       |
 2174|  23.4k|	if(rar5->generic.split_before > 0) {
  ------------------
  |  Branch (2174:5): [True: 1.57k, False: 21.8k]
  ------------------
 2175|       |		/* If now we're standing on a header that has a 'split before'
 2176|       |		 * mark, it means we're standing on a 'continuation' file
 2177|       |		 * header. Signal the caller that if it wants to move to
 2178|       |		 * another file, it must call rar5_read_header() function
 2179|       |		 * again. */
 2180|       |
 2181|  1.57k|		return ARCHIVE_RETRY;
  ------------------
  |  |  235|  1.57k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2182|  21.8k|	} else {
 2183|  21.8k|		return ARCHIVE_OK;
  ------------------
  |  |  234|  21.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2184|  21.8k|	}
 2185|  23.4k|}
archive_read_support_format_rar5.c:reset_file_context:
  885|  19.1k|static void reset_file_context(struct rar5 *rar5) {
  886|  19.1k|	memset(&rar5->file, 0, sizeof(rar5->file));
  887|  19.1k|	blake2sp_init(&rar5->file.b2state, 32);
  ------------------
  |  |   30|  19.1k|#define blake2sp_init __archive_blake2sp_init
  ------------------
  888|       |
  889|  19.1k|	if(rar5->main.solid) {
  ------------------
  |  Branch (889:5): [True: 12.3k, False: 6.73k]
  ------------------
  890|  12.3k|		rar5->cstate.solid_offset += rar5->cstate.write_ptr;
  891|  12.3k|	} else {
  892|  6.73k|		rar5->cstate.solid_offset = 0;
  893|  6.73k|	}
  894|       |
  895|  19.1k|	rar5->cstate.write_ptr = 0;
  896|  19.1k|	rar5->cstate.last_write_ptr = 0;
  897|  19.1k|	rar5->cstate.last_unstore_ptr = 0;
  898|       |
  899|  19.1k|	rar5->file.redir_type = REDIR_TYPE_NONE;
  900|  19.1k|	rar5->file.redir_flags = 0;
  901|       |
  902|  19.1k|	free_filters(rar5);
  903|  19.1k|}
archive_read_support_format_rar5.c:free_filters:
  860|  39.2k|static void free_filters(struct rar5 *rar5) {
  861|  39.2k|	struct cdeque* d = &rar5->cstate.filters;
  862|       |
  863|       |	/* Free any remaining filters. All filters should be naturally
  864|       |	 * consumed by the unpacking function, so remaining filters after
  865|       |	 * unpacking normally mean that unpacking wasn't successful.
  866|       |	 * But still of course we shouldn't leak memory in such case. */
  867|       |
  868|       |	/* cdeque_size() is a fast operation, so we can use it as a loop
  869|       |	 * expression. */
  870|  40.1k|	while(cdeque_size(d) > 0) {
  ------------------
  |  Branch (870:8): [True: 885, False: 39.2k]
  ------------------
  871|    885|		struct filter_info* f = NULL;
  872|       |
  873|       |		/* Pop_front will also decrease the collection's size. */
  874|    885|		if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
  ------------------
  |  Branch (874:7): [True: 885, False: 0]
  ------------------
  875|    885|			free(f);
  876|    885|	}
  877|       |
  878|  39.2k|	cdeque_clear(d);
  879|       |
  880|       |	/* Also clear out the variables needed for sanity checking. */
  881|  39.2k|	rar5->cstate.last_block_start = 0;
  882|  39.2k|	rar5->cstate.last_block_length = 0;
  883|  39.2k|}
archive_read_support_format_rar5.c:cdeque_size:
  426|  63.3k|static size_t cdeque_size(struct cdeque* d) {
  427|  63.3k|	return d->size;
  428|  63.3k|}
archive_read_support_format_rar5.c:cdeque_pop_front:
  472|  2.70k|static int cdeque_pop_front(struct cdeque* d, void** value) {
  473|  2.70k|	if(!d || !value)
  ------------------
  |  Branch (473:5): [True: 0, False: 2.70k]
  |  Branch (473:11): [True: 0, False: 2.70k]
  ------------------
  474|      0|		return CDE_PARAM;
  475|       |
  476|  2.70k|	if(d->size == 0)
  ------------------
  |  Branch (476:5): [True: 0, False: 2.70k]
  ------------------
  477|      0|		return CDE_OUT_OF_BOUNDS;
  478|       |
  479|  2.70k|	cdeque_pop_front_fast(d, value);
  480|  2.70k|	return CDE_OK;
  481|  2.70k|}
archive_read_support_format_rar5.c:cdeque_pop_front_fast:
  464|  2.70k|static void cdeque_pop_front_fast(struct cdeque* d, void** value) {
  465|  2.70k|	*value = (void*) d->arr[d->beg_pos];
  466|  2.70k|	d->beg_pos = (d->beg_pos + 1) & d->cap_mask;
  467|  2.70k|	d->size--;
  468|  2.70k|}
archive_read_support_format_rar5.c:cdeque_filter_p:
  484|  30.5k|static void** cdeque_filter_p(struct filter_info** f) {
  485|  30.5k|	return (void**) (size_t) f;
  486|  30.5k|}
archive_read_support_format_rar5.c:file_entry_sanity_checks:
 1804|  24.2k|{
 1805|  24.2k|	if (is_dir) {
  ------------------
  |  Branch (1805:6): [True: 566, False: 23.7k]
  ------------------
 1806|    566|		const int declares_data_size =
 1807|    566|			(int) (unpacked_size != 0 || packed_size != 0);
  ------------------
  |  Branch (1807:11): [True: 28, False: 538]
  |  Branch (1807:33): [True: 2, False: 536]
  ------------------
 1808|       |
 1809|       |		/* FILE entries for directories still declare HFL_DATA in block flags,
 1810|       |		   even though attaching data to such blocks doesn't make much sense. */
 1811|    566|		if (declares_data_size) {
  ------------------
  |  Branch (1811:7): [True: 30, False: 536]
  ------------------
 1812|     30|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     30|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1813|     30|				"directory entries cannot have any data");
 1814|     30|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1815|     30|		}
 1816|  23.7k|	} else {
 1817|  23.7k|		const int declares_hfl_data = (int) ((block_flags & HFL_DATA) != 0);
 1818|  23.7k|		if (!declares_hfl_data) {
  ------------------
  |  Branch (1818:7): [True: 3, False: 23.7k]
  ------------------
 1819|      3|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1820|      3|					"no data found in file/service block");
 1821|      3|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1822|      3|		}
 1823|  23.7k|	}
 1824|       |
 1825|  24.2k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  24.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1826|  24.2k|}
archive_read_support_format_rar5.c:clear_data_ready_stack:
 4013|  25.5k|static void clear_data_ready_stack(struct rar5 *rar5) {
 4014|  25.5k|	memset(&rar5->cstate.dready, 0, sizeof(rar5->cstate.dready));
 4015|  25.5k|}
archive_read_support_format_rar5.c:init_window_mask:
 1240|  27.3k|static void init_window_mask(struct rar5 *rar5) {
 1241|  27.3k|	if (rar5->cstate.window_size)
  ------------------
  |  Branch (1241:6): [True: 26.8k, False: 507]
  ------------------
 1242|  26.8k|		rar5->cstate.window_mask = rar5->cstate.window_size - 1;
 1243|    507|	else
 1244|    507|		rar5->cstate.window_mask = 0;
 1245|  27.3k|}
archive_read_support_format_rar5.c:process_head_file_extra:
 1704|  6.35k|{
 1705|  6.35k|	uint64_t extra_field_size;
 1706|  6.35k|	uint64_t extra_field_id = 0;
 1707|  6.35k|	uint64_t var_size;
 1708|       |
 1709|  51.9k|	while(extra_data_size > 0) {
  ------------------
  |  Branch (1709:8): [True: 46.2k, False: 5.72k]
  ------------------
 1710|  46.2k|		int r;
 1711|       |
 1712|       |		/* Make sure we won't fail if the file declares only unsupported
 1713|       |		attributes. */
 1714|  46.2k|		int ret = ARCHIVE_OK;
  ------------------
  |  |  234|  46.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1715|       |
 1716|  46.2k|		r = read_var(a, &extra_field_size, &var_size);
 1717|  46.2k|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  46.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1717:6): [True: 119, False: 46.1k]
  ------------------
 1718|    119|			return r;
 1719|       |
 1720|  46.1k|		extra_data_size -= var_size;
 1721|  46.1k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  234|  46.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1721:6): [True: 0, False: 46.1k]
  ------------------
 1722|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1723|      0|		}
 1724|       |
 1725|  46.1k|		r = read_var(a, &extra_field_id, &var_size);
 1726|  46.1k|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  46.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1726:6): [True: 80, False: 46.0k]
  ------------------
 1727|     80|			return r;
 1728|       |
 1729|  46.0k|		extra_field_size -= var_size;
 1730|  46.0k|		extra_data_size -= var_size;
 1731|  46.0k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  234|  46.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1731:6): [True: 0, False: 46.0k]
  ------------------
 1732|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1733|      0|		}
 1734|       |
 1735|  46.0k|		switch(extra_field_id) {
 1736|  1.69k|			case EX_HASH:
  ------------------
  |  Branch (1736:4): [True: 1.69k, False: 44.3k]
  ------------------
 1737|  1.69k|				ret = parse_file_extra_hash(a, rar5,
 1738|  1.69k|				    &extra_data_size);
 1739|  1.69k|				break;
 1740|  4.52k|			case EX_HTIME:
  ------------------
  |  Branch (1740:4): [True: 4.52k, False: 41.5k]
  ------------------
 1741|  4.52k|				ret = parse_file_extra_htime(a, e, rar5,
 1742|  4.52k|				    &extra_data_size);
 1743|  4.52k|				break;
 1744|  5.01k|			case EX_REDIR:
  ------------------
  |  Branch (1744:4): [True: 5.01k, False: 41.0k]
  ------------------
 1745|  5.01k|				ret = parse_file_extra_redir(a, e, rar5,
 1746|  5.01k|				    &extra_data_size);
 1747|  5.01k|				break;
 1748|    736|			case EX_UOWNER:
  ------------------
  |  Branch (1748:4): [True: 736, False: 45.3k]
  ------------------
 1749|    736|				ret = parse_file_extra_owner(a, e,
 1750|    736|				    &extra_data_size);
 1751|    736|				break;
 1752|  29.7k|			case EX_VERSION:
  ------------------
  |  Branch (1752:4): [True: 29.7k, False: 16.3k]
  ------------------
 1753|  29.7k|				ret = parse_file_extra_version(a, e,
 1754|  29.7k|				    &extra_data_size);
 1755|  29.7k|				break;
 1756|    944|			case EX_CRYPT:
  ------------------
  |  Branch (1756:4): [True: 944, False: 45.1k]
  ------------------
 1757|       |				/* Mark the entry as encrypted */
 1758|    944|				archive_entry_set_is_data_encrypted(e, 1);
 1759|    944|				rar5->has_encrypted_entries = 1;
 1760|    944|				rar5->cstate.data_encrypted = 1;
 1761|       |				/* fallthrough */
 1762|    999|			case EX_SUBDATA:
  ------------------
  |  Branch (1762:4): [True: 55, False: 46.0k]
  ------------------
 1763|       |				/* fallthrough */
 1764|  4.38k|			default:
  ------------------
  |  Branch (1764:4): [True: 3.38k, False: 42.6k]
  ------------------
 1765|       |				/* Skip unsupported entry. */
 1766|  4.38k|				if (extra_field_size > (uint64_t)extra_data_size) {
  ------------------
  |  Branch (1766:9): [True: 130, False: 4.25k]
  ------------------
 1767|    130|					archive_set_error(&a->archive,
 1768|    130|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    130|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1769|    130|					    "RAR5 extra-field size exceeds remaining extra-field data");
 1770|    130|					return ARCHIVE_FATAL;
  ------------------
  |  |  240|    130|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1771|    130|				}
 1772|  4.25k|				extra_data_size -= extra_field_size;
 1773|  4.25k|				if (ARCHIVE_OK != consume(a, extra_field_size)) {
  ------------------
  |  |  234|  4.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1773:9): [True: 80, False: 4.17k]
  ------------------
 1774|     80|					return ARCHIVE_EOF;
  ------------------
  |  |  233|     80|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1775|     80|				}
 1776|       |
 1777|       |				/* Don't fail on unsupported attribute -- we've handled it
 1778|       |				   by skipping over it. */
 1779|  4.17k|				ret = ARCHIVE_OK;
  ------------------
  |  |  234|  4.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1780|  46.0k|		}
 1781|       |
 1782|  45.8k|		if (ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  45.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1782:7): [True: 216, False: 45.6k]
  ------------------
 1783|       |			/* Forward any errors signalled by the attribute parsing
 1784|       |			   functions. */
 1785|    216|			return ret;
 1786|    216|		}
 1787|  45.8k|	}
 1788|       |
 1789|  5.72k|	if (extra_data_size != 0) {
  ------------------
  |  Branch (1789:6): [True: 11, False: 5.71k]
  ------------------
 1790|       |		/* We didn't skip everything, or we skipped too much; either way,
 1791|       |		   there's an error in this parsing function. */
 1792|       |
 1793|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     11|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1794|     11|				"unsupported structure of file header extra data");
 1795|     11|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1796|     11|	}
 1797|       |
 1798|  5.71k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  5.71k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1799|  5.72k|}
archive_read_support_format_rar5.c:parse_file_extra_hash:
 1295|  1.69k|{
 1296|  1.69k|	size_t hash_type = 0;
 1297|  1.69k|	size_t value_len;
 1298|  1.69k|	int r;
 1299|       |
 1300|  1.69k|	enum HASH_TYPE {
 1301|  1.69k|		BLAKE2sp = 0x00
 1302|  1.69k|	};
 1303|       |
 1304|  1.69k|	r = read_var_sized(a, &hash_type, &value_len);
 1305|  1.69k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  1.69k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1305:5): [True: 0, False: 1.69k]
  ------------------
 1306|      0|		return r;
 1307|       |
 1308|  1.69k|	*extra_data_size -= value_len;
 1309|  1.69k|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  234|  1.69k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1309:5): [True: 0, False: 1.69k]
  ------------------
 1310|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1311|      0|	}
 1312|       |
 1313|       |	/* The file uses BLAKE2sp checksum algorithm instead of plain old
 1314|       |	 * CRC32. */
 1315|  1.69k|	if(hash_type == BLAKE2sp) {
  ------------------
  |  Branch (1315:5): [True: 1.67k, False: 16]
  ------------------
 1316|  1.67k|		const uint8_t* p;
 1317|  1.67k|		const int hash_size = sizeof(rar5->file.blake2sp);
  ------------------
  |  |   28|  1.67k|#define blake2sp __archive_blake2sp
  ------------------
 1318|       |
 1319|  1.67k|		if(!read_ahead(a, hash_size, &p))
  ------------------
  |  Branch (1319:6): [True: 4, False: 1.67k]
  ------------------
 1320|      4|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1321|       |
 1322|  1.67k|		rar5->file.has_blake2 = 1;
 1323|  1.67k|		memcpy(&rar5->file.blake2sp, p, hash_size);
  ------------------
  |  |   28|  1.67k|#define blake2sp __archive_blake2sp
  ------------------
 1324|       |
 1325|  1.67k|		if(ARCHIVE_OK != consume(a, hash_size)) {
  ------------------
  |  |  234|  1.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1325:6): [True: 0, False: 1.67k]
  ------------------
 1326|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1327|      0|		}
 1328|       |
 1329|  1.67k|		*extra_data_size -= hash_size;
 1330|  1.67k|	} else {
 1331|     16|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1332|     16|		    "Unsupported hash type (0x%jx)", (uintmax_t)hash_type);
 1333|     16|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1334|     16|	}
 1335|       |
 1336|  1.67k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  1.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1337|  1.69k|}
archive_read_support_format_rar5.c:parse_file_extra_htime:
 1420|  4.52k|{
 1421|  4.52k|	char unix_time, has_unix_ns, has_mtime, has_ctime, has_atime;
 1422|  4.52k|	size_t flags = 0;
 1423|  4.52k|	size_t value_len;
 1424|  4.52k|	int ret;
 1425|       |
 1426|  4.52k|	enum HTIME_FLAGS {
 1427|  4.52k|		IS_UNIX       = 0x01,
 1428|  4.52k|		HAS_MTIME     = 0x02,
 1429|  4.52k|		HAS_CTIME     = 0x04,
 1430|  4.52k|		HAS_ATIME     = 0x08,
 1431|  4.52k|		HAS_UNIX_NS   = 0x10,
 1432|  4.52k|	};
 1433|       |
 1434|  4.52k|	ret = read_var_sized(a, &flags, &value_len);
 1435|  4.52k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  4.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1435:5): [True: 3, False: 4.52k]
  ------------------
 1436|      3|		return ret;
 1437|       |
 1438|  4.52k|	*extra_data_size -= value_len;
 1439|  4.52k|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  234|  4.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1439:5): [True: 0, False: 4.52k]
  ------------------
 1440|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1441|      0|	}
 1442|       |
 1443|  4.52k|	unix_time = flags & IS_UNIX;
 1444|  4.52k|	has_unix_ns = unix_time && (flags & HAS_UNIX_NS);
  ------------------
  |  Branch (1444:16): [True: 3.76k, False: 756]
  |  Branch (1444:29): [True: 2.79k, False: 974]
  ------------------
 1445|  4.52k|	has_mtime = flags & HAS_MTIME;
 1446|  4.52k|	has_atime = flags & HAS_ATIME;
 1447|  4.52k|	has_ctime = flags & HAS_CTIME;
 1448|  4.52k|	rar5->file.e_atime_ns = rar5->file.e_ctime_ns = rar5->file.e_mtime_ns = 0;
 1449|       |
 1450|  4.52k|	if(has_mtime) {
  ------------------
  |  Branch (1450:5): [True: 4.10k, False: 419]
  ------------------
 1451|  4.10k|		ret = parse_htime_item(a, unix_time, &rar5->file.e_mtime,
 1452|  4.10k|		    &rar5->file.e_mtime_ns, extra_data_size);
 1453|  4.10k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  4.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1453:6): [True: 4, False: 4.09k]
  ------------------
 1454|      4|			return ret;
 1455|  4.10k|	}
 1456|       |
 1457|  4.51k|	if(has_ctime) {
  ------------------
  |  Branch (1457:5): [True: 660, False: 3.85k]
  ------------------
 1458|    660|		ret = parse_htime_item(a, unix_time, &rar5->file.e_ctime,
 1459|    660|		    &rar5->file.e_ctime_ns, extra_data_size);
 1460|    660|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|    660|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1460:6): [True: 5, False: 655]
  ------------------
 1461|      5|			return ret;
 1462|    660|	}
 1463|       |
 1464|  4.51k|	if(has_atime) {
  ------------------
  |  Branch (1464:5): [True: 805, False: 3.70k]
  ------------------
 1465|    805|		ret = parse_htime_item(a, unix_time, &rar5->file.e_atime,
 1466|    805|		    &rar5->file.e_atime_ns, extra_data_size);
 1467|    805|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|    805|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1467:6): [True: 3, False: 802]
  ------------------
 1468|      3|			return ret;
 1469|    805|	}
 1470|       |
 1471|  4.50k|	if(has_mtime && has_unix_ns) {
  ------------------
  |  Branch (1471:5): [True: 4.09k, False: 416]
  |  Branch (1471:18): [True: 2.78k, False: 1.31k]
  ------------------
 1472|  2.78k|		if(!read_u32(a, &rar5->file.e_mtime_ns))
  ------------------
  |  Branch (1472:6): [True: 0, False: 2.78k]
  ------------------
 1473|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1474|       |
 1475|  2.78k|		*extra_data_size -= 4;
 1476|  2.78k|	}
 1477|       |
 1478|  4.50k|	if(has_ctime && has_unix_ns) {
  ------------------
  |  Branch (1478:5): [True: 652, False: 3.85k]
  |  Branch (1478:18): [True: 285, False: 367]
  ------------------
 1479|    285|		if(!read_u32(a, &rar5->file.e_ctime_ns))
  ------------------
  |  Branch (1479:6): [True: 2, False: 283]
  ------------------
 1480|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1481|       |
 1482|    283|		*extra_data_size -= 4;
 1483|    283|	}
 1484|       |
 1485|  4.50k|	if(has_atime && has_unix_ns) {
  ------------------
  |  Branch (1485:5): [True: 800, False: 3.70k]
  |  Branch (1485:18): [True: 281, False: 519]
  ------------------
 1486|    281|		if(!read_u32(a, &rar5->file.e_atime_ns))
  ------------------
  |  Branch (1486:6): [True: 4, False: 277]
  ------------------
 1487|      4|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1488|       |
 1489|    277|		*extra_data_size -= 4;
 1490|    277|	}
 1491|       |
 1492|       |	/* The seconds and nanoseconds are either together, or separated in two
 1493|       |	 * fields so we parse them, then set the archive_entry's times. */
 1494|  4.50k|	if(has_mtime) {
  ------------------
  |  Branch (1494:5): [True: 4.08k, False: 416]
  ------------------
 1495|  4.08k|		archive_entry_set_mtime(e, rar5->file.e_mtime, rar5->file.e_mtime_ns);
 1496|  4.08k|	}
 1497|       |
 1498|  4.50k|	if(has_ctime) {
  ------------------
  |  Branch (1498:5): [True: 646, False: 3.85k]
  ------------------
 1499|    646|		archive_entry_set_ctime(e, rar5->file.e_ctime, rar5->file.e_ctime_ns);
 1500|    646|	}
 1501|       |
 1502|  4.50k|	if(has_atime) {
  ------------------
  |  Branch (1502:5): [True: 796, False: 3.70k]
  ------------------
 1503|    796|		archive_entry_set_atime(e, rar5->file.e_atime, rar5->file.e_atime_ns);
 1504|    796|	}
 1505|       |
 1506|  4.50k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  4.50k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1507|  4.50k|}
archive_read_support_format_rar5.c:parse_htime_item:
 1341|  5.56k|{
 1342|  5.56k|	if(unix_time) {
  ------------------
  |  Branch (1342:5): [True: 4.33k, False: 1.22k]
  ------------------
 1343|  4.33k|		uint32_t time_val;
 1344|  4.33k|		if(!read_u32(a, &time_val))
  ------------------
  |  Branch (1344:6): [True: 6, False: 4.33k]
  ------------------
 1345|      6|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      6|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1346|       |
 1347|  4.33k|		*extra_data_size -= 4;
 1348|  4.33k|		*sec = (int64_t) time_val;
 1349|  4.33k|	} else {
 1350|  1.22k|		uint64_t windows_time;
 1351|  1.22k|		if(!read_u64(a, &windows_time))
  ------------------
  |  Branch (1351:6): [True: 6, False: 1.22k]
  ------------------
 1352|      6|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      6|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1353|       |
 1354|  1.22k|		__archive_ntfs_to_unix(windows_time, sec, nsec);
 1355|  1.22k|		*extra_data_size -= 8;
 1356|  1.22k|	}
 1357|       |
 1358|  5.55k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  5.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1359|  5.56k|}
archive_read_support_format_rar5.c:read_u64:
 1139|  1.22k|static char read_u64(struct archive_read* a, uint64_t* pvalue) {
 1140|  1.22k|	const uint8_t* p;
 1141|  1.22k|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (1141:5): [True: 6, False: 1.22k]
  ------------------
 1142|      6|		return 0;
 1143|       |
 1144|  1.22k|	*pvalue = archive_le64dec(p);
 1145|  1.22k|	return ARCHIVE_OK == consume(a, 8);
  ------------------
  |  |  234|  1.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1146|  1.22k|}
archive_read_support_format_rar5.c:parse_file_extra_redir:
 1511|  5.01k|{
 1512|  5.01k|	uint64_t value_size = 0;
 1513|  5.01k|	size_t varint_len = 0;
 1514|  5.01k|	size_t target_size = 0;
 1515|  5.01k|	char target_utf8_buf[MAX_NAME_IN_BYTES];
 1516|  5.01k|	const uint8_t* p;
 1517|  5.01k|	int r;
 1518|       |
 1519|  5.01k|	r = read_var(a, &rar5->file.redir_type, &value_size);
 1520|  5.01k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  5.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1520:5): [True: 1, False: 5.01k]
  ------------------
 1521|      1|		return r;
 1522|  5.01k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  234|  5.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1522:5): [True: 0, False: 5.01k]
  ------------------
 1523|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1524|  5.01k|	*extra_data_size -= value_size;
 1525|       |
 1526|  5.01k|	r = read_var(a, &rar5->file.redir_flags, &value_size);
 1527|  5.01k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  5.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1527:5): [True: 1, False: 5.00k]
  ------------------
 1528|      1|		return r;
 1529|  5.00k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  234|  5.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1529:5): [True: 0, False: 5.00k]
  ------------------
 1530|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1531|  5.00k|	*extra_data_size -= value_size;
 1532|       |
 1533|  5.00k|	r = read_var_sized(a, &target_size, &varint_len);
 1534|  5.00k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  5.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1534:5): [True: 0, False: 5.00k]
  ------------------
 1535|      0|		return r;
 1536|  5.00k|	if(ARCHIVE_OK != consume(a, (int64_t)varint_len))
  ------------------
  |  |  234|  5.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1536:5): [True: 0, False: 5.00k]
  ------------------
 1537|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1538|       |
 1539|  5.00k|	if(target_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |  100|  5.00k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1539:5): [True: 14, False: 4.99k]
  ------------------
 1540|     14|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     14|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1541|     14|		    "Link target is too long");
 1542|     14|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1543|     14|	}
 1544|       |
 1545|  4.99k|	if(target_size == 0) {
  ------------------
  |  Branch (1545:5): [True: 6, False: 4.98k]
  ------------------
 1546|      6|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1547|      6|		    "No link target specified");
 1548|      6|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1549|      6|	}
 1550|       |
 1551|  4.98k|	if((int64_t)(target_size + varint_len) > *extra_data_size) {
  ------------------
  |  Branch (1551:5): [True: 5, False: 4.98k]
  ------------------
 1552|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1553|      5|		    "Extra data size is too small for link target");
 1554|      5|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1555|      5|	}
 1556|       |
 1557|  4.98k|	*extra_data_size -= (int64_t)(target_size + varint_len);
 1558|       |
 1559|  4.98k|	if(!read_ahead(a, target_size, &p))
  ------------------
  |  Branch (1559:5): [True: 13, False: 4.97k]
  ------------------
 1560|     13|		return ARCHIVE_EOF;
  ------------------
  |  |  233|     13|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1561|       |
 1562|  4.97k|	memcpy(target_utf8_buf, p, target_size);
 1563|  4.97k|	target_utf8_buf[target_size] = 0;
 1564|       |
 1565|  4.97k|	if(ARCHIVE_OK != consume(a, (int64_t)target_size))
  ------------------
  |  |  234|  4.97k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1565:5): [True: 0, False: 4.97k]
  ------------------
 1566|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1567|       |
 1568|  4.97k|	switch(rar5->file.redir_type) {
 1569|  1.26k|		case REDIR_TYPE_UNIXSYMLINK:
  ------------------
  |  Branch (1569:3): [True: 1.26k, False: 3.70k]
  ------------------
 1570|  1.78k|		case REDIR_TYPE_WINSYMLINK:
  ------------------
  |  Branch (1570:3): [True: 523, False: 4.44k]
  ------------------
 1571|  1.78k|			archive_entry_set_filetype(e, AE_IFLNK);
  ------------------
  |  |  217|  1.78k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1572|  1.78k|			archive_entry_update_symlink_utf8(e, target_utf8_buf);
 1573|  1.78k|			if (rar5->file.redir_flags & REDIR_SYMLINK_IS_DIR) {
  ------------------
  |  |  147|  1.78k|#define REDIR_SYMLINK_IS_DIR	1
  ------------------
  |  Branch (1573:8): [True: 1.15k, False: 637]
  ------------------
 1574|  1.15k|				archive_entry_set_symlink_type(e,
 1575|  1.15k|					AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|  1.15k|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 1576|  1.15k|			} else {
 1577|    637|				archive_entry_set_symlink_type(e,
 1578|    637|				AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|    637|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 1579|    637|			}
 1580|  1.78k|			break;
 1581|       |
 1582|    740|		case REDIR_TYPE_HARDLINK:
  ------------------
  |  Branch (1582:3): [True: 740, False: 4.23k]
  ------------------
 1583|    740|			archive_entry_set_filetype(e, AE_IFREG);
  ------------------
  |  |  216|    740|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1584|    740|			archive_entry_update_hardlink_utf8(e, target_utf8_buf);
 1585|    740|			break;
 1586|       |
 1587|  2.44k|		default:
  ------------------
  |  Branch (1587:3): [True: 2.44k, False: 2.52k]
  ------------------
 1588|       |			/* Unknown redir type, skip it. */
 1589|  2.44k|			break;
 1590|  4.97k|	}
 1591|  4.97k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  4.97k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1592|  4.97k|}
archive_read_support_format_rar5.c:parse_file_extra_owner:
 1596|    736|{
 1597|    736|	uint64_t flags = 0;
 1598|    736|	uint64_t value_size = 0;
 1599|    736|	uint64_t id = 0;
 1600|    736|	size_t name_len = 0;
 1601|    736|	size_t name_size = 0;
 1602|    736|	size_t varint_len = 0;
 1603|    736|	char namebuf[OWNER_MAXNAMELEN];
 1604|    736|	const uint8_t* p;
 1605|    736|	int r;
 1606|       |
 1607|    736|	r = read_var(a, &flags, &value_size);
 1608|    736|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|    736|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1608:5): [True: 1, False: 735]
  ------------------
 1609|      1|		return r;
 1610|    735|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  234|    735|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1610:5): [True: 0, False: 735]
  ------------------
 1611|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1612|    735|	*extra_data_size -= value_size;
 1613|       |
 1614|    735|	if ((flags & OWNER_USER_NAME) != 0) {
  ------------------
  |  |  158|    735|#define	OWNER_USER_NAME		0x01
  ------------------
  |  Branch (1614:6): [True: 382, False: 353]
  ------------------
 1615|    382|		r = read_var_sized(a, &name_size, &varint_len);
 1616|    382|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|    382|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1616:6): [True: 0, False: 382]
  ------------------
 1617|      0|			return r;
 1618|       |
 1619|       |		/* The name cannot be larger than the remaining extra data of
 1620|       |		 * this field. Rejecting an oversized length here also avoids
 1621|       |		 * requesting a huge allocation from read_ahead() below. */
 1622|    382|		if(*extra_data_size < 0 ||
  ------------------
  |  Branch (1622:6): [True: 1, False: 381]
  ------------------
 1623|    381|		    name_size > (uint64_t)*extra_data_size) {
  ------------------
  |  Branch (1623:7): [True: 18, False: 363]
  ------------------
 1624|     19|			archive_set_error(&a->archive,
 1625|     19|			    ARCHIVE_ERRNO_FILE_FORMAT, "Owner name is too long");
  ------------------
  |  |  192|     19|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1626|     19|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1627|     19|		}
 1628|    363|		if(ARCHIVE_OK != consume(a, (int64_t)varint_len))
  ------------------
  |  |  234|    363|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1628:6): [True: 0, False: 363]
  ------------------
 1629|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1630|    363|		*extra_data_size -= (int64_t)(name_size + varint_len);
 1631|       |
 1632|    363|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1632:6): [True: 3, False: 360]
  ------------------
 1633|      3|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1634|       |
 1635|    360|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  162|    360|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1635:7): [True: 12, False: 348]
  ------------------
 1636|     12|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  162|     12|#define	OWNER_MAXNAMELEN	256
  ------------------
 1637|    348|		} else {
 1638|    348|			name_len = name_size;
 1639|    348|		}
 1640|       |
 1641|    360|		memcpy(namebuf, p, name_len);
 1642|    360|		namebuf[name_len] = 0;
 1643|    360|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  234|    360|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1643:6): [True: 0, False: 360]
  ------------------
 1644|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1645|       |
 1646|    360|		archive_entry_set_uname(e, namebuf);
 1647|    360|	}
 1648|    713|	if ((flags & OWNER_GROUP_NAME) != 0) {
  ------------------
  |  |  159|    713|#define	OWNER_GROUP_NAME	0x02
  ------------------
  |  Branch (1648:6): [True: 552, False: 161]
  ------------------
 1649|    552|		r = read_var_sized(a, &name_size, &varint_len);
 1650|    552|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|    552|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1650:6): [True: 2, False: 550]
  ------------------
 1651|      2|			return r;
 1652|       |
 1653|    550|		if(*extra_data_size < 0 ||
  ------------------
  |  Branch (1653:6): [True: 2, False: 548]
  ------------------
 1654|    548|		    name_size > (uint64_t)*extra_data_size) {
  ------------------
  |  Branch (1654:7): [True: 19, False: 529]
  ------------------
 1655|     21|			archive_set_error(&a->archive,
 1656|     21|			    ARCHIVE_ERRNO_FILE_FORMAT, "Group name is too long");
  ------------------
  |  |  192|     21|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1657|     21|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     21|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1658|     21|		}
 1659|    529|		if(ARCHIVE_OK != consume(a, (int64_t)varint_len))
  ------------------
  |  |  234|    529|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1659:6): [True: 0, False: 529]
  ------------------
 1660|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1661|    529|		*extra_data_size -= (int64_t)(name_size + varint_len);
 1662|       |
 1663|    529|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1663:6): [True: 4, False: 525]
  ------------------
 1664|      4|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1665|       |
 1666|    525|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  162|    525|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1666:7): [True: 13, False: 512]
  ------------------
 1667|     13|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  162|     13|#define	OWNER_MAXNAMELEN	256
  ------------------
 1668|    512|		} else {
 1669|    512|			name_len = name_size;
 1670|    512|		}
 1671|       |
 1672|    525|		memcpy(namebuf, p, name_len);
 1673|    525|		namebuf[name_len] = 0;
 1674|    525|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  234|    525|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1674:6): [True: 0, False: 525]
  ------------------
 1675|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1676|       |
 1677|    525|		archive_entry_set_gname(e, namebuf);
 1678|    525|	}
 1679|    686|	if ((flags & OWNER_USER_UID) != 0) {
  ------------------
  |  |  160|    686|#define	OWNER_USER_UID		0x04
  ------------------
  |  Branch (1679:6): [True: 542, False: 144]
  ------------------
 1680|    542|		r = read_var(a, &id, &value_size);
 1681|    542|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|    542|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1681:6): [True: 3, False: 539]
  ------------------
 1682|      3|			return r;
 1683|    539|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  234|    539|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1683:6): [True: 0, False: 539]
  ------------------
 1684|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1685|    539|		*extra_data_size -= value_size;
 1686|       |
 1687|    539|		archive_entry_set_uid(e, (la_int64_t)id);
 1688|    539|	}
 1689|    683|	if ((flags & OWNER_GROUP_GID) != 0) {
  ------------------
  |  |  161|    683|#define	OWNER_GROUP_GID		0x08
  ------------------
  |  Branch (1689:6): [True: 343, False: 340]
  ------------------
 1690|    343|		r = read_var(a, &id, &value_size);
 1691|    343|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|    343|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1691:6): [True: 0, False: 343]
  ------------------
 1692|      0|			return r;
 1693|    343|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  234|    343|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1693:6): [True: 0, False: 343]
  ------------------
 1694|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1695|    343|		*extra_data_size -= value_size;
 1696|       |
 1697|    343|		archive_entry_set_gid(e, (la_int64_t)id);
 1698|    343|	}
 1699|    683|	return ARCHIVE_OK;
  ------------------
  |  |  234|    683|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1700|    683|}
archive_read_support_format_rar5.c:parse_file_extra_version:
 1363|  29.7k|{
 1364|  29.7k|	size_t flags = 0;
 1365|  29.7k|	size_t version = 0;
 1366|  29.7k|	size_t value_len = 0;
 1367|  29.7k|	struct archive_string version_string;
 1368|  29.7k|	struct archive_string name_utf8_string;
 1369|  29.7k|	const char* cur_filename;
 1370|  29.7k|	int r;
 1371|       |
 1372|       |	/* Flags are ignored. */
 1373|  29.7k|	r = read_var_sized(a, &flags, &value_len);
 1374|  29.7k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  29.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1374:5): [True: 38, False: 29.6k]
  ------------------
 1375|     38|		return r;
 1376|       |
 1377|  29.6k|	*extra_data_size -= value_len;
 1378|  29.6k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  234|  29.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1378:5): [True: 0, False: 29.6k]
  ------------------
 1379|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1380|       |
 1381|  29.6k|	r = read_var_sized(a, &version, &value_len);
 1382|  29.6k|	if(r != ARCHIVE_OK)
  ------------------
  |  |  234|  29.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1382:5): [True: 44, False: 29.6k]
  ------------------
 1383|     44|		return r;
 1384|       |
 1385|  29.6k|	*extra_data_size -= value_len;
 1386|  29.6k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  234|  29.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1386:5): [True: 0, False: 29.6k]
  ------------------
 1387|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1388|       |
 1389|       |	/* extra_data_size should be zero here. */
 1390|       |
 1391|  29.6k|	cur_filename = archive_entry_pathname_utf8(e);
 1392|  29.6k|	if(cur_filename == NULL) {
  ------------------
  |  Branch (1392:5): [True: 0, False: 29.6k]
  ------------------
 1393|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1394|      0|		    "Version entry without file name");
 1395|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1396|      0|	}
 1397|       |
 1398|  29.6k|	archive_string_init(&version_string);
  ------------------
  |  |   71|  29.6k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 29.6k]
  |  |  ------------------
  ------------------
 1399|  29.6k|	archive_string_init(&name_utf8_string);
  ------------------
  |  |   71|  29.6k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 29.6k]
  |  |  ------------------
  ------------------
 1400|       |
 1401|       |	/* Prepare a ;123 suffix for the filename, where '123' is the version
 1402|       |	 * value of this file. */
 1403|  29.6k|	archive_string_sprintf(&version_string, ";%zu", version);
 1404|       |
 1405|       |	/* Build the new filename. */
 1406|  29.6k|	archive_strcat(&name_utf8_string, cur_filename);
 1407|  29.6k|	archive_strcat(&name_utf8_string, version_string.s);
 1408|       |
 1409|       |	/* Apply the new filename into this file's context. */
 1410|  29.6k|	archive_entry_update_pathname_utf8(e, name_utf8_string.s);
 1411|       |
 1412|       |	/* Free buffers. */
 1413|  29.6k|	archive_string_free(&version_string);
 1414|  29.6k|	archive_string_free(&name_utf8_string);
 1415|  29.6k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  29.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1416|  29.6k|}
archive_read_support_format_rar5.c:scan_for_signature:
 3564|  16.0k|static int scan_for_signature(struct archive_read* a) {
 3565|  16.0k|	const uint8_t* p;
 3566|  16.0k|	const int chunk_size = 512;
 3567|  16.0k|	ssize_t i;
 3568|  16.0k|	char signature[sizeof(rar5_signature_xor)];
 3569|       |
 3570|       |	/* If we're here, it means we're on an 'unknown territory' data.
 3571|       |	 * There's no indication what kind of data we're reading here.
 3572|       |	 * It could be some text comment, any kind of binary data,
 3573|       |	 * digital sign, dragons, etc.
 3574|       |	 *
 3575|       |	 * We want to find a valid RARv5 magic header inside this unknown
 3576|       |	 * data. */
 3577|       |
 3578|       |	/* Is it possible in libarchive to just skip everything until the
 3579|       |	 * end of the file? If so, it would be a better approach than the
 3580|       |	 * current implementation of this function. */
 3581|       |
 3582|  16.0k|	rar5_signature(signature);
 3583|       |
 3584|  20.2k|	while(1) {
  ------------------
  |  Branch (3584:8): [True: 20.2k, Folded]
  ------------------
 3585|  20.2k|		if(!read_ahead(a, chunk_size, &p))
  ------------------
  |  Branch (3585:6): [True: 1.00k, False: 19.2k]
  ------------------
 3586|  1.00k|			return ARCHIVE_EOF;
  ------------------
  |  |  233|  1.00k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3587|       |
 3588|  5.45M|		for(i = 0; i < chunk_size - (int)sizeof(rar5_signature_xor);
  ------------------
  |  Branch (3588:14): [True: 5.45M, False: 4.23k]
  ------------------
 3589|  5.45M|		    i++) {
 3590|  5.45M|			if(memcmp(&p[i], signature,
  ------------------
  |  Branch (3590:7): [True: 15.0k, False: 5.43M]
  ------------------
 3591|  5.45M|			    sizeof(rar5_signature_xor)) == 0) {
 3592|       |				/* Consume the number of bytes we've used to
 3593|       |				 * search for the signature, as well as the
 3594|       |				 * number of bytes used by the signature
 3595|       |				 * itself. After this we should be standing
 3596|       |				 * on a valid base block header. */
 3597|  15.0k|				(void) consume(a,
 3598|  15.0k|				    i + sizeof(rar5_signature_xor));
 3599|  15.0k|				return ARCHIVE_OK;
  ------------------
  |  |  234|  15.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3600|  15.0k|			}
 3601|  5.45M|		}
 3602|       |
 3603|  4.23k|		consume(a, chunk_size);
 3604|  4.23k|	}
 3605|       |
 3606|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3607|  16.0k|}
archive_read_support_format_rar5.c:rar5_read_data:
 4467|  65.1k|    size_t *size, int64_t *offset) {
 4468|  65.1k|	struct rar5 *rar5 = a->format->data;
 4469|  65.1k|	int ret;
 4470|       |
 4471|  65.1k|	if (buff)
  ------------------
  |  Branch (4471:6): [True: 43.2k, False: 21.8k]
  ------------------
 4472|  43.2k|		*buff = NULL;
 4473|  65.1k|	if (size)
  ------------------
  |  Branch (4473:6): [True: 43.2k, False: 21.8k]
  ------------------
 4474|  43.2k|		*size = 0;
 4475|       |
 4476|  65.1k|	if (rar5->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  416|  65.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (4476:6): [True: 0, False: 65.1k]
  ------------------
 4477|      0|		rar5->has_encrypted_entries = 0;
 4478|      0|	}
 4479|       |
 4480|  65.1k|	if (rar5->headers_are_encrypted || rar5->cstate.data_encrypted) {
  ------------------
  |  Branch (4480:6): [True: 0, False: 65.1k]
  |  Branch (4480:37): [True: 479, False: 64.6k]
  ------------------
 4481|    479|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    479|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4482|    479|		    "Reading encrypted data is not currently supported");
 4483|    479|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|    479|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4484|    479|	}
 4485|       |
 4486|  64.6k|	if(rar5->file.dir > 0) {
  ------------------
  |  Branch (4486:5): [True: 7, False: 64.6k]
  ------------------
 4487|       |		/* Don't process any data if this file entry was declared
 4488|       |		 * as a directory. This is needed, because entries marked as
 4489|       |		 * directory doesn't have any dictionary buffer allocated, so
 4490|       |		 * it's impossible to perform any decompression. */
 4491|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4492|      7|		    "Can't decompress an entry marked as a directory");
 4493|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4494|      7|	}
 4495|       |
 4496|  64.6k|	if(!rar5->skip_mode && (rar5->cstate.last_write_ptr > rar5->file.unpacked_size)) {
  ------------------
  |  Branch (4496:5): [True: 42.7k, False: 21.8k]
  |  Branch (4496:25): [True: 5, False: 42.7k]
  ------------------
 4497|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      5|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4498|      5|		    "Unpacker has written too many bytes");
 4499|      5|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4500|      5|	}
 4501|       |
 4502|  64.6k|	ret = use_data(rar5, buff, size, offset);
 4503|  64.6k|	if(ret == ARCHIVE_OK) {
  ------------------
  |  |  234|  64.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4503:5): [True: 15.1k, False: 49.5k]
  ------------------
 4504|  15.1k|		return ret;
 4505|  15.1k|	}
 4506|       |
 4507|  49.5k|	if(rar5->file.eof == 1) {
  ------------------
  |  Branch (4507:5): [True: 2.52k, False: 46.9k]
  ------------------
 4508|       |		/* The entry is over; report the end of the unpacked data,
 4509|       |		 * so that a sparse-file aware caller does not have to
 4510|       |		 * guess where it is. */
 4511|  2.52k|		if (offset)
  ------------------
  |  Branch (4511:7): [True: 2.52k, False: 2]
  ------------------
 4512|  2.52k|			*offset = rar5->cstate.last_write_ptr;
 4513|  2.52k|		return ARCHIVE_EOF;
  ------------------
  |  |  233|  2.52k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4514|  2.52k|	}
 4515|       |
 4516|  46.9k|	ret = do_unpack(a, rar5, buff, size, offset);
 4517|  46.9k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  46.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4517:5): [True: 16.8k, False: 30.1k]
  ------------------
 4518|  16.8k|		return ret;
 4519|  16.8k|	}
 4520|       |
 4521|  30.1k|	if(rar5->file.bytes_remaining == 0 &&
  ------------------
  |  Branch (4521:5): [True: 5.50k, False: 24.6k]
  ------------------
 4522|  5.50k|			rar5->cstate.last_write_ptr == rar5->file.unpacked_size)
  ------------------
  |  Branch (4522:4): [True: 2.80k, False: 2.69k]
  ------------------
 4523|  2.80k|	{
 4524|       |		/* If all bytes of current file were processed, run
 4525|       |		 * finalization.
 4526|       |		 *
 4527|       |		 * Finalization will check checksum against proper values. If
 4528|       |		 * some of the checksums will not match, we'll return an error
 4529|       |		 * value in the last `archive_read_data` call to signal an error
 4530|       |		 * to the user. */
 4531|       |
 4532|  2.80k|		rar5->file.eof = 1;
 4533|  2.80k|		return verify_global_checksums(a);
 4534|  2.80k|	}
 4535|       |
 4536|  27.3k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  27.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4537|  30.1k|}
archive_read_support_format_rar5.c:use_data:
 3994|  64.6k|{
 3995|  64.6k|	int i;
 3996|       |
 3997|   165k|	for(i = 0; i < rar5_countof(rar5->cstate.dready); i++) {
  ------------------
  |  |   62|   165k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3997:13): [True: 115k, False: 49.5k]
  ------------------
 3998|   115k|		struct data_ready *d = &rar5->cstate.dready[i];
 3999|       |
 4000|   115k|		if(d->used) {
  ------------------
  |  Branch (4000:6): [True: 15.1k, False: 100k]
  ------------------
 4001|  15.1k|			if(buf)    *buf = d->buf;
  ------------------
  |  Branch (4001:7): [True: 15.1k, False: 1]
  ------------------
 4002|  15.1k|			if(size)   *size = d->size;
  ------------------
  |  Branch (4002:7): [True: 15.1k, False: 1]
  ------------------
 4003|  15.1k|			if(offset) *offset = d->offset;
  ------------------
  |  Branch (4003:7): [True: 15.1k, False: 1]
  ------------------
 4004|       |
 4005|  15.1k|			d->used = 0;
 4006|  15.1k|			return ARCHIVE_OK;
  ------------------
  |  |  234|  15.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4007|  15.1k|		}
 4008|   115k|	}
 4009|       |
 4010|  49.5k|	return ARCHIVE_RETRY;
  ------------------
  |  |  235|  49.5k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 4011|  64.6k|}
archive_read_support_format_rar5.c:do_unpack:
 4306|  46.9k|{
 4307|  46.9k|	enum COMPRESSION_METHOD {
 4308|  46.9k|		STORE = 0, FASTEST = 1, FAST = 2, NORMAL = 3, GOOD = 4,
 4309|  46.9k|		BEST = 5
 4310|  46.9k|	};
 4311|       |
 4312|  46.9k|	if(rar5->file.service > 0) {
  ------------------
  |  Branch (4312:5): [True: 321, False: 46.6k]
  ------------------
 4313|    321|		return do_unstore_file(a, rar5, buf, size, offset);
 4314|  46.6k|	} else {
 4315|  46.6k|		switch(rar5->cstate.method) {
 4316|  4.60k|			case STORE:
  ------------------
  |  Branch (4316:4): [True: 4.60k, False: 42.0k]
  ------------------
 4317|  4.60k|				return do_unstore_file(a, rar5, buf, size,
 4318|  4.60k|				    offset);
 4319|  20.1k|			case FASTEST:
  ------------------
  |  Branch (4319:4): [True: 20.1k, False: 26.4k]
  ------------------
 4320|       |				/* fallthrough */
 4321|  21.8k|			case FAST:
  ------------------
  |  Branch (4321:4): [True: 1.71k, False: 44.9k]
  ------------------
 4322|       |				/* fallthrough */
 4323|  29.0k|			case NORMAL:
  ------------------
  |  Branch (4323:4): [True: 7.10k, False: 39.5k]
  ------------------
 4324|       |				/* fallthrough */
 4325|  35.2k|			case GOOD:
  ------------------
  |  Branch (4325:4): [True: 6.23k, False: 40.4k]
  ------------------
 4326|       |				/* fallthrough */
 4327|  42.0k|			case BEST:
  ------------------
  |  Branch (4327:4): [True: 6.83k, False: 39.8k]
  ------------------
 4328|       |				/* No data is returned here. But because a sparse-file aware
 4329|       |				 * caller (like archive_read_data_into_fd) may treat zero-size
 4330|       |				 * as a sparse file block, we need to update the offset
 4331|       |				 * accordingly. At this point the decoder doesn't have any
 4332|       |				 * pending uncompressed data blocks, so the current position in
 4333|       |				 * the output file should be last_write_ptr. */
 4334|  42.0k|				if (offset) *offset = rar5->cstate.last_write_ptr;
  ------------------
  |  Branch (4334:9): [True: 20.5k, False: 21.4k]
  ------------------
 4335|  42.0k|				return uncompress_file(a);
 4336|      0|			default:
  ------------------
  |  Branch (4336:4): [True: 0, False: 46.6k]
  ------------------
 4337|      0|				archive_set_error(&a->archive,
 4338|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4339|      0|				    "Compression method not supported: 0x%x",
 4340|      0|				    (unsigned int)rar5->cstate.method);
 4341|       |
 4342|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4343|  46.6k|		}
 4344|  46.6k|	}
 4345|       |
 4346|      0|#if !defined WIN32
 4347|       |	/* Not reached. */
 4348|      0|	return ARCHIVE_OK;
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4349|  46.9k|#endif
 4350|  46.9k|}
archive_read_support_format_rar5.c:do_unstore_file:
 4242|  4.92k|{
 4243|  4.92k|	size_t to_read;
 4244|  4.92k|	const uint8_t* p;
 4245|       |
 4246|       |	/* This function returns without any data on more than one path,
 4247|       |	 * and the end of the stored data is the position all of them
 4248|       |	 * should report. */
 4249|  4.92k|	if(buf)    *buf = NULL;
  ------------------
  |  Branch (4249:5): [True: 4.54k, False: 373]
  ------------------
 4250|  4.92k|	if(size)   *size = 0;
  ------------------
  |  Branch (4250:5): [True: 4.54k, False: 373]
  ------------------
 4251|  4.92k|	if(offset) *offset = rar5->cstate.last_unstore_ptr;
  ------------------
  |  Branch (4251:5): [True: 4.54k, False: 373]
  ------------------
 4252|       |
 4253|  4.92k|	if(rar5->file.bytes_remaining == 0 && rar5->main.volume > 0 &&
  ------------------
  |  Branch (4253:5): [True: 1.57k, False: 3.35k]
  |  Branch (4253:40): [True: 586, False: 986]
  ------------------
 4254|    586|	    rar5->generic.split_after > 0)
  ------------------
  |  Branch (4254:6): [True: 504, False: 82]
  ------------------
 4255|    504|	{
 4256|    504|		int ret;
 4257|       |
 4258|    504|		rar5->cstate.switch_multivolume = 1;
 4259|    504|		ret = advance_multivolume(a);
 4260|    504|		rar5->cstate.switch_multivolume = 0;
 4261|       |
 4262|    504|		if(ret == ARCHIVE_EOF) {
  ------------------
  |  |  233|    504|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4262:6): [True: 46, False: 458]
  ------------------
 4263|       |			/* We only reach this advance because 'split after' was
 4264|       |			 * set, i.e. the file is promised to continue in a
 4265|       |			 * following volume, but the input ended before we could
 4266|       |			 * reach it (for example, only the first volume of the
 4267|       |			 * set was supplied).  The data decoded so far is
 4268|       |			 * incomplete, so report truncation rather than silently
 4269|       |			 * returning a short read as a clean end of file. */
 4270|     46|			return truncated_multivolume_error(a);
 4271|    458|		} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|    458|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4271:13): [True: 92, False: 366]
  ------------------
 4272|       |			/* Failed to advance to next multivolume archive
 4273|       |			 * file. */
 4274|     92|			return ret;
 4275|     92|		}
 4276|    504|	}
 4277|       |
 4278|  4.78k|	to_read = rar5_min(rar5->file.bytes_remaining, 64 * 1024);
  ------------------
  |  |   60|  4.78k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 33, False: 4.75k]
  |  |  ------------------
  ------------------
 4279|  4.78k|	if(to_read == 0) {
  ------------------
  |  Branch (4279:5): [True: 1.08k, False: 3.70k]
  ------------------
 4280|  1.08k|		return ARCHIVE_EOF;
  ------------------
  |  |  233|  1.08k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4281|  1.08k|	}
 4282|       |
 4283|  3.70k|	if(!read_ahead(a, to_read, &p)) {
  ------------------
  |  Branch (4283:5): [True: 47, False: 3.65k]
  ------------------
 4284|     47|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     47|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4285|     47|		    "I/O error when unstoring file");
 4286|     47|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     47|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4287|     47|	}
 4288|       |
 4289|  3.65k|	if(ARCHIVE_OK != consume(a, to_read)) {
  ------------------
  |  |  234|  3.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4289:5): [True: 0, False: 3.65k]
  ------------------
 4290|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4291|      0|	}
 4292|       |
 4293|  3.65k|	if(buf)    *buf = p;
  ------------------
  |  Branch (4293:5): [True: 3.28k, False: 367]
  ------------------
 4294|  3.65k|	if(size)   *size = to_read;
  ------------------
  |  Branch (4294:5): [True: 3.28k, False: 367]
  ------------------
 4295|  3.65k|	if(offset) *offset = rar5->cstate.last_unstore_ptr;
  ------------------
  |  Branch (4295:5): [True: 3.28k, False: 367]
  ------------------
 4296|       |
 4297|  3.65k|	rar5->file.bytes_remaining -= to_read;
 4298|  3.65k|	rar5->cstate.last_unstore_ptr += to_read;
 4299|       |
 4300|  3.65k|	update_crc(rar5, p, to_read);
 4301|  3.65k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  3.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4302|  3.65k|}
archive_read_support_format_rar5.c:advance_multivolume:
 3623|  10.2k|static int advance_multivolume(struct archive_read* a) {
 3624|  10.2k|	struct rar5 *rar5 = a->format->data;
 3625|  10.2k|	int lret;
 3626|       |
 3627|       |	/* A small state machine that will skip unnecessary data, needed to
 3628|       |	 * switch from one multivolume to another. Such skipping is needed if
 3629|       |	 * we want to be an stream-oriented (instead of file-oriented)
 3630|       |	 * unpacker.
 3631|       |	 *
 3632|       |	 * The state machine starts with `rar5->main.endarc` == 0. It also
 3633|       |	 * assumes that current stream pointer points to some base block
 3634|       |	 * header.
 3635|       |	 *
 3636|       |	 * The `endarc` field is being set when the base block parsing
 3637|       |	 * function encounters the 'end of archive' marker.
 3638|       |	 */
 3639|       |
 3640|  23.5k|	while(1) {
  ------------------
  |  Branch (3640:8): [True: 23.5k, Folded]
  ------------------
 3641|  23.5k|		if(rar5->main.endarc == 1) {
  ------------------
  |  Branch (3641:6): [True: 9.44k, False: 14.0k]
  ------------------
 3642|  9.44k|			int looping = 1;
 3643|       |
 3644|  9.44k|			rar5->main.endarc = 0;
 3645|       |
 3646|  24.9k|			while(looping) {
  ------------------
  |  Branch (3646:10): [True: 21.6k, False: 3.28k]
  ------------------
 3647|  21.6k|				lret = skip_base_block(a);
 3648|  21.6k|				switch(lret) {
 3649|  12.2k|					case ARCHIVE_RETRY:
  ------------------
  |  |  235|  12.2k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3649:6): [True: 12.2k, False: 9.44k]
  ------------------
 3650|       |						/* Continue looping. */
 3651|  12.2k|						break;
 3652|  3.28k|					case ARCHIVE_OK:
  ------------------
  |  |  234|  3.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3652:6): [True: 3.28k, False: 18.3k]
  ------------------
 3653|       |						/* Break loop. */
 3654|  3.28k|						looping = 0;
 3655|  3.28k|						break;
 3656|  6.15k|					default:
  ------------------
  |  Branch (3656:6): [True: 6.15k, False: 15.5k]
  ------------------
 3657|       |						/* Forward any errors to the
 3658|       |						 * caller. */
 3659|  6.15k|						return lret;
 3660|  21.6k|				}
 3661|  21.6k|			}
 3662|       |
 3663|  3.28k|			break;
 3664|  14.0k|		} else {
 3665|       |			/* Skip current base block. In order to properly skip
 3666|       |			 * it, we really need to simply parse it and discard
 3667|       |			 * the results. */
 3668|       |
 3669|  14.0k|			lret = skip_base_block(a);
 3670|  14.0k|			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  240|  28.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  238|  13.9k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3670:7): [True: 131, False: 13.9k]
  |  Branch (3670:32): [True: 400, False: 13.5k]
  ------------------
 3671|    531|				return lret;
 3672|       |
 3673|       |			/* The `skip_base_block` function tells us if we
 3674|       |			 * should continue with skipping, or we should stop
 3675|       |			 * skipping. We're trying to skip everything up to
 3676|       |			 * a base FILE block. */
 3677|       |
 3678|  13.5k|			if(lret != ARCHIVE_RETRY) {
  ------------------
  |  |  235|  13.5k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3678:7): [True: 271, False: 13.2k]
  ------------------
 3679|       |				/* If there was an error during skipping, or we
 3680|       |				 * have just skipped a FILE base block... */
 3681|       |
 3682|    271|				if(rar5->main.endarc == 0) {
  ------------------
  |  Branch (3682:8): [True: 258, False: 13]
  ------------------
 3683|    258|					return lret;
 3684|    258|				} else {
 3685|     13|					continue;
 3686|     13|				}
 3687|    271|			}
 3688|  13.5k|		}
 3689|  23.5k|	}
 3690|       |
 3691|  3.28k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  3.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3692|  10.2k|}
archive_read_support_format_rar5.c:skip_base_block:
 2615|  35.7k|static int skip_base_block(struct archive_read* a) {
 2616|  35.7k|	struct rar5 *rar5 = a->format->data;
 2617|  35.7k|	int ret;
 2618|       |
 2619|       |	/* Create a new local archive_entry structure that will be operated on
 2620|       |	 * by header reader; operations on this archive_entry will be discarded.
 2621|       |	 */
 2622|  35.7k|	struct archive_entry* entry = archive_entry_new();
 2623|  35.7k|	if (entry == NULL)
  ------------------
  |  Branch (2623:6): [True: 0, False: 35.7k]
  ------------------
 2624|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2625|       |
 2626|  35.7k|	ret = process_base_block(a, entry);
 2627|       |
 2628|       |	/* Discard operations on this archive_entry structure. */
 2629|  35.7k|	archive_entry_free(entry);
 2630|  35.7k|	if(ret == ARCHIVE_FATAL)
  ------------------
  |  |  240|  35.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2630:5): [True: 3.96k, False: 31.7k]
  ------------------
 2631|  3.96k|		return ret;
 2632|       |
 2633|  31.7k|	if(rar5->generic.last_header_id == 2 && rar5->generic.split_before > 0)
  ------------------
  |  Branch (2633:5): [True: 17.4k, False: 14.3k]
  |  Branch (2633:42): [True: 3.38k, False: 14.0k]
  ------------------
 2634|  3.38k|		return ARCHIVE_OK;
  ------------------
  |  |  234|  3.38k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2635|       |
 2636|  28.3k|	if(ret == ARCHIVE_OK)
  ------------------
  |  |  234|  28.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2636:5): [True: 22.5k, False: 5.82k]
  ------------------
 2637|  22.5k|		return ARCHIVE_RETRY;
  ------------------
  |  |  235|  22.5k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2638|  5.82k|	else
 2639|  5.82k|		return ret;
 2640|  28.3k|}
archive_read_support_format_rar5.c:truncated_multivolume_error:
 3614|    153|static int truncated_multivolume_error(struct archive_read* a) {
 3615|    153|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    153|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3616|    153|	    "Truncated RAR5 archive: file continues in a subsequent volume "
 3617|    153|	    "that is not available");
 3618|    153|	return ARCHIVE_FATAL;
  ------------------
  |  |  240|    153|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3619|    153|}
archive_read_support_format_rar5.c:update_crc:
 2771|  18.7k|static void update_crc(struct rar5 *rar5, const uint8_t* p, size_t to_read) {
 2772|  18.7k|    int verify_crc;
 2773|       |
 2774|  18.7k|	if(rar5->skip_mode) {
  ------------------
  |  Branch (2774:5): [True: 367, False: 18.4k]
  ------------------
 2775|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 2776|       |		verify_crc = 1;
 2777|       |#else
 2778|    367|		verify_crc = 0;
 2779|    367|#endif
 2780|    367|	} else
 2781|  18.4k|		verify_crc = 1;
 2782|       |
 2783|  18.7k|	if(verify_crc) {
  ------------------
  |  Branch (2783:5): [True: 18.4k, False: 367]
  ------------------
 2784|       |		/* Don't update CRC32 if the file doesn't have the
 2785|       |		 * `stored_crc32` info filled in. */
 2786|  18.4k|		if(rar5->file.stored_crc32 > 0) {
  ------------------
  |  Branch (2786:6): [True: 4.20k, False: 14.1k]
  ------------------
 2787|  4.20k|			rar5->file.calculated_crc32 =
 2788|  4.20k|				__archive_crc32(rar5->file.calculated_crc32, p,
 2789|  4.20k|				    (unsigned int)to_read);
 2790|  4.20k|		}
 2791|       |
 2792|       |		/* Check if the file uses an optional BLAKE2sp checksum
 2793|       |		 * algorithm. */
 2794|  18.4k|		if(rar5->file.has_blake2 > 0) {
  ------------------
  |  Branch (2794:6): [True: 10.0k, False: 8.31k]
  ------------------
 2795|       |			/* Return value of the `update` function is always 0,
 2796|       |			 * so we can explicitly ignore it here. */
 2797|  10.0k|			(void) blake2sp_update(&rar5->file.b2state, p,
  ------------------
  |  |   32|  10.0k|#define blake2sp_update __archive_blake2sp_update
  ------------------
 2798|  10.0k|			    to_read);
 2799|  10.0k|		}
 2800|  18.4k|	}
 2801|  18.7k|}
archive_read_support_format_rar5.c:uncompress_file:
 4226|  42.0k|static int uncompress_file(struct archive_read* a) {
 4227|  42.0k|	int ret;
 4228|       |
 4229|  42.3k|	while(1) {
  ------------------
  |  Branch (4229:8): [True: 42.3k, Folded]
  ------------------
 4230|       |		/* Sometimes the uncompression function will return a
 4231|       |		 * 'retry' signal. If this will happen, we have to retry
 4232|       |		 * the function. */
 4233|  42.3k|		ret = do_uncompress_file(a);
 4234|  42.3k|		if(ret != ARCHIVE_RETRY)
  ------------------
  |  |  235|  42.3k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4234:6): [True: 42.0k, False: 234]
  ------------------
 4235|  42.0k|			return ret;
 4236|  42.3k|	}
 4237|  42.0k|}
archive_read_support_format_rar5.c:do_uncompress_file:
 4113|  42.3k|static int do_uncompress_file(struct archive_read* a) {
 4114|  42.3k|	struct rar5 *rar5 = a->format->data;
 4115|  42.3k|	int ret;
 4116|  42.3k|	int64_t max_end_pos;
 4117|       |
 4118|  42.3k|	if(!rar5->cstate.initialized) {
  ------------------
  |  Branch (4118:5): [True: 13.0k, False: 29.2k]
  ------------------
 4119|       |		/* Don't perform full context reinitialization if we're
 4120|       |		 * processing a solid archive. */
 4121|  13.0k|		if(!rar5->main.solid || !rar5->cstate.window_buf) {
  ------------------
  |  Branch (4121:6): [True: 2.67k, False: 10.3k]
  |  Branch (4121:27): [True: 446, False: 9.90k]
  ------------------
 4122|  3.12k|			if((ret = init_unpack(rar5)) != ARCHIVE_OK)
  ------------------
  |  |  234|  3.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4122:7): [True: 0, False: 3.12k]
  ------------------
 4123|      0|				return ret;
 4124|  3.12k|		}
 4125|       |
 4126|  13.0k|		rar5->cstate.initialized = 1;
 4127|  13.0k|	}
 4128|       |
 4129|       |	/* Don't allow extraction if window_size is invalid. */
 4130|  42.3k|	if(rar5->cstate.window_size == 0) {
  ------------------
  |  Branch (4130:5): [True: 0, False: 42.3k]
  ------------------
 4131|      0|		archive_set_error(&a->archive,
 4132|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4133|      0|			"Invalid window size declaration in this file");
 4134|       |
 4135|       |		/* This should never happen in valid files. */
 4136|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4137|      0|	}
 4138|       |
 4139|  42.3k|	if(rar5->cstate.all_filters_applied == 1) {
  ------------------
  |  Branch (4139:5): [True: 38.7k, False: 3.59k]
  ------------------
 4140|       |		/* We use while(1) here, but standard case allows for just 1
 4141|       |		 * iteration. The loop will iterate if process_block() didn't
 4142|       |		 * generate any data at all. This can happen if the block
 4143|       |		 * contains only filter definitions (this is common in big
 4144|       |		 * files). */
 4145|  57.6k|		while(1) {
  ------------------
  |  Branch (4145:9): [True: 57.6k, Folded]
  ------------------
 4146|  57.6k|			ret = process_block(a);
 4147|  57.6k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  57.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4147:7): [True: 14.7k, False: 42.8k]
  ------------------
 4148|  14.7k|				return ret;
 4149|       |
 4150|  42.8k|			if(rar5->cstate.last_write_ptr ==
  ------------------
  |  Branch (4150:7): [True: 19.6k, False: 23.1k]
  ------------------
 4151|  42.8k|			    rar5->cstate.write_ptr) {
 4152|       |				/* The block didn't generate any new data,
 4153|       |				 * so just process a new block if this one
 4154|       |				 * wasn't the last block in the file. */
 4155|  19.6k|				if (bf_is_last_block(&rar5->last_block_hdr)) {
  ------------------
  |  Branch (4155:9): [True: 739, False: 18.9k]
  ------------------
 4156|    739|					return ARCHIVE_EOF;
  ------------------
  |  |  233|    739|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4157|    739|				}
 4158|       |
 4159|  18.9k|				continue;
 4160|  19.6k|			}
 4161|       |
 4162|       |			/* The block has generated some new data, so break
 4163|       |			 * the loop. */
 4164|  23.1k|			break;
 4165|  42.8k|		}
 4166|  38.7k|	}
 4167|       |
 4168|       |	/* Try to run filters. If filters won't be applied, it means that
 4169|       |	 * insufficient data was generated. */
 4170|  26.7k|	ret = apply_filters(a);
 4171|  26.7k|	if(ret == ARCHIVE_RETRY) {
  ------------------
  |  |  235|  26.7k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4171:5): [True: 3.59k, False: 23.1k]
  ------------------
 4172|  3.59k|		return ARCHIVE_OK;
  ------------------
  |  |  234|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4173|  23.1k|	} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  23.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4173:12): [True: 18, False: 23.1k]
  ------------------
 4174|     18|		return ret;
 4175|     18|	}
 4176|       |
 4177|  23.1k|	if(cdeque_size(&rar5->cstate.filters) > 0) {
  ------------------
  |  Branch (4177:5): [True: 1.09k, False: 22.0k]
  ------------------
 4178|       |		/* Check if we can write something before hitting first
 4179|       |		 * filter. */
 4180|  1.09k|		struct filter_info* flt;
 4181|       |
 4182|       |		/* Get the block_start offset from the first filter. */
 4183|  1.09k|		if(CDE_OK != cdeque_front(&rar5->cstate.filters,
  ------------------
  |  Branch (4183:6): [True: 0, False: 1.09k]
  ------------------
 4184|  1.09k|		    cdeque_filter_p(&flt)))
 4185|      0|		{
 4186|      0|			archive_set_error(&a->archive,
 4187|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4188|      0|			    "Can't read first filter");
 4189|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4190|      0|		}
 4191|       |
 4192|  1.09k|		max_end_pos = rar5_min(flt->block_start,
  ------------------
  |  |   60|  1.09k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 777, False: 316]
  |  |  ------------------
  ------------------
 4193|  1.09k|		    rar5->cstate.write_ptr);
 4194|  22.0k|	} else {
 4195|       |		/* There are no filters defined, or all filters were applied.
 4196|       |		 * This means we can just store the data without any
 4197|       |		 * postprocessing. */
 4198|  22.0k|		max_end_pos = rar5->cstate.write_ptr;
 4199|  22.0k|	}
 4200|       |
 4201|  23.1k|	if(max_end_pos == rar5->cstate.last_write_ptr) {
  ------------------
  |  Branch (4201:5): [True: 234, False: 22.9k]
  ------------------
 4202|       |		/* We can't write anything yet. The block uncompression
 4203|       |		 * function did not generate enough data, and no filter can be
 4204|       |		 * applied. At the same time we don't have any data that can be
 4205|       |		 *  stored without filter postprocessing. This means we need to
 4206|       |		 *  wait for more data to be generated, so we can apply the
 4207|       |		 * filters.
 4208|       |		 *
 4209|       |		 * Signal the caller that we need more data to be able to do
 4210|       |		 * anything.
 4211|       |		 */
 4212|    234|		return ARCHIVE_RETRY;
  ------------------
  |  |  235|    234|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 4213|  22.9k|	} else {
 4214|       |		/* We can write the data before hitting the first filter.
 4215|       |		 * So let's do it. The push_window_data() function will
 4216|       |		 * effectively return the selected data block to the user
 4217|       |		 * application. */
 4218|  22.9k|		push_window_data(a, rar5, rar5->cstate.last_write_ptr,
 4219|  22.9k|		    max_end_pos);
 4220|  22.9k|		rar5->cstate.last_write_ptr = max_end_pos;
 4221|  22.9k|	}
 4222|       |
 4223|  22.9k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  22.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4224|  23.1k|}
archive_read_support_format_rar5.c:init_unpack:
 2735|  3.12k|static int init_unpack(struct rar5 *rar5) {
 2736|  3.12k|	rar5->file.calculated_crc32 = 0;
 2737|  3.12k|	init_window_mask(rar5);
 2738|       |
 2739|  3.12k|	free(rar5->cstate.window_buf);
 2740|  3.12k|	free(rar5->cstate.filtered_buf);
 2741|       |
 2742|  3.12k|	rar5->cstate.window_buf = NULL;
 2743|  3.12k|	rar5->cstate.window_buf_size = 0;
 2744|  3.12k|	rar5->cstate.filtered_buf = NULL;
 2745|       |
 2746|  3.12k|	if(rar5->cstate.window_size > 0) {
  ------------------
  |  Branch (2746:5): [True: 3.12k, False: 0]
  ------------------
 2747|  3.12k|		rar5->cstate.window_buf = calloc(1, rar5->cstate.window_size);
 2748|  3.12k|		if(rar5->cstate.window_buf == NULL)
  ------------------
  |  Branch (2748:6): [True: 0, False: 3.12k]
  ------------------
 2749|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2750|  3.12k|		rar5->cstate.window_buf_size =
 2751|  3.12k|		    (size_t) rar5->cstate.window_size;
 2752|  3.12k|		rar5->cstate.filtered_buf = calloc(1,
 2753|  3.12k|		    rar5->cstate.window_size);
 2754|  3.12k|		if(rar5->cstate.filtered_buf == NULL)
  ------------------
  |  Branch (2754:6): [True: 0, False: 3.12k]
  ------------------
 2755|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2756|  3.12k|	}
 2757|       |
 2758|  3.12k|	clear_data_ready_stack(rar5);
 2759|       |
 2760|  3.12k|	rar5->cstate.write_ptr = 0;
 2761|  3.12k|	rar5->cstate.last_write_ptr = 0;
 2762|       |
 2763|  3.12k|	memset(&rar5->cstate.bd, 0, sizeof(rar5->cstate.bd));
 2764|  3.12k|	memset(&rar5->cstate.ld, 0, sizeof(rar5->cstate.ld));
 2765|  3.12k|	memset(&rar5->cstate.dd, 0, sizeof(rar5->cstate.dd));
 2766|  3.12k|	memset(&rar5->cstate.ldd, 0, sizeof(rar5->cstate.ldd));
 2767|  3.12k|	memset(&rar5->cstate.rd, 0, sizeof(rar5->cstate.rd));
 2768|  3.12k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  3.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2769|  3.12k|}
archive_read_support_format_rar5.c:process_block:
 3826|  57.6k|static int process_block(struct archive_read* a) {
 3827|  57.6k|	struct rar5 *rar5 = a->format->data;
 3828|  57.6k|	const uint8_t* p;
 3829|  57.6k|	int ret;
 3830|       |
 3831|       |	/* If we don't have any data to be processed, this most probably means
 3832|       |	 * we need to switch to the next volume. */
 3833|  57.6k|	if(rar5->main.volume && rar5->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3833:5): [True: 47.9k, False: 9.66k]
  |  Branch (3833:26): [True: 8.92k, False: 39.0k]
  ------------------
 3834|       |		/* Capture 'split after' before advancing: advance_multivolume()
 3835|       |		 * parses following headers and overwrites this flag. */
 3836|  8.92k|		int split_after = rar5->generic.split_after > 0;
 3837|  8.92k|		ret = advance_multivolume(a);
 3838|  8.92k|		if(ret == ARCHIVE_EOF && split_after) {
  ------------------
  |  |  233|  17.8k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3838:6): [True: 179, False: 8.74k]
  |  Branch (3838:28): [True: 19, False: 160]
  ------------------
 3839|       |			/* The file is promised to continue in a following
 3840|       |			 * volume, but the input ended first. */
 3841|     19|			return truncated_multivolume_error(a);
 3842|     19|		}
 3843|  8.90k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  8.90k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3843:6): [True: 6.57k, False: 2.32k]
  ------------------
 3844|  6.57k|			return ret;
 3845|  8.90k|	}
 3846|       |
 3847|  51.0k|	if(rar5->cstate.block_parsing_finished) {
  ------------------
  |  Branch (3847:5): [True: 43.0k, False: 7.97k]
  ------------------
 3848|  43.0k|		ssize_t block_size;
 3849|  43.0k|		ssize_t to_skip;
 3850|  43.0k|		ssize_t cur_block_size;
 3851|       |
 3852|       |		/* The header size won't be bigger than 6 bytes. */
 3853|  43.0k|		if(!read_ahead(a, 6, &p)) {
  ------------------
  |  Branch (3853:6): [True: 335, False: 42.7k]
  ------------------
 3854|       |			/* Failed to prefetch data block header. */
 3855|    335|			return ARCHIVE_EOF;
  ------------------
  |  |  233|    335|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3856|    335|		}
 3857|       |
 3858|       |		/*
 3859|       |		 * Read block_size by parsing block header. Validate the header
 3860|       |		 * by calculating CRC byte stored inside the header. Size of
 3861|       |		 * the header is not constant (block size can be stored either
 3862|       |		 * in 1 or 2 bytes), that's why block size is left out from the
 3863|       |		 * `compressed_block_header` structure and returned by
 3864|       |		 * `parse_block_header` as the second argument. */
 3865|       |
 3866|  42.7k|		ret = parse_block_header(a, p, &block_size,
 3867|  42.7k|		    &rar5->last_block_hdr);
 3868|  42.7k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  42.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3868:6): [True: 3.22k, False: 39.4k]
  ------------------
 3869|  3.22k|			return ret;
 3870|  3.22k|		}
 3871|       |
 3872|       |		/* Skip block header. Next data is huffman tables,
 3873|       |		 * if present. */
 3874|  39.4k|		to_skip = sizeof(struct compressed_block_header) +
 3875|  39.4k|			bf_byte_count(&rar5->last_block_hdr) + 1;
 3876|       |
 3877|       |		/* If the block header's to_skip value exceeds the declared
 3878|       |		 * remaining data, the archive is malformed. */
 3879|  39.4k|		if(to_skip > rar5->file.bytes_remaining) {
  ------------------
  |  Branch (3879:6): [True: 26, False: 39.4k]
  ------------------
 3880|     26|			archive_set_error(&a->archive,
 3881|     26|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     26|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3882|     26|			    "Block header size exceeds remaining file data");
 3883|     26|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     26|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3884|     26|		}
 3885|       |
 3886|  39.4k|		if(ARCHIVE_OK != consume(a, to_skip))
  ------------------
  |  |  234|  39.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3886:6): [True: 0, False: 39.4k]
  ------------------
 3887|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3888|       |
 3889|  39.4k|		rar5->file.bytes_remaining -= to_skip;
 3890|       |
 3891|       |		/* The block size gives information about the whole block size,
 3892|       |		 * but the block could be stored in split form when using
 3893|       |		 * multi-volume archives. In this case, the block size will be
 3894|       |		 * bigger than the actual data stored in this file. Remaining
 3895|       |		 * part of the data will be in another file. */
 3896|       |
 3897|  39.4k|		cur_block_size =
 3898|  39.4k|			rar5_min(rar5->file.bytes_remaining, block_size);
  ------------------
  |  |   60|  39.4k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 28.1k, False: 11.3k]
  |  |  ------------------
  ------------------
 3899|       |
 3900|  39.4k|		if(block_size > rar5->file.bytes_remaining) {
  ------------------
  |  Branch (3900:6): [True: 385, False: 39.0k]
  ------------------
 3901|       |			/* If current blocks' size is bigger than our data
 3902|       |			 * size, this means we have a multivolume archive.
 3903|       |			 * In this case, skip all base headers until the end
 3904|       |			 * of the file, proceed to next "partXXX.rar" volume,
 3905|       |			 * find its signature, skip all headers up to the first
 3906|       |			 * FILE base header, and continue from there.
 3907|       |			 *
 3908|       |			 * Note that `merge_block` will update the `rar`
 3909|       |			 * context structure quite extensively. */
 3910|       |
 3911|    385|			ret = merge_block(a, block_size, &p);
 3912|    385|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|    385|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3912:7): [True: 154, False: 231]
  ------------------
 3913|    154|				return ret;
 3914|    154|			}
 3915|       |
 3916|    231|			cur_block_size = block_size;
 3917|       |
 3918|       |			/* Current stream pointer should be now directly
 3919|       |			 * *after* the block that spanned through multiple
 3920|       |			 * archive files. `p` pointer should have the data of
 3921|       |			 * the *whole* block (merged from partial blocks
 3922|       |			 * stored in multiple archives files). */
 3923|  39.0k|		} else {
 3924|  39.0k|			rar5->cstate.switch_multivolume = 0;
 3925|       |
 3926|       |			/* Read the whole block size into memory. This can take
 3927|       |			 * up to  8 megabytes of memory in theoretical cases.
 3928|       |			 * Might be worth to optimize this and use a standard
 3929|       |			 * chunk of 4kb's. */
 3930|  39.0k|			if(!read_ahead(a, 4 + cur_block_size, &p)) {
  ------------------
  |  Branch (3930:7): [True: 540, False: 38.5k]
  ------------------
 3931|       |				/* Failed to prefetch block data. */
 3932|    540|				return ARCHIVE_EOF;
  ------------------
  |  |  233|    540|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3933|    540|			}
 3934|  39.0k|		}
 3935|       |
 3936|  38.7k|		rar5->cstate.block_buf = p;
 3937|  38.7k|		rar5->cstate.cur_block_size = cur_block_size;
 3938|  38.7k|		rar5->cstate.block_parsing_finished = 0;
 3939|       |
 3940|  38.7k|		rar5->bits.in_addr = 0;
 3941|  38.7k|		rar5->bits.bit_addr = 0;
 3942|       |
 3943|  38.7k|		if(bf_is_table_present(&rar5->last_block_hdr)) {
  ------------------
  |  Branch (3943:6): [True: 3.42k, False: 35.3k]
  ------------------
 3944|       |			/* Load Huffman tables. */
 3945|  3.42k|			ret = parse_tables(a, rar5, p);
 3946|  3.42k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  3.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3946:7): [True: 1.52k, False: 1.89k]
  ------------------
 3947|       |				/* Error during decompression of Huffman
 3948|       |				 * tables. */
 3949|  1.52k|				return ret;
 3950|  1.52k|			}
 3951|  3.42k|		}
 3952|  38.7k|	} else {
 3953|       |		/* Block parsing not finished, reuse previous memory buffer. */
 3954|  7.97k|		p = rar5->cstate.block_buf;
 3955|  7.97k|	}
 3956|       |
 3957|       |	/* Uncompress the block, or a part of it, depending on how many bytes
 3958|       |	 * will be generated by uncompressing the block.
 3959|       |	 *
 3960|       |	 * In case too many bytes will be generated, calling this function
 3961|       |	 * again will resume the uncompression operation. */
 3962|  45.2k|	ret = do_uncompress_block(a, p);
 3963|  45.2k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  45.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3963:5): [True: 2.39k, False: 42.8k]
  ------------------
 3964|  2.39k|		return ret;
 3965|  2.39k|	}
 3966|       |
 3967|  42.8k|	if(rar5->cstate.block_parsing_finished &&
  ------------------
  |  Branch (3967:5): [True: 37.3k, False: 5.46k]
  ------------------
 3968|  37.3k|	    rar5->cstate.switch_multivolume == 0 &&
  ------------------
  |  Branch (3968:6): [True: 37.1k, False: 173]
  ------------------
 3969|  37.1k|	    rar5->cstate.cur_block_size > 0)
  ------------------
  |  Branch (3969:6): [True: 17.7k, False: 19.4k]
  ------------------
 3970|  17.7k|	{
 3971|       |		/* If we're processing a normal block, consume the whole
 3972|       |		 * block. We can do this because we've already read the whole
 3973|       |		 * block to memory. */
 3974|  17.7k|		if(ARCHIVE_OK != consume(a, rar5->cstate.cur_block_size))
  ------------------
  |  |  234|  17.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3974:6): [True: 0, False: 17.7k]
  ------------------
 3975|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3976|       |
 3977|  17.7k|		rar5->file.bytes_remaining -= rar5->cstate.cur_block_size;
 3978|  25.1k|	} else if(rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (3978:12): [True: 173, False: 24.9k]
  ------------------
 3979|       |		/* Don't consume the block if we're doing multivolume
 3980|       |		 * processing. The volume switching function will consume
 3981|       |		 * the proper count of bytes instead. */
 3982|    173|		rar5->cstate.switch_multivolume = 0;
 3983|    173|	}
 3984|       |
 3985|  42.8k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  42.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3986|  42.8k|}
archive_read_support_format_rar5.c:parse_block_header:
 3098|  42.7k|{
 3099|  42.7k|	uint8_t calculated_cksum;
 3100|  42.7k|	memcpy(hdr, p, sizeof(struct compressed_block_header));
 3101|       |
 3102|  42.7k|	if(bf_byte_count(hdr) > 2) {
  ------------------
  |  Branch (3102:5): [True: 3.22k, False: 39.4k]
  ------------------
 3103|  3.22k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  3.22k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3104|  3.22k|		    "Unsupported block header size (was %d, max is 2)",
 3105|  3.22k|		    bf_byte_count(hdr));
 3106|  3.22k|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|  3.22k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3107|  3.22k|	}
 3108|       |
 3109|       |	/* This should probably use bit reader interface in order to be more
 3110|       |	 * future-proof. */
 3111|  39.4k|	*block_size = 0;
 3112|  39.4k|	switch(bf_byte_count(hdr)) {
 3113|       |		/* 1-byte block size */
 3114|  38.9k|		case 0:
  ------------------
  |  Branch (3114:3): [True: 38.9k, False: 510]
  ------------------
 3115|  38.9k|			*block_size = *(const uint8_t*) &p[2];
 3116|  38.9k|			break;
 3117|       |
 3118|       |		/* 2-byte block size */
 3119|    229|		case 1:
  ------------------
  |  Branch (3119:3): [True: 229, False: 39.2k]
  ------------------
 3120|    229|			*block_size = archive_le16dec(&p[2]);
 3121|    229|			break;
 3122|       |
 3123|       |		/* 3-byte block size */
 3124|    281|		case 2:
  ------------------
  |  Branch (3124:3): [True: 281, False: 39.2k]
  ------------------
 3125|    281|			*block_size = archive_le32dec(&p[2]);
 3126|    281|			*block_size &= 0x00FFFFFF;
 3127|    281|			break;
 3128|       |
 3129|       |		/* Other block sizes are not supported. This case is not
 3130|       |		 * reached, because we have an 'if' guard before the switch
 3131|       |		 * that makes sure of it. */
 3132|      0|		default:
  ------------------
  |  Branch (3132:3): [True: 0, False: 39.4k]
  ------------------
 3133|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3134|  39.4k|	}
 3135|       |
 3136|       |	/* Verify the block header checksum. 0x5A is a magic value and is
 3137|       |	 * always * constant. */
 3138|  39.4k|	calculated_cksum = 0x5A
 3139|  39.4k|	    ^ (uint8_t) hdr->block_flags_u8
 3140|  39.4k|	    ^ (uint8_t) *block_size
 3141|  39.4k|	    ^ (uint8_t) (*block_size >> 8)
 3142|  39.4k|	    ^ (uint8_t) (*block_size >> 16);
 3143|       |
 3144|  39.4k|	if(calculated_cksum != hdr->block_cksum) {
  ------------------
  |  Branch (3144:5): [True: 37.2k, False: 2.25k]
  ------------------
 3145|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3146|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 3147|       |		    "Block checksum error: got 0x%x, expected 0x%x",
 3148|       |		    hdr->block_cksum, calculated_cksum);
 3149|       |
 3150|       |		return ARCHIVE_FAILED;
 3151|       |#endif
 3152|  37.2k|	}
 3153|       |
 3154|  39.4k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  39.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3155|  39.4k|}
archive_read_support_format_rar5.c:bf_byte_count:
  517|   124k|uint8_t bf_byte_count(const struct compressed_block_header* hdr) {
  518|   124k|	return (hdr->block_flags_u8 >> 3) & 7;
  519|   124k|}
archive_read_support_format_rar5.c:merge_block:
 3700|    385|{
 3701|    385|	struct rar5 *rar5 = a->format->data;
 3702|    385|	ssize_t cur_block_size, partial_offset = 0;
 3703|    385|	const uint8_t* lp;
 3704|    385|	int ret;
 3705|       |
 3706|    385|	if(rar5->merge_mode) {
  ------------------
  |  Branch (3706:5): [True: 0, False: 385]
  ------------------
 3707|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3708|      0|		    "Recursive merge is not allowed");
 3709|       |
 3710|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3711|      0|	}
 3712|       |
 3713|       |	/* Set a flag that we're in the switching mode. */
 3714|    385|	rar5->cstate.switch_multivolume = 1;
 3715|       |
 3716|       |	/* Reallocate the memory which will hold the whole block. */
 3717|    385|	free(rar5->vol.push_buf);
 3718|       |
 3719|       |	/* Increasing the allocation block by 8 is due to bit reading functions,
 3720|       |	 * which are using additional 2 or 4 bytes. Allocating the block size
 3721|       |	 * by exact value would make bit reader perform reads from invalid
 3722|       |	 * memory block when reading the last byte from the buffer. */
 3723|    385|	rar5->vol.push_buf = malloc(block_size + 8);
 3724|    385|	if(!rar5->vol.push_buf) {
  ------------------
  |  Branch (3724:5): [True: 0, False: 385]
  ------------------
 3725|      0|		archive_set_error(&a->archive, ENOMEM,
 3726|      0|		    "Can't allocate memory for a merge block buffer");
 3727|      0|		rar5->cstate.switch_multivolume = 0;
 3728|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3729|      0|	}
 3730|       |
 3731|       |	/* Valgrind complains if the extension block for bit reader is not
 3732|       |	 * initialized, so initialize it. */
 3733|    385|	memset(&rar5->vol.push_buf[block_size], 0, 8);
 3734|       |
 3735|       |	/* A single block can span across multiple multivolume archive files,
 3736|       |	 * so we use a loop here. This loop will consume enough multivolume
 3737|       |	 * archive files until the whole block is read. */
 3738|       |
 3739|  1.07k|	while(1) {
  ------------------
  |  Branch (3739:8): [True: 1.07k, Folded]
  ------------------
 3740|       |		/* Get the size of current block chunk in this multivolume
 3741|       |		 * archive file and read it. */
 3742|  1.07k|		cur_block_size = rar5_min(rar5->file.bytes_remaining,
  ------------------
  |  |   60|  1.07k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 234, False: 842]
  |  |  ------------------
  ------------------
 3743|  1.07k|		    block_size - partial_offset);
 3744|       |
 3745|  1.07k|		if(cur_block_size < 1) {
  ------------------
  |  Branch (3745:6): [True: 7, False: 1.06k]
  ------------------
 3746|       |			/* bytes_remaining is less than 1 at the wrong point in
 3747|       |			 * the merge loop, indicating corrupt volume
 3748|       |			 * accounting. */
 3749|      7|			archive_set_error(&a->archive,
 3750|      7|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3751|      7|			    "Encountered invalid block size during block merge");
 3752|      7|			rar5->cstate.switch_multivolume = 0;
 3753|      7|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3754|      7|		}
 3755|       |
 3756|  1.06k|		if(!read_ahead(a, cur_block_size, &lp)) {
  ------------------
  |  Branch (3756:6): [True: 31, False: 1.03k]
  ------------------
 3757|       |			/* We are in the middle of merging a block that spans
 3758|       |			 * volumes, so more data must follow; running out of
 3759|       |			 * input here means the following volume is missing. */
 3760|     31|			rar5->cstate.switch_multivolume = 0;
 3761|     31|			return truncated_multivolume_error(a);
 3762|     31|		}
 3763|       |
 3764|       |		/* Sanity check; there should never be a situation where this
 3765|       |		 * function reads more data than the block's size. */
 3766|  1.03k|		if(partial_offset + cur_block_size > block_size) {
  ------------------
  |  Branch (3766:6): [True: 0, False: 1.03k]
  ------------------
 3767|      0|			archive_set_error(&a->archive,
 3768|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3769|      0|			    "Consumed too much data when merging blocks");
 3770|      0|			rar5->cstate.switch_multivolume = 0;
 3771|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3772|      0|		}
 3773|       |
 3774|       |		/* Merge previous block chunk with current block chunk,
 3775|       |		 * or create first block chunk if this is our first
 3776|       |		 * iteration. */
 3777|  1.03k|		memcpy(&rar5->vol.push_buf[partial_offset], lp, cur_block_size);
 3778|       |
 3779|       |		/* Advance the stream read pointer by this block chunk size. */
 3780|  1.03k|		if(ARCHIVE_OK != consume(a, cur_block_size)) {
  ------------------
  |  |  234|  1.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3780:6): [True: 0, False: 1.03k]
  ------------------
 3781|       |			/* Data was copied but stream pointer didn't advance;
 3782|       |			 * stream position is unrecoverable. */
 3783|      0|			rar5->cstate.switch_multivolume = 0;
 3784|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3785|      0|		}
 3786|       |
 3787|       |		/* Update the pointers. `partial_offset` contains information
 3788|       |		 * about the sum of merged block chunks. */
 3789|  1.03k|		partial_offset += cur_block_size;
 3790|  1.03k|		rar5->file.bytes_remaining -= cur_block_size;
 3791|       |
 3792|       |		/* If `partial_offset` is the same as `block_size`, this means
 3793|       |		 * we've merged all block chunks and we have a valid full
 3794|       |		 * block. */
 3795|  1.03k|		if(partial_offset == block_size) {
  ------------------
  |  Branch (3795:6): [True: 231, False: 807]
  ------------------
 3796|    231|			break;
 3797|    231|		}
 3798|       |
 3799|       |		/* If we don't have any bytes to read, this means we should
 3800|       |		 * switch to another multivolume archive file. */
 3801|    807|		if(rar5->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3801:6): [True: 807, False: 0]
  ------------------
 3802|    807|			rar5->merge_mode++;
 3803|    807|			ret = advance_multivolume(a);
 3804|    807|			rar5->merge_mode--;
 3805|    807|			if(ret == ARCHIVE_EOF) {
  ------------------
  |  |  233|    807|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3805:7): [True: 57, False: 750]
  ------------------
 3806|       |				/* The block is only partially merged but the
 3807|       |				 * input ended, so the volume that holds the rest
 3808|       |				 * of it is missing. */
 3809|     57|				rar5->cstate.switch_multivolume = 0;
 3810|     57|				return truncated_multivolume_error(a);
 3811|    750|			} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|    750|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3811:14): [True: 59, False: 691]
  ------------------
 3812|     59|				rar5->cstate.switch_multivolume = 0;
 3813|     59|				return ret;
 3814|     59|			}
 3815|    807|		}
 3816|    807|	}
 3817|       |
 3818|    231|	*p = rar5->vol.push_buf;
 3819|       |
 3820|       |	/* If we're here, we can resume unpacking by processing the block
 3821|       |	 * pointed to by the `*p` memory pointer. */
 3822|       |
 3823|    231|	return ARCHIVE_OK;
  ------------------
  |  |  234|    231|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3824|    385|}
archive_read_support_format_rar5.c:bf_is_table_present:
  522|  38.7k|uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
  523|  38.7k|	return (hdr->block_flags_u8 >> 7) & 1;
  524|  38.7k|}
archive_read_support_format_rar5.c:parse_tables:
 2925|  3.42k|{
 2926|  3.42k|	int ret, value, i, w, idx = 0;
 2927|  3.42k|	uint8_t bit_length[HUFF_BC],
 2928|  3.42k|		table[HUFF_TABLE_SIZE],
 2929|  3.42k|		nibble_mask = 0xF0,
 2930|  3.42k|		nibble_shift = 4;
 2931|       |
 2932|  3.42k|	enum { ESCAPE = 15 };
 2933|       |
 2934|       |	/* The data for table generation is compressed using a simple RLE-like
 2935|       |	 * algorithm when storing zeroes, so we need to unpack it first. */
 2936|  41.0k|	for(w = 0, i = 0; w < HUFF_BC;) {
  ------------------
  |  |  262|  41.0k|#define HUFF_BC 20
  ------------------
  |  Branch (2936:20): [True: 37.7k, False: 3.29k]
  ------------------
 2937|  37.7k|		if(i >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (2937:6): [True: 130, False: 37.6k]
  ------------------
 2938|       |			/* Truncated data, can't continue. */
 2939|    130|			archive_set_error(&a->archive,
 2940|    130|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    130|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2941|    130|			    "Truncated data in huffman tables");
 2942|    130|			return ARCHIVE_FAILED;
  ------------------
  |  |  238|    130|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2943|    130|		}
 2944|       |
 2945|  37.6k|		value = (p[i] & nibble_mask) >> nibble_shift;
 2946|       |
 2947|  37.6k|		if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2947:6): [True: 18.5k, False: 19.0k]
  ------------------
 2948|  18.5k|			++i;
 2949|       |
 2950|  37.6k|		nibble_mask ^= 0xFF;
 2951|  37.6k|		nibble_shift ^= 4;
 2952|       |
 2953|       |		/* Values smaller than 15 is data, so we write it directly.
 2954|       |		 * Value 15 is a flag telling us that we need to unpack more
 2955|       |		 * bytes. */
 2956|  37.6k|		if(value == ESCAPE) {
  ------------------
  |  Branch (2956:6): [True: 3.16k, False: 34.4k]
  ------------------
 2957|  3.16k|			value = (p[i] & nibble_mask) >> nibble_shift;
 2958|  3.16k|			if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2958:7): [True: 396, False: 2.77k]
  ------------------
 2959|    396|				++i;
 2960|  3.16k|			nibble_mask ^= 0xFF;
 2961|  3.16k|			nibble_shift ^= 4;
 2962|       |
 2963|  3.16k|			if(value == 0) {
  ------------------
  |  Branch (2963:7): [True: 102, False: 3.06k]
  ------------------
 2964|       |				/* We sometimes need to write the actual value
 2965|       |				 * of 15, so this case handles that. */
 2966|    102|				bit_length[w++] = ESCAPE;
 2967|  3.06k|			} else {
 2968|  3.06k|				int k;
 2969|       |
 2970|       |				/* Fill zeroes. */
 2971|  34.4k|				for(k = 0; (k < value + 2) && (w < HUFF_BC);
  ------------------
  |  |  262|  31.5k|#define HUFF_BC 20
  ------------------
  |  Branch (2971:16): [True: 31.5k, False: 2.83k]
  |  Branch (2971:35): [True: 31.3k, False: 228]
  ------------------
 2972|  31.3k|				    k++) {
 2973|  31.3k|					bit_length[w++] = 0;
 2974|  31.3k|				}
 2975|  3.06k|			}
 2976|  34.4k|		} else {
 2977|  34.4k|			bit_length[w++] = value;
 2978|  34.4k|		}
 2979|  37.6k|	}
 2980|       |
 2981|  3.29k|	rar5->bits.in_addr = i;
 2982|  3.29k|	rar5->bits.bit_addr = nibble_shift ^ 4;
 2983|       |
 2984|  3.29k|	ret = create_decode_tables(bit_length, &rar5->cstate.bd, HUFF_BC);
  ------------------
  |  |  262|  3.29k|#define HUFF_BC 20
  ------------------
 2985|  3.29k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  3.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2985:5): [True: 194, False: 3.09k]
  ------------------
 2986|    194|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    194|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2987|    194|		    "Decoding huffman tables failed");
 2988|    194|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|    194|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2989|    194|	}
 2990|       |
 2991|   251k|	for(i = 0; i < HUFF_TABLE_SIZE;) {
  ------------------
  |  |  272|   251k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  264|   251k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  266|   251k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  270|   251k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  268|   251k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2991:13): [True: 248k, False: 2.98k]
  ------------------
 2992|   248k|		uint16_t num;
 2993|       |
 2994|   248k|		ret = decode_number(a, &rar5->cstate.bd, p, &num);
 2995|   248k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|   248k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2995:6): [True: 104, False: 248k]
  ------------------
 2996|    104|			archive_set_error(&a->archive,
 2997|    104|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    104|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2998|    104|			    "Decoding huffman tables failed");
 2999|    104|			return ARCHIVE_FAILED;
  ------------------
  |  |  238|    104|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3000|    104|		}
 3001|       |
 3002|   248k|		if(num < 16) {
  ------------------
  |  Branch (3002:6): [True: 213k, False: 34.9k]
  ------------------
 3003|       |			/* 0..15: store directly */
 3004|   213k|			table[i] = (uint8_t) num;
 3005|   213k|			i++;
 3006|   213k|		} else if(num < 18) {
  ------------------
  |  Branch (3006:13): [True: 1.65k, False: 33.2k]
  ------------------
 3007|       |			/* 16..17: repeat previous code */
 3008|  1.65k|			uint16_t n;
 3009|       |
 3010|  1.65k|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &n)))
  ------------------
  |  |  234|  1.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3010:7): [True: 1, False: 1.65k]
  ------------------
 3011|      1|				return ret;
 3012|       |
 3013|  1.65k|			if(num == 16) {
  ------------------
  |  Branch (3013:7): [True: 410, False: 1.24k]
  ------------------
 3014|    410|				n >>= 13;
 3015|    410|				n += 3;
 3016|    410|				skip_bits(rar5, 3);
 3017|  1.24k|			} else {
 3018|  1.24k|				n >>= 9;
 3019|  1.24k|				n += 11;
 3020|  1.24k|				skip_bits(rar5, 7);
 3021|  1.24k|			}
 3022|       |
 3023|  1.65k|			if(i > 0) {
  ------------------
  |  Branch (3023:7): [True: 1.64k, False: 6]
  ------------------
 3024|  89.1k|				while(n-- > 0 && i < HUFF_TABLE_SIZE) {
  ------------------
  |  |  272|  87.6k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  264|  87.6k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  266|  87.6k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  270|  87.6k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  268|  87.6k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (3024:11): [True: 87.6k, False: 1.44k]
  |  Branch (3024:22): [True: 87.4k, False: 199]
  ------------------
 3025|  87.4k|					table[i] = table[i - 1];
 3026|  87.4k|					i++;
 3027|  87.4k|				}
 3028|  1.64k|			} else {
 3029|      6|				archive_set_error(&a->archive,
 3030|      6|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3031|      6|				    "Unexpected error when decoding "
 3032|      6|				    "huffman tables");
 3033|      6|				return ARCHIVE_FAILED;
  ------------------
  |  |  238|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3034|      6|			}
 3035|  33.2k|		} else {
 3036|       |			/* other codes: fill with zeroes `n` times */
 3037|  33.2k|			uint16_t n;
 3038|       |
 3039|  33.2k|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &n)))
  ------------------
  |  |  234|  33.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3039:7): [True: 2, False: 33.2k]
  ------------------
 3040|      2|				return ret;
 3041|       |
 3042|  33.2k|			if(num == 18) {
  ------------------
  |  Branch (3042:7): [True: 18.9k, False: 14.3k]
  ------------------
 3043|  18.9k|				n >>= 13;
 3044|  18.9k|				n += 3;
 3045|  18.9k|				skip_bits(rar5, 3);
 3046|  18.9k|			} else {
 3047|  14.3k|				n >>= 9;
 3048|  14.3k|				n += 11;
 3049|  14.3k|				skip_bits(rar5, 7);
 3050|  14.3k|			}
 3051|       |
 3052|  1.03M|			while(n-- > 0 && i < HUFF_TABLE_SIZE)
  ------------------
  |  |  272|  1.00M|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  264|  1.00M|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  266|  1.00M|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  270|  1.00M|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  268|  1.00M|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (3052:10): [True: 1.00M, False: 30.8k]
  |  Branch (3052:21): [True: 998k, False: 2.41k]
  ------------------
 3053|   998k|				table[i++] = 0;
 3054|  33.2k|		}
 3055|   248k|	}
 3056|       |
 3057|  2.98k|	ret = create_decode_tables(&table[idx], &rar5->cstate.ld, HUFF_NC);
  ------------------
  |  |  264|  2.98k|#define HUFF_NC 306
  ------------------
 3058|  2.98k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.98k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3058:5): [True: 588, False: 2.39k]
  ------------------
 3059|    588|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    588|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3060|    588|		     "Failed to create literal table");
 3061|    588|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|    588|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3062|    588|	}
 3063|       |
 3064|  2.39k|	idx += HUFF_NC;
  ------------------
  |  |  264|  2.39k|#define HUFF_NC 306
  ------------------
 3065|       |
 3066|  2.39k|	ret = create_decode_tables(&table[idx], &rar5->cstate.dd, HUFF_DC);
  ------------------
  |  |  266|  2.39k|#define HUFF_DC 64
  ------------------
 3067|  2.39k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.39k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3067:5): [True: 107, False: 2.28k]
  ------------------
 3068|    107|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    107|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3069|    107|		    "Failed to create distance table");
 3070|    107|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|    107|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3071|    107|	}
 3072|       |
 3073|  2.28k|	idx += HUFF_DC;
  ------------------
  |  |  266|  2.28k|#define HUFF_DC 64
  ------------------
 3074|       |
 3075|  2.28k|	ret = create_decode_tables(&table[idx], &rar5->cstate.ldd, HUFF_LDC);
  ------------------
  |  |  268|  2.28k|#define HUFF_LDC 16
  ------------------
 3076|  2.28k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3076:5): [True: 5, False: 2.28k]
  ------------------
 3077|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3078|      5|		    "Failed to create lower bits of distances table");
 3079|      5|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3080|      5|	}
 3081|       |
 3082|  2.28k|	idx += HUFF_LDC;
  ------------------
  |  |  268|  2.28k|#define HUFF_LDC 16
  ------------------
 3083|       |
 3084|  2.28k|	ret = create_decode_tables(&table[idx], &rar5->cstate.rd, HUFF_RC);
  ------------------
  |  |  270|  2.28k|#define HUFF_RC 44
  ------------------
 3085|  2.28k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  2.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3085:5): [True: 388, False: 1.89k]
  ------------------
 3086|    388|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    388|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3087|    388|		    "Failed to create repeating distances table");
 3088|    388|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|    388|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3089|    388|	}
 3090|       |
 3091|  1.89k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  1.89k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3092|  2.28k|}
archive_read_support_format_rar5.c:create_decode_tables:
 2805|  13.2k|{
 2806|  13.2k|	int code, upper_limit = 0, i, lc[16];
 2807|  13.2k|	uint32_t decode_pos_clone[rar5_countof(table->decode_pos)];
 2808|  13.2k|	ssize_t cur_len, quick_data_size;
 2809|       |
 2810|  13.2k|	memset(&lc, 0, sizeof(lc));
 2811|  13.2k|	memset(table->decode_num, 0, sizeof(table->decode_num));
 2812|  13.2k|	table->size = size;
 2813|  13.2k|	table->quick_bits = size == HUFF_NC ? 10 : 7;
  ------------------
  |  |  264|  13.2k|#define HUFF_NC 306
  ------------------
  |  Branch (2813:22): [True: 2.98k, False: 10.2k]
  ------------------
 2814|       |
 2815|  1.28M|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2815:13): [True: 1.26M, False: 13.2k]
  ------------------
 2816|  1.26M|		lc[bit_length[i] & 15]++;
 2817|  1.26M|	}
 2818|       |
 2819|  13.2k|	lc[0] = 0;
 2820|  13.2k|	table->decode_pos[0] = 0;
 2821|  13.2k|	table->decode_len[0] = 0;
 2822|       |
 2823|   211k|	for(i = 1; i < 16; i++) {
  ------------------
  |  Branch (2823:13): [True: 198k, False: 13.2k]
  ------------------
 2824|   198k|		upper_limit += lc[i];
 2825|       |
 2826|   198k|		table->decode_len[i] = upper_limit << (16 - i);
 2827|   198k|		table->decode_pos[i] = table->decode_pos[i - 1] + lc[i - 1];
 2828|       |
 2829|   198k|		upper_limit <<= 1;
 2830|   198k|	}
 2831|       |
 2832|       |	/* Verify the code-length distribution is not over-subscribed.
 2833|       |	 * After the loop above, upper_limit == sum(lc[i] * 2^(16-i)).
 2834|       |	 * For a valid prefix-free code this must be <= 2^16 = 65536.
 2835|       |	 * An over-subscribed table (> 65536) cannot produce a valid
 2836|       |	 * decode table and must be rejected. */
 2837|  13.2k|	if(upper_limit > 65536) {
  ------------------
  |  Branch (2837:5): [True: 1.28k, False: 11.9k]
  ------------------
 2838|  1.28k|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|  1.28k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2839|  1.28k|	}
 2840|       |
 2841|  11.9k|	memcpy(decode_pos_clone, table->decode_pos, sizeof(decode_pos_clone));
 2842|       |
 2843|  1.07M|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2843:13): [True: 1.06M, False: 11.9k]
  ------------------
 2844|  1.06M|		uint8_t clen = bit_length[i] & 15;
 2845|  1.06M|		if(clen > 0) {
  ------------------
  |  Branch (2845:6): [True: 202k, False: 858k]
  ------------------
 2846|   202k|			int last_pos = decode_pos_clone[clen];
 2847|   202k|			table->decode_num[last_pos] = i;
 2848|   202k|			decode_pos_clone[clen]++;
 2849|   202k|		}
 2850|  1.06M|	}
 2851|       |
 2852|  11.9k|	quick_data_size = (int64_t)1 << table->quick_bits;
 2853|  11.9k|	cur_len = 1;
 2854|  3.68M|	for(code = 0; code < quick_data_size; code++) {
  ------------------
  |  Branch (2854:16): [True: 3.67M, False: 11.9k]
  ------------------
 2855|  3.67M|		int bit_field = code << (16 - table->quick_bits);
 2856|  3.67M|		int dist, pos;
 2857|       |
 2858|  3.84M|		while(cur_len < rar5_countof(table->decode_len) &&
  ------------------
  |  |   62|  7.69M|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2858:9): [True: 2.04M, False: 1.80M]
  ------------------
 2859|  2.04M|				bit_field >= table->decode_len[cur_len]) {
  ------------------
  |  Branch (2859:5): [True: 173k, False: 1.87M]
  ------------------
 2860|   173k|			cur_len++;
 2861|   173k|		}
 2862|       |
 2863|  3.67M|		table->quick_len[code] = (uint8_t) cur_len;
 2864|       |
 2865|  3.67M|		dist = bit_field - table->decode_len[cur_len - 1];
 2866|  3.67M|		dist >>= (16 - cur_len);
 2867|       |
 2868|  3.67M|		pos = table->decode_pos[cur_len & 15] + dist;
 2869|  3.67M|		if(cur_len < rar5_countof(table->decode_pos) && pos < size) {
  ------------------
  |  |   62|  7.35M|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2869:6): [True: 1.87M, False: 1.80M]
  |  Branch (2869:51): [True: 1.87M, False: 0]
  ------------------
 2870|  1.87M|			table->quick_num[code] = table->decode_num[pos];
 2871|  1.87M|		} else {
 2872|  1.80M|			table->quick_num[code] = 0;
 2873|  1.80M|		}
 2874|  3.67M|	}
 2875|       |
 2876|  11.9k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2877|  13.2k|}
archive_read_support_format_rar5.c:decode_number:
 2881|   166M|{
 2882|   166M|	struct rar5 *rar5 = a->format->data;
 2883|   166M|	int i, bits, dist, ret;
 2884|   166M|	uint16_t bitfield;
 2885|   166M|	uint32_t pos;
 2886|       |
 2887|   166M|	if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &bitfield))) {
  ------------------
  |  |  234|   166M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2887:5): [True: 273, False: 166M]
  ------------------
 2888|    273|		return ret;
 2889|    273|	}
 2890|       |
 2891|   166M|	bitfield &= 0xfffe;
 2892|       |
 2893|   166M|	if(bitfield < table->decode_len[table->quick_bits]) {
  ------------------
  |  Branch (2893:5): [True: 166M, False: 437k]
  ------------------
 2894|   166M|		int code = bitfield >> (16 - table->quick_bits);
 2895|   166M|		skip_bits(rar5, table->quick_len[code]);
 2896|   166M|		*num = table->quick_num[code];
 2897|   166M|		return ARCHIVE_OK;
  ------------------
  |  |  234|   166M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2898|   166M|	}
 2899|       |
 2900|   437k|	bits = 15;
 2901|       |
 2902|  5.20M|	for(i = table->quick_bits + 1; i < 15; i++) {
  ------------------
  |  Branch (2902:33): [True: 4.77M, False: 434k]
  ------------------
 2903|  4.77M|		if(bitfield < table->decode_len[i]) {
  ------------------
  |  Branch (2903:6): [True: 3.27k, False: 4.77M]
  ------------------
 2904|  3.27k|			bits = i;
 2905|  3.27k|			break;
 2906|  3.27k|		}
 2907|  4.77M|	}
 2908|       |
 2909|   437k|	skip_bits(rar5, bits);
 2910|       |
 2911|   437k|	dist = bitfield - table->decode_len[bits - 1];
 2912|   437k|	dist >>= (16 - bits);
 2913|   437k|	pos = table->decode_pos[bits] + dist;
 2914|       |
 2915|   437k|	if(pos >= table->size)
  ------------------
  |  Branch (2915:5): [True: 422k, False: 15.2k]
  ------------------
 2916|   422k|		pos = 0;
 2917|       |
 2918|   437k|	*num = table->decode_num[pos];
 2919|   437k|	return ARCHIVE_OK;
  ------------------
  |  |  234|   437k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2920|   166M|}
archive_read_support_format_rar5.c:read_bits_16:
 1082|   167M|{
 1083|   167M|	if(rar5->bits.in_addr >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (1083:5): [True: 412, False: 167M]
  ------------------
 1084|    412|		archive_set_error(&a->archive,
 1085|    412|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|    412|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1086|    412|			"Premature end of stream during extraction of data (#2)");
 1087|    412|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|    412|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1088|    412|	}
 1089|       |
 1090|   167M|	uint32_t bits = archive_be24dec(p + (unsigned)rar5->bits.in_addr);
 1091|   167M|	bits >>= (8 - rar5->bits.bit_addr);
 1092|   167M|	*value = bits & 0xffff;
 1093|   167M|	return ARCHIVE_OK;
  ------------------
  |  |  234|   167M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1094|   167M|}
archive_read_support_format_rar5.c:skip_bits:
 1096|   167M|static void skip_bits(struct rar5 *rar5, int bits) {
 1097|   167M|	const int new_bits = rar5->bits.bit_addr + bits;
 1098|   167M|	rar5->bits.in_addr += new_bits >> 3;
 1099|   167M|	rar5->bits.bit_addr = new_bits & 7;
 1100|   167M|}
archive_read_support_format_rar5.c:do_uncompress_block:
 3334|  45.2k|static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
 3335|  45.2k|	struct rar5 *rar5 = a->format->data;
 3336|  45.2k|	uint16_t num;
 3337|  45.2k|	int ret;
 3338|       |
 3339|  45.2k|	const uint64_t cmask = rar5->cstate.window_mask;
 3340|  45.2k|	const struct compressed_block_header* hdr = &rar5->last_block_hdr;
 3341|  45.2k|	const uint8_t bit_size = 1 + bf_bit_size(hdr);
 3342|       |
 3343|   166M|	while(1) {
  ------------------
  |  Branch (3343:8): [True: 166M, Folded]
  ------------------
 3344|   166M|		if(rar5->cstate.write_ptr - rar5->cstate.last_write_ptr >
  ------------------
  |  Branch (3344:6): [True: 5.46k, False: 166M]
  ------------------
 3345|   166M|		    (rar5->cstate.window_size >> 1)) {
 3346|       |			/* Don't allow growing data by more than half of the
 3347|       |			 * window size at a time. In such case, break the loop;
 3348|       |			 *  next call to this function will continue processing
 3349|       |			 *  from this moment. */
 3350|  5.46k|			break;
 3351|  5.46k|		}
 3352|       |
 3353|   166M|		if(rar5->bits.in_addr > rar5->cstate.cur_block_size - 1 ||
  ------------------
  |  Branch (3353:6): [True: 26.4k, False: 166M]
  ------------------
 3354|   166M|		    (rar5->bits.in_addr == rar5->cstate.cur_block_size - 1 &&
  ------------------
  |  Branch (3354:8): [True: 2.11M, False: 164M]
  ------------------
 3355|  2.11M|		    rar5->bits.bit_addr >= bit_size))
  ------------------
  |  Branch (3355:7): [True: 10.9k, False: 2.10M]
  ------------------
 3356|  37.3k|		{
 3357|       |			/* If the program counter is here, it means the
 3358|       |			 * function has finished processing the block. */
 3359|  37.3k|			rar5->cstate.block_parsing_finished = 1;
 3360|  37.3k|			break;
 3361|  37.3k|		}
 3362|       |
 3363|       |		/* Decode the next literal. */
 3364|   166M|		if(ARCHIVE_OK != decode_number(a, &rar5->cstate.ld, p, &num)) {
  ------------------
  |  |  234|   166M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3364:6): [True: 0, False: 166M]
  ------------------
 3365|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  233|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3366|      0|		}
 3367|       |
 3368|       |		/* Num holds a decompression literal, or 'command code'.
 3369|       |		 *
 3370|       |		 * - Values lower than 256 are just bytes. Those codes
 3371|       |		 *   can be stored in the output buffer directly.
 3372|       |		 *
 3373|       |		 * - Code 256 defines a new filter, which is later used to
 3374|       |		 *   transform the data block accordingly to the filter type.
 3375|       |		 *   The data block needs to be fully uncompressed first.
 3376|       |		 *
 3377|       |		 * - Code bigger than 257 and smaller than 262 define
 3378|       |		 *   a repetition pattern that should be copied from
 3379|       |		 *   an already uncompressed chunk of data.
 3380|       |		 */
 3381|       |
 3382|   166M|		if(num < 256) {
  ------------------
  |  Branch (3382:6): [True: 166M, False: 251k]
  ------------------
 3383|       |			/* Directly store the byte. */
 3384|   166M|			int64_t write_idx;
 3385|       |
 3386|       |			/* A literal write emits one byte; copy_string() checks len. */
 3387|   166M|			if(rar5->cstate.write_ptr >= rar5->file.unpacked_size) {
  ------------------
  |  Branch (3387:7): [True: 376, False: 166M]
  ------------------
 3388|    376|				archive_set_error(&a->archive,
 3389|    376|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    376|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3390|    376|				    "Uncompressed data exceeds declared size");
 3391|    376|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|    365|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3391:12): [True: 11, False: 365]
  ------------------
 3392|    376|			}
 3393|       |
 3394|   166M|			write_idx = rar5->cstate.solid_offset +
 3395|   166M|			    rar5->cstate.write_ptr++;
 3396|       |
 3397|   166M|			rar5->cstate.window_buf[write_idx & cmask] =
 3398|   166M|			    (uint8_t) num;
 3399|   166M|			continue;
 3400|   166M|		} else if(num >= 262) {
  ------------------
  |  Branch (3400:13): [True: 38.9k, False: 212k]
  ------------------
 3401|  38.9k|			uint16_t dist_slot;
 3402|  38.9k|			int len = decode_code_length(a, rar5, p, num - 262),
 3403|  38.9k|				dbits,
 3404|  38.9k|				dist = 1;
 3405|       |
 3406|  38.9k|			if(len == -1) {
  ------------------
  |  Branch (3406:7): [True: 110, False: 38.8k]
  ------------------
 3407|    110|				archive_set_error(&a->archive,
 3408|    110|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|    110|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3409|    110|				    "Failed to decode the code length");
 3410|       |
 3411|    110|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|    107|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3411:12): [True: 3, False: 107]
  ------------------
 3412|    110|			}
 3413|       |
 3414|  38.8k|			if(ARCHIVE_OK != decode_number(a, &rar5->cstate.dd, p,
  ------------------
  |  |  234|  38.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3414:7): [True: 51, False: 38.7k]
  ------------------
 3415|  38.8k|			    &dist_slot))
 3416|     51|			{
 3417|     51|				archive_set_error(&a->archive,
 3418|     51|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     51|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3419|     51|				    "Failed to decode the distance slot");
 3420|       |
 3421|     51|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|     47|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3421:12): [True: 4, False: 47]
  ------------------
 3422|     51|			}
 3423|       |
 3424|  38.7k|			if(dist_slot < 4) {
  ------------------
  |  Branch (3424:7): [True: 17.3k, False: 21.3k]
  ------------------
 3425|  17.3k|				dbits = 0;
 3426|  17.3k|				dist += dist_slot;
 3427|  21.3k|			} else {
 3428|  21.3k|				dbits = dist_slot / 2 - 1;
 3429|       |
 3430|       |				/* Cast to uint32_t will make sure the shift
 3431|       |				 * left operation won't produce undefined
 3432|       |				 * result. Then, the uint32_t type will
 3433|       |				 * be implicitly casted to int. */
 3434|  21.3k|				dist += (uint32_t) (2 |
 3435|  21.3k|				    (dist_slot & 1)) << dbits;
 3436|  21.3k|			}
 3437|       |
 3438|  38.7k|			if(dbits > 0) {
  ------------------
  |  Branch (3438:7): [True: 21.3k, False: 17.3k]
  ------------------
 3439|  21.3k|				if(dbits >= 4) {
  ------------------
  |  Branch (3439:8): [True: 18.4k, False: 2.92k]
  ------------------
 3440|  18.4k|					uint32_t add = 0;
 3441|  18.4k|					uint16_t low_dist;
 3442|       |
 3443|  18.4k|					if(dbits > 4) {
  ------------------
  |  Branch (3443:9): [True: 16.2k, False: 2.23k]
  ------------------
 3444|  16.2k|						if(ARCHIVE_OK != (ret = read_bits_32(
  ------------------
  |  |  234|  16.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3444:10): [True: 10, False: 16.2k]
  ------------------
 3445|  16.2k|						    a, rar5, p, &add))) {
 3446|       |							/* Return EOF if we
 3447|       |							 * can't read more
 3448|       |							 * data. */
 3449|     10|							return ret;
 3450|     10|						}
 3451|       |
 3452|  16.2k|						skip_bits(rar5, dbits - 4);
 3453|  16.2k|						add = (add >> (
 3454|  16.2k|						    36 - dbits)) << 4;
 3455|  16.2k|						dist += add;
 3456|  16.2k|					}
 3457|       |
 3458|  18.4k|					if(ARCHIVE_OK != decode_number(a,
  ------------------
  |  |  234|  18.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3458:9): [True: 107, False: 18.3k]
  ------------------
 3459|  18.4k|					    &rar5->cstate.ldd, p, &low_dist))
 3460|    107|					{
 3461|    107|						archive_set_error(&a->archive,
 3462|    107|						    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|    107|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3463|    107|						    "Failed to decode the "
 3464|    107|						    "distance slot");
 3465|       |
 3466|    107|						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|     99|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3466:14): [True: 8, False: 99]
  ------------------
 3467|    107|					}
 3468|       |
 3469|  18.3k|					if(dist >= INT_MAX - low_dist - 1) {
  ------------------
  |  Branch (3469:9): [True: 3, False: 18.3k]
  ------------------
 3470|       |						/* This only happens in
 3471|       |						 * invalid archives. */
 3472|      3|						archive_set_error(&a->archive,
 3473|      3|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3474|      3|						    "Distance pointer "
 3475|      3|						    "overflow");
 3476|      3|						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3476:14): [True: 2, False: 1]
  ------------------
 3477|      3|					}
 3478|       |
 3479|  18.3k|					dist += low_dist;
 3480|  18.3k|				} else {
 3481|       |					/* dbits is one of [0,1,2,3] */
 3482|  2.92k|					int add;
 3483|       |
 3484|  2.92k|					if(ARCHIVE_OK != (ret = read_consume_bits(a, rar5,
  ------------------
  |  |  234|  2.92k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3484:9): [True: 1, False: 2.92k]
  ------------------
 3485|  2.92k|					     p, dbits, &add))) {
 3486|       |						/* Return EOF if we can't read
 3487|       |						 * more data. */
 3488|      1|						return ret;
 3489|      1|					}
 3490|       |
 3491|  2.92k|					dist += add;
 3492|  2.92k|				}
 3493|  21.3k|			}
 3494|       |
 3495|  38.6k|			if(dist > 0x100) {
  ------------------
  |  Branch (3495:7): [True: 13.9k, False: 24.6k]
  ------------------
 3496|  13.9k|				len++;
 3497|       |
 3498|  13.9k|				if(dist > 0x2000) {
  ------------------
  |  Branch (3498:8): [True: 12.0k, False: 1.88k]
  ------------------
 3499|  12.0k|					len++;
 3500|       |
 3501|  12.0k|					if(dist > 0x40000) {
  ------------------
  |  Branch (3501:9): [True: 10.2k, False: 1.79k]
  ------------------
 3502|  10.2k|						len++;
 3503|  10.2k|					}
 3504|  12.0k|				}
 3505|  13.9k|			}
 3506|       |
 3507|  38.6k|			dist_cache_push(rar5, dist);
 3508|  38.6k|			rar5->cstate.last_len = len;
 3509|       |
 3510|  38.6k|			ret = copy_string(a, len, dist);
 3511|  38.6k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  38.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3511:7): [True: 1.01k, False: 37.6k]
  ------------------
 3512|  1.01k|				return ret;
 3513|       |
 3514|  37.6k|			continue;
 3515|   212k|		} else if(num == 256) {
  ------------------
  |  Branch (3515:13): [True: 3.08k, False: 209k]
  ------------------
 3516|       |			/* Create a filter. */
 3517|  3.08k|			ret = parse_filter(a, p);
 3518|  3.08k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  3.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3518:7): [True: 380, False: 2.70k]
  ------------------
 3519|    380|				return ret;
 3520|       |
 3521|  2.70k|			continue;
 3522|   209k|		} else if(num == 257) {
  ------------------
  |  Branch (3522:13): [True: 191k, False: 17.2k]
  ------------------
 3523|   191k|			if(rar5->cstate.last_len != 0) {
  ------------------
  |  Branch (3523:7): [True: 186k, False: 5.17k]
  ------------------
 3524|   186k|				ret = copy_string(a,
 3525|   186k|				    rar5->cstate.last_len,
 3526|   186k|				    rar5->cstate.dist_cache[0]);
 3527|   186k|				if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|   186k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3527:8): [True: 180, False: 186k]
  ------------------
 3528|    180|					return ret;
 3529|   186k|			}
 3530|       |
 3531|   191k|			continue;
 3532|   191k|		} else {
 3533|       |			/* num < 262 */
 3534|  17.2k|			const int idx = num - 258;
 3535|  17.2k|			const int dist = dist_cache_touch(rar5, idx);
 3536|       |
 3537|  17.2k|			uint16_t len_slot;
 3538|  17.2k|			int len;
 3539|       |
 3540|  17.2k|			if(ARCHIVE_OK != decode_number(a, &rar5->cstate.rd, p,
  ------------------
  |  |  234|  17.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3540:7): [True: 11, False: 17.2k]
  ------------------
 3541|  17.2k|			    &len_slot)) {
 3542|     11|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|      7|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3542:12): [True: 4, False: 7]
  ------------------
 3543|     11|			}
 3544|       |
 3545|  17.2k|			len = decode_code_length(a, rar5, p, len_slot);
 3546|  17.2k|			if (len == -1) {
  ------------------
  |  Branch (3546:8): [True: 4, False: 17.2k]
  ------------------
 3547|      4|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3547:12): [True: 1, False: 3]
  ------------------
 3548|      4|			}
 3549|       |
 3550|  17.2k|			rar5->cstate.last_len = len;
 3551|       |
 3552|  17.2k|			ret = copy_string(a, len, dist);
 3553|  17.2k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  17.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3553:7): [True: 141, False: 17.1k]
  ------------------
 3554|    141|				return ret;
 3555|       |
 3556|  17.1k|			continue;
 3557|  17.2k|		}
 3558|   166M|	}
 3559|       |
 3560|  42.8k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  42.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3561|  45.2k|}
archive_read_support_format_rar5.c:bf_bit_size:
  512|  45.2k|uint8_t bf_bit_size(const struct compressed_block_header* hdr) {
  513|  45.2k|	return hdr->block_flags_u8 & 7;
  514|  45.2k|}
archive_read_support_format_rar5.c:decode_code_length:
 3276|  56.1k|{
 3277|  56.1k|	int lbits, length = 2;
 3278|       |
 3279|  56.1k|	if(code < 8) {
  ------------------
  |  Branch (3279:5): [True: 7.42k, False: 48.7k]
  ------------------
 3280|  7.42k|		lbits = 0;
 3281|  7.42k|		length += code;
 3282|  48.7k|	} else {
 3283|  48.7k|		lbits = code / 4 - 1;
 3284|  48.7k|		length += (4 | (code & 3)) << lbits;
 3285|  48.7k|	}
 3286|       |
 3287|  56.1k|	if(lbits > 0) {
  ------------------
  |  Branch (3287:5): [True: 48.7k, False: 7.42k]
  ------------------
 3288|  48.7k|		int add;
 3289|       |
 3290|  48.7k|		if(ARCHIVE_OK != read_consume_bits(a, rar5, p, lbits, &add))
  ------------------
  |  |  234|  48.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3290:6): [True: 114, False: 48.6k]
  ------------------
 3291|    114|			return -1;
 3292|       |
 3293|  48.6k|		length += add;
 3294|  48.6k|	}
 3295|       |
 3296|  56.0k|	return length;
 3297|  56.1k|}
archive_read_support_format_rar5.c:read_bits_32:
 1065|  16.2k|{
 1066|  16.2k|	if(rar5->bits.in_addr >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (1066:5): [True: 10, False: 16.2k]
  ------------------
 1067|     10|		archive_set_error(&a->archive,
 1068|     10|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     10|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1069|     10|			"Premature end of stream during extraction of data (#1)");
 1070|     10|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1071|     10|	}
 1072|       |
 1073|  16.2k|	uint32_t bits = archive_be32dec(p + rar5->bits.in_addr);
 1074|  16.2k|	bits <<= rar5->bits.bit_addr;
 1075|  16.2k|	bits |= p[rar5->bits.in_addr + 4] >> (8 - rar5->bits.bit_addr);
 1076|  16.2k|	*value = bits;
 1077|  16.2k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  16.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1078|  16.2k|}
archive_read_support_format_rar5.c:read_consume_bits:
 1105|  58.1k|{
 1106|  58.1k|	uint16_t v;
 1107|  58.1k|	int ret, num;
 1108|       |
 1109|  58.1k|	if(n == 0 || n > 16) {
  ------------------
  |  Branch (1109:5): [True: 0, False: 58.1k]
  |  Branch (1109:15): [True: 0, False: 58.1k]
  ------------------
 1110|       |		/* This is a programmer error and should never happen
 1111|       |		 * in runtime. */
 1112|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1113|      0|	}
 1114|       |
 1115|  58.1k|	ret = read_bits_16(a, rar5, p, &v);
 1116|  58.1k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  58.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1116:5): [True: 122, False: 58.0k]
  ------------------
 1117|    122|		return ret;
 1118|       |
 1119|  58.0k|	num = (int) v;
 1120|  58.0k|	num >>= 16 - n;
 1121|       |
 1122|  58.0k|	skip_bits(rar5, n);
 1123|       |
 1124|  58.0k|	if(value)
  ------------------
  |  Branch (1124:5): [True: 58.0k, False: 0]
  ------------------
 1125|  58.0k|		*value = num;
 1126|       |
 1127|  58.0k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  58.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1128|  58.1k|}
archive_read_support_format_rar5.c:dist_cache_push:
  840|  38.6k|static void dist_cache_push(struct rar5 *rar5, int value) {
  841|  38.6k|	int* q = rar5->cstate.dist_cache;
  842|       |
  843|  38.6k|	q[3] = q[2];
  844|  38.6k|	q[2] = q[1];
  845|  38.6k|	q[1] = q[0];
  846|  38.6k|	q[0] = value;
  847|  38.6k|}
archive_read_support_format_rar5.c:copy_string:
 3299|   242k|static int copy_string(struct archive_read* a, int len, int dist) {
 3300|   242k|	struct rar5 *rar5 = a->format->data;
 3301|   242k|	const ssize_t cmask = rar5->cstate.window_mask;
 3302|   242k|	const uint64_t write_ptr = rar5->cstate.write_ptr +
 3303|   242k|	    rar5->cstate.solid_offset;
 3304|   242k|	int i;
 3305|       |
 3306|   242k|	if (rar5->cstate.window_buf == NULL)
  ------------------
  |  Branch (3306:6): [True: 0, False: 242k]
  ------------------
 3307|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3308|       |
 3309|   242k|	if (rar5->cstate.write_ptr > rar5->file.unpacked_size ||
  ------------------
  |  Branch (3309:6): [True: 596, False: 242k]
  ------------------
 3310|   242k|	    len > rar5->file.unpacked_size - rar5->cstate.write_ptr) {
  ------------------
  |  Branch (3310:6): [True: 742, False: 241k]
  ------------------
 3311|  1.33k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.33k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3312|  1.33k|		    "Uncompressed data exceeds declared size");
 3313|  1.33k|		return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  240|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              		return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  238|  1.33k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3313:10): [True: 8, False: 1.33k]
  ------------------
 3314|  1.33k|	}
 3315|       |
 3316|       |	/* The unpacker spends most of the time in this function. It would be
 3317|       |	 * a good idea to introduce some optimizations here.
 3318|       |	 *
 3319|       |	 * Just remember that this loop treats buffers that overlap differently
 3320|       |	 * than buffers that do not overlap. This is why a simple memcpy(3)
 3321|       |	 * call will not be enough. */
 3322|       |
 3323|   534M|	for(i = 0; i < len; i++) {
  ------------------
  |  Branch (3323:13): [True: 534M, False: 241k]
  ------------------
 3324|   534M|		const ssize_t write_idx = (write_ptr + i) & cmask;
 3325|   534M|		const ssize_t read_idx = (write_ptr + i - dist) & cmask;
 3326|   534M|		rar5->cstate.window_buf[write_idx] =
 3327|   534M|		    rar5->cstate.window_buf[read_idx];
 3328|   534M|	}
 3329|       |
 3330|   241k|	rar5->cstate.write_ptr += len;
 3331|   241k|	return ARCHIVE_OK;
  ------------------
  |  |  234|   241k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3332|   242k|}
archive_read_support_format_rar5.c:parse_filter:
 3211|  3.08k|static int parse_filter(struct archive_read* ar, const uint8_t* p) {
 3212|  3.08k|	struct rar5 *rar5 = ar->format->data;
 3213|  3.08k|	uint32_t block_start, block_length;
 3214|  3.08k|	uint16_t filter_type;
 3215|  3.08k|	struct filter_info* filt = NULL;
 3216|  3.08k|	int ret;
 3217|       |
 3218|       |	/* Read the parameters from the input stream. */
 3219|  3.08k|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar5, p, &block_start)))
  ------------------
  |  |  234|  3.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3219:5): [True: 4, False: 3.08k]
  ------------------
 3220|      4|		return ret;
 3221|       |
 3222|  3.08k|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar5, p, &block_length)))
  ------------------
  |  |  234|  3.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3222:5): [True: 8, False: 3.07k]
  ------------------
 3223|      8|		return ret;
 3224|       |
 3225|  3.07k|	if(ARCHIVE_OK != (ret = read_bits_16(ar, rar5, p, &filter_type)))
  ------------------
  |  |  234|  3.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3225:5): [True: 6, False: 3.06k]
  ------------------
 3226|      6|		return ret;
 3227|       |
 3228|  3.06k|	filter_type >>= 13;
 3229|  3.06k|	skip_bits(rar5, 3);
 3230|       |
 3231|       |	/* Perform some sanity checks on this filter parameters. */
 3232|       |
 3233|  3.06k|	if(block_length < 4 ||
  ------------------
  |  Branch (3233:5): [True: 66, False: 3.00k]
  ------------------
 3234|  3.00k|	    block_length > 0x400000 ||
  ------------------
  |  Branch (3234:6): [True: 111, False: 2.89k]
  ------------------
 3235|  2.89k|	    !is_valid_filter_block_start(rar5, block_start) ||
  ------------------
  |  Branch (3235:6): [True: 66, False: 2.82k]
  ------------------
 3236|  2.82k|	    (rar5->cstate.window_size > 0 &&
  ------------------
  |  Branch (3236:7): [True: 2.82k, False: 0]
  ------------------
 3237|  2.82k|	     (ssize_t)block_length > rar5->cstate.window_size >> 1))
  ------------------
  |  Branch (3237:7): [True: 116, False: 2.70k]
  ------------------
 3238|    359|	{
 3239|    359|		archive_set_error(&ar->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    359|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3240|    359|		    "Invalid filter encountered");
 3241|    359|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|    359|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3242|    359|	}
 3243|       |
 3244|       |	/* Allocate a new filter. */
 3245|  2.70k|	filt = add_new_filter(rar5);
 3246|  2.70k|	if(filt == NULL) {
  ------------------
  |  Branch (3246:5): [True: 0, False: 2.70k]
  ------------------
 3247|      0|		archive_set_error(&ar->archive, ENOMEM,
 3248|      0|		    "Can't allocate memory for a filter descriptor");
 3249|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3250|      0|	}
 3251|       |
 3252|  2.70k|	filt->type = filter_type;
 3253|  2.70k|	filt->block_start = rar5->cstate.write_ptr + block_start;
 3254|  2.70k|	filt->block_length = block_length;
 3255|       |
 3256|  2.70k|	rar5->cstate.last_block_start = filt->block_start;
 3257|  2.70k|	rar5->cstate.last_block_length = filt->block_length;
 3258|       |
 3259|       |	/* Read some more data in case this is a DELTA filter. Other filter
 3260|       |	 * types don't require any additional data over what was already
 3261|       |	 * read. */
 3262|  2.70k|	if(filter_type == FILTER_DELTA) {
  ------------------
  |  Branch (3262:5): [True: 355, False: 2.35k]
  ------------------
 3263|    355|		int channels;
 3264|       |
 3265|    355|		if(ARCHIVE_OK != (ret = read_consume_bits(ar, rar5, p, 5, &channels)))
  ------------------
  |  |  234|    355|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3265:6): [True: 3, False: 352]
  ------------------
 3266|      3|			return ret;
 3267|       |
 3268|    352|		filt->channels = channels + 1;
 3269|    352|	}
 3270|       |
 3271|  2.70k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  2.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3272|  2.70k|}
archive_read_support_format_rar5.c:parse_filter_data:
 3160|  6.16k|{
 3161|  6.16k|	int i, bytes, ret;
 3162|  6.16k|	uint32_t data = 0;
 3163|       |
 3164|  6.16k|	if(ARCHIVE_OK != (ret = read_consume_bits(a, rar5, p, 2, &bytes)))
  ------------------
  |  |  234|  6.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3164:5): [True: 4, False: 6.16k]
  ------------------
 3165|      4|		return ret;
 3166|       |
 3167|  6.16k|	bytes++;
 3168|       |
 3169|  14.7k|	for(i = 0; i < bytes; i++) {
  ------------------
  |  Branch (3169:13): [True: 8.59k, False: 6.15k]
  ------------------
 3170|  8.59k|		uint16_t byte;
 3171|       |
 3172|  8.59k|		if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &byte))) {
  ------------------
  |  |  234|  8.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3172:6): [True: 8, False: 8.58k]
  ------------------
 3173|      8|			return ret;
 3174|      8|		}
 3175|       |
 3176|       |		/* Cast to uint32_t will ensure the shift operation will not
 3177|       |		 * produce undefined result. */
 3178|  8.58k|		data += ((uint32_t) byte >> 8) << (i * 8);
 3179|  8.58k|		skip_bits(rar5, 8);
 3180|  8.58k|	}
 3181|       |
 3182|  6.15k|	*filter_data = data;
 3183|  6.15k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  6.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3184|  6.16k|}
archive_read_support_format_rar5.c:is_valid_filter_block_start:
 3189|  2.89k|{
 3190|  2.89k|	const int64_t block_start = (ssize_t) start + rar5->cstate.write_ptr;
 3191|  2.89k|	const int64_t last_bs = rar5->cstate.last_block_start;
 3192|  2.89k|	const ssize_t last_bl = rar5->cstate.last_block_length;
 3193|       |
 3194|  2.89k|	if(last_bs == 0 || last_bl == 0) {
  ------------------
  |  Branch (3194:5): [True: 558, False: 2.33k]
  |  Branch (3194:21): [True: 0, False: 2.33k]
  ------------------
 3195|       |		/* We didn't have any filters yet, so accept this offset. */
 3196|    558|		return 1;
 3197|    558|	}
 3198|       |
 3199|  2.33k|	if(block_start >= last_bs + last_bl) {
  ------------------
  |  Branch (3199:5): [True: 2.26k, False: 66]
  ------------------
 3200|       |		/* Current offset is bigger than last block's end offset, so
 3201|       |		 * accept current offset. */
 3202|  2.26k|		return 1;
 3203|  2.26k|	}
 3204|       |
 3205|       |	/* Any other case is not a normal situation and we should fail. */
 3206|     66|	return 0;
 3207|  2.33k|}
archive_read_support_format_rar5.c:add_new_filter:
  560|  2.70k|static struct filter_info* add_new_filter(struct rar5 *rar5) {
  561|  2.70k|	struct filter_info* f = calloc(1, sizeof(*f));
  562|       |
  563|  2.70k|	if(!f) {
  ------------------
  |  Branch (563:5): [True: 0, False: 2.70k]
  ------------------
  564|      0|		return NULL;
  565|      0|	}
  566|       |
  567|  2.70k|	if (CDE_OK != cdeque_push_back(&rar5->cstate.filters, cdeque_filter(f))) {
  ------------------
  |  Branch (567:6): [True: 0, False: 2.70k]
  ------------------
  568|      0|		free(f);
  569|      0|		return NULL;
  570|      0|	}
  571|       |
  572|  2.70k|	return f;
  573|  2.70k|}
archive_read_support_format_rar5.c:cdeque_push_back:
  448|  2.70k|static int cdeque_push_back(struct cdeque* d, void* item) {
  449|  2.70k|	if(d == NULL)
  ------------------
  |  Branch (449:5): [True: 0, False: 2.70k]
  ------------------
  450|      0|		return CDE_PARAM;
  451|       |
  452|  2.70k|	if(d->size == d->cap_mask + 1)
  ------------------
  |  Branch (452:5): [True: 0, False: 2.70k]
  ------------------
  453|      0|		return CDE_OUT_OF_BOUNDS;
  454|       |
  455|  2.70k|	d->arr[d->end_pos] = (size_t) item;
  456|  2.70k|	d->end_pos = (d->end_pos + 1) & d->cap_mask;
  457|  2.70k|	d->size++;
  458|       |
  459|  2.70k|	return CDE_OK;
  460|  2.70k|}
archive_read_support_format_rar5.c:cdeque_filter:
  489|  2.70k|static void* cdeque_filter(struct filter_info* f) {
  490|  2.70k|	return (void**) (size_t) f;
  491|  2.70k|}
archive_read_support_format_rar5.c:dist_cache_touch:
  849|  17.2k|static int dist_cache_touch(struct rar5 *rar5, int idx) {
  850|  17.2k|	int* q = rar5->cstate.dist_cache;
  851|  17.2k|	int i, dist = q[idx];
  852|       |
  853|  36.3k|	for(i = idx; i > 0; i--)
  ------------------
  |  Branch (853:15): [True: 19.1k, False: 17.2k]
  ------------------
  854|  19.1k|		q[i] = q[i - 1];
  855|       |
  856|  17.2k|	q[0] = dist;
  857|  17.2k|	return dist;
  858|  17.2k|}
archive_read_support_format_rar5.c:bf_is_last_block:
  527|  19.6k|uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
  528|  19.6k|	return (hdr->block_flags_u8 >> 6) & 1;
  529|  19.6k|}
archive_read_support_format_rar5.c:apply_filters:
  788|  26.7k|static int apply_filters(struct archive_read* a) {
  789|  26.7k|	struct rar5 *rar5 = a->format->data;
  790|  26.7k|	struct filter_info* flt;
  791|  26.7k|	int ret;
  792|       |
  793|  26.7k|	rar5->cstate.all_filters_applied = 0;
  794|       |
  795|       |	/* Get the first filter that can be applied to our data. The data
  796|       |	 * needs to be fully unpacked before the filter can be run. */
  797|  26.7k|	if(CDE_OK == cdeque_front(&rar5->cstate.filters,
  ------------------
  |  Branch (797:5): [True: 4.70k, False: 22.0k]
  ------------------
  798|  26.7k|	    cdeque_filter_p(&flt))) {
  799|       |		/* Check if our unpacked data fully covers this filter's
  800|       |		 * range. */
  801|  4.70k|		if(rar5->cstate.write_ptr > flt->block_start &&
  ------------------
  |  Branch (801:6): [True: 3.92k, False: 779]
  ------------------
  802|  3.92k|		    rar5->cstate.write_ptr >= flt->block_start +
  ------------------
  |  Branch (802:7): [True: 3.61k, False: 314]
  ------------------
  803|  3.92k|		    flt->block_length) {
  804|       |			/* Check if we have some data pending to be written
  805|       |			 * right before the filter's start offset. */
  806|  3.61k|			if(rar5->cstate.last_write_ptr == flt->block_start) {
  ------------------
  |  Branch (806:7): [True: 1.84k, False: 1.77k]
  ------------------
  807|       |				/* Run the filter specified by descriptor
  808|       |				 * `flt`. */
  809|  1.84k|				ret = run_filter(a, flt);
  810|  1.84k|				if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  1.84k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (810:8): [True: 18, False: 1.82k]
  ------------------
  811|       |					/* Filter failure, return error. */
  812|     18|					return ret;
  813|     18|				}
  814|       |
  815|       |				/* Filter descriptor won't be needed anymore
  816|       |				 * after it's used, * so remove it from the
  817|       |				 * filter list and free its memory. */
  818|  1.82k|				(void) cdeque_pop_front(&rar5->cstate.filters,
  819|  1.82k|				    cdeque_filter_p(&flt));
  820|       |
  821|  1.82k|				free(flt);
  822|  1.82k|			} else {
  823|       |				/* We can't run filters yet, dump the memory
  824|       |				 * right before the filter. */
  825|  1.77k|				push_window_data(a, rar5,
  826|  1.77k|				    rar5->cstate.last_write_ptr,
  827|  1.77k|				    flt->block_start);
  828|  1.77k|			}
  829|       |
  830|       |			/* Return 'filter applied or not needed' state to the
  831|       |			 * caller. */
  832|  3.59k|			return ARCHIVE_RETRY;
  ------------------
  |  |  235|  3.59k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  833|  3.61k|		}
  834|  4.70k|	}
  835|       |
  836|  23.1k|	rar5->cstate.all_filters_applied = 1;
  837|  23.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  23.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  838|  26.7k|}
archive_read_support_format_rar5.c:run_filter:
  678|  1.84k|static int run_filter(struct archive_read* a, struct filter_info* flt) {
  679|  1.84k|	struct rar5 *rar5 = a->format->data;
  680|  1.84k|	int ret;
  681|       |
  682|  1.84k|	clear_data_ready_stack(rar5);
  683|  1.84k|	free(rar5->cstate.filtered_buf);
  684|       |
  685|  1.84k|	rar5->cstate.filtered_buf = malloc(flt->block_length);
  686|  1.84k|	if(!rar5->cstate.filtered_buf) {
  ------------------
  |  Branch (686:5): [True: 0, False: 1.84k]
  ------------------
  687|      0|		archive_set_error(&a->archive, ENOMEM,
  688|      0|		    "Can't allocate memory for filter data");
  689|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  690|      0|	}
  691|       |
  692|  1.84k|	switch(flt->type) {
  693|    211|		case FILTER_DELTA:
  ------------------
  |  Branch (693:3): [True: 211, False: 1.63k]
  ------------------
  694|    211|			ret = run_delta_filter(rar5, flt);
  695|    211|			break;
  696|       |
  697|    343|		case FILTER_E8:
  ------------------
  |  Branch (697:3): [True: 343, False: 1.49k]
  ------------------
  698|       |			/* fallthrough */
  699|    465|		case FILTER_E8E9:
  ------------------
  |  Branch (699:3): [True: 122, False: 1.71k]
  ------------------
  700|    465|			ret = run_e8e9_filter(rar5, flt,
  701|    465|			    flt->type == FILTER_E8E9);
  702|    465|			break;
  703|       |
  704|  1.14k|		case FILTER_ARM:
  ------------------
  |  Branch (704:3): [True: 1.14k, False: 693]
  ------------------
  705|  1.14k|			ret = run_arm_filter(rar5, flt);
  706|  1.14k|			break;
  707|       |
  708|     17|		default:
  ------------------
  |  Branch (708:3): [True: 17, False: 1.82k]
  ------------------
  709|     17|			archive_set_error(&a->archive,
  710|     17|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  711|     17|			    "Unsupported filter type: 0x%x",
  712|     17|			    (unsigned int)flt->type);
  713|     17|			return ARCHIVE_FAILED;
  ------------------
  |  |  238|     17|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  714|  1.84k|	}
  715|       |
  716|  1.82k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  234|  1.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (716:5): [True: 0, False: 1.82k]
  ------------------
  717|       |		/* Filter has failed. */
  718|      0|		return ret;
  719|      0|	}
  720|       |
  721|  1.82k|	if(ARCHIVE_OK != push_data_ready(a, rar5, rar5->cstate.filtered_buf,
  ------------------
  |  |  234|  1.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (721:5): [True: 1, False: 1.82k]
  ------------------
  722|  1.82k|	    flt->block_length, rar5->cstate.last_write_ptr))
  723|      1|	{
  724|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  725|      1|		    "Stack overflow when submitting unpacked data");
  726|       |
  727|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  728|      1|	}
  729|       |
  730|  1.82k|	rar5->cstate.last_write_ptr += flt->block_length;
  731|  1.82k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  1.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  732|  1.82k|}
archive_read_support_format_rar5.c:run_delta_filter:
  575|    211|static int run_delta_filter(struct rar5 *rar5, struct filter_info* flt) {
  576|    211|	int i;
  577|    211|	ssize_t dest_pos, src_pos = 0;
  578|       |
  579|  2.33k|	for(i = 0; i < flt->channels; i++) {
  ------------------
  |  Branch (579:13): [True: 2.12k, False: 211]
  ------------------
  580|  2.12k|		uint8_t prev_byte = 0;
  581|  2.12k|		for(dest_pos = i;
  582|   385k|				dest_pos < flt->block_length;
  ------------------
  |  Branch (582:5): [True: 383k, False: 2.12k]
  ------------------
  583|   383k|				dest_pos += flt->channels)
  584|   383k|		{
  585|   383k|			uint8_t byte;
  586|       |
  587|   383k|			byte = rar5->cstate.window_buf[
  588|   383k|			    (rar5->cstate.solid_offset + flt->block_start +
  589|   383k|			    src_pos) & rar5->cstate.window_mask];
  590|       |
  591|   383k|			prev_byte -= byte;
  592|   383k|			rar5->cstate.filtered_buf[dest_pos] = prev_byte;
  593|   383k|			src_pos++;
  594|   383k|		}
  595|  2.12k|	}
  596|       |
  597|    211|	return ARCHIVE_OK;
  ------------------
  |  |  234|    211|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  598|    211|}
archive_read_support_format_rar5.c:run_e8e9_filter:
  602|    465|{
  603|    465|	const uint32_t file_size = 0x1000000;
  604|    465|	ssize_t i;
  605|       |
  606|    465|	circular_memcpy(rar5->cstate.filtered_buf,
  607|    465|	    rar5->cstate.window_buf, rar5->cstate.window_mask,
  608|    465|	    rar5->cstate.solid_offset + flt->block_start,
  609|    465|	    rar5->cstate.solid_offset + flt->block_start + flt->block_length);
  610|       |
  611|  1.00M|	for(i = 0; i < flt->block_length - 4;) {
  ------------------
  |  Branch (611:13): [True: 1.00M, False: 465]
  ------------------
  612|  1.00M|		uint8_t b = rar5->cstate.window_buf[
  613|  1.00M|		    (rar5->cstate.solid_offset + flt->block_start +
  614|  1.00M|		    i++) & rar5->cstate.window_mask];
  615|       |
  616|       |		/*
  617|       |		 * 0xE8 = x86's call <relative_addr_uint32> (function call)
  618|       |		 * 0xE9 = x86's jmp <relative_addr_uint32> (unconditional jump)
  619|       |		 */
  620|  1.00M|		if(b == 0xE8 || (extended && b == 0xE9)) {
  ------------------
  |  Branch (620:6): [True: 451, False: 1.00M]
  |  Branch (620:20): [True: 863k, False: 141k]
  |  Branch (620:32): [True: 90.1k, False: 773k]
  ------------------
  621|       |
  622|  90.5k|			uint32_t addr;
  623|  90.5k|			uint32_t offset = (i + flt->block_start) % file_size;
  624|       |
  625|  90.5k|			addr = read_filter_data(rar5,
  626|  90.5k|			    (uint32_t)(rar5->cstate.solid_offset +
  627|  90.5k|			    flt->block_start + i) & rar5->cstate.window_mask);
  628|       |
  629|  90.5k|			if(addr & 0x80000000) {
  ------------------
  |  Branch (629:7): [True: 64.8k, False: 25.7k]
  ------------------
  630|  64.8k|				if(((addr + offset) & 0x80000000) == 0) {
  ------------------
  |  Branch (630:8): [True: 1.41k, False: 63.4k]
  ------------------
  631|  1.41k|					write_filter_data(rar5, (uint32_t)i,
  632|  1.41k|					    addr + file_size);
  633|  1.41k|				}
  634|  64.8k|			} else {
  635|  25.7k|				if((addr - file_size) & 0x80000000) {
  ------------------
  |  Branch (635:8): [True: 13.2k, False: 12.4k]
  ------------------
  636|  13.2k|					uint32_t naddr = addr - offset;
  637|  13.2k|					write_filter_data(rar5, (uint32_t)i,
  638|  13.2k|					    naddr);
  639|  13.2k|				}
  640|  25.7k|			}
  641|       |
  642|  90.5k|			i += 4;
  643|  90.5k|		}
  644|  1.00M|	}
  645|       |
  646|    465|	return ARCHIVE_OK;
  ------------------
  |  |  234|    465|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  647|    465|}
archive_read_support_format_rar5.c:circular_memcpy:
  534|   110k|{
  535|   110k|	if((start & mask) > (end & mask)) {
  ------------------
  |  Branch (535:5): [True: 48, False: 110k]
  ------------------
  536|     48|		ssize_t len1 = mask + 1 - (start & mask);
  537|     48|		ssize_t len2 = end & mask;
  538|       |
  539|     48|		memcpy(dst, &window[start & mask], len1);
  540|     48|		memcpy(dst + len1, window, len2);
  541|   110k|	} else {
  542|   110k|		memcpy(dst, &window[start & mask], (size_t) (end - start));
  543|   110k|	}
  544|   110k|}
archive_read_support_format_rar5.c:read_filter_data:
  546|   108k|static uint32_t read_filter_data(struct rar5 *rar5, uint32_t offset) {
  547|   108k|	uint8_t linear_buf[4];
  548|   108k|	circular_memcpy(linear_buf, rar5->cstate.window_buf,
  549|   108k|	    rar5->cstate.window_mask, offset, offset + 4);
  550|   108k|	return archive_le32dec(linear_buf);
  551|   108k|}
archive_read_support_format_rar5.c:write_filter_data:
  555|  32.8k|{
  556|  32.8k|	archive_le32enc(&rar5->cstate.filtered_buf[offset], value);
  557|  32.8k|}
archive_read_support_format_rar5.c:run_arm_filter:
  649|  1.14k|static int run_arm_filter(struct rar5 *rar5, struct filter_info* flt) {
  650|  1.14k|	ssize_t i = 0;
  651|  1.14k|	uint32_t offset;
  652|       |
  653|  1.14k|	circular_memcpy(rar5->cstate.filtered_buf,
  654|  1.14k|	    rar5->cstate.window_buf, rar5->cstate.window_mask,
  655|  1.14k|	    rar5->cstate.solid_offset + flt->block_start,
  656|  1.14k|	    rar5->cstate.solid_offset + flt->block_start + flt->block_length);
  657|       |
  658|   168k|	for(i = 0; i < flt->block_length - 3; i += 4) {
  ------------------
  |  Branch (658:13): [True: 167k, False: 1.14k]
  ------------------
  659|   167k|		uint8_t* b = &rar5->cstate.window_buf[
  660|   167k|		    (rar5->cstate.solid_offset +
  661|   167k|		    flt->block_start + i + 3) & rar5->cstate.window_mask];
  662|       |
  663|   167k|		if(*b == 0xEB) {
  ------------------
  |  Branch (663:6): [True: 18.1k, False: 149k]
  ------------------
  664|       |			/* 0xEB = ARM's BL (branch + link) instruction. */
  665|  18.1k|			offset = read_filter_data(rar5,
  666|  18.1k|			    (rar5->cstate.solid_offset + flt->block_start + i) &
  667|  18.1k|			     (uint32_t)rar5->cstate.window_mask) & 0x00ffffff;
  668|       |
  669|  18.1k|			offset -= (uint32_t) ((i + flt->block_start) / 4);
  670|  18.1k|			offset = (offset & 0x00ffffff) | 0xeb000000;
  671|  18.1k|			write_filter_data(rar5, (uint32_t)i, offset);
  672|  18.1k|		}
  673|   167k|	}
  674|       |
  675|  1.14k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  1.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  676|  1.14k|}
archive_read_support_format_rar5.c:push_data_ready:
 4022|  29.2k|{
 4023|  29.2k|	int i;
 4024|       |
 4025|       |	/* Don't push if we're in skip mode. This is needed because solid
 4026|       |	 * streams need full processing even if we're skipping data. After
 4027|       |	 * fully processing the stream, we need to discard the generated bytes,
 4028|       |	 * because we're interested only in the side effect: building up the
 4029|       |	 * internal window circular buffer. This window buffer will be used
 4030|       |	 * later during unpacking of requested data. */
 4031|  29.2k|	if(rar5->skip_mode)
  ------------------
  |  Branch (4031:5): [True: 13.5k, False: 15.7k]
  ------------------
 4032|  13.5k|		return ARCHIVE_OK;
  ------------------
  |  |  234|  13.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4033|       |
 4034|       |	/* Sanity check. */
 4035|  15.7k|	if(offset != rar5->file.last_offset + rar5->file.last_size) {
  ------------------
  |  Branch (4035:5): [True: 616, False: 15.1k]
  ------------------
 4036|    616|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|    616|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4037|    616|		    "Sanity check error: output stream is not continuous");
 4038|    616|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|    616|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4039|    616|	}
 4040|       |
 4041|  16.4k|	for(i = 0; i < rar5_countof(rar5->cstate.dready); i++) {
  ------------------
  |  |   62|  16.4k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (4041:13): [True: 16.4k, False: 0]
  ------------------
 4042|  16.4k|		struct data_ready* d = &rar5->cstate.dready[i];
 4043|  16.4k|		if(!d->used) {
  ------------------
  |  Branch (4043:6): [True: 15.1k, False: 1.35k]
  ------------------
 4044|  15.1k|			d->used = 1;
 4045|  15.1k|			d->buf = buf;
 4046|  15.1k|			d->size = size;
 4047|  15.1k|			d->offset = offset;
 4048|       |
 4049|       |			/* These fields are used only in sanity checking. */
 4050|  15.1k|			rar5->file.last_offset = offset;
 4051|  15.1k|			rar5->file.last_size = size;
 4052|       |
 4053|       |			/* Calculate the checksum of this new block before
 4054|       |			 * submitting data to libarchive's engine. */
 4055|  15.1k|			update_crc(rar5, d->buf, d->size);
 4056|       |
 4057|  15.1k|			return ARCHIVE_OK;
  ------------------
  |  |  234|  15.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4058|  15.1k|		}
 4059|  16.4k|	}
 4060|       |
 4061|       |	/* Program counter will reach this code if the
 4062|       |	 * `rar5->cstate.data_ready` stack will be filled up so that no new
 4063|       |	 * entries will be allowed. The code shouldn't allow such situation to
 4064|       |	 * occur. So we treat this case as an internal error. */
 4065|       |
 4066|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4067|      0|	    "Premature end of data_ready stack");
 4068|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4069|  15.1k|}
archive_read_support_format_rar5.c:cdeque_front:
  439|  27.8k|static int cdeque_front(struct cdeque* d, void** value) {
  440|  27.8k|	if(d->size > 0) {
  ------------------
  |  Branch (440:5): [True: 5.79k, False: 22.0k]
  ------------------
  441|  5.79k|		cdeque_front_fast(d, value);
  442|  5.79k|		return CDE_OK;
  443|  5.79k|	} else
  444|  22.0k|		return CDE_OUT_OF_BOUNDS;
  445|  27.8k|}
archive_read_support_format_rar5.c:cdeque_front_fast:
  433|  5.79k|static void cdeque_front_fast(struct cdeque* d, void** value) {
  434|  5.79k|	*value = (void*) d->arr[d->beg_pos];
  435|  5.79k|}
archive_read_support_format_rar5.c:push_window_data:
  784|  24.7k|{
  785|  24.7k|	push_data(a, rar5, rar5->cstate.window_buf, idx_begin, idx_end);
  786|  24.7k|}
archive_read_support_format_rar5.c:push_data:
  740|  24.7k|{
  741|  24.7k|	const ssize_t wmask = rar5->cstate.window_mask;
  742|  24.7k|	const ssize_t solid_write_ptr = (rar5->cstate.solid_offset +
  743|  24.7k|	    rar5->cstate.last_write_ptr) & wmask;
  744|       |
  745|  24.7k|	idx_begin += rar5->cstate.solid_offset;
  746|  24.7k|	idx_end += rar5->cstate.solid_offset;
  747|       |
  748|       |	/* Check if our unpacked data is wrapped inside the window circular
  749|       |	 * buffer.  If it's not wrapped, it can be copied out by using
  750|       |	 * a single memcpy, but when it's wrapped, we need to copy the first
  751|       |	 * part with one memcpy, and the second part with another memcpy. */
  752|       |
  753|  24.7k|	if((idx_begin & wmask) > (idx_end & wmask)) {
  ------------------
  |  Branch (753:5): [True: 2.72k, False: 21.9k]
  ------------------
  754|       |		/* The data is wrapped (begin offset sis bigger than end
  755|       |		 * offset). */
  756|  2.72k|		const ssize_t frag1_size = rar5->cstate.window_size -
  757|  2.72k|		    (idx_begin & wmask);
  758|  2.72k|		const ssize_t frag2_size = idx_end & wmask;
  759|       |
  760|       |		/* Copy the first part of the buffer first. */
  761|  2.72k|		push_data_ready(a, rar5, buf + solid_write_ptr, frag1_size,
  762|  2.72k|		    rar5->cstate.last_write_ptr);
  763|       |
  764|       |		/* Copy the second part of the buffer. */
  765|  2.72k|		push_data_ready(a, rar5, buf, frag2_size,
  766|  2.72k|		    rar5->cstate.last_write_ptr + frag1_size);
  767|       |
  768|  2.72k|		rar5->cstate.last_write_ptr += frag1_size + frag2_size;
  769|  21.9k|	} else {
  770|       |		/* Data is not wrapped, so we can just use one call to copy the
  771|       |		 * data. */
  772|  21.9k|		push_data_ready(a, rar5,
  773|  21.9k|		    buf + solid_write_ptr, (idx_end - idx_begin) & wmask,
  774|  21.9k|		    rar5->cstate.last_write_ptr);
  775|       |
  776|  21.9k|		rar5->cstate.last_write_ptr += idx_end - idx_begin;
  777|  21.9k|	}
  778|  24.7k|}
archive_read_support_format_rar5.c:verify_global_checksums:
 4450|  2.80k|static int verify_global_checksums(struct archive_read* a) {
 4451|  2.80k|	return verify_checksums(a);
 4452|  2.80k|}
archive_read_support_format_rar5.c:verify_checksums:
 4352|  2.80k|static int verify_checksums(struct archive_read* a) {
 4353|  2.80k|	struct rar5 *rar5 = a->format->data;
 4354|  2.80k|	int verify_crc;
 4355|       |
 4356|       |	/* Check checksums only when actually unpacking the data. There's no
 4357|       |	 * need to calculate checksum when we're skipping data in solid archives
 4358|       |	 * (skipping in solid archives is the same thing as unpacking compressed
 4359|       |	 * data and discarding the result). */
 4360|       |
 4361|  2.80k|	if(!rar5->skip_mode) {
  ------------------
  |  Branch (4361:5): [True: 2.52k, False: 286]
  ------------------
 4362|       |		/* Always check checksums if we're not in skip mode */
 4363|  2.52k|		verify_crc = 1;
 4364|  2.52k|	} else {
 4365|       |		/* We can override the logic above with a compile-time option
 4366|       |		 * NO_CRC_ON_SOLID_SKIP. This option is used during debugging,
 4367|       |		 * and it will check checksums of unpacked data even when
 4368|       |		 * we're skipping it. */
 4369|       |
 4370|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 4371|       |		/* Debug case */
 4372|       |		verify_crc = 1;
 4373|       |#else
 4374|       |		/* Normal case */
 4375|    286|		verify_crc = 0;
 4376|    286|#endif
 4377|    286|	}
 4378|       |
 4379|  2.80k|	if(verify_crc) {
  ------------------
  |  Branch (4379:5): [True: 2.52k, False: 286]
  ------------------
 4380|       |		/* During unpacking, on each unpacked block we're calling the
 4381|       |		 * update_crc() function. Since we are here, the unpacking
 4382|       |		 * process is already over and we can check if calculated
 4383|       |		 * checksum (CRC32 or BLAKE2sp) is the same as what is stored
 4384|       |		 * in the archive. */
 4385|  2.52k|		if(rar5->file.stored_crc32 > 0) {
  ------------------
  |  Branch (4385:6): [True: 1.43k, False: 1.09k]
  ------------------
 4386|       |			/* Check CRC32 only when the file contains a CRC32
 4387|       |			 * value for this file. */
 4388|       |
 4389|  1.43k|			if(rar5->file.calculated_crc32 !=
  ------------------
  |  Branch (4389:7): [True: 1.43k, False: 0]
  ------------------
 4390|  1.43k|			    rar5->file.stored_crc32) {
 4391|       |				/* Checksums do not match; the unpacked file
 4392|       |				 * is corrupted. */
 4393|       |
 4394|  1.43k|				DEBUG_CODE {
  ------------------
  |  |   68|  1.43k|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (68:23): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
 4395|      0|					printf("Checksum error: CRC32 "
 4396|      0|					    "(was: %08" PRIx32 ", expected: %08" PRIx32 ")\n",
 4397|      0|					    rar5->file.calculated_crc32,
 4398|      0|					    rar5->file.stored_crc32);
 4399|      0|				}
 4400|       |
 4401|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4402|       |				archive_set_error(&a->archive,
 4403|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4404|       |				    "Checksum error: CRC32");
 4405|       |				return ARCHIVE_FAILED;
 4406|       |#endif
 4407|  1.43k|			} else {
 4408|      0|				DEBUG_CODE {
  ------------------
  |  |   68|      0|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (68:23): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4409|      0|					printf("Checksum OK: CRC32 "
 4410|      0|					    "(%08" PRIx32 "/%08" PRIx32 ")\n",
 4411|      0|					    rar5->file.stored_crc32,
 4412|      0|					    rar5->file.calculated_crc32);
 4413|      0|				}
 4414|      0|			}
 4415|  1.43k|		}
 4416|       |
 4417|  2.52k|		if(rar5->file.has_blake2 > 0) {
  ------------------
  |  Branch (4417:6): [True: 1.43k, False: 1.09k]
  ------------------
 4418|       |			/* BLAKE2sp is an optional checksum algorithm that is
 4419|       |			 * added to RARv5 archives when using the `-htb` switch
 4420|       |			 *  during creation of archive.
 4421|       |			 *
 4422|       |			 * We now finalize the hash calculation by calling the
 4423|       |			 * `final` function. This will generate the final hash
 4424|       |			 * value we can use to compare it with the BLAKE2sp
 4425|       |			 * checksum that is stored in the archive.
 4426|       |			 *
 4427|       |			 * The return value of this `final` function is not
 4428|       |			 * very helpful, as it guards only against improper use.
 4429|       | 			 * This is why we're explicitly ignoring it. */
 4430|       |
 4431|  1.43k|			uint8_t b2_buf[32];
 4432|  1.43k|			(void) blake2sp_final(&rar5->file.b2state, b2_buf, 32);
  ------------------
  |  |   29|  1.43k|#define blake2sp_final __archive_blake2sp_final
  ------------------
 4433|       |
 4434|  1.43k|			if(memcmp(&rar5->file.blake2sp, b2_buf, 32) != 0) {
  ------------------
  |  |   28|  1.43k|#define blake2sp __archive_blake2sp
  ------------------
  |  Branch (4434:7): [True: 1.43k, False: 0]
  ------------------
 4435|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4436|       |				archive_set_error(&a->archive,
 4437|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4438|       |				    "Checksum error: BLAKE2");
 4439|       |
 4440|       |				return ARCHIVE_FAILED;
 4441|       |#endif
 4442|  1.43k|			}
 4443|  1.43k|		}
 4444|  2.52k|	}
 4445|       |
 4446|       |	/* Finalization for this file has been successfully completed. */
 4447|  2.80k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  2.80k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4448|  2.80k|}
archive_read_support_format_rar5.c:rar5_read_data_skip:
 4539|  20.4k|static int rar5_read_data_skip(struct archive_read *a) {
 4540|  20.4k|	struct rar5 *rar5 = a->format->data;
 4541|       |
 4542|  20.4k|	if(rar5->main.solid && (rar5->cstate.data_encrypted == 0)) {
  ------------------
  |  Branch (4542:5): [True: 12.4k, False: 7.97k]
  |  Branch (4542:25): [True: 11.8k, False: 612]
  ------------------
 4543|       |		/* In solid archives, instead of skipping the data, we need to
 4544|       |		 * extract it, and dispose the result. The side effect of this
 4545|       |		 * operation will be setting up the initial window buffer state
 4546|       |		 * needed to be able to extract the selected file. Note that
 4547|       |		 * this is only possible when data within this solid block is
 4548|       |		 * not encrypted, in which case we'll skip and fail if the user
 4549|       |		 * tries to read data. */
 4550|       |
 4551|  11.8k|		int ret;
 4552|       |
 4553|       |		/* Make sure to process all blocks in the compressed stream. */
 4554|  24.4k|		while(rar5->file.bytes_remaining > 0) {
  ------------------
  |  Branch (4554:9): [True: 21.8k, False: 2.59k]
  ------------------
 4555|       |			/* Setting the "skip mode" will allow us to skip
 4556|       |			 * checksum checks during data skipping. Checking the
 4557|       |			 * checksum of skipped data isn't really necessary and
 4558|       |			 * it's only slowing things down.
 4559|       |			 *
 4560|       |			 * This is incremented instead of setting to 1 because
 4561|       |			 * this data skipping function can be called
 4562|       |			 * recursively. */
 4563|  21.8k|			rar5->skip_mode++;
 4564|       |
 4565|       |			/* We're disposing 1 block of data, so we use triple
 4566|       |			 * NULLs in arguments. */
 4567|  21.8k|			ret = rar5_read_data(a, NULL, NULL, NULL);
 4568|       |
 4569|       |			/* Turn off "skip mode". */
 4570|  21.8k|			rar5->skip_mode--;
 4571|       |
 4572|  21.8k|			if(ret < 0 || ret == ARCHIVE_EOF) {
  ------------------
  |  |  233|  12.9k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4572:7): [True: 8.92k, False: 12.9k]
  |  Branch (4572:18): [True: 324, False: 12.6k]
  ------------------
 4573|       |				/* Propagate any potential error conditions
 4574|       |				 * to the caller. */
 4575|  9.25k|				return ret;
 4576|  9.25k|			}
 4577|  21.8k|		}
 4578|  11.8k|	} else {
 4579|       |		/* In standard archives, we can just jump over the compressed
 4580|       |		 * stream. Each file in non-solid archives starts from an empty
 4581|       |		 * window buffer. */
 4582|       |
 4583|  8.59k|		if(ARCHIVE_OK != consume(a, rar5->file.bytes_remaining)) {
  ------------------
  |  |  234|  8.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4583:6): [True: 382, False: 8.20k]
  ------------------
 4584|    382|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|    382|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4585|    382|		}
 4586|       |
 4587|  8.20k|		rar5->file.bytes_remaining = 0;
 4588|  8.20k|	}
 4589|       |
 4590|  10.8k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  10.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4591|  20.4k|}
archive_read_support_format_rar5.c:rar5_cleanup:
 4607|  20.1k|static int rar5_cleanup(struct archive_read *a) {
 4608|  20.1k|	struct rar5 *rar5 = a->format->data;
 4609|       |
 4610|  20.1k|	free(rar5->cstate.window_buf);
 4611|  20.1k|	free(rar5->cstate.filtered_buf);
 4612|  20.1k|	clear_data_ready_stack(rar5);
 4613|       |
 4614|  20.1k|	free(rar5->vol.push_buf);
 4615|       |
 4616|  20.1k|	free_filters(rar5);
 4617|  20.1k|	rar5_deinit(rar5);
 4618|       |
 4619|  20.1k|	free(rar5);
 4620|  20.1k|	a->format->data = NULL;
 4621|       |
 4622|  20.1k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4623|  20.1k|}
archive_read_support_format_rar5.c:rar5_capabilities:
 4625|  4.74k|static int rar5_capabilities(struct archive_read * a) {
 4626|  4.74k|	(void) a;
 4627|  4.74k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  403|  4.74k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 4628|  4.74k|			| ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  404|  4.74k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 4629|  4.74k|}
archive_read_support_format_rar5.c:rar5_has_encrypted_entries:
 4631|  2.37k|static int rar5_has_encrypted_entries(struct archive_read *_a) {
 4632|  2.37k|	if (_a && _a->format) {
  ------------------
  |  Branch (4632:6): [True: 2.37k, False: 0]
  |  Branch (4632:12): [True: 2.37k, False: 0]
  ------------------
 4633|  2.37k|		struct rar5 *rar5 = _a->format->data;
 4634|  2.37k|		if (rar5) {
  ------------------
  |  Branch (4634:7): [True: 2.37k, False: 0]
  ------------------
 4635|  2.37k|			return rar5->has_encrypted_entries;
 4636|  2.37k|		}
 4637|  2.37k|	}
 4638|       |
 4639|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4640|  2.37k|}
archive_read_support_format_rar5.c:rar5_deinit:
 4659|  20.1k|static void rar5_deinit(struct rar5 *rar5) {
 4660|  20.1k|	cdeque_free(&rar5->cstate.filters);
 4661|  20.1k|}
archive_read_support_format_rar5.c:cdeque_free:
  496|  20.1k|static void cdeque_free(struct cdeque* d) {
  497|  20.1k|	if(!d)
  ------------------
  |  Branch (497:5): [True: 0, False: 20.1k]
  ------------------
  498|      0|		return;
  499|       |
  500|  20.1k|	if(!d->arr)
  ------------------
  |  Branch (500:5): [True: 0, False: 20.1k]
  ------------------
  501|      0|		return;
  502|       |
  503|  20.1k|	free(d->arr);
  504|       |
  505|       |	d->arr = NULL;
  506|  20.1k|	d->beg_pos = -1;
  507|  20.1k|	d->end_pos = -1;
  508|  20.1k|	d->cap_mask = 0;
  509|  20.1k|}

archive_read_support_format_raw:
   57|  20.1k|{
   58|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
   59|  20.1k|	struct raw *raw;
   60|  20.1k|	int r;
   61|       |
   62|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
   63|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_raw");
   64|       |
   65|  20.1k|	raw = calloc(1, sizeof(*raw));
   66|  20.1k|	if (raw == NULL) {
  ------------------
  |  Branch (66:6): [True: 0, False: 20.1k]
  ------------------
   67|      0|		archive_set_error(_a, ENOMEM, "Can't allocate raw data");
   68|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   69|      0|	}
   70|       |
   71|  20.1k|	r = __archive_read_register_format(a,
   72|  20.1k|	    raw,
   73|  20.1k|	    "raw",
   74|  20.1k|	    archive_read_format_raw_bid,
   75|  20.1k|	    NULL,
   76|  20.1k|	    archive_read_format_raw_read_header,
   77|  20.1k|	    archive_read_format_raw_read_data,
   78|  20.1k|	    archive_read_format_raw_read_data_skip,
   79|  20.1k|	    NULL,
   80|  20.1k|	    archive_read_format_raw_cleanup,
   81|  20.1k|	    NULL,
   82|  20.1k|	    NULL);
   83|       |
   84|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (84:6): [True: 0, False: 20.1k]
  ------------------
   85|      0|		free(raw);
   86|  20.1k|	return (r);
   87|  20.1k|}
archive_read_support_format_raw.c:archive_read_format_raw_bid:
   98|  19.7k|{
   99|  19.7k|	if (best_bid < 1 && __archive_read_ahead(a, 1, NULL) != NULL)
  ------------------
  |  Branch (99:6): [True: 1.08k, False: 18.6k]
  |  Branch (99:22): [True: 1.00k, False: 80]
  ------------------
  100|  1.00k|		return (1);
  101|  18.7k|	return (-1);
  102|  19.7k|}
archive_read_support_format_raw.c:archive_read_format_raw_read_header:
  110|  1.97k|{
  111|  1.97k|	struct raw *raw = a->format->data;
  112|       |
  113|  1.97k|	if (raw->end_of_file)
  ------------------
  |  Branch (113:6): [True: 972, False: 1.00k]
  ------------------
  114|    972|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|    972|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  115|       |
  116|  1.00k|	a->archive.archive_format = ARCHIVE_FORMAT_RAW;
  ------------------
  |  |  385|  1.00k|#define	ARCHIVE_FORMAT_RAW			0x90000
  ------------------
  117|  1.00k|	a->archive.archive_format_name = "raw";
  118|  1.00k|	archive_entry_set_pathname(entry, "data");
  119|  1.00k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  1.00k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  120|  1.00k|	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.00k|	return __archive_read_header(a, entry);
  125|  1.97k|}
archive_read_support_format_raw.c:archive_read_format_raw_read_data:
  130|  13.2k|{
  131|  13.2k|	struct raw *raw = a->format->data;
  132|  13.2k|	ssize_t avail;
  133|       |
  134|       |	/* Consume the bytes we read last time. */
  135|  13.2k|	if (raw->unconsumed) {
  ------------------
  |  Branch (135:6): [True: 11.2k, False: 1.94k]
  ------------------
  136|  11.2k|		__archive_read_consume(a, raw->unconsumed);
  137|  11.2k|		raw->unconsumed = 0;
  138|  11.2k|	}
  139|       |
  140|  13.2k|	if (raw->end_of_file) {
  ------------------
  |  Branch (140:6): [True: 938, False: 12.2k]
  ------------------
  141|       |		/* Keep reporting the end of the entry, so that a caller
  142|       |		 * that asks once more after end-of-file still gets a
  143|       |		 * position it can use. */
  144|    938|		*buff = NULL;
  145|    938|		*size = 0;
  146|    938|		*offset = raw->offset;
  147|    938|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|    938|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  148|    938|	}
  149|       |
  150|       |	/* Get whatever bytes are immediately available. */
  151|  12.2k|	*buff = __archive_read_ahead(a, 1, &avail);
  152|  12.2k|	if (avail > 0) {
  ------------------
  |  Branch (152:6): [True: 11.2k, False: 1.00k]
  ------------------
  153|       |		/* Return the bytes we just read */
  154|  11.2k|		*offset = raw->offset;
  155|  11.2k|		if (archive_ckd_add_i64(&raw->offset, raw->offset, avail)) {
  ------------------
  |  Branch (155:7): [True: 0, False: 11.2k]
  ------------------
  156|      0|			avail = INT64_MAX - *offset;
  157|      0|			if (avail == 0) {
  ------------------
  |  Branch (157:8): [True: 0, False: 0]
  ------------------
  158|      0|				*size = 0;
  159|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  160|      0|			}
  161|      0|		}
  162|  11.2k|		*size = avail;
  163|  11.2k|		raw->unconsumed = avail;
  164|  11.2k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  11.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  165|  11.2k|	} else if (0 == avail) {
  ------------------
  |  Branch (165:13): [True: 972, False: 32]
  ------------------
  166|       |		/* Record and return end-of-file. */
  167|    972|		raw->end_of_file = 1;
  168|    972|		*size = 0;
  169|    972|		*offset = raw->offset;
  170|    972|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|    972|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  171|    972|	} else {
  172|       |		/* Record and return an error. */
  173|     32|		*size = 0;
  174|     32|		*offset = raw->offset;
  175|     32|		return ((int)avail);
  176|     32|	}
  177|  12.2k|}
archive_read_support_format_raw.c:archive_read_format_raw_read_data_skip:
  181|    972|{
  182|    972|	struct raw *raw = a->format->data;
  183|       |
  184|       |	/* Consume the bytes we read last time. */
  185|    972|	if (raw->unconsumed) {
  ------------------
  |  Branch (185:6): [True: 0, False: 972]
  ------------------
  186|      0|		__archive_read_consume(a, raw->unconsumed);
  187|      0|		raw->unconsumed = 0;
  188|      0|	}
  189|    972|	raw->end_of_file = 1;
  190|    972|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    972|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  191|    972|}
archive_read_support_format_raw.c:archive_read_format_raw_cleanup:
  195|  20.1k|{
  196|  20.1k|	struct raw *raw = a->format->data;
  197|       |
  198|  20.1k|	free(raw);
  199|  20.1k|	a->format->data = NULL;
  200|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  201|  20.1k|}

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

archive_read_support_format_warc:
  136|  20.1k|{
  137|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
  138|  20.1k|	struct warc *warc;
  139|  20.1k|	int r;
  140|       |
  141|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  142|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
  143|       |
  144|  20.1k|	if ((warc = calloc(1, sizeof(*warc))) == NULL) {
  ------------------
  |  Branch (144:6): [True: 0, False: 20.1k]
  ------------------
  145|      0|		archive_set_error(_a, ENOMEM, "Can't allocate warc data");
  146|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  147|      0|	}
  148|       |
  149|  20.1k|	r = __archive_read_register_format(a,
  150|  20.1k|	    warc,
  151|  20.1k|	    "warc",
  152|  20.1k|	    archive_read_format_warc_bid,
  153|  20.1k|	    NULL,
  154|  20.1k|	    archive_read_format_warc_read_header,
  155|  20.1k|	    archive_read_format_warc_read_data,
  156|  20.1k|	    archive_read_format_warc_skip,
  157|  20.1k|	    NULL,
  158|  20.1k|	    archive_read_format_warc_cleanup,
  159|  20.1k|	    NULL,
  160|  20.1k|	    NULL);
  161|       |
  162|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (162:6): [True: 0, False: 20.1k]
  ------------------
  163|      0|		free(warc);
  164|  20.1k|	return (r);
  165|  20.1k|}
archive_read_support_format_warc.c:archive_read_format_warc_cleanup:
  169|  20.1k|{
  170|  20.1k|	struct warc *warc = a->format->data;
  171|       |
  172|  20.1k|	archive_string_free(&warc->fname);
  173|  20.1k|	archive_string_free(&warc->sver);
  174|  20.1k|	free(warc);
  175|  20.1k|	a->format->data = NULL;
  176|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  177|  20.1k|}
archive_read_support_format_warc.c:archive_read_format_warc_bid:
  181|  19.8k|{
  182|  19.8k|	const void *h;
  183|  19.8k|	ssize_t nrd;
  184|  19.8k|	unsigned int ver;
  185|       |
  186|  19.8k|	(void)best_bid; /* UNUSED */
  187|       |
  188|       |	/* Check the first line, which should already be a record header. */
  189|  19.8k|	if ((h = __archive_read_ahead(a, 12, &nrd)) == NULL) {
  ------------------
  |  Branch (189:6): [True: 126, False: 19.7k]
  ------------------
  190|       |		/* Not enough data to identify this format. */
  191|    126|		return -1;
  192|    126|	}
  193|       |
  194|       |	/* Parse the record version number. */
  195|  19.7k|	ver = warc_read_version(h, nrd);
  196|  19.7k|	if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (196:6): [True: 19.0k, False: 725]
  |  Branch (196:21): [True: 0, False: 725]
  ------------------
  197|       |		/* Only WARC 0.12 through WARC 1.0 are supported. */
  198|  19.0k|		return -1;
  199|  19.0k|	}
  200|       |
  201|       |	/* WARC magic and version checks passed. */
  202|    725|	return (64);
  203|  19.7k|}
archive_read_support_format_warc.c:warc_read_version:
  602|  34.9k|{
  603|  34.9k|	static const char magic[] = "WARC/";
  604|  34.9k|	const char *c;
  605|  34.9k|	unsigned int ver = 0U;
  606|  34.9k|	unsigned int end = 0U;
  607|       |
  608|  34.9k|	if (bsz < 12 || memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
  ------------------
  |  Branch (608:6): [True: 3, False: 34.9k]
  |  Branch (608:18): [True: 19.0k, False: 15.9k]
  ------------------
  609|       |		/* Buffer too small or invalid magic. */
  610|  19.0k|		return ver;
  611|  19.0k|	}
  612|       |	/* Parse the version number. */
  613|  15.9k|	buf += sizeof(magic) - 1U;
  614|       |
  615|  15.9k|	if (warc_isdigit(buf[0]) && buf[1] == '.' && warc_isdigit(buf[2])) {
  ------------------
  |  Branch (615:6): [True: 15.9k, False: 14]
  |  Branch (615:30): [True: 15.9k, False: 1]
  |  Branch (615:47): [True: 15.9k, False: 4]
  ------------------
  616|       |		/* Support at most two digits in the minor version. */
  617|  15.9k|		if (warc_isdigit(buf[3]))
  ------------------
  |  Branch (617:7): [True: 224, False: 15.7k]
  ------------------
  618|    224|			end = 1U;
  619|       |		/* Set up the major version. */
  620|  15.9k|		ver = (buf[0U] - '0') * 10000U;
  621|       |		/* Set up the minor version. */
  622|  15.9k|		if (end == 1U) {
  ------------------
  |  Branch (622:7): [True: 224, False: 15.7k]
  ------------------
  623|    224|			ver += (buf[2U] - '0') * 1000U;
  624|    224|			ver += (buf[3U] - '0') * 100U;
  625|    224|		} else
  626|  15.7k|			ver += (buf[2U] - '0') * 100U;
  627|       |		/*
  628|       |		 * WARC versions before 0.12 use a space-separated header.
  629|       |		 * WARC 0.12 and later terminate the version with CRLF.
  630|       |		 */
  631|  15.9k|		c = buf + 3U + end;
  632|  15.9k|		if (ver >= 1200U) {
  ------------------
  |  Branch (632:7): [True: 15.9k, False: 2]
  ------------------
  633|  15.9k|			if (memcmp(c, "\r\n", 2U) != 0)
  ------------------
  |  Branch (633:8): [True: 23, False: 15.9k]
  ------------------
  634|     23|				ver = 0U;
  635|  15.9k|		} else {
  636|       |			/* Version is below WARC 0.12. */
  637|      2|			if (*c != ' ' && *c != '\t')
  ------------------
  |  Branch (637:8): [True: 2, False: 0]
  |  Branch (637:21): [True: 2, False: 0]
  ------------------
  638|      2|				ver = 0U;
  639|      2|		}
  640|  15.9k|	}
  641|  15.9k|	return ver;
  642|  34.9k|}
archive_read_support_format_warc.c:warc_isdigit:
  596|  47.8k|{
  597|  47.8k|	return c >= '0' && c <= '9';
  ------------------
  |  Branch (597:9): [True: 32.1k, False: 15.7k]
  |  Branch (597:21): [True: 32.1k, False: 3]
  ------------------
  598|  47.8k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_header:
  208|  6.20k|{
  209|  6.20k|#define HDR_PROBE_LEN		(12U)
  210|  6.20k|	struct warc *warc = a->format->data;
  211|  6.20k|	unsigned int ver;
  212|  6.20k|	const char *buf;
  213|  6.20k|	ssize_t nrd;
  214|  6.20k|	const char *eoh;
  215|       |	/* WARC record type */
  216|  6.20k|	warc_type_t ftyp;
  217|       |	/* Content length, or a negative error indicator */
  218|  6.20k|	int64_t cntlen;
  219|       |	/* WARC-Date is exposed as the entry ctime. */
  220|  6.20k|	time_t rtime;
  221|       |	/* A Last-Modified record header is exposed as the entry mtime. */
  222|  6.20k|	time_t mtime;
  223|       |
  224|  15.5k|start_over:
  225|       |	/* Use read_ahead(); it already tracks unconsumed bytes, so this
  226|       |	 * reader does not need a separate shift buffer. */
  227|  15.5k|	buf = __archive_read_ahead(a, HDR_PROBE_LEN, &nrd);
  ------------------
  |  |  209|  15.5k|#define HDR_PROBE_LEN		(12U)
  ------------------
  228|       |
  229|  15.5k|	if (nrd < 0) {
  ------------------
  |  Branch (229:6): [True: 0, False: 15.5k]
  ------------------
  230|       |		/* I/O or stream error. */
  231|      0|		archive_set_error(
  232|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  233|      0|			"Bad record header");
  234|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  235|  15.5k|	} else if (buf == NULL) {
  ------------------
  |  Branch (235:13): [True: 58, False: 15.4k]
  ------------------
  236|       |		/* there should be room for at least WARC/bla\r\n
  237|       |		 * must be EOF therefore */
  238|     58|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|     58|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  239|     58|	}
  240|       |	/* Locate the end of the record header. */
  241|  15.4k|	eoh = warc_find_eoh(buf, nrd);
  242|  15.4k|	if (eoh == NULL) {
  ------------------
  |  Branch (242:6): [True: 238, False: 15.2k]
  ------------------
  243|       |		/* The header terminator was not found in the probed data. */
  244|    238|		archive_set_error(
  245|    238|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    238|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  246|    238|			"Bad record header");
  247|    238|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    238|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  248|    238|	}
  249|  15.2k|	ver = warc_read_version(buf, eoh - buf);
  250|       |	/* Only WARC 0.12 through WARC 1.0 are supported. */
  251|  15.2k|	if (ver == 0U) {
  ------------------
  |  Branch (251:6): [True: 50, False: 15.2k]
  ------------------
  252|     50|		archive_set_error(
  253|     50|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     50|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  254|     50|			"Invalid record version");
  255|     50|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     50|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  256|  15.2k|	} else if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (256:13): [True: 0, False: 15.2k]
  |  Branch (256:28): [True: 1, False: 15.2k]
  ------------------
  257|      1|		archive_set_error(
  258|      1|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  259|      1|			"Unsupported record version: %u.%u",
  260|      1|			ver / 10000, (ver % 10000) / 100);
  261|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  262|      1|	}
  263|  15.2k|	cntlen = warc_read_length(buf, eoh - buf);
  264|  15.2k|	if (cntlen < 0) {
  ------------------
  |  Branch (264:6): [True: 78, False: 15.1k]
  ------------------
  265|       |		/* This reader requires Content-Length before processing a record. */
  266|     78|		archive_set_error(
  267|     78|			&a->archive, EINVAL,
  268|     78|			"Bad content length");
  269|     78|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     78|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  270|     78|	}
  271|  15.1k|	rtime = warc_read_date(buf, eoh - buf);
  272|  15.1k|	if (rtime == (time_t)-1) {
  ------------------
  |  Branch (272:6): [True: 167, False: 14.9k]
  ------------------
  273|       |		/* This reader requires WARC-Date before processing a record. */
  274|    167|		archive_set_error(
  275|    167|			&a->archive, EINVAL,
  276|    167|			"Bad record time");
  277|    167|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    167|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  278|    167|	}
  279|       |
  280|       |	/* Report this archive as WARC. */
  281|  14.9k|	a->archive.archive_format = ARCHIVE_FORMAT_WARC;
  ------------------
  |  |  391|  14.9k|#define	ARCHIVE_FORMAT_WARC			0xF0000
  ------------------
  282|  14.9k|	if (ver != warc->pver) {
  ------------------
  |  Branch (282:6): [True: 693, False: 14.2k]
  ------------------
  283|       |		/* Format this entry's WARC version. */
  284|    693|		archive_string_sprintf(&warc->sver,
  285|    693|			"WARC/%u.%u", ver / 10000, (ver % 10000) / 100);
  286|       |		/* Remember the version for later entries. */
  287|    693|		warc->pver = ver;
  288|    693|	}
  289|       |	/* Parse the record type. */
  290|  14.9k|	ftyp = warc_read_type(buf, eoh - buf);
  291|       |	/* Save content state for subsequent read calls. */
  292|  14.9k|	warc->cntlen = cntlen;
  293|  14.9k|	warc->cntoff = 0;
  294|  14.9k|	mtime = 0;/* Avoid compiler warnings on some platforms. */
  295|       |
  296|  14.9k|	switch (ftyp) {
  297|  2.93k|	case WT_RSRC:
  ------------------
  |  Branch (297:2): [True: 2.93k, False: 12.0k]
  ------------------
  298|  11.6k|	case WT_RSP:
  ------------------
  |  Branch (298:2): [True: 8.72k, False: 6.23k]
  ------------------
  299|       |		/* Read the filename only for record types that are expected to
  300|       |		 * have a target URI. */
  301|  11.6k|		warc_read_uri(buf, eoh - buf, &warc->fname);
  302|       |		/* Avoid creating directory endpoints as files. */
  303|  11.6k|		if (archive_strlen(&warc->fname) == 0 ||
  ------------------
  |  |  178|  11.6k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (303:7): [True: 6.12k, False: 5.53k]
  ------------------
  304|  6.14k|		    warc->fname.s[warc->fname.length - 1] == '/') {
  ------------------
  |  Branch (304:7): [True: 22, False: 5.51k]
  ------------------
  305|       |			/* Skip this record. */
  306|  6.14k|			archive_string_empty(&warc->fname);
  ------------------
  |  |  181|  6.14k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  307|  6.14k|			break;
  308|  6.14k|		}
  309|       |
  310|       |		/* Use a Last-Modified record header when present; otherwise fall back
  311|       |		 * to WARC-Date. */
  312|  5.51k|		if ((mtime = warc_read_last_modified(buf, eoh - buf)) == (time_t)-1) {
  ------------------
  |  Branch (312:7): [True: 5.37k, False: 142]
  ------------------
  313|  5.37k|			mtime = rtime;
  314|  5.37k|		}
  315|  5.51k|		break;
  316|  3.30k|	case WT_NONE:
  ------------------
  |  Branch (316:2): [True: 3.30k, False: 11.6k]
  ------------------
  317|  3.30k|	case WT_INFO:
  ------------------
  |  Branch (317:2): [True: 0, False: 14.9k]
  ------------------
  318|  3.30k|	case WT_META:
  ------------------
  |  Branch (318:2): [True: 0, False: 14.9k]
  ------------------
  319|  3.30k|	case WT_REQ:
  ------------------
  |  Branch (319:2): [True: 0, False: 14.9k]
  ------------------
  320|  3.30k|	case WT_RVIS:
  ------------------
  |  Branch (320:2): [True: 0, False: 14.9k]
  ------------------
  321|  3.30k|	case WT_CONV:
  ------------------
  |  Branch (321:2): [True: 0, False: 14.9k]
  ------------------
  322|  3.30k|	case WT_CONT:
  ------------------
  |  Branch (322:2): [True: 0, False: 14.9k]
  ------------------
  323|  3.30k|	case LAST_WT:
  ------------------
  |  Branch (323:2): [True: 0, False: 14.9k]
  ------------------
  324|  3.30k|	default:
  ------------------
  |  Branch (324:2): [True: 0, False: 14.9k]
  ------------------
  325|  3.30k|		archive_string_empty(&warc->fname);
  ------------------
  |  |  181|  3.30k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  326|  3.30k|		break;
  327|  14.9k|	}
  328|       |
  329|       |	/* Consume the record header. */
  330|  14.9k|	__archive_read_consume(a, eoh - buf);
  331|       |
  332|  14.9k|	switch (ftyp) {
  333|  2.93k|	case WT_RSRC:
  ------------------
  |  Branch (333:2): [True: 2.93k, False: 12.0k]
  ------------------
  334|  11.6k|	case WT_RSP:
  ------------------
  |  Branch (334:2): [True: 8.72k, False: 6.23k]
  ------------------
  335|  11.6k|		if (archive_strlen(&warc->fname) > 0) {
  ------------------
  |  |  178|  11.6k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (335:7): [True: 5.51k, False: 6.14k]
  ------------------
  336|       |			/* Populate the entry object. */
  337|  5.51k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  5.51k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  338|  5.51k|			archive_entry_copy_pathname(entry, warc->fname.s);
  339|  5.51k|			archive_entry_set_size(entry, cntlen);
  340|  5.51k|			archive_entry_set_perm(entry, 0644);
  341|       |			/* WARC-Date becomes ctime; mtime comes from Last-Modified or WARC-Date. */
  342|  5.51k|			archive_entry_set_ctime(entry, rtime, 0L);
  343|  5.51k|			archive_entry_set_mtime(entry, mtime, 0L);
  344|  5.51k|			break;
  345|  5.51k|		}
  346|       |		/* FALLTHROUGH */
  347|  9.44k|	case WT_NONE:
  ------------------
  |  Branch (347:2): [True: 3.30k, False: 11.6k]
  ------------------
  348|  9.44k|	case WT_INFO:
  ------------------
  |  Branch (348:2): [True: 0, False: 14.9k]
  ------------------
  349|  9.44k|	case WT_META:
  ------------------
  |  Branch (349:2): [True: 0, False: 14.9k]
  ------------------
  350|  9.44k|	case WT_REQ:
  ------------------
  |  Branch (350:2): [True: 0, False: 14.9k]
  ------------------
  351|  9.44k|	case WT_RVIS:
  ------------------
  |  Branch (351:2): [True: 0, False: 14.9k]
  ------------------
  352|  9.44k|	case WT_CONV:
  ------------------
  |  Branch (352:2): [True: 0, False: 14.9k]
  ------------------
  353|  9.44k|	case WT_CONT:
  ------------------
  |  Branch (353:2): [True: 0, False: 14.9k]
  ------------------
  354|  9.44k|	case LAST_WT:
  ------------------
  |  Branch (354:2): [True: 0, False: 14.9k]
  ------------------
  355|  9.44k|	default:
  ------------------
  |  Branch (355:2): [True: 0, False: 14.9k]
  ------------------
  356|       |		/* Skip this record body and look for the next one. */
  357|  9.44k|		if (archive_read_format_warc_skip(a) < 0)
  ------------------
  |  Branch (357:7): [True: 93, False: 9.35k]
  ------------------
  358|     93|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     93|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  359|  9.35k|		goto start_over;
  360|  14.9k|	}
  361|  5.51k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  5.51k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  362|  14.9k|}
archive_read_support_format_warc.c:warc_find_eoh:
  829|  15.4k|{
  830|  15.4k|	static const char _marker[] = "\r\n\r\n";
  831|  15.4k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  832|       |
  833|  15.4k|	if (hit != NULL) {
  ------------------
  |  Branch (833:6): [True: 15.2k, False: 238]
  ------------------
  834|  15.2k|		hit += sizeof(_marker) - 1U;
  835|  15.2k|	}
  836|  15.4k|	return hit;
  837|  15.4k|}
archive_read_support_format_warc.c:xmemmem:
  430|   146k|{
  431|   146k|	const char *const eoh = hay + haysize;
  432|   146k|	const char *const eon = needle + needlesize;
  433|   146k|	const char *hp;
  434|   146k|	const char *np;
  435|   146k|	const char *cand;
  436|   146k|	unsigned int hsum;
  437|   146k|	unsigned int nsum;
  438|   146k|	unsigned int eqp;
  439|       |
  440|       |	/* Handle trivial cases first.  A zero-sized needle is defined to be
  441|       |	 * found anywhere in the haystack; otherwise find the first candidate
  442|       |	 * that begins with *NEEDLE. */
  443|   146k|	if (needlesize == 0UL) {
  ------------------
  |  Branch (443:6): [True: 0, False: 146k]
  ------------------
  444|      0|		return hay;
  445|   146k|	} else if ((hay = memchr(hay, *needle, haysize)) == NULL) {
  ------------------
  |  Branch (445:13): [True: 343, False: 145k]
  ------------------
  446|       |		/* No candidate match remains. */
  447|    343|		return NULL;
  448|    343|	}
  449|       |
  450|       |	/* The first characters of haystack and needle already match, and both
  451|       |	 * strings are at least one character long.  Compute the rolling XOR
  452|       |	 * values for the needle and the first NEEDLESIZE characters of haystack. */
  453|   145k|	for (hp = hay + 1U, np = needle + 1U, hsum = *hay, nsum = *hay, eqp = 1U;
  454|  1.12M|	     hp < eoh && np < eon;
  ------------------
  |  Branch (454:7): [True: 1.12M, False: 543]
  |  Branch (454:19): [True: 979k, False: 145k]
  ------------------
  455|   979k|	     hsum ^= *hp, nsum ^= *np, eqp &= *hp == *np, hp++, np++);
  456|       |
  457|       |	/* HP now references the (NEEDLESIZE + 1)-th character. */
  458|   145k|	if (np < eon) {
  ------------------
  |  Branch (458:6): [True: 232, False: 145k]
  ------------------
  459|       |		/* The haystack is smaller than the needle. */
  460|    232|		return NULL;
  461|   145k|	} else if (eqp) {
  ------------------
  |  Branch (461:13): [True: 75.8k, False: 69.8k]
  ------------------
  462|       |		/* Found a match. */
  463|  75.8k|		return hay;
  464|  75.8k|	}
  465|       |
  466|       |	/* Loop through the rest of the haystack and update the rolling XOR
  467|       |	 * iteratively. */
  468|  19.9M|	for (cand = hay; hp < eoh; hp++) {
  ------------------
  |  Branch (468:19): [True: 19.9M, False: 5.33k]
  ------------------
  469|  19.9M|		hsum ^= *cand++;
  470|  19.9M|		hsum ^= *hp;
  471|       |
  472|       |		/* When the rolling XOR values match, it is enough to check
  473|       |		 * NEEDLESIZE - 1 characters for equality.  CAND is always before
  474|       |		 * HP by design, so no range check is needed. */
  475|  19.9M|		if (hsum == nsum && memcmp(cand, needle, needlesize - 1U) == 0) {
  ------------------
  |  Branch (475:7): [True: 1.77M, False: 18.1M]
  |  Branch (475:23): [True: 64.5k, False: 1.71M]
  ------------------
  476|  64.5k|			return cand;
  477|  64.5k|		}
  478|  19.9M|	}
  479|  5.33k|	return NULL;
  480|  69.8k|}
archive_read_support_format_warc.c:warc_read_length:
  736|  15.2k|{
  737|  15.2k|	static const char _key[] = "\r\nContent-Length:";
  738|  15.2k|	const char *val, *eol, *p;
  739|  15.2k|	int64_t len;
  740|       |
  741|  15.2k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (741:6): [True: 37, False: 15.1k]
  ------------------
  742|       |		/* Header field is absent. */
  743|     37|		return -1;
  744|     37|	}
  745|  15.1k|	val += sizeof(_key) - 1U;
  746|       |
  747|  15.1k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (747:6): [True: 0, False: 15.1k]
  ------------------
  748|       |		/* Malformed field with no end of line. */
  749|      0|		return -1;
  750|      0|	}
  751|       |
  752|       |	/* Skip leading whitespace. */
  753|  15.9k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (753:9): [True: 15.9k, False: 2]
  |  Branch (753:23): [True: 445, False: 15.5k]
  |  Branch (753:38): [True: 374, False: 15.1k]
  ------------------
  754|    819|		val++;
  755|       |
  756|       |	/* Require at least one digit. */
  757|  15.1k|	if (val >= eol || *val < '0' || *val > '9')
  ------------------
  |  Branch (757:6): [True: 2, False: 15.1k]
  |  Branch (757:20): [True: 10, False: 15.1k]
  |  Branch (757:34): [True: 8, False: 15.1k]
  ------------------
  758|     20|		return -1;
  759|       |
  760|  15.1k|	len = 0;
  761|  44.6k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (761:16): [True: 29.5k, False: 15.1k]
  ------------------
  762|  29.5k|		int64_t digit;
  763|       |
  764|  29.5k|		if (*p < '0' || *p > '9')
  ------------------
  |  Branch (764:7): [True: 17, False: 29.5k]
  |  Branch (764:19): [True: 3, False: 29.5k]
  ------------------
  765|     20|			return -1;
  766|  29.5k|		digit = *p - '0';
  767|  29.5k|		if (archive_ckd_mul_i64(&len, len, 10) ||
  ------------------
  |  Branch (767:7): [True: 0, False: 29.5k]
  ------------------
  768|  29.5k|		    archive_ckd_add_i64(&len, len, digit))
  ------------------
  |  Branch (768:7): [True: 1, False: 29.5k]
  ------------------
  769|      1|			return -1;
  770|  29.5k|	}
  771|       |
  772|  15.1k|	return len;
  773|  15.1k|}
archive_read_support_format_warc.c:warc_find_eol:
  841|  57.8k|{
  842|  57.8k|	static const char _marker[] = "\r\n";
  843|  57.8k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  844|       |
  845|  57.8k|	return hit;
  846|  57.8k|}
archive_read_support_format_warc.c:warc_read_date:
  777|  15.1k|{
  778|  15.1k|	static const char _key[] = "\r\nWARC-Date:";
  779|  15.1k|	const char *val, *eol, *on = NULL;
  780|  15.1k|	time_t res;
  781|       |
  782|  15.1k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (782:6): [True: 40, False: 15.0k]
  ------------------
  783|       |		/* Header field is absent. */
  784|     40|		return (time_t)-1;
  785|     40|	}
  786|  15.0k|	val += sizeof(_key) - 1U;
  787|  15.0k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (787:6): [True: 0, False: 15.0k]
  ------------------
  788|       |		/* Header field has no end of line. */
  789|      0|		return -1;
  790|      0|	}
  791|       |
  792|       |	/* xstrpisotime() skips leading whitespace. */
  793|  15.0k|	res = xstrpisotime(val, &on);
  794|  15.0k|	if (on != eol) {
  ------------------
  |  Branch (794:6): [True: 123, False: 14.9k]
  ------------------
  795|       |		/* The field must end here. */
  796|    123|		return -1;
  797|    123|	}
  798|  14.9k|	return res;
  799|  15.0k|}
archive_read_support_format_warc.c:xstrpisotime:
  542|  18.8k|{
  543|       |/* Like strptime(), but only for ISO 8601 Zulu strings. */
  544|  18.8k|	struct tm tm;
  545|  18.8k|	time_t res = (time_t)-1;
  546|       |
  547|       |	/* Clear the tm structure. */
  548|  18.8k|	memset(&tm, 0, sizeof(tm));
  549|       |
  550|       |	/* This is a non-standard routine, so skip leading whitespace for
  551|       |	 * caller convenience. */
  552|  37.5k|	while (*s == ' ' || *s == '\t')
  ------------------
  |  Branch (552:9): [True: 249, False: 37.2k]
  |  Branch (552:22): [True: 18.4k, False: 18.8k]
  ------------------
  553|  18.6k|		++s;
  554|       |
  555|       |	/* Read the year. */
  556|  18.8k|	if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (556:6): [True: 1.05k, False: 17.8k]
  |  Branch (556:58): [True: 408, False: 17.4k]
  ------------------
  557|  1.45k|		goto out;
  558|  1.45k|	}
  559|       |	/* Read the month. */
  560|  17.4k|	if ((tm.tm_mon = strtoi_lim(s, &s, 1, 12)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (560:6): [True: 170, False: 17.2k]
  |  Branch (560:52): [True: 94, False: 17.1k]
  ------------------
  561|    264|		goto out;
  562|    264|	}
  563|       |	/* Read the day of the month. */
  564|  17.1k|	if ((tm.tm_mday = strtoi_lim(s, &s, 1, 31)) < 0 || *s++ != 'T') {
  ------------------
  |  Branch (564:6): [True: 169, False: 16.9k]
  |  Branch (564:53): [True: 598, False: 16.3k]
  ------------------
  565|    767|		goto out;
  566|    767|	}
  567|       |	/* Read the hour. */
  568|  16.3k|	if ((tm.tm_hour = strtoi_lim(s, &s, 0, 23)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (568:6): [True: 758, False: 15.6k]
  |  Branch (568:53): [True: 143, False: 15.4k]
  ------------------
  569|    901|		goto out;
  570|    901|	}
  571|       |	/* Read the minute. */
  572|  15.4k|	if ((tm.tm_min = strtoi_lim(s, &s, 0, 59)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (572:6): [True: 121, False: 15.3k]
  |  Branch (572:52): [True: 19, False: 15.3k]
  ------------------
  573|    140|		goto out;
  574|    140|	}
  575|       |	/* Read the second. */
  576|  15.3k|	if ((tm.tm_sec = strtoi_lim(s, &s, 0, 60)) < 0 || *s++ != 'Z') {
  ------------------
  |  Branch (576:6): [True: 42, False: 15.3k]
  |  Branch (576:52): [True: 198, False: 15.1k]
  ------------------
  577|    240|		goto out;
  578|    240|	}
  579|       |
  580|       |	/* Adjust tm fields to satisfy POSIX constraints. */
  581|  15.1k|	tm.tm_year -= 1900;
  582|  15.1k|	tm.tm_mon--;
  583|       |
  584|       |	/* Convert the tm structure to a Unix timestamp in UTC. */
  585|  15.1k|	res = time_from_tm(&tm);
  586|       |
  587|  18.8k|out:
  588|  18.8k|	if (endptr != NULL) {
  ------------------
  |  Branch (588:6): [True: 18.8k, False: 0]
  ------------------
  589|  18.8k|		*endptr = s;
  590|  18.8k|	}
  591|  18.8k|	return res;
  592|  15.1k|}
archive_read_support_format_warc.c:strtoi_lim:
  484|   100k|{
  485|   100k|	int res = 0;
  486|   100k|	const char *sp;
  487|       |	/* Track the number of digits with rulim. */
  488|   100k|	int rulim;
  489|       |
  490|   100k|	for (sp = str, rulim = ulim > 10 ? ulim : 10;
  ------------------
  |  Branch (490:25): [True: 100k, False: 0]
  ------------------
  491|   269k|	     res * 10 <= ulim && rulim && *sp >= '0' && *sp <= '9';
  ------------------
  |  Branch (491:7): [True: 209k, False: 60.6k]
  |  Branch (491:27): [True: 208k, False: 821]
  |  Branch (491:36): [True: 205k, False: 2.47k]
  |  Branch (491:50): [True: 169k, False: 36.7k]
  ------------------
  492|   169k|	     sp++, rulim /= 10) {
  493|   169k|		res *= 10;
  494|   169k|		res += *sp - '0';
  495|   169k|	}
  496|   100k|	if (sp == str) {
  ------------------
  |  Branch (496:6): [True: 728, False: 99.9k]
  ------------------
  497|    728|		res = -1;
  498|  99.9k|	} else if (res < llim || res > ulim) {
  ------------------
  |  Branch (498:13): [True: 692, False: 99.2k]
  |  Branch (498:27): [True: 891, False: 98.3k]
  ------------------
  499|  1.58k|		res = -2;
  500|  1.58k|	}
  501|   100k|	*ep = (const char*)sp;
  502|   100k|	return res;
  503|   100k|}
archive_read_support_format_warc.c:time_from_tm:
  507|  15.1k|{
  508|       |#if HAVE__MKGMTIME
  509|       |        return _mkgmtime(t);
  510|       |#elif HAVE_TIMEGM
  511|       |        /* Use platform timegm() if available. */
  512|  15.1k|        return (timegm(t));
  513|       |#else
  514|       |        int64_t days, result;
  515|       |
  516|       |        /* Otherwise, calculate directly using POSIX assumptions. */
  517|       |        /* First, fix up tm_yday based on the year, month, and day. */
  518|       |        if (mktime(t) == (time_t)-1)
  519|       |                return ((time_t)-1);
  520|       |        /* Then compute timegm() from first principles. */
  521|       |        days = (int64_t)t->tm_yday
  522|       |            + ((int64_t)t->tm_year - 70) * 365
  523|       |            + ((int64_t)t->tm_year - 69) / 4
  524|       |            - ((int64_t)t->tm_year - 1) / 100
  525|       |            + ((int64_t)t->tm_year + 299) / 400;
  526|       |        if (archive_ckd_mul_i64(&result, days, 86400) ||
  527|       |            archive_ckd_add_i64(&result, result,
  528|       |                (int64_t)t->tm_hour * 3600 + t->tm_min * 60
  529|       |                + t->tm_sec))
  530|       |                return ((time_t)-1);
  531|       |        if (result < 0) {
  532|       |                if (TIME_MIN == 0 || result < (int64_t)TIME_MIN)
  533|       |                        return ((time_t)-1);
  534|       |        } else if ((uint64_t)result > (uint64_t)TIME_MAX)
  535|       |                return ((time_t)-1);
  536|       |        return ((time_t)result);
  537|       |#endif
  538|  15.1k|}
archive_read_support_format_warc.c:warc_read_type:
  646|  14.9k|{
  647|  14.9k|	static const char _key[] = "\r\nWARC-Type:";
  648|  14.9k|	const char *val, *eol;
  649|       |
  650|  14.9k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (650:6): [True: 1.75k, False: 13.2k]
  ------------------
  651|       |		/* Header field is absent. */
  652|  1.75k|		return WT_NONE;
  653|  1.75k|	}
  654|  13.2k|	val += sizeof(_key) - 1U;
  655|  13.2k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (655:6): [True: 0, False: 13.2k]
  ------------------
  656|       |		/* Header field has no end of line. */
  657|      0|		return WT_NONE;
  658|      0|	}
  659|       |
  660|       |	/* Skip leading whitespace. */
  661|  44.2k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (661:9): [True: 43.9k, False: 328]
  |  Branch (661:23): [True: 12.7k, False: 31.1k]
  |  Branch (661:38): [True: 18.3k, False: 12.8k]
  ------------------
  662|  31.0k|		++val;
  663|       |
  664|  13.2k|	if (val + 8U == eol) {
  ------------------
  |  Branch (664:6): [True: 12.2k, False: 1.00k]
  ------------------
  665|  12.2k|		if (memcmp(val, "resource", 8U) == 0)
  ------------------
  |  Branch (665:7): [True: 2.93k, False: 9.26k]
  ------------------
  666|  2.93k|			return WT_RSRC;
  667|  9.26k|		else if (memcmp(val, "response", 8U) == 0)
  ------------------
  |  Branch (667:12): [True: 8.72k, False: 543]
  ------------------
  668|  8.72k|			return WT_RSP;
  669|  12.2k|	}
  670|  1.55k|	return WT_NONE;
  671|  13.2k|}
archive_read_support_format_warc.c:warc_read_uri:
  675|  11.6k|{
  676|  11.6k|	static const char _key[] = "\r\nWARC-Target-URI:";
  677|  11.6k|	const char *val, *uri, *eol, *p;
  678|       |
  679|  11.6k|	archive_string_empty(str);
  ------------------
  |  |  181|  11.6k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  680|       |
  681|  11.6k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (681:6): [True: 1.10k, False: 10.5k]
  ------------------
  682|       |		/* Header field is absent. */
  683|  1.10k|		return;
  684|  1.10k|	}
  685|       |	/* Skip leading whitespace. */
  686|  10.5k|	val += sizeof(_key) - 1U;
  687|  10.5k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (687:6): [True: 0, False: 10.5k]
  ------------------
  688|       |		/* Header field has no end of line. */
  689|      0|		return;
  690|      0|	}
  691|       |
  692|  11.9k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (692:9): [True: 11.8k, False: 120]
  |  Branch (692:23): [True: 921, False: 10.9k]
  |  Branch (692:38): [True: 484, False: 10.4k]
  ------------------
  693|  1.40k|		++val;
  694|       |
  695|       |	/* Locate the :// separator. */
  696|  10.5k|	if ((uri = xmemmem(val, eol - val, "://", 3U)) == NULL) {
  ------------------
  |  Branch (696:6): [True: 1.02k, False: 9.53k]
  ------------------
  697|       |		/* Ignore values without a :// separator. */
  698|  1.02k|		return;
  699|  1.02k|	}
  700|       |
  701|       |	/* Spaces inside a URI are not allowed; CRLF should follow. */
  702|   418k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (702:16): [True: 409k, False: 9.23k]
  ------------------
  703|   409k|		if (isspace((unsigned char)*p))
  ------------------
  |  Branch (703:7): [True: 300, False: 409k]
  ------------------
  704|    300|			return;
  705|   409k|	}
  706|       |
  707|       |	/* Require enough room for the shortest supported scheme. */
  708|  9.23k|	if (uri < (val + 3U))
  ------------------
  |  Branch (708:6): [True: 2.09k, False: 7.14k]
  ------------------
  709|  2.09k|		return;
  710|       |
  711|       |	/* Move uri past the :// separator. */
  712|  7.14k|	uri += 3U;
  713|       |
  714|       |	/* Inspect the scheme prefix. */
  715|  7.14k|	if (memcmp(val, "file", 4U) == 0) {
  ------------------
  |  Branch (715:6): [True: 3.42k, False: 3.72k]
  ------------------
  716|       |		/* Keep file:// paths as-is. */
  717|       |
  718|  3.72k|	} else if (memcmp(val, "http", 4U) == 0 ||
  ------------------
  |  Branch (718:13): [True: 3.20k, False: 515]
  ------------------
  719|  3.28k|		   memcmp(val, "ftp", 3U) == 0) {
  ------------------
  |  Branch (719:6): [True: 81, False: 434]
  ------------------
  720|       |		/* Skip the domain and the first slash. */
  721|  23.7k|		while (uri < eol && *uri++ != '/');
  ------------------
  |  Branch (721:10): [True: 23.6k, False: 111]
  |  Branch (721:23): [True: 20.5k, False: 3.17k]
  ------------------
  722|  3.28k|	} else {
  723|       |		/* Unsupported URI scheme. */
  724|    434|		return;
  725|    434|	}
  726|       |
  727|       |	/* Require valid C string representation. */
  728|  6.70k|	if (memchr(uri, '\0', eol - uri) != NULL)
  ------------------
  |  Branch (728:6): [True: 1.05k, False: 5.65k]
  ------------------
  729|  1.05k|		return;
  730|       |
  731|  5.65k|	archive_strncpy(str, uri, eol - uri);
  ------------------
  |  |  173|  5.65k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  732|  5.65k|}
archive_read_support_format_warc.c:warc_read_last_modified:
  803|  5.51k|{
  804|  5.51k|	static const char _key[] = "\r\nLast-Modified:";
  805|  5.51k|	const char *val, *eol, *on = NULL;
  806|  5.51k|	time_t res;
  807|       |
  808|  5.51k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (808:6): [True: 1.71k, False: 3.79k]
  ------------------
  809|       |		/* Header field is absent. */
  810|  1.71k|		return (time_t)-1;
  811|  1.71k|	}
  812|  3.79k|	val += sizeof(_key) - 1U;
  813|  3.79k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (813:6): [True: 0, False: 3.79k]
  ------------------
  814|       |		/* Header field has no end of line. */
  815|      0|		return -1;
  816|      0|	}
  817|       |
  818|       |	/* xstrpisotime() skips leading whitespace. */
  819|  3.79k|	res = xstrpisotime(val, &on);
  820|  3.79k|	if (on != eol) {
  ------------------
  |  Branch (820:6): [True: 3.37k, False: 418]
  ------------------
  821|       |		/* The field must end here. */
  822|  3.37k|		return -1;
  823|  3.37k|	}
  824|    418|	return res;
  825|  3.79k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_data:
  367|  16.5k|{
  368|  16.5k|	struct warc *warc = a->format->data;
  369|  16.5k|	const char *rab;
  370|  16.5k|	ssize_t nrd;
  371|       |
  372|  16.5k|	if (warc->unconsumed) {
  ------------------
  |  Branch (372:6): [True: 5.50k, False: 10.9k]
  ------------------
  373|  5.50k|		__archive_read_consume(a, warc->unconsumed);
  374|  5.50k|		warc->unconsumed = 0;
  375|  5.50k|	}
  376|       |
  377|  16.5k|	if (warc->cntoff >= warc->cntlen) {
  ------------------
  |  Branch (377:6): [True: 10.9k, False: 5.53k]
  ------------------
  378|       |		/* No data is available to return for this entry. */
  379|  10.9k|		*buf = NULL;
  380|  10.9k|		*bsz = 0U;
  381|  10.9k|		*off = warc->cntoff;
  382|  10.9k|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|  10.9k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  383|  10.9k|	}
  384|       |
  385|  5.53k|	rab = __archive_read_ahead(a, 1U, &nrd);
  386|  5.53k|	if (nrd < 0) {
  ------------------
  |  Branch (386:6): [True: 0, False: 5.53k]
  ------------------
  387|      0|		*bsz = 0U;
  388|       |		/* Propagate the read error. */
  389|      0|		return (int)nrd;
  390|  5.53k|	} else if (nrd == 0) {
  ------------------
  |  Branch (390:13): [True: 29, False: 5.50k]
  ------------------
  391|     29|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     29|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  392|     29|		    "Truncated WARC file data");
  393|     29|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  394|  5.50k|	} else if ((int64_t)nrd > warc->cntlen - warc->cntoff) {
  ------------------
  |  Branch (394:13): [True: 5.48k, False: 19]
  ------------------
  395|       |		/* Clamp reads to Content-Length. */
  396|  5.48k|		nrd = warc->cntlen - warc->cntoff;
  397|  5.48k|	}
  398|  5.50k|	*off = warc->cntoff;
  399|  5.50k|	*bsz = nrd;
  400|  5.50k|	*buf = rab;
  401|       |
  402|  5.50k|	warc->cntoff += nrd;
  403|  5.50k|	warc->unconsumed = nrd;
  404|  5.50k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  5.50k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  405|  5.53k|}
archive_read_support_format_warc.c:archive_read_format_warc_skip:
  409|  14.9k|{
  410|  14.9k|	struct warc *warc = a->format->data;
  411|       |
  412|  14.9k|	if (warc->cntoff > warc->cntlen)
  ------------------
  |  Branch (412:6): [True: 0, False: 14.9k]
  ------------------
  413|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  414|  14.9k|	if (warc->unconsumed) {
  ------------------
  |  Branch (414:6): [True: 0, False: 14.9k]
  ------------------
  415|      0|		__archive_read_consume(a, warc->unconsumed);
  416|      0|		warc->unconsumed = 0;
  417|      0|	}
  418|  14.9k|	if (__archive_read_consume(a, warc->cntlen - warc->cntoff) < 0 ||
  ------------------
  |  Branch (418:6): [True: 68, False: 14.8k]
  ------------------
  419|  14.8k|	    __archive_read_consume(a, 4U/*\r\n\r\n separator*/) < 0)
  ------------------
  |  Branch (419:6): [True: 36, False: 14.8k]
  ------------------
  420|    104|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    104|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  421|  14.8k|	warc->cntlen = 0;
  422|  14.8k|	warc->cntoff = 0;
  423|  14.8k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  14.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  424|  14.9k|}

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

archive_read_support_format_zip:
 3855|  20.1k|{
 3856|  20.1k|	int r;
 3857|  20.1k|	r = archive_read_support_format_zip_streamable(a);
 3858|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3858:6): [True: 0, False: 20.1k]
  ------------------
 3859|      0|		return r;
 3860|  20.1k|	return (archive_read_support_format_zip_seekable(a));
 3861|  20.1k|}
archive_read_support_format_zip_streamable:
 4054|  20.1k|{
 4055|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
 4056|  20.1k|	struct zip *zip;
 4057|  20.1k|	int r;
 4058|       |
 4059|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
 4060|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip");
 4061|       |
 4062|  20.1k|	zip = calloc(1, sizeof(*zip));
 4063|  20.1k|	if (zip == NULL) {
  ------------------
  |  Branch (4063:6): [True: 0, False: 20.1k]
  ------------------
 4064|      0|		archive_set_error(_a, ENOMEM, "Can't allocate zip data");
 4065|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4066|      0|	}
 4067|       |
 4068|       |	/* Streamable reader doesn't support mac extensions. */
 4069|  20.1k|	zip->process_mac_extensions = 0;
 4070|       |
 4071|       |	/*
 4072|       |	 * Until enough data has been read, we cannot tell about
 4073|       |	 * any encrypted entries yet.
 4074|       |	 */
 4075|  20.1k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|  20.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4076|  20.1k|	zip->crc32func = real_crc32;
 4077|       |
 4078|  20.1k|	r = __archive_read_register_format(a,
 4079|  20.1k|	    zip,
 4080|  20.1k|	    "zip",
 4081|  20.1k|	    archive_read_format_zip_streamable_bid,
 4082|  20.1k|	    archive_read_format_zip_options,
 4083|  20.1k|	    archive_read_format_zip_streamable_read_header,
 4084|  20.1k|	    archive_read_format_zip_read_data,
 4085|  20.1k|	    archive_read_format_zip_read_data_skip_streamable,
 4086|  20.1k|	    NULL,
 4087|  20.1k|	    archive_read_format_zip_cleanup,
 4088|  20.1k|	    archive_read_support_format_zip_capabilities_streamable,
 4089|  20.1k|	    archive_read_format_zip_has_encrypted_entries);
 4090|       |
 4091|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4091:6): [True: 0, False: 20.1k]
  ------------------
 4092|      0|		free(zip);
 4093|  20.1k|	return (r);
 4094|  20.1k|}
archive_read_support_format_zip_seekable:
 4852|  20.1k|{
 4853|  20.1k|	struct archive_read *a = (struct archive_read *)_a;
 4854|  20.1k|	struct zip *zip;
 4855|  20.1k|	int r;
 4856|       |
 4857|  20.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  20.1k|	do { \
  |  |  180|  20.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  20.1k|			(allowed_states), (function_name)); \
  |  |  182|  20.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  240|  20.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 20.1k]
  |  |  ------------------
  |  |  183|  20.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  20.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
 4858|  20.1k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip_seekable");
 4859|       |
 4860|  20.1k|	zip = calloc(1, sizeof(*zip));
 4861|  20.1k|	if (zip == NULL) {
  ------------------
  |  Branch (4861:6): [True: 0, False: 20.1k]
  ------------------
 4862|      0|		archive_set_error(&a->archive, ENOMEM,
 4863|      0|		    "Can't allocate zip data");
 4864|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4865|      0|	}
 4866|       |
 4867|       |#ifdef HAVE_COPYFILE_H
 4868|       |	/* Set this by default on Mac OS. */
 4869|       |	zip->process_mac_extensions = 1;
 4870|       |#endif
 4871|       |
 4872|       |	/*
 4873|       |	 * Until enough data has been read, we cannot tell about
 4874|       |	 * any encrypted entries yet.
 4875|       |	 */
 4876|  20.1k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|  20.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4877|  20.1k|	zip->crc32func = real_crc32;
 4878|       |
 4879|  20.1k|	r = __archive_read_register_format(a,
 4880|  20.1k|	    zip,
 4881|  20.1k|	    "zip",
 4882|  20.1k|	    archive_read_format_zip_seekable_bid,
 4883|  20.1k|	    archive_read_format_zip_options,
 4884|  20.1k|	    archive_read_format_zip_seekable_read_header,
 4885|  20.1k|	    archive_read_format_zip_read_data,
 4886|  20.1k|	    archive_read_format_zip_read_data_skip_seekable,
 4887|  20.1k|	    NULL,
 4888|  20.1k|	    archive_read_format_zip_cleanup,
 4889|  20.1k|	    archive_read_support_format_zip_capabilities_seekable,
 4890|  20.1k|	    archive_read_format_zip_has_encrypted_entries);
 4891|       |
 4892|  20.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4892:6): [True: 0, False: 20.1k]
  ------------------
 4893|      0|		free(zip);
 4894|  20.1k|	return (r);
 4895|  20.1k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_bid:
 3880|  19.8k|{
 3881|  19.8k|	const char *h;
 3882|       |
 3883|  19.8k|	(void)best_bid; /* UNUSED */
 3884|       |
 3885|  19.8k|	if ((h = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3885:6): [True: 152, False: 19.6k]
  ------------------
 3886|    152|		return (-1);
 3887|       |
 3888|       |	/*
 3889|       |	 * Bid of 29 here comes from:
 3890|       |	 *  + 16 bits for "PK",
 3891|       |	 *  + next 16-bit field has 6 options so contributes
 3892|       |	 *    about 16 - log_2(6) ~= 16 - 2.6 ~= 13 bits
 3893|       |	 *
 3894|       |	 * So we've effectively verified ~29 total bits of check data.
 3895|       |	 */
 3896|  19.6k|	if (h[0] == 'P' && h[1] == 'K') {
  ------------------
  |  Branch (3896:6): [True: 3.14k, False: 16.5k]
  |  Branch (3896:21): [True: 3.04k, False: 99]
  ------------------
 3897|  3.04k|		if ((h[2] == '\001' && h[3] == '\002')
  ------------------
  |  Branch (3897:8): [True: 14, False: 3.02k]
  |  Branch (3897:26): [True: 14, False: 0]
  ------------------
 3898|  3.02k|		    || (h[2] == '\003' && h[3] == '\004')
  ------------------
  |  Branch (3898:11): [True: 2.89k, False: 136]
  |  Branch (3898:29): [True: 2.88k, False: 5]
  ------------------
 3899|    141|		    || (h[2] == '\005' && h[3] == '\006')
  ------------------
  |  Branch (3899:11): [True: 0, False: 141]
  |  Branch (3899:29): [True: 0, False: 0]
  ------------------
 3900|    141|		    || (h[2] == '\006' && h[3] == '\006')
  ------------------
  |  Branch (3900:11): [True: 0, False: 141]
  |  Branch (3900:29): [True: 0, False: 0]
  ------------------
 3901|    141|		    || (h[2] == '\007' && h[3] == '\010')
  ------------------
  |  Branch (3901:11): [True: 126, False: 15]
  |  Branch (3901:29): [True: 126, False: 0]
  ------------------
 3902|     15|		    || (h[2] == '0' && h[3] == '0'))
  ------------------
  |  Branch (3902:11): [True: 3, False: 12]
  |  Branch (3902:26): [True: 2, False: 1]
  ------------------
 3903|  3.03k|			return (29);
 3904|  3.04k|	}
 3905|       |
 3906|       |	/* TODO: It's worth looking ahead a little bit for a valid
 3907|       |	 * PK signature.  In particular, that would make it possible
 3908|       |	 * to read some UUEncoded SFX files or SFX files coming from
 3909|       |	 * a network socket. */
 3910|       |
 3911|  16.6k|	return (0);
 3912|  19.6k|}
archive_read_support_format_zip.c:archive_read_format_zip_options:
 3808|  40.2k|{
 3809|  40.2k|	struct zip *zip = a->format->data;
 3810|  40.2k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  238|  40.2k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3811|       |
 3812|  40.2k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (3812:6): [True: 0, False: 40.2k]
  ------------------
 3813|       |		/* Handle filenames as libarchive 2.x */
 3814|      0|		zip->init_default_conversion = (val != NULL) ? 1 : 0;
  ------------------
  |  Branch (3814:34): [True: 0, False: 0]
  ------------------
 3815|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3816|  40.2k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (3816:13): [True: 0, False: 40.2k]
  ------------------
 3817|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (3817:7): [True: 0, False: 0]
  |  Branch (3817:22): [True: 0, False: 0]
  ------------------
 3818|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3819|      0|			    "zip: hdrcharset option needs a character-set name"
 3820|      0|			);
 3821|      0|		else {
 3822|      0|			zip->sconv = archive_string_conversion_from_charset(
 3823|      0|			    &a->archive, val, 0);
 3824|      0|			if (zip->sconv != NULL) {
  ------------------
  |  Branch (3824:8): [True: 0, False: 0]
  ------------------
 3825|      0|				if (strcmp(val, "UTF-8") == 0)
  ------------------
  |  Branch (3825:9): [True: 0, False: 0]
  ------------------
 3826|      0|					zip->sconv_utf8 = zip->sconv;
 3827|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3828|      0|			} else
 3829|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3830|      0|		}
 3831|      0|		return (ret);
 3832|  40.2k|	} else if (strcmp(key, "ignorecrc32") == 0) {
  ------------------
  |  Branch (3832:13): [True: 40.2k, False: 0]
  ------------------
 3833|       |		/* Mostly useful for testing. */
 3834|  40.2k|		if (val == NULL || val[0] == 0) {
  ------------------
  |  Branch (3834:7): [True: 0, False: 40.2k]
  |  Branch (3834:22): [True: 0, False: 40.2k]
  ------------------
 3835|      0|			zip->crc32func = real_crc32;
 3836|      0|			zip->ignore_crc32 = 0;
 3837|  40.2k|		} else {
 3838|  40.2k|			zip->crc32func = fake_crc32;
 3839|  40.2k|			zip->ignore_crc32 = 1;
 3840|  40.2k|		}
 3841|  40.2k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  40.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3842|  40.2k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (3842:13): [True: 0, False: 0]
  ------------------
 3843|      0|		zip->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (3843:34): [True: 0, False: 0]
  |  Branch (3843:49): [True: 0, False: 0]
  ------------------
 3844|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3845|      0|	}
 3846|       |
 3847|       |	/* Note: The "warn" return is just to inform the options
 3848|       |	 * supervisor that we didn't handle it.  It will generate
 3849|       |	 * a suitable error if no one used this option. */
 3850|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3851|  40.2k|}
archive_read_support_format_zip.c:fake_crc32:
  611|  74.9k|{
  612|  74.9k|	(void)crc; /* UNUSED */
  613|  74.9k|	(void)buff; /* UNUSED */
  614|  74.9k|	(void)len; /* UNUSED */
  615|  74.9k|	return 0;
  616|  74.9k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_read_header:
 3917|  55.7k|{
 3918|  55.7k|	struct zip *zip = a->format->data;
 3919|       |
 3920|  55.7k|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  379|  55.7k|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 3921|  55.7k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (3921:6): [True: 2.86k, False: 52.8k]
  ------------------
 3922|  2.86k|		a->archive.archive_format_name = "ZIP";
 3923|       |
 3924|       |	/*
 3925|       |	 * It should be sufficient to call archive_read_next_header() for
 3926|       |	 * a reader to determine if an entry is encrypted or not. If the
 3927|       |	 * encryption of an entry is only detectable when calling
 3928|       |	 * archive_read_data(), so be it. We'll do the same check there
 3929|       |	 * as well.
 3930|       |	 */
 3931|  55.7k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3931:6): [True: 2.86k, False: 52.8k]
  ------------------
 3932|  55.7k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  416|  55.7k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3933|  2.86k|		zip->has_encrypted_entries = 0;
 3934|       |
 3935|       |	/* Make sure we have a zip_entry structure to use. */
 3936|  55.7k|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3936:6): [True: 2.86k, False: 52.8k]
  ------------------
 3937|  2.86k|		zip->zip_entries = malloc(sizeof(struct zip_entry));
 3938|  2.86k|		if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3938:7): [True: 0, False: 2.86k]
  ------------------
 3939|      0|			archive_set_error(&a->archive, ENOMEM,
 3940|      0|			    "Out  of memory");
 3941|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3942|      0|		}
 3943|  2.86k|	}
 3944|  55.7k|	zip->entry = zip->zip_entries;
 3945|  55.7k|	memset(zip->entry, 0, sizeof(struct zip_entry));
 3946|       |
 3947|  55.7k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3947:6): [True: 2.65k, False: 53.0k]
  ------------------
 3948|  2.65k|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|  2.65k|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3949|  55.7k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3949:6): [True: 2.65k, False: 53.0k]
  ------------------
 3950|  2.65k|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |   95|  2.65k|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3951|  55.7k|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 3952|  55.7k|	__archive_read_reset_passphrase(a);
 3953|       |
 3954|       |	/* Search ahead for the next local file header. */
 3955|  55.7k|	__archive_read_consume(a, zip->unconsumed);
 3956|  55.7k|	zip->unconsumed = 0;
 3957|  56.9k|	for (;;) {
 3958|  56.9k|		int64_t skipped = 0;
 3959|  56.9k|		const char *p, *end;
 3960|  56.9k|		ssize_t bytes;
 3961|       |
 3962|  56.9k|		p = __archive_read_ahead(a, 4, &bytes);
 3963|  56.9k|		if (p == NULL) {
  ------------------
  |  Branch (3963:7): [True: 1.06k, False: 55.8k]
  ------------------
 3964|  1.06k|			archive_set_error(&a->archive,
 3965|  1.06k|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.06k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3966|  1.06k|			    "Truncated ZIP file header");
 3967|  1.06k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|  1.06k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3968|  1.06k|		}
 3969|  55.8k|		end = p + bytes;
 3970|       |
 3971|  19.0M|		while (p + 4 <= end) {
  ------------------
  |  Branch (3971:10): [True: 19.0M, False: 1.17k]
  ------------------
 3972|  19.0M|			if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3972:8): [True: 156k, False: 18.8M]
  |  Branch (3972:23): [True: 75.9k, False: 80.3k]
  ------------------
 3973|  75.9k|				if (p[2] == '\003' && p[3] == '\004') {
  ------------------
  |  Branch (3973:9): [True: 56.0k, False: 19.9k]
  |  Branch (3973:27): [True: 54.6k, False: 1.36k]
  ------------------
 3974|       |					/* Regular file entry. */
 3975|  54.6k|					__archive_read_consume(a, skipped);
 3976|  54.6k|					return zip_read_local_file_header(a,
 3977|  54.6k|					    entry, zip);
 3978|  54.6k|				}
 3979|       |
 3980|       |                              /*
 3981|       |                               * TODO: We cannot restore permissions
 3982|       |                               * based only on the local file headers.
 3983|       |                               * Consider scanning the central
 3984|       |                               * directory and returning additional
 3985|       |                               * entries for at least directories.
 3986|       |                               * This would allow us to properly set
 3987|       |                               * directory permissions.
 3988|       |			       *
 3989|       |			       * This won't help us fix symlinks
 3990|       |			       * and may not help with regular file
 3991|       |			       * permissions, either.  <sigh>
 3992|       |                               */
 3993|  21.3k|                              if (p[2] == '\001' && p[3] == '\002') {
  ------------------
  |  Branch (3993:35): [True: 716, False: 20.6k]
  |  Branch (3993:53): [True: 5, False: 711]
  ------------------
 3994|      5|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  233|      5|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3995|      5|                              }
 3996|       |
 3997|       |                              /* End of central directory?  Must be an
 3998|       |                               * empty archive. */
 3999|  21.3k|                              if ((p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3999:36): [True: 5.28k, False: 16.0k]
  |  Branch (3999:54): [True: 11, False: 5.27k]
  ------------------
 4000|  21.3k|                                  || (p[2] == '\006' && p[3] == '\006'))
  ------------------
  |  Branch (4000:39): [True: 490, False: 20.8k]
  |  Branch (4000:57): [True: 0, False: 490]
  ------------------
 4001|     11|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  233|     11|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4002|  21.3k|			}
 4003|  18.9M|			++p;
 4004|  18.9M|			++skipped;
 4005|  18.9M|		}
 4006|  1.17k|		__archive_read_consume(a, skipped);
 4007|  1.17k|	}
 4008|  55.7k|}
archive_read_support_format_zip.c:zip_read_local_file_header:
 1244|  54.9k|{
 1245|  54.9k|	const char *p;
 1246|  54.9k|	const void *h;
 1247|  54.9k|	const wchar_t *wp;
 1248|  54.9k|	const char *cp;
 1249|  54.9k|	size_t len, filename_length, extra_length;
 1250|  54.9k|	struct archive_string_conv *sconv;
 1251|  54.9k|	struct zip_entry *zip_entry = zip->entry;
 1252|  54.9k|	struct zip_entry zip_entry_central_dir;
 1253|  54.9k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  234|  54.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1254|  54.9k|	char version;
 1255|       |
 1256|       |	/* Save a copy of the original for consistency checks. */
 1257|  54.9k|	zip_entry_central_dir = *zip_entry;
 1258|       |
 1259|  54.9k|	zip->decompress_init = 0;
 1260|  54.9k|	zip->end_of_entry = 0;
 1261|  54.9k|	zip->entry_uncompressed_bytes_read = 0;
 1262|  54.9k|	zip->entry_compressed_bytes_read = 0;
 1263|  54.9k|	zip->computed_crc32 = zip->crc32func(0, NULL, 0);
 1264|       |
 1265|       |	/* Setup default conversion. */
 1266|  54.9k|	if (zip->sconv == NULL && !zip->init_default_conversion) {
  ------------------
  |  Branch (1266:6): [True: 54.9k, False: 0]
  |  Branch (1266:28): [True: 2.95k, False: 52.0k]
  ------------------
 1267|  2.95k|		zip->sconv_default =
 1268|  2.95k|		    archive_string_default_conversion_for_read(&(a->archive));
 1269|  2.95k|		zip->init_default_conversion = 1;
 1270|  2.95k|	}
 1271|       |
 1272|  54.9k|	if ((p = __archive_read_ahead(a, ZIP_LOCHDR_LEN, NULL)) == NULL) {
  ------------------
  |  |   83|  54.9k|#define ZIP_LOCHDR_LEN		30U
  ------------------
  |  Branch (1272:6): [True: 138, False: 54.8k]
  ------------------
 1273|    138|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    138|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1274|    138|		    "Truncated ZIP file header");
 1275|    138|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    138|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1276|    138|	}
 1277|       |
 1278|  54.8k|	if (memcmp(p, "PK\003\004", 4) != 0) {
  ------------------
  |  Branch (1278:6): [True: 21, False: 54.8k]
  ------------------
 1279|     21|		archive_set_error(&a->archive, -1, "Damaged Zip archive");
 1280|     21|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|     21|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1281|     21|	}
 1282|  54.8k|	version = p[4];
 1283|  54.8k|	zip_entry->system = p[5];
 1284|  54.8k|	zip_entry->zip_flags = archive_le16dec(p + 6);
 1285|  54.8k|	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  137|  54.8k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  139|  54.8k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (1285:6): [True: 16.0k, False: 38.8k]
  ------------------
 1286|  16.0k|		zip->has_encrypted_entries = 1;
 1287|  16.0k|		archive_entry_set_is_data_encrypted(entry, 1);
 1288|  16.0k|		if (zip_entry->zip_flags & ZIP_CENTRAL_DIRECTORY_ENCRYPTED &&
  ------------------
  |  |  143|  32.0k|#define ZIP_CENTRAL_DIRECTORY_ENCRYPTED	(1 << 13)
  ------------------
  |  Branch (1288:7): [True: 9.59k, False: 6.42k]
  ------------------
 1289|  9.59k|			zip_entry->zip_flags & ZIP_ENCRYPTED &&
  ------------------
  |  |  137|  25.6k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  |  Branch (1289:4): [True: 4.94k, False: 4.65k]
  ------------------
 1290|  4.94k|			zip_entry->zip_flags & ZIP_STRONG_ENCRYPTED) {
  ------------------
  |  |  139|  4.94k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (1290:4): [True: 7, False: 4.93k]
  ------------------
 1291|      7|			archive_entry_set_is_metadata_encrypted(entry, 1);
 1292|      7|			archive_set_error(&a->archive,
 1293|      7|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1294|      7|			    "Encrypted central directory is unsupported");
 1295|      7|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1296|      7|		}
 1297|  16.0k|	}
 1298|  54.8k|	zip->init_decryption = (zip_entry->zip_flags & ZIP_ENCRYPTED);
  ------------------
  |  |  137|  54.8k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
 1299|  54.8k|	zip_entry->compression = (char)archive_le16dec(p + 8);
 1300|       |	/* This DOS timestamp carries no information a Central Directory
 1301|       |	 * prescan wouldn't already have, and no sub-second precision:
 1302|       |	 * only use it (and reset mtime_ns to match, since it has none) as
 1303|       |	 * a fallback default, not an unconditional override of a more
 1304|       |	 * precise value the prescan may have already established from an
 1305|       |	 * extra field the Local Header doesn't itself repeat. */
 1306|  54.8k|	if (!(zip_entry->flags & LA_MTIME_FROM_EXTRA)) {
  ------------------
  |  |  148|  54.8k|#define LA_MTIME_FROM_EXTRA (1 << 2)
  ------------------
  |  Branch (1306:6): [True: 54.7k, False: 55]
  ------------------
 1307|  54.7k|		zip_entry->mtime = __archive_dos_to_unix(archive_le32dec(p + 10));
 1308|  54.7k|		zip_entry->mtime_ns = 0;
 1309|  54.7k|	}
 1310|  54.8k|	zip_entry->crc32 = archive_le32dec(p + 14);
 1311|  54.8k|	if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  54.8k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1311:6): [True: 31.6k, False: 23.1k]
  ------------------
 1312|  31.6k|		zip_entry->decdat = p[11];
 1313|  23.1k|	else
 1314|  23.1k|		zip_entry->decdat = p[17];
 1315|  54.8k|	zip_entry->compressed_size = archive_le32dec(p + 18);
 1316|  54.8k|	zip_entry->uncompressed_size = archive_le32dec(p + 22);
 1317|  54.8k|	filename_length = archive_le16dec(p + 26);
 1318|  54.8k|	extra_length = archive_le16dec(p + 28);
 1319|       |
 1320|  54.8k|	__archive_read_consume(a, ZIP_LOCHDR_LEN);
  ------------------
  |  |   83|  54.8k|#define ZIP_LOCHDR_LEN		30U
  ------------------
 1321|       |
 1322|       |	/* Read the filename. */
 1323|  54.8k|	if ((h = __archive_read_ahead(a, filename_length, NULL)) == NULL) {
  ------------------
  |  Branch (1323:6): [True: 168, False: 54.6k]
  ------------------
 1324|    168|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    168|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1325|    168|		    "Truncated ZIP file header");
 1326|    168|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    168|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1327|    168|	}
 1328|  54.6k|	if (zip_entry->zip_flags & ZIP_UTF8_NAME) {
  ------------------
  |  |  140|  54.6k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1328:6): [True: 22.8k, False: 31.8k]
  ------------------
 1329|       |		/* The filename is stored to be UTF-8. */
 1330|  22.8k|		if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1330:7): [True: 1.19k, False: 21.6k]
  ------------------
 1331|  1.19k|			zip->sconv_utf8 =
 1332|  1.19k|			    archive_string_conversion_from_charset(
 1333|  1.19k|				&a->archive, "UTF-8", 1);
 1334|  1.19k|			if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (1334:8): [True: 0, False: 1.19k]
  ------------------
 1335|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1336|  1.19k|		}
 1337|  22.8k|		sconv = zip->sconv_utf8;
 1338|  31.8k|	} else if (zip->sconv != NULL)
  ------------------
  |  Branch (1338:13): [True: 0, False: 31.8k]
  ------------------
 1339|      0|		sconv = zip->sconv;
 1340|  31.8k|	else
 1341|  31.8k|		sconv = zip->sconv_default;
 1342|       |
 1343|  54.6k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  54.6k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1343:6): [True: 4.32k, False: 50.3k]
  ------------------
 1344|  54.6k|	    h, filename_length, sconv) != 0) {
 1345|  4.32k|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1345:7): [True: 0, False: 4.32k]
  ------------------
 1346|      0|			archive_set_error(&a->archive, ENOMEM,
 1347|      0|			    "Can't allocate memory for Pathname");
 1348|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1349|      0|		}
 1350|  4.32k|		archive_set_error(&a->archive,
 1351|  4.32k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  4.32k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1352|  4.32k|		    "Pathname cannot be converted "
 1353|  4.32k|		    "from %s to current locale",
 1354|  4.32k|		    archive_string_conversion_charset_name(sconv));
 1355|  4.32k|		ret = ARCHIVE_WARN;
  ------------------
  |  |  236|  4.32k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1356|  4.32k|	}
 1357|  54.6k|	__archive_read_consume(a, filename_length);
 1358|       |
 1359|       |	/* Read the extra data. */
 1360|  54.6k|	if ((h = __archive_read_ahead(a, extra_length, NULL)) == NULL) {
  ------------------
  |  Branch (1360:6): [True: 77, False: 54.5k]
  ------------------
 1361|     77|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     77|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1362|     77|		    "Truncated ZIP file header");
 1363|     77|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     77|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1364|     77|	}
 1365|       |
 1366|  54.5k|	if (ARCHIVE_OK != process_extra(a, entry, h, extra_length,
  ------------------
  |  |  234|  54.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1366:6): [True: 184, False: 54.3k]
  ------------------
 1367|  54.5k|	    zip_entry)) {
 1368|    184|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|    184|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1369|    184|	}
 1370|  54.3k|	__archive_read_consume(a, extra_length);
 1371|       |
 1372|       |	/* Work around a bug in Info-Zip: When reading from a pipe, it
 1373|       |	 * stats the pipe instead of synthesizing a file entry. */
 1374|  54.3k|	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  215|  54.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  222|  54.3k|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1374:6): [True: 260, False: 54.1k]
  ------------------
 1375|    260|		zip_entry->mode &= ~ AE_IFMT;
  ------------------
  |  |  215|    260|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1376|    260|		zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|    260|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1377|    260|	}
 1378|       |
 1379|       |	/* If the mode is totally empty, set some sane default. */
 1380|  54.3k|	if (zip_entry->mode == 0) {
  ------------------
  |  Branch (1380:6): [True: 51.5k, False: 2.87k]
  ------------------
 1381|  51.5k|		zip_entry->mode |= 0664;
 1382|  51.5k|	}
 1383|       |
 1384|       |	/* Windows archivers sometimes use backslash as the directory
 1385|       |	 * separator. Normalize to slash. */
 1386|  54.3k|	if (zip_entry->system == 0 &&
  ------------------
  |  Branch (1386:6): [True: 25.8k, False: 28.5k]
  ------------------
 1387|  25.8k|	    (wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (1387:6): [True: 19.1k, False: 6.69k]
  ------------------
 1388|  19.1k|		if (wcschr(wp, L'/') == NULL && wcschr(wp, L'\\') != NULL) {
  ------------------
  |  Branch (1388:7): [True: 18.6k, False: 538]
  |  Branch (1388:35): [True: 887, False: 17.7k]
  ------------------
 1389|    887|			size_t i;
 1390|    887|			struct archive_wstring s;
 1391|    887|			archive_string_init(&s);
  ------------------
  |  |   71|    887|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 887]
  |  |  ------------------
  ------------------
 1392|    887|			archive_wstrcpy(&s, wp);
  ------------------
  |  |  167|    887|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|  1.77k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 887]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1393|  26.5k|			for (i = 0; i < archive_strlen(&s); i++) {
  ------------------
  |  |  178|  26.5k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1393:16): [True: 25.6k, False: 887]
  ------------------
 1394|  25.6k|				if (s.s[i] == '\\')
  ------------------
  |  Branch (1394:9): [True: 5.03k, False: 20.6k]
  ------------------
 1395|  5.03k|					s.s[i] = '/';
 1396|  25.6k|			}
 1397|    887|			archive_entry_copy_pathname_w(entry, s.s);
 1398|    887|			archive_wstring_free(&s);
 1399|    887|		}
 1400|  19.1k|	}
 1401|       |
 1402|       |	/* Make sure that entries with a trailing '/' are marked as directories
 1403|       |	 * even if the External File Attributes contains bogus values.  If this
 1404|       |	 * is not a directory and there is no type, assume a regular file. */
 1405|  54.3k|	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  54.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  54.3k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1405:6): [True: 53.4k, False: 904]
  ------------------
 1406|  53.4k|		int has_slash;
 1407|       |
 1408|  53.4k|		wp = archive_entry_pathname_w(entry);
 1409|  53.4k|		if (wp != NULL) {
  ------------------
  |  Branch (1409:7): [True: 40.5k, False: 12.9k]
  ------------------
 1410|  40.5k|			len = wcslen(wp);
 1411|  40.5k|			has_slash = len > 0 && wp[len - 1] == L'/';
  ------------------
  |  Branch (1411:16): [True: 11.8k, False: 28.7k]
  |  Branch (1411:27): [True: 310, False: 11.5k]
  ------------------
 1412|  40.5k|		} else {
 1413|  12.9k|			cp = archive_entry_pathname(entry);
 1414|  12.9k|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1414:10): [True: 8.71k, False: 4.24k]
  ------------------
 1415|  12.9k|			has_slash = len > 0 && cp[len - 1] == '/';
  ------------------
  |  Branch (1415:16): [True: 8.71k, False: 4.24k]
  |  Branch (1415:27): [True: 98, False: 8.61k]
  ------------------
 1416|  12.9k|		}
 1417|       |		/* Correct file type as needed. */
 1418|  53.4k|		if (has_slash) {
  ------------------
  |  Branch (1418:7): [True: 408, False: 53.0k]
  ------------------
 1419|    408|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|    408|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1420|    408|			zip_entry->mode |= AE_IFDIR;
  ------------------
  |  |  221|    408|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1421|    408|			zip_entry->mode |= 0111;
 1422|  53.0k|		} else if ((zip_entry->mode & AE_IFMT) == 0) {
  ------------------
  |  |  215|  53.0k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (1422:14): [True: 51.8k, False: 1.19k]
  ------------------
 1423|  51.8k|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|  51.8k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1424|  51.8k|		}
 1425|  53.4k|	}
 1426|       |
 1427|       |	/* Make sure directories end in '/' */
 1428|  54.3k|	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|  54.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|  54.3k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1428:6): [True: 1.31k, False: 53.0k]
  ------------------
 1429|  1.31k|		wp = archive_entry_pathname_w(entry);
 1430|  1.31k|		if (wp != NULL) {
  ------------------
  |  Branch (1430:7): [True: 1.13k, False: 177]
  ------------------
 1431|  1.13k|			len = wcslen(wp);
 1432|  1.13k|			if (len > 0 && wp[len - 1] != L'/') {
  ------------------
  |  Branch (1432:8): [True: 443, False: 692]
  |  Branch (1432:19): [True: 84, False: 359]
  ------------------
 1433|     84|				struct archive_wstring s;
 1434|     84|				archive_string_init(&s);
  ------------------
  |  |   71|     84|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 84]
  |  |  ------------------
  ------------------
 1435|     84|				archive_wstrcat(&s, wp);
 1436|     84|				archive_wstrappend_wchar(&s, L'/');
 1437|     84|				archive_entry_copy_pathname_w(entry, s.s);
 1438|     84|				archive_wstring_free(&s);
 1439|     84|			}
 1440|  1.13k|		} else {
 1441|    177|			cp = archive_entry_pathname(entry);
 1442|    177|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1442:10): [True: 111, False: 66]
  ------------------
 1443|    177|			if (len > 0 && cp[len - 1] != '/') {
  ------------------
  |  Branch (1443:8): [True: 111, False: 66]
  |  Branch (1443:19): [True: 13, False: 98]
  ------------------
 1444|     13|				struct archive_string s;
 1445|     13|				archive_string_init(&s);
  ------------------
  |  |   71|     13|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 13]
  |  |  ------------------
  ------------------
 1446|     13|				archive_strcat(&s, cp);
 1447|     13|				archive_strappend_char(&s, '/');
 1448|     13|				archive_entry_set_pathname(entry, s.s);
 1449|     13|				archive_string_free(&s);
 1450|     13|			}
 1451|    177|		}
 1452|  1.31k|	}
 1453|       |
 1454|  54.3k|	if (zip_entry->flags & LA_FROM_CENTRAL_DIRECTORY) {
  ------------------
  |  |  147|  54.3k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
  |  Branch (1454:6): [True: 301, False: 54.0k]
  ------------------
 1455|       |		/* If this came from the central dir, its size info
 1456|       |		 * is definitive, so ignore the length-at-end flag. */
 1457|    301|		zip_entry->zip_flags &= ~ZIP_LENGTH_AT_END;
  ------------------
  |  |  138|    301|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
 1458|       |		/* If local header is missing a value, use the one from
 1459|       |		   the central directory.  If both have it, warn about
 1460|       |		   mismatches. */
 1461|    301|		if (zip_entry->crc32 == 0) {
  ------------------
  |  Branch (1461:7): [True: 82, False: 219]
  ------------------
 1462|     82|			zip_entry->crc32 = zip_entry_central_dir.crc32;
 1463|    219|		} else if (!zip->ignore_crc32
  ------------------
  |  Branch (1463:14): [True: 0, False: 219]
  ------------------
 1464|      0|		    && zip_entry->crc32 != zip_entry_central_dir.crc32) {
  ------------------
  |  Branch (1464:10): [True: 0, False: 0]
  ------------------
 1465|      0|			archive_set_error(&a->archive,
 1466|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1467|      0|			    "Inconsistent CRC32 values");
 1468|      0|			ret = ARCHIVE_WARN;
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1469|      0|		}
 1470|    301|		if (zip_entry->compressed_size == 0
  ------------------
  |  Branch (1470:7): [True: 74, False: 227]
  ------------------
 1471|    227|		    || zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (1471:10): [True: 11, False: 216]
  ------------------
 1472|     85|			zip_entry->compressed_size
 1473|     85|			    = zip_entry_central_dir.compressed_size;
 1474|    216|		} else if (zip_entry->compressed_size
  ------------------
  |  Branch (1474:14): [True: 57, False: 159]
  ------------------
 1475|    216|		    != zip_entry_central_dir.compressed_size) {
 1476|     57|			archive_set_error(&a->archive,
 1477|     57|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     57|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1478|     57|			    "Inconsistent compressed size: "
 1479|     57|			    "%jd in central directory, %jd in local header",
 1480|     57|			    (intmax_t)zip_entry_central_dir.compressed_size,
 1481|     57|			    (intmax_t)zip_entry->compressed_size);
 1482|     57|			ret = ARCHIVE_WARN;
  ------------------
  |  |  236|     57|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1483|     57|		}
 1484|    301|		if (zip_entry->uncompressed_size == 0 ||
  ------------------
  |  Branch (1484:7): [True: 72, False: 229]
  ------------------
 1485|    229|			zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (1485:4): [True: 2, False: 227]
  ------------------
 1486|     74|			zip_entry->uncompressed_size
 1487|     74|			    = zip_entry_central_dir.uncompressed_size;
 1488|    227|		} else if (zip_entry->uncompressed_size
  ------------------
  |  Branch (1488:14): [True: 58, False: 169]
  ------------------
 1489|    227|		    != zip_entry_central_dir.uncompressed_size) {
 1490|     58|			archive_set_error(&a->archive,
 1491|     58|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     58|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1492|     58|			    "Inconsistent uncompressed size: "
 1493|     58|			    "%jd in central directory, %jd in local header",
 1494|     58|			    (intmax_t)zip_entry_central_dir.uncompressed_size,
 1495|     58|			    (intmax_t)zip_entry->uncompressed_size);
 1496|     58|			ret = ARCHIVE_WARN;
  ------------------
  |  |  236|     58|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1497|     58|		}
 1498|    301|	}
 1499|       |
 1500|       |	/* Populate some additional entry fields: */
 1501|  54.3k|	archive_entry_set_mode(entry, zip_entry->mode);
 1502|  54.3k|	archive_entry_set_uid(entry, zip_entry->uid);
 1503|  54.3k|	archive_entry_set_gid(entry, zip_entry->gid);
 1504|  54.3k|	archive_entry_set_mtime(entry, zip_entry->mtime, zip_entry->mtime_ns);
 1505|       |	/* Without an extra field to supply them, leave atime and ctime
 1506|       |	 * unset, rather than reporting them as set to the Unix epoch. */
 1507|  54.3k|	if (zip_entry->flags & LA_CTIME_FROM_EXTRA)
  ------------------
  |  |  150|  54.3k|#define LA_CTIME_FROM_EXTRA (1 << 4)
  ------------------
  |  Branch (1507:6): [True: 1.45k, False: 52.9k]
  ------------------
 1508|  1.45k|		archive_entry_set_ctime(entry, zip_entry->ctime, 0);
 1509|  54.3k|	if (zip_entry->flags & LA_ATIME_FROM_EXTRA)
  ------------------
  |  |  149|  54.3k|#define LA_ATIME_FROM_EXTRA (1 << 3)
  ------------------
  |  Branch (1509:6): [True: 3.48k, False: 50.9k]
  ------------------
 1510|  3.48k|		archive_entry_set_atime(entry, zip_entry->atime,
 1511|  3.48k|		    zip_entry->atime_ns);
 1512|  54.3k|	if (zip_entry->flags & LA_NTFS_BTIME)
  ------------------
  |  |  153|  54.3k|#define LA_NTFS_BTIME (1 << 7)
  ------------------
  |  Branch (1512:6): [True: 18, False: 54.3k]
  ------------------
 1513|     18|		archive_entry_set_birthtime(entry, zip_entry->btime,
 1514|     18|		    zip_entry->btime_ns);
 1515|       |	/* The compressed size is only known once the local header (or,
 1516|       |	 * when seeking, the central directory) has supplied it. */
 1517|  54.3k|	if ((zip_entry->zip_flags & ZIP_LENGTH_AT_END) == 0)
  ------------------
  |  |  138|  54.3k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1517:6): [True: 22.9k, False: 31.4k]
  ------------------
 1518|  22.9k|		archive_entry_set_compressed_size(entry,
 1519|  22.9k|		    zip_entry->compressed_size);
 1520|       |
 1521|  54.3k|	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  54.3k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  54.3k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1521:6): [True: 538, False: 53.8k]
  ------------------
 1522|    538|		size_t linkname_length;
 1523|       |
 1524|    538|		if (zip_entry->compressed_size > 64 * 1024) {
  ------------------
  |  Branch (1524:7): [True: 2, False: 536]
  ------------------
 1525|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1526|      2|			    "Zip file with oversized link entry");
 1527|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1528|      2|		}
 1529|       |
 1530|    536|		linkname_length = (size_t)zip_entry->compressed_size;
 1531|       |
 1532|    536|		archive_entry_set_size(entry, 0);
 1533|       |
 1534|       |		// take into account link compression if any
 1535|    536|		size_t linkname_full_length = linkname_length;
 1536|    536|		if (zip->entry->compression != 0)
  ------------------
  |  Branch (1536:7): [True: 139, False: 397]
  ------------------
 1537|    139|		{
 1538|       |			// symlink target string appeared to be compressed
 1539|    139|			int status = ARCHIVE_FATAL;
  ------------------
  |  |  240|    139|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1540|    139|			const void *uncompressed_buffer = NULL;
 1541|       |
 1542|    139|			switch (zip->entry->compression)
 1543|    139|			{
 1544|      0|#if HAVE_ZLIB_H
 1545|    135|				case 8: /* Deflate compression. */
  ------------------
  |  Branch (1545:5): [True: 135, False: 4]
  ------------------
 1546|    135|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1547|    135|					status = zip_read_data_deflate(a, &uncompressed_buffer,
 1548|    135|						&linkname_full_length, NULL);
 1549|    135|					break;
 1550|      0|#endif
 1551|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 1552|      0|				case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (1552:5): [True: 0, False: 139]
  ------------------
 1553|       |					/*(see zip file format specification, section 4.4.5)*/
 1554|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1555|      0|					status = zip_read_data_zipx_lzma_alone(a, &uncompressed_buffer,
 1556|      0|						&linkname_full_length, NULL);
 1557|      0|					break;
 1558|      0|#endif
 1559|      4|				default: /* Unsupported compression. */
  ------------------
  |  Branch (1559:5): [True: 4, False: 135]
  ------------------
 1560|      4|					break;
 1561|    139|			}
 1562|    139|			if (status == ARCHIVE_OK)
  ------------------
  |  |  234|    139|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1562:8): [True: 134, False: 5]
  ------------------
 1563|    134|			{
 1564|    134|				p = uncompressed_buffer;
 1565|    134|			}
 1566|      5|			else
 1567|      5|			{
 1568|      5|				archive_set_error(&a->archive,
 1569|      5|					ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1570|      5|					"Unsupported ZIP compression method "
 1571|      5|					"during decompression of link entry (%d: %s)",
 1572|      5|					zip->entry->compression,
 1573|      5|					compression_name(zip->entry->compression));
 1574|      5|				return ARCHIVE_FAILED;
  ------------------
  |  |  238|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1575|      5|			}
 1576|    139|		}
 1577|    397|		else
 1578|    397|		{
 1579|    397|			p = __archive_read_ahead(a, linkname_length, NULL);
 1580|    397|		}
 1581|       |
 1582|    531|		if (p == NULL) {
  ------------------
  |  Branch (1582:7): [True: 0, False: 531]
  ------------------
 1583|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1584|      0|			    "Truncated Zip file");
 1585|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1586|      0|		}
 1587|       |
 1588|    531|		sconv = zip->sconv;
 1589|    531|		if (sconv == NULL && (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  140|    531|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1589:7): [True: 531, False: 0]
  |  Branch (1589:24): [True: 395, False: 136]
  ------------------
 1590|    395|			sconv = zip->sconv_utf8;
 1591|    531|		if (sconv == NULL)
  ------------------
  |  Branch (1591:7): [True: 136, False: 395]
  ------------------
 1592|    136|			sconv = zip->sconv_default;
 1593|    531|		if (archive_entry_copy_symlink_l(entry, p, linkname_full_length,
  ------------------
  |  |   83|    531|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
  |  Branch (1593:7): [True: 360, False: 171]
  ------------------
 1594|    531|		    sconv) != 0) {
 1595|    360|			if (errno != ENOMEM && sconv == zip->sconv_utf8 &&
  ------------------
  |  Branch (1595:8): [True: 360, False: 0]
  |  Branch (1595:27): [True: 360, False: 0]
  ------------------
 1596|    360|			    (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  140|    360|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1596:8): [True: 360, False: 0]
  ------------------
 1597|    360|			    archive_entry_copy_symlink_l(entry, p,
  ------------------
  |  |   83|    360|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
 1598|    360|				linkname_full_length, NULL);
 1599|    360|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1599:8): [True: 0, False: 360]
  ------------------
 1600|      0|				archive_set_error(&a->archive, ENOMEM,
 1601|      0|				    "Can't allocate memory for Symlink");
 1602|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1603|      0|			}
 1604|       |			/*
 1605|       |			 * Since there is no character-set regulation for
 1606|       |			 * symlink name, do not report the conversion error
 1607|       |			 * in an automatic conversion.
 1608|       |			 */
 1609|    360|			if (sconv != zip->sconv_utf8 ||
  ------------------
  |  Branch (1609:8): [True: 0, False: 360]
  ------------------
 1610|    360|			    (zip->entry->zip_flags & ZIP_UTF8_NAME) == 0) {
  ------------------
  |  |  140|    360|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1610:8): [True: 0, False: 360]
  ------------------
 1611|      0|				archive_set_error(&a->archive,
 1612|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1613|      0|				    "Symlink cannot be converted "
 1614|      0|				    "from %s to current locale",
 1615|      0|				    archive_string_conversion_charset_name(
 1616|      0|					sconv));
 1617|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  236|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|      0|			}
 1619|    360|		}
 1620|       |		/* A decoder already consumes the compressed symlink data. */
 1621|    531|		if (zip->entry->compression != 0)
  ------------------
  |  Branch (1621:7): [True: 134, False: 397]
  ------------------
 1622|    134|			linkname_length = zip->entry_bytes_remaining > 0 ?
  ------------------
  |  Branch (1622:22): [True: 1, False: 133]
  ------------------
 1623|    133|			    (size_t)zip->entry_bytes_remaining : 0;
 1624|    531|		zip_entry->uncompressed_size = zip_entry->compressed_size = 0;
 1625|       |
 1626|    531|		if (__archive_read_consume(a, linkname_length) < 0) {
  ------------------
  |  Branch (1626:7): [True: 1, False: 530]
  ------------------
 1627|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1628|      1|			    "Read error skipping symlink target name");
 1629|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1630|      1|		}
 1631|  53.8k|	} else if (zip_entry_size_is_set(zip_entry)) {
  ------------------
  |  Branch (1631:13): [True: 43.1k, False: 10.7k]
  ------------------
 1632|  43.1k|		archive_entry_set_size(entry, zip_entry->uncompressed_size);
 1633|  43.1k|	}
 1634|  54.3k|	zip->entry_bytes_remaining = zip_entry->compressed_size;
 1635|       |
 1636|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1637|  54.3k|	if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  54.3k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1637:6): [True: 22.9k, False: 31.4k]
  ------------------
 1638|  22.9k|	    && zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1638:9): [True: 10.9k, False: 11.9k]
  ------------------
 1639|  10.9k|		zip->end_of_entry = 1;
 1640|       |
 1641|       |	/* Set up a more descriptive format name. */
 1642|  54.3k|        archive_string_empty(&zip->format_name);
  ------------------
  |  |  181|  54.3k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1643|  54.3k|	archive_string_sprintf(&zip->format_name, "ZIP %d.%d (%s)",
 1644|  54.3k|	    version / 10, version % 10,
 1645|  54.3k|	    compression_name(zip->entry->compression));
 1646|  54.3k|	a->archive.archive_format_name = zip->format_name.s;
 1647|       |
 1648|  54.3k|	switch (zip->entry->compression)
 1649|  54.3k|	{
 1650|  7.81k|	case 0:
  ------------------
  |  Branch (1650:2): [True: 7.81k, False: 46.5k]
  ------------------
 1651|  7.81k|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_STORE);
  ------------------
  |  |  462|  7.81k|#define ARCHIVE_ENTRY_COMPRESSION_STORE       0x00000001 /* Uncompressed */
  ------------------
 1652|  7.81k|		break;
 1653|  3.11k|	case 8:
  ------------------
  |  Branch (1653:2): [True: 3.11k, False: 51.2k]
  ------------------
 1654|  3.11k|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_DEFLATE);
  ------------------
  |  |  463|  3.11k|#define ARCHIVE_ENTRY_COMPRESSION_DEFLATE     0x00000002
  ------------------
 1655|  3.11k|		break;
 1656|    117|	case 12:
  ------------------
  |  Branch (1656:2): [True: 117, False: 54.2k]
  ------------------
 1657|    117|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_BZIP2);
  ------------------
  |  |  464|    117|#define ARCHIVE_ENTRY_COMPRESSION_BZIP2       0x00000003
  ------------------
 1658|    117|		break;
 1659|    983|	case 14:
  ------------------
  |  Branch (1659:2): [True: 983, False: 53.4k]
  ------------------
 1660|    983|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_LZMA);
  ------------------
  |  |  465|    983|#define ARCHIVE_ENTRY_COMPRESSION_LZMA        0x00000004
  ------------------
 1661|    983|		break;
 1662|    582|	case 93:
  ------------------
  |  Branch (1662:2): [True: 582, False: 53.8k]
  ------------------
 1663|    582|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_ZSTD);
  ------------------
  |  |  468|    582|#define ARCHIVE_ENTRY_COMPRESSION_ZSTD        0x00000007
  ------------------
 1664|    582|		break;
 1665|    349|	case 95:
  ------------------
  |  Branch (1665:2): [True: 349, False: 54.0k]
  ------------------
 1666|    349|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_XZ);
  ------------------
  |  |  467|    349|#define ARCHIVE_ENTRY_COMPRESSION_XZ          0x00000006
  ------------------
 1667|    349|		break;
 1668|  20.6k|	case 98:
  ------------------
  |  Branch (1668:2): [True: 20.6k, False: 33.7k]
  ------------------
 1669|  20.6k|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_PPMD);
  ------------------
  |  |  469|  20.6k|#define ARCHIVE_ENTRY_COMPRESSION_PPMD        0x00000008
  ------------------
 1670|  20.6k|		break;
 1671|  20.7k|	default:
  ------------------
  |  Branch (1671:2): [True: 20.7k, False: 33.6k]
  ------------------
 1672|  20.7k|		archive_entry_set_compression(entry, ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED);
  ------------------
  |  |  461|  20.7k|#define ARCHIVE_ENTRY_COMPRESSION_UNSPECIFIED 0x00000000
  ------------------
 1673|  20.7k|		break;
 1674|  54.3k|	}
 1675|       |
 1676|  54.3k|	return (ret);
 1677|  54.3k|}
archive_read_support_format_zip.c:process_extra:
  691|  56.0k|{
  692|  56.0k|	struct zip *zip = a->format->data;
  693|  56.0k|	unsigned offset = 0;
  694|       |
  695|  56.0k|	if (extra_length == 0) {
  ------------------
  |  Branch (695:6): [True: 32.7k, False: 23.2k]
  ------------------
  696|  32.7k|		return ARCHIVE_OK;
  ------------------
  |  |  234|  32.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  697|  32.7k|	}
  698|       |
  699|  23.2k|	if (extra_length < 4) {
  ------------------
  |  Branch (699:6): [True: 577, False: 22.6k]
  ------------------
  700|    577|		size_t i = 0;
  701|       |		/* Some ZIP files may have trailing 0 bytes. Let's check they
  702|       |		 * are all 0 and ignore them instead of returning an error.
  703|       |		 *
  704|       |		 * This is not technically correct, but some ZIP files look
  705|       |		 * like this and other tools support those files - so let's
  706|       |		 * also  support them.
  707|       |		 */
  708|  1.62k|		for (; i < extra_length; i++) {
  ------------------
  |  Branch (708:10): [True: 1.05k, False: 570]
  ------------------
  709|  1.05k|			if (p[i] != 0) {
  ------------------
  |  Branch (709:8): [True: 7, False: 1.05k]
  ------------------
  710|      7|				archive_set_error(&a->archive,
  711|      7|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  712|      7|				    "Too-small extra data: "
  713|      7|				    "Need at least 4 bytes, "
  714|      7|				    "but only found %d bytes",
  715|      7|				    (int)extra_length);
  716|      7|				return ARCHIVE_FAILED;
  ------------------
  |  |  238|      7|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  717|      7|			}
  718|  1.05k|		}
  719|       |
  720|    570|		return ARCHIVE_OK;
  ------------------
  |  |  234|    570|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  721|    577|	}
  722|       |
  723|  64.7k|	while (offset <= extra_length - 4) {
  ------------------
  |  Branch (723:9): [True: 42.2k, False: 22.4k]
  ------------------
  724|  42.2k|		unsigned short headerid = archive_le16dec(p + offset);
  725|  42.2k|		unsigned short datasize = archive_le16dec(p + offset + 2);
  726|       |
  727|  42.2k|		offset += 4;
  728|  42.2k|		if (offset + datasize > extra_length) {
  ------------------
  |  Branch (728:7): [True: 180, False: 42.0k]
  ------------------
  729|    180|			archive_set_error(&a->archive,
  730|    180|			    ARCHIVE_ERRNO_FILE_FORMAT, "Extra data overflow: "
  ------------------
  |  |  192|    180|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  731|    180|			    "Need %d bytes but only found %d bytes",
  732|    180|			    (int)datasize, (int)(extra_length - offset));
  733|    180|			return ARCHIVE_FAILED;
  ------------------
  |  |  238|    180|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  734|    180|		}
  735|       |#ifdef DEBUG
  736|       |		fprintf(stderr, "Header id 0x%04x, length %d\n",
  737|       |		    headerid, datasize);
  738|       |#endif
  739|  42.0k|		switch (headerid) {
  740|  1.23k|		case 0x0001:
  ------------------
  |  Branch (740:3): [True: 1.23k, False: 40.8k]
  ------------------
  741|       |			/* Zip64 extended information extra field. */
  742|  1.23k|			zip_entry->flags |= LA_USED_ZIP64;
  ------------------
  |  |  146|  1.23k|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  743|  1.23k|			if (zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (743:8): [True: 438, False: 799]
  ------------------
  744|    438|				uint64_t t = 0;
  745|    438|				if (datasize < 8
  ------------------
  |  Branch (745:9): [True: 0, False: 438]
  ------------------
  746|    438|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (746:12): [True: 11, False: 427]
  ------------------
  747|    438|				    INT64_MAX) {
  748|     11|					archive_set_error(&a->archive,
  749|     11|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     11|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  750|     11|					    "Malformed 64-bit "
  751|     11|					    "uncompressed size");
  752|     11|					return ARCHIVE_FAILED;
  ------------------
  |  |  238|     11|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  753|     11|				}
  754|    427|				zip_entry->uncompressed_size = t;
  755|    427|				offset += 8;
  756|    427|				datasize -= 8;
  757|    427|			}
  758|  1.22k|			if (zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (758:8): [True: 618, False: 608]
  ------------------
  759|    618|				uint64_t t = 0;
  760|    618|				if (datasize < 8
  ------------------
  |  Branch (760:9): [True: 0, False: 618]
  ------------------
  761|    618|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (761:12): [True: 1, False: 617]
  ------------------
  762|    618|				    INT64_MAX) {
  763|      1|					archive_set_error(&a->archive,
  764|      1|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  765|      1|					    "Malformed 64-bit "
  766|      1|					    "compressed size");
  767|      1|					return ARCHIVE_FAILED;
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  768|      1|				}
  769|    617|				zip_entry->compressed_size = t;
  770|    617|				offset += 8;
  771|    617|				datasize -= 8;
  772|    617|			}
  773|  1.22k|			if (zip_entry->local_header_offset == 0xffffffff) {
  ------------------
  |  Branch (773:8): [True: 4, False: 1.22k]
  ------------------
  774|      4|				uint64_t t = 0;
  775|      4|				if (datasize < 8
  ------------------
  |  Branch (775:9): [True: 1, False: 3]
  ------------------
  776|      3|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (776:12): [True: 1, False: 2]
  ------------------
  777|      3|				    INT64_MAX) {
  778|      2|					archive_set_error(&a->archive,
  779|      2|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  780|      2|					    "Malformed 64-bit "
  781|      2|					    "local header offset");
  782|      2|					return ARCHIVE_FAILED;
  ------------------
  |  |  238|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  783|      2|				}
  784|      2|				zip_entry->local_header_offset = t;
  785|      2|				offset += 8;
  786|      2|				datasize -= 8;
  787|      2|			}
  788|       |			/* archive_le32dec(p + offset) gives disk
  789|       |			 * on which file starts, but we don't handle
  790|       |			 * multi-volume Zip files. */
  791|  1.22k|			break;
  792|  2.62k|		case 0x000a:
  ------------------
  |  Branch (792:3): [True: 2.62k, False: 39.4k]
  ------------------
  793|  2.62k|		{
  794|       |			/* NTFS Extra Field: 4 reserved bytes, then one or
  795|       |			 * more Tag(2)/Size(2)/Data(Size) attribute blocks.
  796|       |			 * Only Tag 1 (size 24: Mtime, Atime, Ctime, each an
  797|       |			 * 8-byte Windows FILETIME) is defined; skip any
  798|       |			 * other tag, per spec. Unlike every other ZIP
  799|       |			 * timestamp source, FILETIME has no negative/pre-
  800|       |			 * epoch ambiguity (it's unsigned ticks since
  801|       |			 * 1601), and it's 100ns-precision rather than
  802|       |			 * 1-second, so it also supplies mtime_ns/atime_ns.
  803|       |			 * "Ctime" here is Windows creation time, not POSIX
  804|       |			 * ctime, so it maps to btime. */
  805|  2.62k|			unsigned sub_offset = offset;
  806|  2.62k|			unsigned sub_remaining = datasize;
  807|       |
  808|  2.62k|			if (sub_remaining < 4)
  ------------------
  |  Branch (808:8): [True: 423, False: 2.20k]
  ------------------
  809|    423|				break;
  810|  2.20k|			sub_offset += 4;
  811|  2.20k|			sub_remaining -= 4;
  812|       |
  813|  5.46k|			while (sub_remaining >= 4) {
  ------------------
  |  Branch (813:11): [True: 4.19k, False: 1.26k]
  ------------------
  814|  4.19k|				unsigned short tag =
  815|  4.19k|				    archive_le16dec(p + sub_offset);
  816|  4.19k|				unsigned short size =
  817|  4.19k|				    archive_le16dec(p + sub_offset + 2);
  818|  4.19k|				sub_offset += 4;
  819|  4.19k|				sub_remaining -= 4;
  820|  4.19k|				if (size > sub_remaining)
  ------------------
  |  Branch (820:9): [True: 935, False: 3.25k]
  ------------------
  821|    935|					break;
  822|  3.25k|				if (tag == 1 && size == 24) {
  ------------------
  |  Branch (822:9): [True: 665, False: 2.59k]
  |  Branch (822:21): [True: 47, False: 618]
  ------------------
  823|       |					/* A raw FILETIME of 0 marks a slot
  824|       |					 * the writer didn't have a value
  825|       |					 * for (see the matching comment in
  826|       |					 * archive_write_set_format_zip.c);
  827|       |					 * treat it as absent rather than
  828|       |					 * decoding it as 1601-01-01. */
  829|     47|					uint64_t raw;
  830|     47|					int64_t secs;
  831|     47|					uint32_t nsecs;
  832|       |
  833|     47|					raw = archive_le64dec(p + sub_offset);
  834|     47|					if (raw != 0) {
  ------------------
  |  Branch (834:10): [True: 45, False: 2]
  ------------------
  835|     45|						__archive_ntfs_to_unix(raw,
  836|     45|						    &secs, &nsecs);
  837|     45|						zip_entry->mtime = (time_t)secs;
  838|     45|						zip_entry->mtime_ns = nsecs;
  839|     45|						zip_entry->flags |= LA_NTFS_MTIME;
  ------------------
  |  |  151|     45|#define LA_NTFS_MTIME (1 << 5)
  ------------------
  840|     45|						zip_entry->flags |= LA_MTIME_FROM_EXTRA;
  ------------------
  |  |  148|     45|#define LA_MTIME_FROM_EXTRA (1 << 2)
  ------------------
  841|     45|					}
  842|       |
  843|     47|					raw = archive_le64dec(p + sub_offset + 8);
  844|     47|					if (raw != 0) {
  ------------------
  |  Branch (844:10): [True: 45, False: 2]
  ------------------
  845|     45|						__archive_ntfs_to_unix(raw,
  846|     45|						    &secs, &nsecs);
  847|     45|						zip_entry->atime = (time_t)secs;
  848|     45|						zip_entry->atime_ns = nsecs;
  849|     45|						zip_entry->flags |= LA_NTFS_ATIME;
  ------------------
  |  |  152|     45|#define LA_NTFS_ATIME (1 << 6)
  ------------------
  850|     45|						zip_entry->flags |= LA_ATIME_FROM_EXTRA;
  ------------------
  |  |  149|     45|#define LA_ATIME_FROM_EXTRA (1 << 3)
  ------------------
  851|     45|					}
  852|       |
  853|     47|					raw = archive_le64dec(p + sub_offset + 16);
  854|     47|					if (raw != 0) {
  ------------------
  |  Branch (854:10): [True: 44, False: 3]
  ------------------
  855|     44|						__archive_ntfs_to_unix(raw,
  856|     44|						    &secs, &nsecs);
  857|     44|						zip_entry->btime = (time_t)secs;
  858|     44|						zip_entry->btime_ns = nsecs;
  859|     44|						zip_entry->flags |= LA_NTFS_BTIME;
  ------------------
  |  |  153|     44|#define LA_NTFS_BTIME (1 << 7)
  ------------------
  860|     44|					}
  861|     47|				}
  862|  3.25k|				sub_offset += size;
  863|  3.25k|				sub_remaining -= size;
  864|  3.25k|			}
  865|  2.20k|			break;
  866|  2.62k|		}
  867|    758|		case 0x000d:
  ------------------
  |  Branch (867:3): [True: 758, False: 41.3k]
  ------------------
  868|       |			/* PKWARE Unix Extra Field fixed metadata. */
  869|    758|			if (datasize >= 12) {
  ------------------
  |  Branch (869:8): [True: 402, False: 356]
  ------------------
  870|    402|				if (!(zip_entry->flags & LA_NTFS_ATIME)) {
  ------------------
  |  |  152|    402|#define LA_NTFS_ATIME (1 << 6)
  ------------------
  |  Branch (870:9): [True: 402, False: 0]
  ------------------
  871|    402|					zip_entry->atime =
  872|    402|					    to_time_t(archive_le32dec(p + offset));
  873|    402|					zip_entry->atime_ns = 0;
  874|    402|					zip_entry->flags |= LA_ATIME_FROM_EXTRA;
  ------------------
  |  |  149|    402|#define LA_ATIME_FROM_EXTRA (1 << 3)
  ------------------
  875|    402|				}
  876|    402|				if (!(zip_entry->flags & LA_NTFS_MTIME)) {
  ------------------
  |  |  151|    402|#define LA_NTFS_MTIME (1 << 5)
  ------------------
  |  Branch (876:9): [True: 402, False: 0]
  ------------------
  877|    402|					zip_entry->mtime =
  878|    402|					    to_time_t(archive_le32dec(p + offset + 4));
  879|    402|					zip_entry->mtime_ns = 0;
  880|    402|					zip_entry->flags |= LA_MTIME_FROM_EXTRA;
  ------------------
  |  |  148|    402|#define LA_MTIME_FROM_EXTRA (1 << 2)
  ------------------
  881|    402|				}
  882|    402|				zip_entry->uid =
  883|    402|				    archive_le16dec(p + offset + 8);
  884|    402|				zip_entry->gid =
  885|    402|				    archive_le16dec(p + offset + 10);
  886|       |				/*
  887|       |				 * APPNOTE.TXT also defines additional data after
  888|       |				 * this fixed metadata, depending on file type.
  889|       |				 */
  890|    402|			}
  891|    758|			break;
  892|       |#ifdef DEBUG
  893|       |		case 0x0017:
  894|       |		{
  895|       |			/* Strong encryption field. */
  896|       |			if (archive_le16dec(p + offset) == 2) {
  897|       |				unsigned algId =
  898|       |					archive_le16dec(p + offset + 2);
  899|       |				unsigned bitLen =
  900|       |					archive_le16dec(p + offset + 4);
  901|       |				int	 flags =
  902|       |					archive_le16dec(p + offset + 6);
  903|       |				fprintf(stderr, "algId=0x%04x, bitLen=%u, "
  904|       |				    "flgas=%d\n", algId, bitLen,flags);
  905|       |			}
  906|       |			break;
  907|       |		}
  908|       |#endif
  909|  4.49k|		case 0x5455:
  ------------------
  |  Branch (909:3): [True: 4.49k, False: 37.5k]
  ------------------
  910|  4.49k|		{
  911|       |			/* Extended time field "UT". */
  912|  4.49k|			int flags;
  913|  4.49k|			if (datasize == 0) {
  ------------------
  |  Branch (913:8): [True: 1, False: 4.49k]
  ------------------
  914|      1|				archive_set_error(&a->archive,
  915|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  916|      1|				    "Incomplete extended time field");
  917|      1|				return ARCHIVE_FAILED;
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  918|      1|			}
  919|  4.49k|			flags = p[offset];
  920|  4.49k|			offset++;
  921|  4.49k|			datasize--;
  922|       |			/* Flag bits indicate which dates are present. */
  923|  4.49k|			if (flags & 0x01)
  ------------------
  |  Branch (923:8): [True: 4.17k, False: 319]
  ------------------
  924|  4.17k|			{
  925|       |#ifdef DEBUG
  926|       |				fprintf(stderr, "mtime: %lld -> %d\n",
  927|       |				    (long long)zip_entry->mtime,
  928|       |				    archive_le32dec(p + offset));
  929|       |#endif
  930|  4.17k|				if (datasize < 4)
  ------------------
  |  Branch (930:9): [True: 58, False: 4.11k]
  ------------------
  931|     58|					break;
  932|  4.11k|				if (!(zip_entry->flags & LA_NTFS_MTIME)) {
  ------------------
  |  |  151|  4.11k|#define LA_NTFS_MTIME (1 << 5)
  ------------------
  |  Branch (932:9): [True: 4.11k, False: 0]
  ------------------
  933|  4.11k|					zip_entry->mtime =
  934|  4.11k|					    to_time_t(archive_le32dec(p + offset));
  935|  4.11k|					zip_entry->mtime_ns = 0;
  936|  4.11k|					zip_entry->flags |= LA_MTIME_FROM_EXTRA;
  ------------------
  |  |  148|  4.11k|#define LA_MTIME_FROM_EXTRA (1 << 2)
  ------------------
  937|  4.11k|				}
  938|  4.11k|				offset += 4;
  939|  4.11k|				datasize -= 4;
  940|  4.11k|			}
  941|  4.43k|			if (flags & 0x02)
  ------------------
  |  Branch (941:8): [True: 3.07k, False: 1.35k]
  ------------------
  942|  3.07k|			{
  943|  3.07k|				if (datasize < 4)
  ------------------
  |  Branch (943:9): [True: 460, False: 2.61k]
  ------------------
  944|    460|					break;
  945|  2.61k|				if (!(zip_entry->flags & LA_NTFS_ATIME)) {
  ------------------
  |  |  152|  2.61k|#define LA_NTFS_ATIME (1 << 6)
  ------------------
  |  Branch (945:9): [True: 2.61k, False: 0]
  ------------------
  946|  2.61k|					zip_entry->atime =
  947|  2.61k|					    to_time_t(archive_le32dec(p + offset));
  948|  2.61k|					zip_entry->atime_ns = 0;
  949|  2.61k|					zip_entry->flags |= LA_ATIME_FROM_EXTRA;
  ------------------
  |  |  149|  2.61k|#define LA_ATIME_FROM_EXTRA (1 << 3)
  ------------------
  950|  2.61k|				}
  951|  2.61k|				offset += 4;
  952|  2.61k|				datasize -= 4;
  953|  2.61k|			}
  954|  3.97k|			if (flags & 0x04)
  ------------------
  |  Branch (954:8): [True: 1.82k, False: 2.14k]
  ------------------
  955|  1.82k|			{
  956|  1.82k|				if (datasize < 4)
  ------------------
  |  Branch (956:9): [True: 340, False: 1.48k]
  ------------------
  957|    340|					break;
  958|  1.48k|				zip_entry->ctime =
  959|  1.48k|				    to_time_t(archive_le32dec(p + offset));
  960|  1.48k|				zip_entry->flags |= LA_CTIME_FROM_EXTRA;
  ------------------
  |  |  150|  1.48k|#define LA_CTIME_FROM_EXTRA (1 << 4)
  ------------------
  961|  1.48k|				offset += 4;
  962|  1.48k|				datasize -= 4;
  963|  1.48k|			}
  964|  3.63k|			break;
  965|  3.97k|		}
  966|  3.63k|		case 0x5855:
  ------------------
  |  Branch (966:3): [True: 583, False: 41.5k]
  ------------------
  967|    583|		{
  968|       |			/* Info-ZIP Unix Extra Field (old version) "UX". */
  969|    583|			if (datasize >= 8) {
  ------------------
  |  Branch (969:8): [True: 516, False: 67]
  ------------------
  970|    516|				if (!(zip_entry->flags & LA_NTFS_ATIME)) {
  ------------------
  |  |  152|    516|#define LA_NTFS_ATIME (1 << 6)
  ------------------
  |  Branch (970:9): [True: 516, False: 0]
  ------------------
  971|    516|					zip_entry->atime =
  972|    516|					    to_time_t(archive_le32dec(p + offset));
  973|    516|					zip_entry->atime_ns = 0;
  974|    516|					zip_entry->flags |= LA_ATIME_FROM_EXTRA;
  ------------------
  |  |  149|    516|#define LA_ATIME_FROM_EXTRA (1 << 3)
  ------------------
  975|    516|				}
  976|    516|				if (!(zip_entry->flags & LA_NTFS_MTIME)) {
  ------------------
  |  |  151|    516|#define LA_NTFS_MTIME (1 << 5)
  ------------------
  |  Branch (976:9): [True: 516, False: 0]
  ------------------
  977|    516|					zip_entry->mtime =
  978|    516|					    to_time_t(archive_le32dec(p + offset + 4));
  979|    516|					zip_entry->mtime_ns = 0;
  980|    516|					zip_entry->flags |= LA_MTIME_FROM_EXTRA;
  ------------------
  |  |  148|    516|#define LA_MTIME_FROM_EXTRA (1 << 2)
  ------------------
  981|    516|				}
  982|    516|			}
  983|    583|			if (datasize >= 12) {
  ------------------
  |  Branch (983:8): [True: 278, False: 305]
  ------------------
  984|    278|				zip_entry->uid =
  985|    278|				    archive_le16dec(p + offset + 8);
  986|    278|				zip_entry->gid =
  987|    278|				    archive_le16dec(p + offset + 10);
  988|    278|			}
  989|    583|			break;
  990|  3.97k|		}
  991|  6.02k|		case 0x6c78:
  ------------------
  |  Branch (991:3): [True: 6.02k, False: 36.0k]
  ------------------
  992|  6.02k|		{
  993|       |			/* Experimental 'xl' field */
  994|       |			/*
  995|       |			 * Introduced Dec 2013 to provide a way to
  996|       |			 * include external file attributes (and other
  997|       |			 * fields that ordinarily appear only in
  998|       |			 * central directory) in local file header.
  999|       |			 * This provides file type and permission
 1000|       |			 * information necessary to support full
 1001|       |			 * streaming extraction.  Currently being
 1002|       |			 * discussed with other Zip developers
 1003|       |			 * ... subject to change.
 1004|       |			 *
 1005|       |			 * Format:
 1006|       |			 *  The field starts with a bitmap that specifies
 1007|       |			 *  which additional fields are included.  The
 1008|       |			 *  bitmap is variable length and can be extended in
 1009|       |			 *  the future.
 1010|       |			 *
 1011|       |			 *  n bytes - feature bitmap: first byte has low-order
 1012|       |			 *    7 bits.  If high-order bit is set, a subsequent
 1013|       |			 *    byte holds the next 7 bits, etc.
 1014|       |			 *
 1015|       |			 *  if bitmap & 1, 2 byte "version made by"
 1016|       |			 *  if bitmap & 2, 2 byte "internal file attributes"
 1017|       |			 *  if bitmap & 4, 4 byte "external file attributes"
 1018|       |			 *  if bitmap & 8, 2 byte comment length + n byte
 1019|       |			 *  comment
 1020|       |			 */
 1021|  6.02k|			int bitmap, bitmap_last;
 1022|       |
 1023|  6.02k|			if (datasize < 1)
  ------------------
  |  Branch (1023:8): [True: 90, False: 5.93k]
  ------------------
 1024|     90|				break;
 1025|  5.93k|			bitmap_last = bitmap = 0xff & p[offset];
 1026|  5.93k|			offset += 1;
 1027|  5.93k|			datasize -= 1;
 1028|       |
 1029|       |			/* We only support first 7 bits of bitmap; skip rest. */
 1030|  29.1k|			while ((bitmap_last & 0x80) != 0
  ------------------
  |  Branch (1030:11): [True: 24.4k, False: 4.71k]
  ------------------
 1031|  24.4k|			    && datasize >= 1) {
  ------------------
  |  Branch (1031:11): [True: 23.2k, False: 1.22k]
  ------------------
 1032|  23.2k|				bitmap_last = p[offset];
 1033|  23.2k|				offset += 1;
 1034|  23.2k|				datasize -= 1;
 1035|  23.2k|			}
 1036|       |
 1037|  5.93k|			if (bitmap & 1) {
  ------------------
  |  Branch (1037:8): [True: 5.02k, False: 909]
  ------------------
 1038|       |				/* 2 byte "version made by" */
 1039|  5.02k|				if (datasize < 2)
  ------------------
  |  Branch (1039:9): [True: 1.20k, False: 3.81k]
  ------------------
 1040|  1.20k|					break;
 1041|  3.81k|				zip_entry->system
 1042|  3.81k|				    = archive_le16dec(p + offset) >> 8;
 1043|  3.81k|				offset += 2;
 1044|  3.81k|				datasize -= 2;
 1045|  3.81k|			}
 1046|  4.72k|			if (bitmap & 2) {
  ------------------
  |  Branch (1046:8): [True: 2.43k, False: 2.28k]
  ------------------
 1047|       |				/* 2 byte "internal file attributes" */
 1048|  2.43k|				uint32_t internal_attributes;
 1049|  2.43k|				if (datasize < 2)
  ------------------
  |  Branch (1049:9): [True: 471, False: 1.96k]
  ------------------
 1050|    471|					break;
 1051|  1.96k|				internal_attributes
 1052|  1.96k|				    = archive_le16dec(p + offset);
 1053|       |				/* Not used by libarchive at present. */
 1054|  1.96k|				(void)internal_attributes; /* UNUSED */
 1055|  1.96k|				offset += 2;
 1056|  1.96k|				datasize -= 2;
 1057|  1.96k|			}
 1058|  4.25k|			if (bitmap & 4) {
  ------------------
  |  Branch (1058:8): [True: 3.73k, False: 521]
  ------------------
 1059|       |				/* 4 byte "external file attributes" */
 1060|  3.73k|				uint32_t external_attributes;
 1061|  3.73k|				if (datasize < 4)
  ------------------
  |  Branch (1061:9): [True: 216, False: 3.51k]
  ------------------
 1062|    216|					break;
 1063|  3.51k|				external_attributes
 1064|  3.51k|				    = archive_le32dec(p + offset);
 1065|  3.51k|				if (zip_entry->system == 3) {
  ------------------
  |  Branch (1065:9): [True: 1.18k, False: 2.33k]
  ------------------
 1066|  1.18k|					zip_entry->mode
 1067|  1.18k|					    = external_attributes >> 16;
 1068|  2.33k|				} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (1068:16): [True: 1.66k, False: 668]
  ------------------
 1069|       |					// Interpret MSDOS directory bit
 1070|  1.66k|					if (0x10 == (external_attributes &
  ------------------
  |  Branch (1070:10): [True: 1.16k, False: 496]
  ------------------
 1071|  1.66k|					    0x10)) {
 1072|  1.16k|						zip_entry->mode =
 1073|  1.16k|						    AE_IFDIR | 0775;
  ------------------
  |  |  221|  1.16k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1074|  1.16k|					} else {
 1075|    496|						zip_entry->mode =
 1076|    496|						    AE_IFREG | 0664;
  ------------------
  |  |  216|    496|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1077|    496|					}
 1078|  1.66k|					if (0x01 == (external_attributes &
  ------------------
  |  Branch (1078:10): [True: 727, False: 936]
  ------------------
 1079|  1.66k|					    0x01)) {
 1080|       |						/* Read-only bit;
 1081|       |						 * strip write permissions */
 1082|    727|						zip_entry->mode &= 0555;
 1083|    727|					}
 1084|  1.66k|				} else {
 1085|    668|					zip_entry->mode = 0;
 1086|    668|				}
 1087|  3.51k|				offset += 4;
 1088|  3.51k|				datasize -= 4;
 1089|  3.51k|			}
 1090|  4.03k|			if (bitmap & 8) {
  ------------------
  |  Branch (1090:8): [True: 3.54k, False: 497]
  ------------------
 1091|       |				/* 2 byte comment length + comment */
 1092|  3.54k|				uint32_t comment_length;
 1093|  3.54k|				if (datasize < 2)
  ------------------
  |  Branch (1093:9): [True: 1.73k, False: 1.80k]
  ------------------
 1094|  1.73k|					break;
 1095|  1.80k|				comment_length
 1096|  1.80k|				    = archive_le16dec(p + offset);
 1097|  1.80k|				offset += 2;
 1098|  1.80k|				datasize -= 2;
 1099|       |
 1100|  1.80k|				if (datasize < comment_length)
  ------------------
  |  Branch (1100:9): [True: 733, False: 1.07k]
  ------------------
 1101|    733|					break;
 1102|       |				/* Comment is not supported by libarchive */
 1103|  1.07k|				offset += comment_length;
 1104|  1.07k|				datasize -= comment_length;
 1105|  1.07k|			}
 1106|  1.57k|			break;
 1107|  4.03k|		}
 1108|  3.34k|		case 0x7075:
  ------------------
  |  Branch (1108:3): [True: 3.34k, False: 38.7k]
  ------------------
 1109|  3.34k|		{
 1110|       |			/* Info-ZIP Unicode Path Extra Field. */
 1111|  3.34k|			if (datasize < 5 || entry == NULL)
  ------------------
  |  Branch (1111:8): [True: 377, False: 2.96k]
  |  Branch (1111:24): [True: 0, False: 2.96k]
  ------------------
 1112|    377|				break;
 1113|  2.96k|			offset += 5;
 1114|  2.96k|			datasize -= 5;
 1115|       |
 1116|       |			/* The path name in this field is always encoded
 1117|       |			 * in UTF-8. */
 1118|  2.96k|			if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1118:8): [True: 14, False: 2.95k]
  ------------------
 1119|     14|				zip->sconv_utf8 =
 1120|     14|					archive_string_conversion_from_charset(
 1121|     14|					&a->archive, "UTF-8", 1);
 1122|       |				/* If the converter from UTF-8 is not
 1123|       |				 * available, then the path name from the main
 1124|       |				 * field will more likely be correct. */
 1125|     14|				if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (1125:9): [True: 0, False: 14]
  ------------------
 1126|      0|					break;
 1127|     14|			}
 1128|       |
 1129|       |			/* Make sure the CRC32 of the filename matches. */
 1130|  2.96k|			if (!zip->ignore_crc32) {
  ------------------
  |  Branch (1130:8): [True: 0, False: 2.96k]
  ------------------
 1131|      0|				const char *cp = archive_entry_pathname(entry);
 1132|      0|				if (cp) {
  ------------------
  |  Branch (1132:9): [True: 0, False: 0]
  ------------------
 1133|      0|					uint32_t file_crc =
 1134|      0|					    zip->crc32func(0, cp, strlen(cp));
 1135|      0|					uint32_t utf_crc =
 1136|      0|					    archive_le32dec(p + offset - 4);
 1137|      0|					if (file_crc != utf_crc) {
  ------------------
  |  Branch (1137:10): [True: 0, False: 0]
  ------------------
 1138|       |#ifdef DEBUG
 1139|       |						fprintf(stderr,
 1140|       |						    "CRC filename mismatch; "
 1141|       |						    "CDE is %lx, but UTF8 "
 1142|       |						    "is outdated with %lx\n",
 1143|       |						    file_crc, utf_crc);
 1144|       |#endif
 1145|      0|						break;
 1146|      0|					}
 1147|      0|				}
 1148|      0|			}
 1149|       |
 1150|  2.96k|			if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  2.96k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1150:8): [True: 178, False: 2.78k]
  ------------------
 1151|  2.96k|			    p + offset, datasize, zip->sconv_utf8) != 0) {
 1152|       |				/* Ignore the error, and fallback to the path
 1153|       |				 * name from the main field. */
 1154|       |#ifdef DEBUG
 1155|       |				fprintf(stderr, "Failed to read the ZIP "
 1156|       |				    "0x7075 extra field path.\n");
 1157|       |#endif
 1158|    178|			}
 1159|  2.96k|			break;
 1160|  2.96k|		}
 1161|    760|		case 0x7855:
  ------------------
  |  Branch (1161:3): [True: 760, False: 41.3k]
  ------------------
 1162|       |			/* Info-ZIP Unix Extra Field (type 2) "Ux". */
 1163|       |#ifdef DEBUG
 1164|       |			if (datasize >= 4)
 1165|       |				fprintf(stderr, "uid %d gid %d\n",
 1166|       |				    archive_le16dec(p + offset),
 1167|       |				    archive_le16dec(p + offset + 2));
 1168|       |#endif
 1169|    760|			if (datasize >= 2)
  ------------------
  |  Branch (1169:8): [True: 263, False: 497]
  ------------------
 1170|    263|				zip_entry->uid = archive_le16dec(p + offset);
 1171|    760|			if (datasize >= 4)
  ------------------
  |  Branch (1171:8): [True: 243, False: 517]
  ------------------
 1172|    243|				zip_entry->gid =
 1173|    243|				    archive_le16dec(p + offset + 2);
 1174|    760|			break;
 1175|  2.85k|		case 0x7875:
  ------------------
  |  Branch (1175:3): [True: 2.85k, False: 39.2k]
  ------------------
 1176|  2.85k|		{
 1177|       |			/* Info-Zip Unix Extra Field (type 3) "ux". */
 1178|  2.85k|			int uidsize = 0, gidsize = 0;
 1179|       |
 1180|       |			/* TODO: support arbitrary uidsize/gidsize. */
 1181|  2.85k|			if (datasize >= 1 && p[offset] == 1) {/* version=1 */
  ------------------
  |  Branch (1181:8): [True: 2.74k, False: 110]
  |  Branch (1181:25): [True: 2.60k, False: 133]
  ------------------
 1182|  2.60k|				if (datasize >= 4) {
  ------------------
  |  Branch (1182:9): [True: 1.77k, False: 836]
  ------------------
 1183|       |					/* get a uid size. */
 1184|  1.77k|					uidsize = 0xff & (int)p[offset+1];
 1185|  1.77k|					if (uidsize == 2)
  ------------------
  |  Branch (1185:10): [True: 37, False: 1.73k]
  ------------------
 1186|     37|						zip_entry->uid =
 1187|     37|						    archive_le16dec(
 1188|     37|						        p + offset + 2);
 1189|  1.73k|					else if (uidsize == 4 && datasize >= 6)
  ------------------
  |  Branch (1189:15): [True: 1.41k, False: 322]
  |  Branch (1189:31): [True: 1.39k, False: 21]
  ------------------
 1190|  1.39k|						zip_entry->uid =
 1191|  1.39k|						    archive_le32dec(
 1192|  1.39k|						        p + offset + 2);
 1193|  1.77k|				}
 1194|  2.60k|				if (datasize >= (2 + uidsize + 3)) {
  ------------------
  |  Branch (1194:9): [True: 1.73k, False: 871]
  ------------------
 1195|       |					/* get a gid size. */
 1196|  1.73k|					gidsize = 0xff &
 1197|  1.73k|					    (int)p[offset+2+uidsize];
 1198|  1.73k|					if (gidsize == 2)
  ------------------
  |  Branch (1198:10): [True: 352, False: 1.38k]
  ------------------
 1199|    352|						zip_entry->gid =
 1200|    352|						    archive_le16dec(
 1201|    352|						        p+offset+2+uidsize+1);
 1202|  1.38k|					else if (gidsize == 4 &&
  ------------------
  |  Branch (1202:15): [True: 1.12k, False: 260]
  ------------------
 1203|  1.12k|					    datasize >= (2 + uidsize + 5))
  ------------------
  |  Branch (1203:10): [True: 825, False: 300]
  ------------------
 1204|    825|						zip_entry->gid =
 1205|    825|						    archive_le32dec(
 1206|    825|						        p+offset+2+uidsize+1);
 1207|  1.73k|				}
 1208|  2.60k|			}
 1209|  2.85k|			break;
 1210|  2.96k|		}
 1211|  3.33k|		case 0x9901:
  ------------------
  |  Branch (1211:3): [True: 3.33k, False: 38.7k]
  ------------------
 1212|       |			/* WinZip AES extra data field. */
 1213|  3.33k|			if (datasize < 6) {
  ------------------
  |  Branch (1213:8): [True: 1, False: 3.33k]
  ------------------
 1214|      1|				archive_set_error(&a->archive,
 1215|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1216|      1|				    "Incomplete AES field");
 1217|      1|				return ARCHIVE_FAILED;
  ------------------
  |  |  238|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1218|      1|			}
 1219|  3.33k|			if (p[offset + 2] == 'A' && p[offset + 3] == 'E') {
  ------------------
  |  Branch (1219:8): [True: 3.24k, False: 89]
  |  Branch (1219:32): [True: 3.23k, False: 14]
  ------------------
 1220|       |				/* Vendor version. */
 1221|  3.23k|				zip_entry->aes_extra.vendor =
 1222|  3.23k|				    archive_le16dec(p + offset);
 1223|       |				/* AES encryption strength. */
 1224|  3.23k|				zip_entry->aes_extra.strength = p[offset + 4];
 1225|       |				/* Actual compression method. */
 1226|  3.23k|				zip_entry->aes_extra.compression =
 1227|  3.23k|				    p[offset + 5];
 1228|  3.23k|			}
 1229|  3.33k|			break;
 1230|  16.0k|		default:
  ------------------
  |  Branch (1230:3): [True: 16.0k, False: 26.0k]
  ------------------
 1231|  16.0k|			break;
 1232|  42.0k|		}
 1233|  42.0k|		offset += datasize;
 1234|  42.0k|	}
 1235|  22.4k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  22.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1236|  22.6k|}
archive_read_support_format_zip.c:to_time_t:
  676|  10.0k|{
  677|  10.0k|	const int32_t year_1960_offset = (10 * 365 + 3) * 24 * 60 * 60;
  678|  10.0k|	const int32_t t = (int32_t)raw;
  679|  10.0k|	return (sizeof(time_t) <= sizeof(raw) || t >= -year_1960_offset)
  ------------------
  |  Branch (679:10): [Folded, False: 10.0k]
  |  Branch (679:43): [True: 6.96k, False: 3.09k]
  ------------------
  680|  10.0k|	    ? (time_t)t : (time_t)raw;
  681|  10.0k|}
archive_read_support_format_zip.c:zip_read_data_deflate:
 3088|  4.86k|{
 3089|  4.86k|	struct zip *zip = a->format->data;
 3090|  4.86k|	ssize_t bytes_avail, max_in, to_consume = 0;
 3091|  4.86k|	const void *compressed_buff;
 3092|  4.86k|	const void *sp;
 3093|  4.86k|	int r;
 3094|       |
 3095|  4.86k|	(void)offset; /* UNUSED */
 3096|       |
 3097|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3098|  4.86k|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3098:6): [True: 255, False: 4.60k]
  ------------------
 3099|    255|		zip->uncompressed_buffer_size = 256 * 1024;
 3100|    255|		zip->uncompressed_buffer
 3101|    255|		    = malloc(zip->uncompressed_buffer_size);
 3102|    255|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3102:7): [True: 0, False: 255]
  ------------------
 3103|      0|			archive_set_error(&a->archive, ENOMEM,
 3104|      0|			    "No memory for ZIP decompression");
 3105|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3106|      0|		}
 3107|    255|	}
 3108|       |
 3109|  4.86k|	r = zip_deflate_init(a, zip);
 3110|  4.86k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  4.86k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3110:6): [True: 0, False: 4.86k]
  ------------------
 3111|      0|		return (r);
 3112|       |
 3113|       |	/*
 3114|       |	 * Note: '1' here is a performance optimization.
 3115|       |	 * Recall that the decompression layer returns a count of
 3116|       |	 * available bytes; asking for more than that forces the
 3117|       |	 * decompressor to combine reads by copying data.
 3118|       |	 */
 3119|  4.86k|	compressed_buff = sp = __archive_read_ahead(a, 1, &bytes_avail);
 3120|  4.86k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  4.86k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3120:6): [True: 1.24k, False: 3.62k]
  ------------------
 3121|  1.24k|	    && bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (3121:9): [True: 486, False: 754]
  ------------------
 3122|    486|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 3123|    486|	}
 3124|  4.86k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (3124:6): [True: 0, False: 4.86k]
  ------------------
 3125|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3126|      0|		    "Truncated ZIP file body");
 3127|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3128|      0|	}
 3129|       |
 3130|  4.86k|	zip_read_decrypt(zip, compressed_buff, bytes_avail,
 3131|  4.86k|					 &compressed_buff, &bytes_avail, &sp);
 3132|       |
 3133|       |	/* stream.avail_in is a uInt, which is 32 bits wide even where
 3134|       |	 * ssize_t is 64 bits.  Clamp the available byte count so that a
 3135|       |	 * read-ahead window larger than 4 GiB is not truncated. */
 3136|  4.86k|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (3136:6): [Folded, False: 4.86k]
  ------------------
 3137|      0|		max_in = SSIZE_MAX;
 3138|  4.86k|	else
 3139|  4.86k|		max_in = UINT_MAX;
 3140|  4.86k|	if (bytes_avail > max_in)
  ------------------
  |  Branch (3140:6): [True: 0, False: 4.86k]
  ------------------
 3141|      0|		bytes_avail = max_in;
 3142|       |
 3143|       |	/*
 3144|       |	 * A bug in zlib.h: stream.next_in should be marked 'const'
 3145|       |	 * but isn't (the library never alters data through the
 3146|       |	 * next_in pointer, only reads it).  The result: this ugly
 3147|       |	 * cast to remove 'const'.
 3148|       |	 */
 3149|  4.86k|	zip->stream.next_in = (Bytef *)(uintptr_t)(const void *)compressed_buff;
 3150|  4.86k|	zip->stream.avail_in = (uInt)bytes_avail;
 3151|  4.86k|	zip->stream.total_in = 0;
 3152|  4.86k|	zip->stream.next_out = zip->uncompressed_buffer;
 3153|  4.86k|	zip->stream.avail_out = (uInt)zip->uncompressed_buffer_size;
 3154|  4.86k|	zip->stream.total_out = 0;
 3155|       |
 3156|  4.86k|	r = inflate(&zip->stream, 0);
 3157|  4.86k|	switch (r) {
 3158|    419|	case Z_OK:
  ------------------
  |  Branch (3158:2): [True: 419, False: 4.44k]
  ------------------
 3159|    419|		break;
 3160|  4.36k|	case Z_STREAM_END:
  ------------------
  |  Branch (3160:2): [True: 4.36k, False: 491]
  ------------------
 3161|  4.36k|		zip->end_of_entry = 1;
 3162|  4.36k|		break;
 3163|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (3163:2): [True: 0, False: 4.86k]
  ------------------
 3164|      0|		archive_set_error(&a->archive, ENOMEM,
 3165|      0|		    "Out of memory for ZIP decompression");
 3166|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3167|     72|	default:
  ------------------
  |  Branch (3167:2): [True: 72, False: 4.78k]
  ------------------
 3168|     72|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     72|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3169|     72|		    "ZIP decompression failed (%d)", r);
 3170|     72|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     72|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3171|  4.86k|	}
 3172|       |
 3173|       |	/* Consume as much as the compressor actually used. */
 3174|  4.78k|	to_consume = zip->stream.total_in;
 3175|  4.78k|	__archive_read_consume(a, to_consume);
 3176|  4.78k|	zip->entry_bytes_remaining -= to_consume;
 3177|  4.78k|	zip->entry_compressed_bytes_read += to_consume;
 3178|  4.78k|	zip->entry_uncompressed_bytes_read += zip->stream.total_out;
 3179|       |
 3180|  4.78k|	zip_read_decrypt_update(zip, to_consume, sp);
 3181|       |
 3182|  4.78k|	if (zip->end_of_entry && zip->hctx_valid) {
  ------------------
  |  Branch (3182:6): [True: 4.36k, False: 419]
  |  Branch (3182:27): [True: 1.73k, False: 2.63k]
  ------------------
 3183|  1.73k|		r = check_authentication_code(a, NULL);
 3184|  1.73k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  234|  1.73k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3184:7): [True: 624, False: 1.11k]
  ------------------
 3185|    624|			return r;
 3186|    624|		}
 3187|  1.73k|	}
 3188|       |
 3189|  4.16k|	*size = zip->stream.total_out;
 3190|  4.16k|	*buff = zip->uncompressed_buffer;
 3191|       |
 3192|  4.16k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  4.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3193|  4.78k|}
archive_read_support_format_zip.c:zip_deflate_init:
 3062|  4.86k|{
 3063|  4.86k|	int r;
 3064|       |
 3065|       |	/* If we haven't yet read any data, initialize the decompressor. */
 3066|  4.86k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (3066:6): [True: 4.57k, False: 287]
  ------------------
 3067|  4.57k|		if (zip->stream_valid)
  ------------------
  |  Branch (3067:7): [True: 4.25k, False: 316]
  ------------------
 3068|  4.25k|			r = inflateReset(&zip->stream);
 3069|    316|		else
 3070|    316|			r = inflateInit2(&zip->stream,
 3071|  4.57k|			    -15 /* Don't check for zlib header */);
 3072|  4.57k|		if (r != Z_OK) {
  ------------------
  |  Branch (3072:7): [True: 0, False: 4.57k]
  ------------------
 3073|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3074|      0|			    "Can't initialize ZIP decompression");
 3075|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3076|      0|		}
 3077|       |		/* Stream structure has been set up. */
 3078|  4.57k|		zip->stream_valid = 1;
 3079|       |		/* We've initialized decompression for this stream. */
 3080|  4.57k|		zip->decompress_init = 1;
 3081|  4.57k|	}
 3082|  4.86k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  4.86k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3083|  4.86k|}
archive_read_support_format_zip.c:zip_read_decrypt:
  504|  6.95k|{
  505|  6.95k|	*sp = compressed_buff;
  506|       |
  507|       |	/* Safety check to prevent potential OOB reads if something went wrong
  508|       |	 * previously. We should not have a negative bytes_avail count here.
  509|       |	 * If we do, set them to zero so that reading the ZIP will fail later,
  510|       |	 * safely as corrupted instead of crashing. */
  511|  6.95k|	if (bytes_avail < 0)
  ------------------
  |  Branch (511:6): [True: 0, False: 6.95k]
  ------------------
  512|      0|		bytes_avail = 0;
  513|       |
  514|  6.95k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (514:6): [True: 212, False: 6.74k]
  |  Branch (514:25): [True: 1.76k, False: 4.98k]
  ------------------
  515|  1.97k|		if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) {
  ------------------
  |  Branch (515:7): [True: 1.96k, False: 12]
  ------------------
  516|  1.96k|			size_t buff_remaining =
  517|  1.96k|			    (zip->decrypted_buffer +
  518|  1.96k|			    zip->decrypted_buffer_size)
  519|  1.96k|			    - (zip->decrypted_ptr +
  520|  1.96k|			    zip->decrypted_bytes_remaining);
  521|       |			/* The new bytes to decrypt start after decrypted_bytes_remaining
  522|       |			 * in the raw stream: those leading bytes were already
  523|       |			 * decrypted on a previous call but have not yet been consumed. */
  524|  1.96k|			size_t new_bytes =
  525|  1.96k|			    (size_t)bytes_avail
  526|  1.96k|			    - zip->decrypted_bytes_remaining;
  527|       |
  528|  1.96k|			if (buff_remaining > new_bytes)
  ------------------
  |  Branch (528:8): [True: 1.70k, False: 255]
  ------------------
  529|  1.70k|				buff_remaining = new_bytes;
  530|       |
  531|  1.96k|			if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END) &&
  ------------------
  |  |  138|  1.96k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (531:8): [True: 383, False: 1.58k]
  ------------------
  532|    383|			      zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (532:10): [True: 383, False: 0]
  ------------------
  533|    383|				if ((int64_t)(zip->decrypted_bytes_remaining
  ------------------
  |  Branch (533:9): [True: 0, False: 383]
  ------------------
  534|    383|				    + buff_remaining)
  535|    383|				      > zip->entry_bytes_remaining) {
  536|      0|					if (zip->entry_bytes_remaining <
  ------------------
  |  Branch (536:10): [True: 0, False: 0]
  ------------------
  537|      0|					    (int64_t)zip->decrypted_bytes_remaining)
  538|      0|						buff_remaining = 0;
  539|      0|					else
  540|      0|						buff_remaining =
  541|      0|						    (size_t)zip->entry_bytes_remaining
  542|      0|						    - zip->decrypted_bytes_remaining;
  543|      0|				}
  544|    383|			}
  545|  1.96k|			if (buff_remaining > 0) {
  ------------------
  |  Branch (545:8): [True: 1.96k, False: 0]
  ------------------
  546|  1.96k|				if (zip->tctx_valid) {
  ------------------
  |  Branch (546:9): [True: 210, False: 1.75k]
  ------------------
  547|    210|					trad_enc_decrypt_update(&zip->tctx,
  548|    210|					    (const uint8_t *)compressed_buff
  549|    210|					      + zip->decrypted_bytes_remaining,
  550|    210|					    buff_remaining,
  551|    210|					    zip->decrypted_ptr
  552|    210|					      + zip->decrypted_bytes_remaining,
  553|    210|					    buff_remaining);
  554|  1.75k|				} else {
  555|  1.75k|					size_t dsize = buff_remaining;
  556|  1.75k|					archive_decrypto_aes_ctr_update(
  ------------------
  |  |  154|  1.75k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  557|  1.75k|					    &zip->cctx,
  558|  1.75k|					    (const uint8_t *)compressed_buff
  559|  1.75k|					      + zip->decrypted_bytes_remaining,
  560|  1.75k|					    buff_remaining,
  561|  1.75k|					    zip->decrypted_ptr
  562|  1.75k|					      + zip->decrypted_bytes_remaining,
  563|  1.75k|					    &dsize);
  564|  1.75k|				}
  565|  1.96k|				zip->decrypted_bytes_remaining +=
  566|  1.96k|				    buff_remaining;
  567|  1.96k|			}
  568|  1.96k|		}
  569|  1.97k|		*result_avail = zip->decrypted_bytes_remaining;
  570|  1.97k|		*result_buff = (const char *)zip->decrypted_ptr;
  571|  4.98k|	} else {
  572|  4.98k|		*result_buff = compressed_buff;
  573|  4.98k|		*result_avail = bytes_avail;
  574|  4.98k|	}
  575|  6.95k|}
archive_read_support_format_zip.c:trad_enc_decrypt_update:
  373|  31.0k|{
  374|  31.0k|	unsigned i, max;
  375|       |
  376|  31.0k|	max = (unsigned)((in_len < out_len)? in_len: out_len);
  ------------------
  |  Branch (376:19): [True: 0, False: 31.0k]
  ------------------
  377|       |
  378|  6.28M|	for (i = 0; i < max; i++) {
  ------------------
  |  Branch (378:14): [True: 6.24M, False: 31.0k]
  ------------------
  379|  6.24M|		uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx);
  380|  6.24M|		out[i] = t;
  381|  6.24M|		trad_enc_update_keys(ctx, t);
  382|  6.24M|	}
  383|  31.0k|}
archive_read_support_format_zip.c:trad_enc_decrypt_byte:
  365|  6.24M|{
  366|  6.24M|	unsigned temp = ctx->keys[2] | 2;
  367|  6.24M|	return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
  368|  6.24M|}
archive_read_support_format_zip.c:trad_enc_update_keys:
  352|  6.26M|{
  353|  6.26M|	uint8_t t;
  354|  6.26M|#define CRC32(c, b) (__archive_crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  355|       |
  356|  6.26M|	ctx->keys[0] = CRC32(ctx->keys[0], c);
  ------------------
  |  |  354|  6.26M|#define CRC32(c, b) (__archive_crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  357|  6.26M|	ctx->keys[1] = (ctx->keys[1] + (ctx->keys[0] & 0xff)) * 134775813L + 1;
  358|  6.26M|	t = (ctx->keys[1] >> 24) & 0xff;
  359|  6.26M|	ctx->keys[2] = CRC32(ctx->keys[2], t);
  ------------------
  |  |  354|  6.26M|#define CRC32(c, b) (__archive_crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  360|  6.26M|#undef CRC32
  361|  6.26M|}
archive_read_support_format_zip.c:zip_read_decrypt_update:
  582|  6.70k|{
  583|  6.70k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (583:6): [True: 208, False: 6.50k]
  |  Branch (583:25): [True: 1.74k, False: 4.75k]
  ------------------
  584|  1.95k|		zip->decrypted_bytes_remaining -= to_consume;
  585|  1.95k|		if (zip->decrypted_bytes_remaining == 0)
  ------------------
  |  Branch (585:7): [True: 85, False: 1.86k]
  ------------------
  586|     85|			zip->decrypted_ptr = zip->decrypted_buffer;
  587|  1.86k|		else
  588|  1.86k|			zip->decrypted_ptr += to_consume;
  589|  1.95k|	}
  590|  6.70k|	if (zip->hctx_valid)
  ------------------
  |  Branch (590:6): [True: 1.74k, False: 4.96k]
  ------------------
  591|  1.74k|		archive_hmac_sha1_update(&zip->hctx, sp, to_consume);
  ------------------
  |  |   91|  1.74k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  592|  6.70k|}
archive_read_support_format_zip.c:check_authentication_code:
 1681|  2.63k|{
 1682|  2.63k|	struct zip *zip = a->format->data;
 1683|       |
 1684|       |	/* Check authentication code. */
 1685|  2.63k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1685:6): [True: 2.63k, False: 0]
  ------------------
 1686|  2.63k|		const void *p;
 1687|  2.63k|		uint8_t hmac[20];
 1688|  2.63k|		size_t hmac_len = 20;
 1689|  2.63k|		int cmp;
 1690|       |
 1691|  2.63k|		archive_hmac_sha1_final(&zip->hctx, hmac, &hmac_len);
  ------------------
  |  |   93|  2.63k|  	__archive_hmac.__hmac_sha1_final(ctx, out, out_len)
  ------------------
 1692|  2.63k|		if (_p == NULL) {
  ------------------
  |  Branch (1692:7): [True: 2.43k, False: 201]
  ------------------
 1693|       |			/* Read authentication code. */
 1694|  2.43k|			p = __archive_read_ahead(a, AUTH_CODE_SIZE, NULL);
  ------------------
  |  |  162|  2.43k|#define AUTH_CODE_SIZE	10
  ------------------
 1695|  2.43k|			if (p == NULL) {
  ------------------
  |  Branch (1695:8): [True: 3, False: 2.43k]
  ------------------
 1696|      3|				archive_set_error(&a->archive,
 1697|      3|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1698|      3|				    "Truncated ZIP file data");
 1699|      3|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1700|      3|			}
 1701|  2.43k|		} else {
 1702|    201|			p = _p;
 1703|    201|		}
 1704|  2.63k|		cmp = memcmp(hmac, p, AUTH_CODE_SIZE);
  ------------------
  |  |  162|  2.63k|#define AUTH_CODE_SIZE	10
  ------------------
 1705|  2.63k|		__archive_read_consume(a, AUTH_CODE_SIZE);
  ------------------
  |  |  162|  2.63k|#define AUTH_CODE_SIZE	10
  ------------------
 1706|  2.63k|		if (cmp != 0) {
  ------------------
  |  Branch (1706:7): [True: 1.33k, False: 1.29k]
  ------------------
 1707|  1.33k|			archive_set_error(&a->archive,
 1708|  1.33k|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  1.33k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1709|  1.33k|			    "ZIP bad Authentication code");
 1710|  1.33k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  1.33k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1711|  1.33k|		}
 1712|  2.63k|	}
 1713|  1.29k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1714|  2.63k|}
archive_read_support_format_zip.c:zip_read_data_zipx_lzma_alone:
 2424|  1.68k|{
 2425|  1.68k|	struct zip *zip = a->format->data;
 2426|  1.68k|	int ret;
 2427|  1.68k|	lzma_ret lz_ret;
 2428|  1.68k|	const void* compressed_buf;
 2429|  1.68k|	const void* sp;
 2430|  1.68k|	ssize_t bytes_avail, to_consume;
 2431|       |
 2432|  1.68k|	(void) offset; /* UNUSED */
 2433|       |
 2434|       |	/* Initialize decompressor if not yet initialized. */
 2435|  1.68k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2435:6): [True: 979, False: 702]
  ------------------
 2436|    979|		ret = zipx_lzma_alone_init(a, zip);
 2437|    979|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|    979|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2437:7): [True: 34, False: 945]
  ------------------
 2438|     34|			return (ret);
 2439|    979|	}
 2440|       |
 2441|       |	/* Fetch more compressed data. The same note as in deflate handler
 2442|       |	 * applies here as well:
 2443|       |	 *
 2444|       |	 * Note: '1' here is a performance optimization. Recall that the
 2445|       |	 * decompression layer returns a count of available bytes; asking for
 2446|       |	 * more than that forces the decompressor to combine reads by copying
 2447|       |	 * data.
 2448|       |	 */
 2449|  1.64k|	compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
 2450|  1.64k|	if (zip->entry_bytes_remaining > 0
  ------------------
  |  Branch (2450:6): [True: 1.48k, False: 158]
  ------------------
 2451|  1.48k|		&& bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2451:6): [True: 937, False: 552]
  ------------------
 2452|    937|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2453|    937|	}
 2454|  1.64k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2454:6): [True: 0, False: 1.64k]
  ------------------
 2455|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2456|      0|		    "Truncated lzma file body");
 2457|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2458|      0|	}
 2459|       |
 2460|  1.64k|	zip_read_decrypt(zip, compressed_buf, bytes_avail,
 2461|  1.64k|	    &compressed_buf, &bytes_avail, &sp);
 2462|       |
 2463|  1.64k|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2464|  1.64k|	zip->zipx_lzma_stream.avail_in = bytes_avail;
 2465|  1.64k|	zip->zipx_lzma_stream.total_in = 0;
 2466|  1.64k|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2467|       |	/* These lzma_alone streams lack an end of stream marker in some
 2468|       |	 * cases, so when the uncompressed size is known we cap avail_out to
 2469|       |	 * make sure the unpacker won't try to unpack more than it's supposed
 2470|       |	 * to.  When the compressed size is unknown (entry_bytes_remaining <= 0,
 2471|       |	 * e.g. ZIP_LENGTH_AT_END from a non-seekable source) we must use the
 2472|       |	 * full buffer and rely on the LZMA stream end marker to detect the end
 2473|       |	 * of the entry. */
 2474|  1.64k|	if (zip->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (2474:6): [True: 158, False: 1.48k]
  ------------------
 2475|    158|		zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2476|  1.48k|	} else {
 2477|  1.48k|		zip->zipx_lzma_stream.avail_out =
 2478|  1.48k|			(size_t)zipmin((int64_t) zip->uncompressed_buffer_size,
  ------------------
  |  |  274|  1.48k|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (274:22): [True: 786, False: 703]
  |  |  ------------------
  ------------------
 2479|  1.48k|			    zip->entry->uncompressed_size -
 2480|  1.48k|			    zip->entry_uncompressed_bytes_read);
 2481|  1.48k|	}
 2482|  1.64k|	zip->zipx_lzma_stream.total_out = 0;
 2483|       |
 2484|       |	/* Perform the decompression. */
 2485|  1.64k|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2486|  1.64k|	switch(lz_ret) {
 2487|     15|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2487:3): [True: 15, False: 1.63k]
  ------------------
 2488|     15|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     15|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2489|     15|			    "lzma data error (%d)", (int) lz_ret);
 2490|     15|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     15|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2491|       |
 2492|       |		/* This case is optional in lzma alone format. It can happen,
 2493|       |		 * but most of the files don't have it. (GitHub #1257) */
 2494|    267|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2494:3): [True: 267, False: 1.38k]
  ------------------
 2495|       |			/* This assertion is only possible if the size of the
 2496|       |			 * compressed data stream is known. */
 2497|    267|			if((int64_t) zip->zipx_lzma_stream.total_in !=
  ------------------
  |  Branch (2497:7): [True: 50, False: 217]
  ------------------
 2498|    267|			    zip->entry_bytes_remaining
 2499|     50|			    && zip->entry_bytes_remaining > 0)
  ------------------
  |  Branch (2499:11): [True: 4, False: 46]
  ------------------
 2500|      4|			{
 2501|      4|				archive_set_error(&a->archive,
 2502|      4|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2503|      4|				    "lzma alone premature end of stream");
 2504|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2505|      4|			}
 2506|       |
 2507|    263|			zip->end_of_entry = 1;
 2508|    263|			break;
 2509|       |
 2510|  1.14k|		case LZMA_OK:
  ------------------
  |  Branch (2510:3): [True: 1.14k, False: 499]
  ------------------
 2511|  1.14k|			break;
 2512|       |
 2513|    217|		case LZMA_BUF_ERROR:
  ------------------
  |  Branch (2513:3): [True: 217, False: 1.43k]
  ------------------
 2514|    217|			if (zip->zipx_lzma_stream.avail_out == 0) {
  ------------------
  |  Branch (2514:8): [True: 170, False: 47]
  ------------------
 2515|       |				/* The output buffer was filled exactly.  When
 2516|       |				 * the uncompressed size is known this means we
 2517|       |				 * have decompressed all expected bytes.  When
 2518|       |				 * the size is unknown a full buffer just means
 2519|       |				 * we need another iteration. */
 2520|    170|				if (zip->entry_bytes_remaining > 0)
  ------------------
  |  Branch (2520:9): [True: 170, False: 0]
  ------------------
 2521|    170|					zip->end_of_entry = 1;
 2522|    170|				break;
 2523|    170|			}
 2524|       |			/* FALL THROUGH */
 2525|     47|		default:
  ------------------
  |  Branch (2525:3): [True: 0, False: 1.64k]
  ------------------
 2526|     47|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     47|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2527|     47|			    "lzma unknown error (%d)", (int) lz_ret);
 2528|     47|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     47|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2529|  1.64k|	}
 2530|       |
 2531|  1.58k|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2532|       |
 2533|       |	/* Update pointers. */
 2534|  1.58k|	__archive_read_consume(a, to_consume);
 2535|  1.58k|	zip->entry_compressed_bytes_read += to_consume;
 2536|  1.58k|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2537|       |
 2538|  1.58k|	zip_read_decrypt_update(zip, to_consume, sp);
 2539|       |
 2540|  1.58k|	if(zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2540:5): [True: 1.42k, False: 152]
  ------------------
 2541|  1.42k|		zip->entry_bytes_remaining -= to_consume;
 2542|  1.42k|		if(zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2542:6): [True: 589, False: 840]
  ------------------
 2543|    589|			zip->end_of_entry = 1;
 2544|    589|		}
 2545|  1.42k|	}
 2546|       |
 2547|  1.75k|	while(zip->end_of_entry && zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2547:8): [True: 975, False: 776]
  |  Branch (2547:29): [True: 224, False: 751]
  ------------------
 2548|    224|		const void *p = __archive_read_ahead(a, 1, &bytes_avail);
 2549|    224|		if (p == NULL)
  ------------------
  |  Branch (2549:7): [True: 54, False: 170]
  ------------------
 2550|     54|			break;
 2551|    170|		if (bytes_avail > zip->entry_bytes_remaining)
  ------------------
  |  Branch (2551:7): [True: 116, False: 54]
  ------------------
 2552|    116|			bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2553|    170|		if (zip->hctx_valid)
  ------------------
  |  Branch (2553:7): [True: 0, False: 170]
  ------------------
 2554|      0|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |   91|      0|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 2555|    170|			    p, bytes_avail);
 2556|    170|		__archive_read_consume(a, bytes_avail);
 2557|    170|		zip->entry_compressed_bytes_read += bytes_avail;
 2558|    170|		zip->entry_bytes_remaining -= bytes_avail;
 2559|    170|	}
 2560|       |
 2561|       |	/* Free lzma decoder handle because we'll no longer need it. */
 2562|       |	/* This cannot be folded into LZMA_STREAM_END handling above
 2563|       |	 * because the stream end marker is not required in this format. */
 2564|  1.58k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2564:5): [True: 805, False: 776]
  ------------------
 2565|    805|		lzma_end(&zip->zipx_lzma_stream);
 2566|    805|		zip->zipx_lzma_valid = 0;
 2567|       |
 2568|    805|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2568:7): [True: 0, False: 805]
  ------------------
 2569|      0|			ret = check_authentication_code(a, NULL);
 2570|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2570:8): [True: 0, False: 0]
  ------------------
 2571|      0|				return ret;
 2572|      0|		}
 2573|    805|	}
 2574|       |
 2575|       |	/* Return values. */
 2576|  1.58k|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2577|  1.58k|	*buff = zip->uncompressed_buffer;
 2578|       |
 2579|       |	/* If we're here, then we're good! */
 2580|  1.58k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2581|  1.58k|}
archive_read_support_format_zip.c:zipx_lzma_alone_init:
 2156|    979|{
 2157|    979|	lzma_ret r;
 2158|    979|	const uint8_t* p;
 2159|       |
 2160|    979|#pragma pack(push)
 2161|    979|#pragma pack(1)
 2162|    979|	struct _alone_header {
 2163|    979|	    uint8_t bytes[5];
 2164|    979|	    uint64_t uncompressed_size;
 2165|    979|	} alone_header;
 2166|    979|#pragma pack(pop)
 2167|       |
 2168|    979|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (2168:5): [True: 72, False: 907]
  ------------------
 2169|     72|		lzma_end(&zip->zipx_lzma_stream);
 2170|     72|		zip->zipx_lzma_valid = 0;
 2171|     72|	}
 2172|       |
 2173|       |	/* To unpack ZIPX's "LZMA" (id 14) stream we can use standard liblzma
 2174|       |	 * that is a part of XZ Utils. The stream format stored inside ZIPX
 2175|       |	 * file is a modified "lzma alone" file format, that was used by the
 2176|       |	 * `lzma` utility which was later deprecated in favour of `xz` utility.
 2177|       | 	 * Since those formats are nearly the same, we can use a standard
 2178|       |	 * "lzma alone" decoder from XZ Utils. */
 2179|       |
 2180|    979|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 2181|    979|	r = lzma_alone_decoder(&zip->zipx_lzma_stream,
 2182|    979|	    MAX_DECODER_SIZE);
  ------------------
  |  |   89|    979|#define MAX_DECODER_SIZE	(576 * 1024 * 1024)
  ------------------
 2183|    979|	if (r != LZMA_OK) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 979]
  ------------------
 2184|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2185|      0|		    "lzma initialization failed (%d)", r);
 2186|       |
 2187|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2188|      0|	}
 2189|       |
 2190|       |	/* Flag the cleanup function that we want our lzma-related structures
 2191|       |	 * to be freed later. */
 2192|    979|	zip->zipx_lzma_valid = 1;
 2193|       |
 2194|       |	/* The "lzma alone" file format and the stream format inside ZIPx are
 2195|       |	 * almost the same. Here's an example of a structure of "lzma alone"
 2196|       |	 * format:
 2197|       |	 *
 2198|       |	 * $ cat /bin/ls | lzma | xxd | head -n 1
 2199|       |	 * 00000000: 5d00 0080 00ff ffff ffff ffff ff00 2814
 2200|       |	 *
 2201|       |	 *    5 bytes        8 bytes        n bytes
 2202|       |	 * <lzma_params><uncompressed_size><data...>
 2203|       |	 *
 2204|       |	 * lzma_params is a 5-byte blob that has to be decoded to extract
 2205|       |	 * parameters of this LZMA stream. The uncompressed_size field is an
 2206|       |	 * uint64_t value that contains information about the size of the
 2207|       |	 * uncompressed file, or UINT64_MAX if this value is unknown.
 2208|       |	 * The <data...> part is the actual lzma-compressed data stream.
 2209|       |	 *
 2210|       |	 * Now here's the structure of the stream inside the ZIPX file:
 2211|       |	 *
 2212|       |	 * $ cat stream_inside_zipx | xxd | head -n 1
 2213|       |	 * 00000000: 0914 0500 5d00 8000 0000 2814 .... ....
 2214|       |	 *
 2215|       |	 *  2byte   2byte    5 bytes     n bytes
 2216|       |	 * <magic1><magic2><lzma_params><data...>
 2217|       |	 *
 2218|       |	 * This means that the ZIPX file contains an additional magic1 and
 2219|       |	 * magic2 headers, the lzma_params field contains the same parameter
 2220|       |	 * set as in the "lzma alone" format, and the <data...> field is the
 2221|       |	 * same as in the "lzma alone" format as well. Note that also the zipx
 2222|       |	 * format is missing the uncompressed_size field.
 2223|       |	 *
 2224|       |	 * So, in order to use the "lzma alone" decoder for the zipx lzma
 2225|       |	 * stream, we simply need to shuffle around some fields, prepare a new
 2226|       |	 * lzma alone header, feed it into lzma alone decoder so it will
 2227|       |	 * initialize itself properly, and then we can start feeding normal
 2228|       |	 * zipx lzma stream into the decoder.
 2229|       |	 */
 2230|       |
 2231|       |	/* Read magic1,magic2,lzma_params from the ZIPX stream. */
 2232|       |	/* When the compressed size is unknown (e.g. ZIP_LENGTH_AT_END read
 2233|       |	 * from a non-seekable source), entry_bytes_remaining is 0 or negative
 2234|       |	 * here.  We can still attempt to read the 9-byte header; if the data
 2235|       |	 * is truly truncated, the __archive_read_ahead calls below will catch
 2236|       |	 * it. */
 2237|    979|	if(zip->entry_bytes_remaining > 0
  ------------------
  |  Branch (2237:5): [True: 977, False: 2]
  ------------------
 2238|    977|		&& zip->entry_bytes_remaining < 9) {
  ------------------
  |  Branch (2238:6): [True: 2, False: 975]
  ------------------
 2239|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2240|      2|		    "Truncated lzma data");
 2241|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2242|      2|	}
 2243|       |
 2244|    977|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2244:6): [True: 0, False: 977]
  |  Branch (2244:25): [True: 1, False: 976]
  ------------------
 2245|      1|		const void *decrypted;
 2246|      1|		size_t out_len;
 2247|      1|		size_t consumed;
 2248|      1|		int ret;
 2249|       |
 2250|      1|		ret = zipx_read_header_and_decrypt(a, &decrypted, 9, &out_len, &consumed);
 2251|      1|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2251:7): [True: 1, False: 0]
  ------------------
 2252|      1|			return ret;
 2253|      0|		p = decrypted;
 2254|    976|	} else {
 2255|    976|		p = __archive_read_ahead(a, 9, NULL);
 2256|    976|		if (p == NULL) {
  ------------------
  |  Branch (2256:7): [True: 4, False: 972]
  ------------------
 2257|      4|			archive_set_error(&a->archive,
 2258|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2259|      4|			    "Truncated lzma data");
 2260|      4|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2261|      4|		}
 2262|    976|	}
 2263|       |
 2264|    972|	if(p[2] != 0x05 || p[3] != 0x00) {
  ------------------
  |  Branch (2264:5): [True: 24, False: 948]
  |  Branch (2264:21): [True: 1, False: 947]
  ------------------
 2265|     25|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     25|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2266|     25|		    "Invalid lzma data");
 2267|     25|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     25|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2268|     25|	}
 2269|       |
 2270|       |	/* Prepare an lzma alone header: copy the lzma_params blob into
 2271|       |	 * a proper place into the lzma alone header. */
 2272|    947|	memcpy(&alone_header.bytes[0], p + 4, 5);
 2273|       |
 2274|       |	/* Initialize the 'uncompressed size' field to unknown; we'll manually
 2275|       |	 * monitor how many bytes there are still to be uncompressed. */
 2276|    947|	alone_header.uncompressed_size = UINT64_MAX;
 2277|       |
 2278|    947|	if(!zip->uncompressed_buffer) {
  ------------------
  |  Branch (2278:5): [True: 170, False: 777]
  ------------------
 2279|    170|		zip->uncompressed_buffer_size = 256 * 1024;
 2280|    170|		zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2281|       |
 2282|    170|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2282:7): [True: 0, False: 170]
  ------------------
 2283|      0|			archive_set_error(&a->archive, ENOMEM,
 2284|      0|			    "No memory for lzma decompression");
 2285|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2286|      0|		}
 2287|    170|	}
 2288|       |
 2289|    947|	zip->zipx_lzma_stream.next_in = (void*) &alone_header;
 2290|    947|	zip->zipx_lzma_stream.avail_in = sizeof(alone_header);
 2291|    947|	zip->zipx_lzma_stream.total_in = 0;
 2292|    947|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2293|    947|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2294|    947|	zip->zipx_lzma_stream.total_out = 0;
 2295|       |
 2296|       |	/* Feed only the header into the lzma alone decoder. This will
 2297|       |	 * effectively initialize the decoder, and will not produce any
 2298|       |	 * output bytes yet. */
 2299|    947|	r = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2300|    947|	if (r != LZMA_OK) {
  ------------------
  |  Branch (2300:6): [True: 2, False: 945]
  ------------------
 2301|      2|		if (r == LZMA_MEMLIMIT_ERROR)
  ------------------
  |  Branch (2301:7): [True: 1, False: 1]
  ------------------
 2302|      1|			archive_set_error(&a->archive, ENOMEM,
 2303|      1|			    "lzma stream requires too much memory");
 2304|      1|		else
 2305|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2306|      1|			    "lzma stream initialization error");
 2307|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2308|      2|	}
 2309|       |
 2310|       |	/* We've already consumed some bytes, so take this into account. */
 2311|    945|	__archive_read_consume(a, 9);
 2312|    945|	zip->entry_compressed_bytes_read += 9;
 2313|    945|	if (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2313:6): [True: 943, False: 2]
  ------------------
 2314|    943|		zip->entry_bytes_remaining -= 9;
 2315|    943|	}
 2316|       |
 2317|    945|	zip->decompress_init = 1;
 2318|    945|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    945|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2319|    947|}
archive_read_support_format_zip.c:zipx_read_header_and_decrypt:
  453|    579|{
  454|    579|	struct zip *zip = a->format->data;
  455|    579|	const void *raw;
  456|    579|	ssize_t bytes_avail;
  457|    579|	size_t to_decrypt;
  458|       |
  459|    579|	raw = __archive_read_ahead(a, in_len, &bytes_avail);
  460|    579|	if (raw == NULL || bytes_avail < (ssize_t)in_len) {
  ------------------
  |  Branch (460:6): [True: 1, False: 578]
  |  Branch (460:21): [True: 0, False: 578]
  ------------------
  461|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  462|      1|		    "Truncated ZIP file data");
  463|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  464|      1|	}
  465|       |
  466|    578|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (466:6): [True: 108, False: 470]
  |  Branch (466:25): [True: 470, False: 0]
  ------------------
  467|    578|		to_decrypt = in_len;
  468|    578|		if (to_decrypt > zip->decrypted_buffer_size)
  ------------------
  |  Branch (468:7): [True: 0, False: 578]
  ------------------
  469|      0|			to_decrypt = zip->decrypted_buffer_size;
  470|       |
  471|    578|		if (zip->tctx_valid) {
  ------------------
  |  Branch (471:7): [True: 108, False: 470]
  ------------------
  472|    108|			trad_enc_decrypt_update(&zip->tctx,
  473|    108|			    raw, to_decrypt,
  474|    108|			    zip->decrypted_buffer, to_decrypt);
  475|    470|		} else {
  476|    470|			size_t dsize = to_decrypt;
  477|    470|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  154|    470|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  478|    470|			    raw, to_decrypt,
  479|    470|			    zip->decrypted_buffer, &dsize);
  480|    470|		}
  481|    578|		if (zip->hctx_valid)
  ------------------
  |  Branch (481:7): [True: 470, False: 108]
  ------------------
  482|    470|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |   91|    470|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  483|    578|			    raw, to_decrypt);
  484|       |
  485|    578|		*buf = zip->decrypted_buffer;
  486|    578|		*out_len = to_decrypt;
  487|    578|		*consumed = to_decrypt;
  488|    578|	} else {
  489|      0|		*buf = raw;
  490|      0|		*out_len = in_len;
  491|      0|		*consumed = in_len;
  492|      0|	}
  493|    578|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    578|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  494|    579|}
archive_read_support_format_zip.c:compression_name:
  653|  65.5k|{
  654|  65.5k|	static const int num_compression_methods =
  655|  65.5k|		sizeof(compression_methods)/sizeof(compression_methods[0]);
  656|  65.5k|	int i=0;
  657|       |
  658|  1.14M|	while(compression >= 0 && i < num_compression_methods) {
  ------------------
  |  Branch (658:8): [True: 1.14M, False: 0]
  |  Branch (658:28): [True: 1.13M, False: 5.36k]
  ------------------
  659|  1.13M|		if (compression_methods[i].id == compression)
  ------------------
  |  Branch (659:7): [True: 60.1k, False: 1.07M]
  ------------------
  660|  60.1k|			return compression_methods[i].name;
  661|  1.07M|		i++;
  662|  1.07M|	}
  663|  5.36k|	return "??";
  664|  65.5k|}
archive_read_support_format_zip.c:zip_entry_size_is_set:
  279|  92.4k|{
  280|  92.4k|	return (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  92.4k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (280:10): [True: 29.0k, False: 63.4k]
  ------------------
  281|  63.4k|	    || (zip_entry->uncompressed_size > 0
  ------------------
  |  Branch (281:10): [True: 41.2k, False: 22.2k]
  ------------------
  282|  41.2k|		&& zip_entry->uncompressed_size != 0xffffffff));
  ------------------
  |  Branch (282:6): [True: 40.6k, False: 573]
  ------------------
  283|  92.4k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data:
 3577|  73.6k|{
 3578|  73.6k|	struct zip *zip = a->format->data;
 3579|  73.6k|	int r;
 3580|       |
 3581|  73.6k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3581:6): [True: 0, False: 73.6k]
  ------------------
 3582|  73.6k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  416|  73.6k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3583|      0|		zip->has_encrypted_entries = 0;
 3584|      0|	}
 3585|       |
 3586|  73.6k|	*offset = zip->entry_uncompressed_bytes_read;
 3587|  73.6k|	*size = 0;
 3588|  73.6k|	*buff = NULL;
 3589|       |
 3590|       |	/* If we hit end-of-entry last time, return ARCHIVE_EOF. */
 3591|  73.6k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3591:6): [True: 16.3k, False: 57.2k]
  ------------------
 3592|  16.3k|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3593|       |
 3594|       |	/* Return EOF immediately if this is a non-regular file. */
 3595|  57.2k|	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  216|  57.2k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
              	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  215|  57.2k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (3595:6): [True: 1.08k, False: 56.1k]
  ------------------
 3596|  1.08k|		return (ARCHIVE_EOF);
  ------------------
  |  |  233|  1.08k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3597|       |
 3598|  56.1k|	__archive_read_consume(a, zip->unconsumed);
 3599|  56.1k|	zip->unconsumed = 0;
 3600|       |
 3601|  56.1k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3601:6): [True: 11.1k, False: 45.0k]
  ------------------
 3602|  11.1k|		zip->has_encrypted_entries = 1;
 3603|  11.1k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  139|  11.1k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3603:7): [True: 1.96k, False: 9.21k]
  ------------------
 3604|  1.96k|			r = read_decryption_header(a);
 3605|  9.21k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  160|  9.21k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3605:12): [True: 3.56k, False: 5.64k]
  ------------------
 3606|  3.56k|			r = init_WinZip_AES_decryption(a);
 3607|  5.64k|		else
 3608|  5.64k|			r = init_traditional_PKWARE_decryption(a);
 3609|  11.1k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  11.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3609:7): [True: 7.91k, False: 3.26k]
  ------------------
 3610|  7.91k|			return (r);
 3611|  3.26k|		zip->init_decryption = 0;
 3612|  3.26k|	}
 3613|       |
 3614|  48.2k|	switch(zip->entry->compression) {
 3615|  8.90k|	case 0:  /* No compression. */
  ------------------
  |  Branch (3615:2): [True: 8.90k, False: 39.3k]
  ------------------
 3616|  8.90k|		r =  zip_read_data_none(a, buff, size, offset);
 3617|  8.90k|		break;
 3618|      0|#ifdef HAVE_BZLIB_H
 3619|    391|	case 12: /* ZIPx bzip2 compression. */
  ------------------
  |  Branch (3619:2): [True: 391, False: 47.8k]
  ------------------
 3620|    391|		r = zip_read_data_zipx_bzip2(a, buff, size, offset);
 3621|    391|		break;
 3622|      0|#endif
 3623|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3624|  1.68k|	case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (3624:2): [True: 1.68k, False: 46.6k]
  ------------------
 3625|  1.68k|		r = zip_read_data_zipx_lzma_alone(a, buff, size, offset);
 3626|  1.68k|		break;
 3627|     65|	case 95: /* ZIPx XZ compression. */
  ------------------
  |  Branch (3627:2): [True: 65, False: 48.2k]
  ------------------
 3628|     65|		r = zip_read_data_zipx_xz(a, buff, size, offset);
 3629|     65|		break;
 3630|      0|#endif
 3631|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3632|       |	case 93: /* ZIPx Zstd compression. */
 3633|       |		r = zip_read_data_zipx_zstd(a, buff, size, offset);
 3634|       |		break;
 3635|       |#endif
 3636|       |	/* PPMd support is built-in, so we don't need any #if guards. */
 3637|  21.3k|	case 98: /* ZIPx PPMd compression. */
  ------------------
  |  Branch (3637:2): [True: 21.3k, False: 26.9k]
  ------------------
 3638|  21.3k|		r = zip_read_data_zipx_ppmd(a, buff, size, offset);
 3639|  21.3k|		break;
 3640|       |
 3641|      0|#ifdef HAVE_ZLIB_H
 3642|  4.72k|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3642:2): [True: 4.72k, False: 43.5k]
  ------------------
 3643|  4.72k|		r =  zip_read_data_deflate(a, buff, size, offset);
 3644|  4.72k|		break;
 3645|      0|#endif
 3646|  11.1k|	default: /* Unsupported compression. */
  ------------------
  |  Branch (3646:2): [True: 11.1k, False: 37.1k]
  ------------------
 3647|       |		/* Return a warning. */
 3648|  11.1k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  11.1k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3649|  11.1k|		    "Unsupported ZIP compression method (%d: %s)",
 3650|  11.1k|		    zip->entry->compression, compression_name(zip->entry->compression));
 3651|       |		/* We can't decompress this entry, but we will
 3652|       |		 * be able to skip() it and try the next entry. */
 3653|  11.1k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  11.1k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3654|  48.2k|	}
 3655|  37.1k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  37.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3655:6): [True: 8.23k, False: 28.9k]
  ------------------
 3656|  8.23k|		return (r);
 3657|       |
 3658|       |	/*
 3659|       |	 * FAIL if there are more uncompressed bytes than were
 3660|       |	 * initially advertised.  The end-of-entry check below also
 3661|       |	 * compares these values, but only once decoding reaches its
 3662|       |	 * own natural end. Fail the entry so a caller relying on
 3663|       |	 * archive_entry_size() as a hard boundary is never misled;
 3664|       |	 * later entries in the archive can still be read normally.
 3665|       |	 */
 3666|  28.9k|	if (*size > 0 && zip_entry_size_is_set(zip->entry) &&
  ------------------
  |  Branch (3666:6): [True: 20.3k, False: 8.60k]
  |  Branch (3666:19): [True: 14.4k, False: 5.85k]
  ------------------
 3667|  14.4k|	    zip->entry_uncompressed_bytes_read > zip->entry->uncompressed_size) {
  ------------------
  |  Branch (3667:6): [True: 319, False: 14.1k]
  ------------------
 3668|    319|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    319|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3669|    319|		    "ZIP uncompressed data is larger than the declared "
 3670|    319|		    "entry size (read at least %jd, expected %jd)",
 3671|    319|		    (intmax_t)zip->entry_uncompressed_bytes_read,
 3672|    319|		    (intmax_t)zip->entry->uncompressed_size);
 3673|    319|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|    319|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3674|    319|	}
 3675|       |
 3676|  28.5k|	if (*size > 0) {
  ------------------
  |  Branch (3676:6): [True: 19.9k, False: 8.60k]
  ------------------
 3677|  19.9k|		zip->computed_crc32 = zip->crc32func(zip->computed_crc32, *buff,
 3678|  19.9k|						     (unsigned)*size);
 3679|  19.9k|	}
 3680|       |	/* If we hit the end, swallow any end-of-data marker and
 3681|       |	 * verify the final check values. */
 3682|  28.5k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (3682:6): [True: 23.8k, False: 4.70k]
  ------------------
 3683|  23.8k|		int64_t local_uncompressed_size = -1;
 3684|       |
 3685|       |		/* The descriptor may replace a size already exposed to callers. */
 3686|  23.8k|		if ((zip->entry->zip_flags & ZIP_LENGTH_AT_END) &&
  ------------------
  |  |  138|  23.8k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3686:7): [True: 18.3k, False: 5.54k]
  ------------------
 3687|  18.3k|		    zip_entry_size_is_set(zip->entry))
  ------------------
  |  Branch (3687:7): [True: 12.0k, False: 6.25k]
  ------------------
 3688|  12.0k|			local_uncompressed_size = zip->entry->uncompressed_size;
 3689|  23.8k|		consume_end_of_file_marker(a, zip);
 3690|       |
 3691|  23.8k|		if (local_uncompressed_size >= 0 &&
  ------------------
  |  Branch (3691:7): [True: 12.0k, False: 11.7k]
  ------------------
 3692|  12.0k|		    local_uncompressed_size != zip->entry_uncompressed_bytes_read) {
  ------------------
  |  Branch (3692:7): [True: 12.0k, False: 82]
  ------------------
 3693|  12.0k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  12.0k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3694|  12.0k|			    "ZIP uncompressed data is wrong size "
 3695|  12.0k|			    "(read %jd, expected %jd from local header)",
 3696|  12.0k|			    (intmax_t)zip->entry_uncompressed_bytes_read,
 3697|  12.0k|			    (intmax_t)local_uncompressed_size);
 3698|  12.0k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  12.0k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3699|  12.0k|		}
 3700|       |
 3701|       |		/* Check computed CRC against header */
 3702|  11.8k|		if ((!zip->hctx_valid ||
  ------------------
  |  Branch (3702:8): [True: 11.8k, False: 25]
  ------------------
 3703|     25|		      zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
  ------------------
  |  |  123|     25|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (3703:9): [True: 6, False: 19]
  ------------------
 3704|  11.8k|		   zip->entry->crc32 != zip->computed_crc32
  ------------------
  |  Branch (3704:6): [True: 11.3k, False: 555]
  ------------------
 3705|  11.3k|		    && !zip->ignore_crc32) {
  ------------------
  |  Branch (3705:10): [True: 0, False: 11.3k]
  ------------------
 3706|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3707|      0|			    "ZIP bad CRC: 0x%x should be 0x%x",
 3708|      0|			    zip->computed_crc32,
 3709|      0|			    zip->entry->crc32);
 3710|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3711|      0|		}
 3712|       |		/* Check file size against header. */
 3713|  11.8k|		if (zip->entry->compressed_size !=
  ------------------
  |  Branch (3713:7): [True: 8.16k, False: 3.71k]
  ------------------
 3714|  11.8k|		    zip->entry_compressed_bytes_read) {
 3715|  8.16k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  8.16k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3716|  8.16k|			    "ZIP compressed data is wrong size "
 3717|  8.16k|			    "(read %jd, expected %jd)",
 3718|  8.16k|			    (intmax_t)zip->entry_compressed_bytes_read,
 3719|  8.16k|			    (intmax_t)zip->entry->compressed_size);
 3720|  8.16k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  8.16k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3721|  8.16k|		}
 3722|  3.71k|		if (zip->entry->uncompressed_size !=
  ------------------
  |  Branch (3722:7): [True: 738, False: 2.97k]
  ------------------
 3723|  3.71k|		    zip->entry_uncompressed_bytes_read) {
 3724|    738|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    738|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3725|    738|			    "ZIP uncompressed data is wrong size "
 3726|    738|			    "(read %jd, expected %jd)",
 3727|    738|			    (intmax_t)zip->entry_uncompressed_bytes_read,
 3728|    738|			    (intmax_t)zip->entry->uncompressed_size);
 3729|    738|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|    738|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3730|    738|		}
 3731|  3.71k|	}
 3732|       |
 3733|  7.68k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  7.68k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3734|  28.5k|}
archive_read_support_format_zip.c:read_decryption_header:
 3198|  1.96k|{
 3199|  1.96k|	struct zip *zip = a->format->data;
 3200|  1.96k|	const char *p;
 3201|  1.96k|	unsigned int remaining_size;
 3202|  1.96k|	unsigned int ts;
 3203|       |
 3204|       |	/*
 3205|       |	 * Read an initialization vector data field.
 3206|       |	 */
 3207|  1.96k|	p = __archive_read_ahead(a, 2, NULL);
 3208|  1.96k|	if (p == NULL)
  ------------------
  |  Branch (3208:6): [True: 5, False: 1.96k]
  ------------------
 3209|      5|		goto truncated;
 3210|  1.96k|	ts = zip->iv_size;
 3211|  1.96k|	zip->iv_size = archive_le16dec(p);
 3212|  1.96k|	__archive_read_consume(a, 2);
 3213|  1.96k|	if (ts < zip->iv_size) {
  ------------------
  |  Branch (3213:6): [True: 255, False: 1.70k]
  ------------------
 3214|    255|		free(zip->iv);
 3215|    255|		zip->iv = NULL;
 3216|    255|	}
 3217|  1.96k|	p = __archive_read_ahead(a, zip->iv_size, NULL);
 3218|  1.96k|	if (p == NULL)
  ------------------
  |  Branch (3218:6): [True: 13, False: 1.95k]
  ------------------
 3219|     13|		goto truncated;
 3220|  1.95k|	if (zip->iv == NULL) {
  ------------------
  |  Branch (3220:6): [True: 264, False: 1.68k]
  ------------------
 3221|    264|		zip->iv = malloc(zip->iv_size);
 3222|    264|		if (zip->iv == NULL)
  ------------------
  |  Branch (3222:7): [True: 0, False: 264]
  ------------------
 3223|      0|			goto nomem;
 3224|    264|	}
 3225|  1.95k|	memcpy(zip->iv, p, zip->iv_size);
 3226|  1.95k|	__archive_read_consume(a, zip->iv_size);
 3227|       |
 3228|       |	/*
 3229|       |	 * Read a size of remaining decryption header field.
 3230|       |	 */
 3231|  1.95k|	p = __archive_read_ahead(a, 14, NULL);
 3232|  1.95k|	if (p == NULL)
  ------------------
  |  Branch (3232:6): [True: 2, False: 1.94k]
  ------------------
 3233|      2|		goto truncated;
 3234|  1.94k|	remaining_size = archive_le32dec(p);
 3235|  1.94k|	if (remaining_size < 16 || remaining_size > (1 << 18))
  ------------------
  |  Branch (3235:6): [True: 0, False: 1.94k]
  |  Branch (3235:29): [True: 29, False: 1.91k]
  ------------------
 3236|     29|		goto corrupted;
 3237|       |
 3238|       |	/* Check if format version is supported. */
 3239|  1.91k|	if (archive_le16dec(p+4) != 3) {
  ------------------
  |  Branch (3239:6): [True: 257, False: 1.66k]
  ------------------
 3240|    257|		archive_set_error(&a->archive,
 3241|    257|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    257|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3242|    257|		    "Unsupported encryption format version: %u",
 3243|    257|		    archive_le16dec(p+4));
 3244|    257|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|    257|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3245|    257|	}
 3246|       |
 3247|       |	/*
 3248|       |	 * Read an encryption algorithm field.
 3249|       |	 */
 3250|  1.66k|	zip->alg_id = archive_le16dec(p+6);
 3251|  1.66k|	switch (zip->alg_id) {
 3252|    250|	case 0x6601:/* DES */
  ------------------
  |  Branch (3252:2): [True: 250, False: 1.41k]
  ------------------
 3253|    446|	case 0x6602:/* RC2 */
  ------------------
  |  Branch (3253:2): [True: 196, False: 1.46k]
  ------------------
 3254|    653|	case 0x6603:/* 3DES 168 */
  ------------------
  |  Branch (3254:2): [True: 207, False: 1.45k]
  ------------------
 3255|    747|	case 0x6609:/* 3DES 112 */
  ------------------
  |  Branch (3255:2): [True: 94, False: 1.56k]
  ------------------
 3256|    833|	case 0x660E:/* AES 128 */
  ------------------
  |  Branch (3256:2): [True: 86, False: 1.57k]
  ------------------
 3257|  1.10k|	case 0x660F:/* AES 192 */
  ------------------
  |  Branch (3257:2): [True: 270, False: 1.39k]
  ------------------
 3258|  1.12k|	case 0x6610:/* AES 256 */
  ------------------
  |  Branch (3258:2): [True: 18, False: 1.64k]
  ------------------
 3259|  1.39k|	case 0x6702:/* RC2 (version >= 5.2) */
  ------------------
  |  Branch (3259:2): [True: 273, False: 1.38k]
  ------------------
 3260|  1.41k|	case 0x6720:/* Blowfish */
  ------------------
  |  Branch (3260:2): [True: 23, False: 1.63k]
  ------------------
 3261|  1.49k|	case 0x6721:/* Twofish */
  ------------------
  |  Branch (3261:2): [True: 80, False: 1.58k]
  ------------------
 3262|  1.56k|	case 0x6801:/* RC4 */
  ------------------
  |  Branch (3262:2): [True: 67, False: 1.59k]
  ------------------
 3263|       |		/* Supported encryption algorithm. */
 3264|  1.56k|		break;
 3265|     98|	default:
  ------------------
  |  Branch (3265:2): [True: 98, False: 1.56k]
  ------------------
 3266|     98|		archive_set_error(&a->archive,
 3267|     98|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     98|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3268|     98|		    "Unknown encryption algorithm: %u", zip->alg_id);
 3269|     98|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|     98|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3270|  1.66k|	}
 3271|       |
 3272|       |	/*
 3273|       |	 * Read a bit length field.
 3274|       |	 */
 3275|  1.56k|	zip->bit_len = archive_le16dec(p+8);
 3276|       |
 3277|       |	/*
 3278|       |	 * Read a flags field.
 3279|       |	 */
 3280|  1.56k|	zip->flags = archive_le16dec(p+10);
 3281|  1.56k|	switch (zip->flags & 0xf000) {
 3282|      0|	case 0x0001: /* Password is required to decrypt. */
  ------------------
  |  Branch (3282:2): [True: 0, False: 1.56k]
  ------------------
 3283|      0|	case 0x0002: /* Certificates only. */
  ------------------
  |  Branch (3283:2): [True: 0, False: 1.56k]
  ------------------
 3284|      0|	case 0x0003: /* Password or certificate required to decrypt. */
  ------------------
  |  Branch (3284:2): [True: 0, False: 1.56k]
  ------------------
 3285|      0|		break;
 3286|  1.56k|	default:
  ------------------
  |  Branch (3286:2): [True: 1.56k, False: 0]
  ------------------
 3287|  1.56k|		archive_set_error(&a->archive,
 3288|  1.56k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.56k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3289|  1.56k|		    "Unknown encryption flag: %u", zip->flags);
 3290|  1.56k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  1.56k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3291|  1.56k|	}
 3292|      0|	if ((zip->flags & 0xf000) == 0 ||
  ------------------
  |  Branch (3292:6): [True: 0, False: 0]
  ------------------
 3293|      0|	    (zip->flags & 0xf000) == 0x4000) {
  ------------------
  |  Branch (3293:6): [True: 0, False: 0]
  ------------------
 3294|      0|		archive_set_error(&a->archive,
 3295|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3296|      0|		    "Unknown encryption flag: %u", zip->flags);
 3297|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3298|      0|	}
 3299|       |
 3300|       |	/*
 3301|       |	 * Read an encrypted random data field.
 3302|       |	 */
 3303|      0|	ts = zip->erd_size;
 3304|      0|	zip->erd_size = archive_le16dec(p+12);
 3305|      0|	__archive_read_consume(a, 14);
 3306|      0|	if ((zip->erd_size & 0xf) != 0 ||
  ------------------
  |  Branch (3306:6): [True: 0, False: 0]
  ------------------
 3307|      0|	    (zip->erd_size + 16) > remaining_size ||
  ------------------
  |  Branch (3307:6): [True: 0, False: 0]
  ------------------
 3308|      0|	    (zip->erd_size + 16) < zip->erd_size)
  ------------------
  |  Branch (3308:6): [True: 0, False: 0]
  ------------------
 3309|      0|		goto corrupted;
 3310|       |
 3311|      0|	if (ts < zip->erd_size) {
  ------------------
  |  Branch (3311:6): [True: 0, False: 0]
  ------------------
 3312|      0|		free(zip->erd);
 3313|      0|		zip->erd = NULL;
 3314|      0|	}
 3315|      0|	p = __archive_read_ahead(a, zip->erd_size, NULL);
 3316|      0|	if (p == NULL)
  ------------------
  |  Branch (3316:6): [True: 0, False: 0]
  ------------------
 3317|      0|		goto truncated;
 3318|      0|	if (zip->erd == NULL) {
  ------------------
  |  Branch (3318:6): [True: 0, False: 0]
  ------------------
 3319|      0|		zip->erd = malloc(zip->erd_size);
 3320|      0|		if (zip->erd == NULL)
  ------------------
  |  Branch (3320:7): [True: 0, False: 0]
  ------------------
 3321|      0|			goto nomem;
 3322|      0|	}
 3323|      0|	memcpy(zip->erd, p, zip->erd_size);
 3324|      0|	__archive_read_consume(a, zip->erd_size);
 3325|       |
 3326|       |	/*
 3327|       |	 * Read a reserved data field.
 3328|       |	 */
 3329|      0|	p = __archive_read_ahead(a, 4, NULL);
 3330|      0|	if (p == NULL)
  ------------------
  |  Branch (3330:6): [True: 0, False: 0]
  ------------------
 3331|      0|		goto truncated;
 3332|       |	/* Reserved data size should be zero. */
 3333|      0|	if (archive_le32dec(p) != 0)
  ------------------
  |  Branch (3333:6): [True: 0, False: 0]
  ------------------
 3334|      0|		goto corrupted;
 3335|      0|	__archive_read_consume(a, 4);
 3336|       |
 3337|       |	/*
 3338|       |	 * Read a password validation data field.
 3339|       |	 */
 3340|      0|	p = __archive_read_ahead(a, 2, NULL);
 3341|      0|	if (p == NULL)
  ------------------
  |  Branch (3341:6): [True: 0, False: 0]
  ------------------
 3342|      0|		goto truncated;
 3343|      0|	ts = zip->v_size;
 3344|      0|	zip->v_size = archive_le16dec(p);
 3345|      0|	__archive_read_consume(a, 2);
 3346|      0|	if ((zip->v_size & 0x0f) != 0 ||
  ------------------
  |  Branch (3346:6): [True: 0, False: 0]
  ------------------
 3347|      0|	    (zip->erd_size + zip->v_size + 16) > remaining_size ||
  ------------------
  |  Branch (3347:6): [True: 0, False: 0]
  ------------------
 3348|      0|	    (zip->erd_size + zip->v_size + 16) < (zip->erd_size + zip->v_size))
  ------------------
  |  Branch (3348:6): [True: 0, False: 0]
  ------------------
 3349|      0|		goto corrupted;
 3350|      0|	if (ts < zip->v_size) {
  ------------------
  |  Branch (3350:6): [True: 0, False: 0]
  ------------------
 3351|      0|		free(zip->v_data);
 3352|      0|		zip->v_data = NULL;
 3353|      0|	}
 3354|      0|	p = __archive_read_ahead(a, zip->v_size, NULL);
 3355|      0|	if (p == NULL)
  ------------------
  |  Branch (3355:6): [True: 0, False: 0]
  ------------------
 3356|      0|		goto truncated;
 3357|      0|	if (zip->v_data == NULL) {
  ------------------
  |  Branch (3357:6): [True: 0, False: 0]
  ------------------
 3358|      0|		zip->v_data = malloc(zip->v_size);
 3359|      0|		if (zip->v_data == NULL)
  ------------------
  |  Branch (3359:7): [True: 0, False: 0]
  ------------------
 3360|      0|			goto nomem;
 3361|      0|	}
 3362|      0|	memcpy(zip->v_data, p, zip->v_size);
 3363|      0|	__archive_read_consume(a, zip->v_size);
 3364|       |
 3365|      0|	p = __archive_read_ahead(a, 4, NULL);
 3366|      0|	if (p == NULL)
  ------------------
  |  Branch (3366:6): [True: 0, False: 0]
  ------------------
 3367|      0|		goto truncated;
 3368|      0|	zip->v_crc32 = archive_le32dec(p);
 3369|      0|	__archive_read_consume(a, 4);
 3370|       |
 3371|       |	/*return (ARCHIVE_OK);
 3372|       |	 * This is not fully implemented yet.*/
 3373|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3374|      0|	    "Encrypted file is unsupported");
 3375|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3376|     20|truncated:
 3377|     20|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     20|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3378|     20|	    "Truncated ZIP file data");
 3379|     20|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     20|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3380|     29|corrupted:
 3381|     29|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     29|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3382|     29|	    "Corrupted ZIP file data");
 3383|     29|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3384|      0|nomem:
 3385|      0|	archive_set_error(&a->archive, ENOMEM,
 3386|      0|	    "No memory for ZIP decryption");
 3387|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3388|      0|}
archive_read_support_format_zip.c:init_WinZip_AES_decryption:
 3483|  3.56k|{
 3484|  3.56k|	struct zip *zip = a->format->data;
 3485|  3.56k|	const void *p;
 3486|  3.56k|	const uint8_t *pv;
 3487|  3.56k|	size_t key_len, salt_len;
 3488|  3.56k|	uint8_t derived_key[MAX_DERIVED_KEY_BUF_SIZE];
 3489|  3.56k|	int retry;
 3490|  3.56k|	int r;
 3491|       |
 3492|  3.56k|	if (zip->cctx_valid || zip->hctx_valid)
  ------------------
  |  Branch (3492:6): [True: 0, False: 3.56k]
  |  Branch (3492:25): [True: 0, False: 3.56k]
  ------------------
 3493|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3494|       |
 3495|  3.56k|	switch (zip->entry->aes_extra.strength) {
 3496|     98|	case 1: salt_len = 8;  key_len = 16; break;
  ------------------
  |  Branch (3496:2): [True: 98, False: 3.46k]
  ------------------
 3497|  3.29k|	case 2: salt_len = 12; key_len = 24; break;
  ------------------
  |  Branch (3497:2): [True: 3.29k, False: 273]
  ------------------
 3498|    158|	case 3: salt_len = 16; key_len = 32; break;
  ------------------
  |  Branch (3498:2): [True: 158, False: 3.40k]
  ------------------
 3499|     17|	default: goto corrupted;
  ------------------
  |  Branch (3499:2): [True: 17, False: 3.54k]
  ------------------
 3500|  3.56k|	}
 3501|  3.54k|	p = __archive_read_ahead(a, salt_len + 2, NULL);
 3502|  3.54k|	if (p == NULL)
  ------------------
  |  Branch (3502:6): [True: 2, False: 3.54k]
  ------------------
 3503|      2|		goto truncated;
 3504|       |
 3505|  4.03k|	for (retry = 0;; retry++) {
 3506|  4.03k|		const char *passphrase;
 3507|       |
 3508|  4.03k|		passphrase = __archive_read_next_passphrase(a);
 3509|  4.03k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3509:7): [True: 822, False: 3.21k]
  ------------------
 3510|    822|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    822|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3511|    822|			    (retry > 0)?
  ------------------
  |  Branch (3511:8): [True: 492, False: 330]
  ------------------
 3512|    492|				"Incorrect passphrase":
 3513|    822|				"Passphrase required for this entry");
 3514|    822|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|    822|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3515|    822|		}
 3516|  3.21k|		memset(derived_key, 0, sizeof(derived_key));
 3517|  3.21k|		r = archive_pbkdf2_sha1(passphrase, strlen(passphrase),
  ------------------
  |  |  149|  3.21k|  __archive_cryptor.pbkdf2sha1(pw, pw_len, salt, salt_len, rounds, dk, dk_len)
  ------------------
 3518|  3.21k|		    p, salt_len, 1000, derived_key, key_len * 2 + 2);
 3519|  3.21k|		if (r != 0) {
  ------------------
  |  Branch (3519:7): [True: 0, False: 3.21k]
  ------------------
 3520|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3521|      0|			    r == CRYPTOR_STUB_FUNCTION ? "Decryption is unsupported due "
  ------------------
  |  |  166|      0|#define CRYPTOR_STUB_FUNCTION	-2
  ------------------
  |  Branch (3521:8): [True: 0, False: 0]
  ------------------
 3522|      0|				"to lack of crypto library" : "Failed to process passphrase");
 3523|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3524|      0|		}
 3525|       |
 3526|       |		/* Check password verification value. */
 3527|  3.21k|		pv = ((const uint8_t *)p) + salt_len;
 3528|  3.21k|		if (derived_key[key_len * 2] == pv[0] &&
  ------------------
  |  Branch (3528:7): [True: 2.82k, False: 390]
  ------------------
 3529|  2.82k|		    derived_key[key_len * 2 + 1] == pv[1])
  ------------------
  |  Branch (3529:7): [True: 2.72k, False: 102]
  ------------------
 3530|  2.72k|			break;/* The passphrase is OK. */
 3531|    492|		if (retry > 10000) {
  ------------------
  |  Branch (3531:7): [True: 0, False: 492]
  ------------------
 3532|       |			/* Avoid infinity loop. */
 3533|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3534|      0|			    "Too many incorrect passphrases");
 3535|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3536|      0|		}
 3537|    492|	}
 3538|       |
 3539|  2.72k|	r = archive_decrypto_aes_ctr_init(&zip->cctx, derived_key, key_len);
  ------------------
  |  |  152|  2.72k|  __archive_cryptor.decrypto_aes_ctr_init(ctx, key, key_len)
  ------------------
 3540|  2.72k|	if (r != 0) {
  ------------------
  |  Branch (3540:6): [True: 0, False: 2.72k]
  ------------------
 3541|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3542|      0|		    "Decryption is unsupported due to lack of crypto library");
 3543|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3544|      0|	}
 3545|  2.72k|	r = archive_hmac_sha1_init(&zip->hctx, derived_key + key_len, key_len);
  ------------------
  |  |   89|  2.72k|	__archive_hmac.__hmac_sha1_init(ctx, key, key_len)
  ------------------
 3546|  2.72k|	if (r != 0) {
  ------------------
  |  Branch (3546:6): [True: 0, False: 2.72k]
  ------------------
 3547|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3548|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3549|      0|		    "Failed to initialize HMAC-SHA1");
 3550|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3551|      0|	}
 3552|  2.72k|	zip->cctx_valid = zip->hctx_valid = 1;
 3553|  2.72k|	__archive_read_consume(a, salt_len + 2);
 3554|  2.72k|	zip->entry_bytes_remaining -= salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  162|  2.72k|#define AUTH_CODE_SIZE	10
  ------------------
 3555|  2.72k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  2.72k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3555:6): [True: 446, False: 2.27k]
  ------------------
 3556|    446|	    && zip->entry_bytes_remaining < 0)
  ------------------
  |  Branch (3556:9): [True: 2, False: 444]
  ------------------
 3557|      2|		goto corrupted;
 3558|  2.72k|	zip->entry_compressed_bytes_read += salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  162|  2.72k|#define AUTH_CODE_SIZE	10
  ------------------
 3559|  2.72k|	zip->decrypted_bytes_remaining = 0;
 3560|       |
 3561|  2.72k|	zip->entry->compression = zip->entry->aes_extra.compression;
 3562|  2.72k|	return (zip_alloc_decryption_buffer(a));
 3563|       |
 3564|      2|truncated:
 3565|      2|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3566|      2|	    "Truncated ZIP file data");
 3567|      2|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3568|     19|corrupted:
 3569|     19|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     19|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3570|     19|	    "Corrupted ZIP file data");
 3571|     19|	return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3572|  2.72k|}
archive_read_support_format_zip.c:zip_alloc_decryption_buffer:
 3392|  3.26k|{
 3393|  3.26k|	struct zip *zip = a->format->data;
 3394|  3.26k|	size_t bs = 256 * 1024;
 3395|       |
 3396|  3.26k|	if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3396:6): [True: 303, False: 2.96k]
  ------------------
 3397|    303|		zip->decrypted_buffer_size = bs;
 3398|    303|		zip->decrypted_buffer = malloc(bs);
 3399|    303|		if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3399:7): [True: 0, False: 303]
  ------------------
 3400|      0|			archive_set_error(&a->archive, ENOMEM,
 3401|      0|			    "No memory for ZIP decryption");
 3402|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3403|      0|		}
 3404|    303|	}
 3405|  3.26k|	zip->decrypted_ptr = zip->decrypted_buffer;
 3406|  3.26k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  3.26k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3407|  3.26k|}
archive_read_support_format_zip.c:init_traditional_PKWARE_decryption:
 3411|  5.64k|{
 3412|  5.64k|	struct zip *zip = a->format->data;
 3413|  5.64k|	const void *p;
 3414|  5.64k|	int retry;
 3415|  5.64k|	int r;
 3416|       |
 3417|  5.64k|	if (zip->tctx_valid)
  ------------------
  |  Branch (3417:6): [True: 0, False: 5.64k]
  ------------------
 3418|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3419|       |
 3420|       |	/*
 3421|       |	   Read the 12 bytes encryption header stored at
 3422|       |	   the start of the data area.
 3423|       |	 */
 3424|  5.64k|#define ENC_HEADER_SIZE	12
 3425|  5.64k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  5.64k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3425:6): [True: 313, False: 5.33k]
  ------------------
 3426|    313|	    && zip->entry_bytes_remaining < ENC_HEADER_SIZE) {
  ------------------
  |  | 3424|    313|#define ENC_HEADER_SIZE	12
  ------------------
  |  Branch (3426:9): [True: 1, False: 312]
  ------------------
 3427|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3428|      1|		    "Truncated Zip encrypted body: only %jd bytes available",
 3429|      1|		    (intmax_t)zip->entry_bytes_remaining);
 3430|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3431|      1|	}
 3432|       |
 3433|  5.64k|	p = __archive_read_ahead(a, ENC_HEADER_SIZE, NULL);
  ------------------
  |  | 3424|  5.64k|#define ENC_HEADER_SIZE	12
  ------------------
 3434|  5.64k|	if (p == NULL) {
  ------------------
  |  Branch (3434:6): [True: 11, False: 5.63k]
  ------------------
 3435|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     11|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3436|     11|		    "Truncated ZIP file data");
 3437|     11|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3438|     11|	}
 3439|       |
 3440|  8.30k|	for (retry = 0;; retry++) {
 3441|  8.30k|		const char *passphrase;
 3442|  8.30k|		uint8_t crcchk;
 3443|       |
 3444|  8.30k|		passphrase = __archive_read_next_passphrase(a);
 3445|  8.30k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3445:7): [True: 5.08k, False: 3.21k]
  ------------------
 3446|  5.08k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  5.08k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3447|  5.08k|			    (retry > 0)?
  ------------------
  |  Branch (3447:8): [True: 2.67k, False: 2.41k]
  ------------------
 3448|  2.67k|				"Incorrect passphrase":
 3449|  5.08k|				"Passphrase required for this entry");
 3450|  5.08k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  5.08k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3451|  5.08k|		}
 3452|       |
 3453|       |		/*
 3454|       |		 * Initialize ctx for Traditional PKWARE Decryption.
 3455|       |		 */
 3456|  3.21k|		r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase),
 3457|  3.21k|			p, ENC_HEADER_SIZE, &crcchk);
  ------------------
  |  | 3424|  3.21k|#define ENC_HEADER_SIZE	12
  ------------------
 3458|  3.21k|		if (r == 0 && crcchk == zip->entry->decdat)
  ------------------
  |  Branch (3458:7): [True: 3.21k, False: 0]
  |  Branch (3458:17): [True: 546, False: 2.67k]
  ------------------
 3459|    546|			break;/* The passphrase is OK. */
 3460|  2.67k|		if (retry > 10000) {
  ------------------
  |  Branch (3460:7): [True: 0, False: 2.67k]
  ------------------
 3461|       |			/* Avoid infinity loop. */
 3462|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3463|      0|			    "Too many incorrect passphrases");
 3464|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3465|      0|		}
 3466|  2.67k|	}
 3467|       |
 3468|    546|	__archive_read_consume(a, ENC_HEADER_SIZE);
  ------------------
  |  | 3424|    546|#define ENC_HEADER_SIZE	12
  ------------------
 3469|    546|	zip->tctx_valid = 1;
 3470|    546|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)) {
  ------------------
  |  |  138|    546|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3470:6): [True: 211, False: 335]
  ------------------
 3471|    211|	    zip->entry_bytes_remaining -= ENC_HEADER_SIZE;
  ------------------
  |  | 3424|    211|#define ENC_HEADER_SIZE	12
  ------------------
 3472|    211|	}
 3473|       |	/*zip->entry_uncompressed_bytes_read += ENC_HEADER_SIZE;*/
 3474|    546|	zip->entry_compressed_bytes_read += ENC_HEADER_SIZE;
  ------------------
  |  | 3424|    546|#define ENC_HEADER_SIZE	12
  ------------------
 3475|    546|	zip->decrypted_bytes_remaining = 0;
 3476|       |
 3477|    546|	return (zip_alloc_decryption_buffer(a));
 3478|  5.63k|#undef ENC_HEADER_SIZE
 3479|  5.63k|}
archive_read_support_format_zip.c:trad_enc_init:
  388|  3.21k|{
  389|  3.21k|	uint8_t header[12];
  390|       |
  391|  3.21k|	if (key_len < 12) {
  ------------------
  |  Branch (391:6): [True: 0, False: 3.21k]
  ------------------
  392|      0|		*crcchk = 0xff;
  393|      0|		return -1;
  394|      0|	}
  395|       |
  396|  3.21k|	ctx->keys[0] = 305419896L;
  397|  3.21k|	ctx->keys[1] = 591751049L;
  398|  3.21k|	ctx->keys[2] = 878082192L;
  399|       |
  400|  22.5k|	for (;pw_len; --pw_len)
  ------------------
  |  Branch (400:8): [True: 19.3k, False: 3.21k]
  ------------------
  401|  19.3k|		trad_enc_update_keys(ctx, *pw++);
  402|       |
  403|  3.21k|	trad_enc_decrypt_update(ctx, key, 12, header, 12);
  404|       |	/* Return the last byte for CRC check. */
  405|  3.21k|	*crcchk = header[11];
  406|  3.21k|	return 0;
  407|  3.21k|}
archive_read_support_format_zip.c:zip_read_data_none:
 2005|  8.90k|{
 2006|  8.90k|	struct zip *zip = a->format->data;
 2007|  8.90k|	const char *buff;
 2008|  8.90k|	ssize_t bytes_avail;
 2009|  8.90k|	ssize_t trailing_extra;
 2010|  8.90k|	int r;
 2011|       |
 2012|  8.90k|	(void)offset; /* UNUSED */
 2013|       |
 2014|  8.90k|	trailing_extra = zip->hctx_valid ? AUTH_CODE_SIZE : 0;
  ------------------
  |  |  162|    949|#define AUTH_CODE_SIZE	10
  ------------------
  |  Branch (2014:19): [True: 949, False: 7.95k]
  ------------------
 2015|       |
 2016|  8.90k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END) {
  ------------------
  |  |  138|  8.90k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2016:6): [True: 5.96k, False: 2.93k]
  ------------------
 2017|  5.96k|		const char *p;
 2018|  5.96k|		ssize_t grabbing_bytes = 24 + trailing_extra;
 2019|       |
 2020|       |		/* Grab at least 24 bytes. */
 2021|  5.96k|		buff = __archive_read_ahead(a, grabbing_bytes, &bytes_avail);
 2022|  5.96k|		if (bytes_avail < grabbing_bytes) {
  ------------------
  |  Branch (2022:7): [True: 122, False: 5.84k]
  ------------------
 2023|       |			/* Zip archives have end-of-archive markers
 2024|       |			   that are longer than this, so a failure to get at
 2025|       |			   least 24 bytes really does indicate a truncated
 2026|       |			   file. */
 2027|    122|			archive_set_error(&a->archive,
 2028|    122|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    122|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2029|    122|			    "Truncated ZIP file data");
 2030|    122|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    122|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2031|    122|		}
 2032|       |		/* Check for a complete PK\007\010 signature, followed
 2033|       |		 * by the correct 4-byte CRC. */
 2034|  5.84k|		p = buff + trailing_extra;
 2035|  5.84k|		if (p[0] == 'P' && p[1] == 'K'
  ------------------
  |  Branch (2035:7): [True: 4.68k, False: 1.16k]
  |  Branch (2035:22): [True: 4.58k, False: 98]
  ------------------
 2036|  4.58k|		    && p[2] == '\007' && p[3] == '\010'
  ------------------
  |  Branch (2036:10): [True: 4.37k, False: 204]
  |  Branch (2036:28): [True: 3.94k, False: 435]
  ------------------
 2037|  3.94k|		    && (archive_le32dec(p + 4) == zip->computed_crc32
  ------------------
  |  Branch (2037:11): [True: 789, False: 3.15k]
  ------------------
 2038|  3.15k|			|| zip->ignore_crc32
  ------------------
  |  Branch (2038:7): [True: 3.15k, False: 0]
  ------------------
 2039|      0|			|| (zip->hctx_valid
  ------------------
  |  Branch (2039:8): [True: 0, False: 0]
  ------------------
 2040|  3.94k|			 && zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) {
  ------------------
  |  |  123|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (2040:8): [True: 0, False: 0]
  ------------------
 2041|  3.94k|			zip->end_of_entry = 1;
 2042|  3.94k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (2042:8): [True: 201, False: 3.74k]
  ------------------
 2043|    201|				r = check_authentication_code(a, buff);
 2044|    201|				if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    201|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2044:9): [True: 94, False: 107]
  ------------------
 2045|     94|					return (r);
 2046|    201|			}
 2047|  3.84k|			return (ARCHIVE_OK);
  ------------------
  |  |  234|  3.84k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2048|  3.94k|		}
 2049|       |		/* If not at EOF, ensure we consume at least one byte. */
 2050|  1.89k|		++p;
 2051|       |
 2052|       |		/* Scan forward until we see where a PK\007\010 signature
 2053|       |		 * might be. */
 2054|       |		/* Return bytes up until that point.  On the next call,
 2055|       |		 * the code above will verify the data descriptor. */
 2056|  2.69M|		while (p < buff + bytes_avail - 4) {
  ------------------
  |  Branch (2056:10): [True: 2.69M, False: 176]
  ------------------
 2057|  2.69M|			if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (2057:8): [True: 4.14k, False: 2.69M]
  ------------------
 2058|  2.69M|			else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (2058:13): [True: 2.34k, False: 2.69M]
  ------------------
 2059|  2.69M|			else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (2059:13): [True: 3.47k, False: 2.68M]
  ------------------
 2060|  2.68M|			else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (2060:13): [True: 5.99k, False: 2.68M]
  |  Branch (2060:31): [True: 2.32k, False: 3.67k]
  ------------------
 2061|  2.32k|			    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (2061:11): [True: 2.05k, False: 272]
  |  Branch (2061:26): [True: 1.72k, False: 333]
  ------------------
 2062|  1.72k|				break;
 2063|  2.68M|			} else { p += 4; }
 2064|  2.69M|		}
 2065|  1.89k|		p -= trailing_extra;
 2066|  1.89k|		bytes_avail = p - buff;
 2067|  2.93k|	} else {
 2068|  2.93k|		if (zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2068:7): [True: 1.35k, False: 1.58k]
  ------------------
 2069|  1.35k|			zip->end_of_entry = 1;
 2070|  1.35k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (2070:8): [True: 257, False: 1.09k]
  ------------------
 2071|    257|				r = check_authentication_code(a, NULL);
 2072|    257|				if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    257|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2072:9): [True: 239, False: 18]
  ------------------
 2073|    239|					return (r);
 2074|    257|			}
 2075|  1.11k|			return (ARCHIVE_OK);
  ------------------
  |  |  234|  1.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2076|  1.35k|		}
 2077|       |		/* Grab a bunch of bytes. */
 2078|  1.58k|		buff = __archive_read_ahead(a, 1, &bytes_avail);
 2079|  1.58k|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (2079:7): [True: 30, False: 1.55k]
  ------------------
 2080|     30|			archive_set_error(&a->archive,
 2081|     30|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     30|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2082|     30|			    "Truncated ZIP file data");
 2083|     30|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2084|     30|		}
 2085|  1.55k|		if (bytes_avail > zip->entry_bytes_remaining)
  ------------------
  |  Branch (2085:7): [True: 1.44k, False: 108]
  ------------------
 2086|  1.44k|			bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2087|  1.55k|	}
 2088|  3.45k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2088:6): [True: 268, False: 3.18k]
  |  Branch (2088:25): [True: 480, False: 2.70k]
  ------------------
 2089|    748|		size_t dec_size = bytes_avail;
 2090|       |
 2091|    748|		if (dec_size > zip->decrypted_buffer_size)
  ------------------
  |  Branch (2091:7): [True: 13, False: 735]
  ------------------
 2092|     13|			dec_size = zip->decrypted_buffer_size;
 2093|    748|		if (zip->tctx_valid) {
  ------------------
  |  Branch (2093:7): [True: 268, False: 480]
  ------------------
 2094|    268|			trad_enc_decrypt_update(&zip->tctx,
 2095|    268|			    (const uint8_t *)buff, dec_size,
 2096|    268|			    zip->decrypted_buffer, dec_size);
 2097|    480|		} else {
 2098|    480|			size_t dsize = dec_size;
 2099|    480|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |   91|    480|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 2100|    480|			    (const uint8_t *)buff, dec_size);
 2101|    480|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  154|    480|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 2102|    480|			    (const uint8_t *)buff, dec_size,
 2103|    480|			    zip->decrypted_buffer, &dsize);
 2104|    480|		}
 2105|    748|		bytes_avail = dec_size;
 2106|    748|		buff = (const char *)zip->decrypted_buffer;
 2107|    748|	}
 2108|  3.45k|	zip->entry_bytes_remaining -= bytes_avail;
 2109|  3.45k|	zip->entry_uncompressed_bytes_read += bytes_avail;
 2110|  3.45k|	zip->entry_compressed_bytes_read += bytes_avail;
 2111|  3.45k|	zip->unconsumed += bytes_avail;
 2112|  3.45k|	*size = bytes_avail;
 2113|  3.45k|	*_buff = buff;
 2114|  3.45k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  3.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2115|  8.90k|}
archive_read_support_format_zip.c:zip_read_data_zipx_bzip2:
 2814|    391|{
 2815|    391|	struct zip *zip = a->format->data;
 2816|    391|	ssize_t bytes_avail = 0, max_in, to_consume;
 2817|    391|	const void *compressed_buff;
 2818|    391|	const void *sp;
 2819|    391|	int r;
 2820|    391|	uint64_t total_out;
 2821|       |
 2822|    391|	(void) offset; /* UNUSED */
 2823|       |
 2824|       |	/* Initialize decompression context if we're here for the first time. */
 2825|    391|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2825:5): [True: 121, False: 270]
  ------------------
 2826|    121|		r = zipx_bzip2_init(a, zip);
 2827|    121|		if(r != ARCHIVE_OK)
  ------------------
  |  |  234|    121|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2827:6): [True: 0, False: 121]
  ------------------
 2828|      0|			return r;
 2829|    121|	}
 2830|       |
 2831|       |	/* Fetch more compressed bytes. */
 2832|    391|	compressed_buff = __archive_read_ahead(a, 1, &bytes_avail);
 2833|    391|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|    391|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2833:6): [True: 258, False: 133]
  ------------------
 2834|    258|		&& bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2834:6): [True: 119, False: 139]
  ------------------
 2835|    119|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2836|    119|	}
 2837|    391|	if(bytes_avail < 1) {
  ------------------
  |  Branch (2837:5): [True: 7, False: 384]
  ------------------
 2838|       |		/* libbz2 doesn't complain when caller feeds avail_in == 0.
 2839|       |		 * It will actually return success in this case, which is
 2840|       |		 * undesirable. This is why we need to make this check
 2841|       |		 * manually. */
 2842|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2843|      7|		    "Truncated bzip2 file body");
 2844|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2845|      7|	}
 2846|       |
 2847|    384|	zip_read_decrypt(zip, compressed_buff, bytes_avail,
 2848|    384|	    &compressed_buff, &bytes_avail, &sp);
 2849|       |
 2850|       |	/* Setup buffer boundaries.  bzstream.avail_in is 32 bits wide,
 2851|       |	 * so clamp the available byte count before the assignment. */
 2852|    384|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (2852:6): [Folded, False: 384]
  ------------------
 2853|      0|		max_in = SSIZE_MAX;
 2854|    384|	else
 2855|    384|		max_in = UINT_MAX;
 2856|    384|	if (bytes_avail > max_in)
  ------------------
  |  Branch (2856:6): [True: 0, False: 384]
  ------------------
 2857|      0|		bytes_avail = max_in;
 2858|    384|	zip->bzstream.next_in = (char*)(uintptr_t) compressed_buff;
 2859|    384|	zip->bzstream.avail_in = (uint32_t)bytes_avail;
 2860|    384|	zip->bzstream.total_in_hi32 = 0;
 2861|    384|	zip->bzstream.total_in_lo32 = 0;
 2862|    384|	zip->bzstream.next_out = (char*) zip->uncompressed_buffer;
 2863|    384|	zip->bzstream.avail_out = (uint32_t)zip->uncompressed_buffer_size;
 2864|    384|	zip->bzstream.total_out_hi32 = 0;
 2865|    384|	zip->bzstream.total_out_lo32 = 0;
 2866|       |
 2867|       |	/* Perform the decompression. */
 2868|    384|	r = BZ2_bzDecompress(&zip->bzstream);
 2869|    384|	switch(r) {
 2870|     44|		case BZ_STREAM_END:
  ------------------
  |  Branch (2870:3): [True: 44, False: 340]
  ------------------
 2871|       |			/* If we're at the end of the stream, deinitialize the
 2872|       |			 * decompression context now. */
 2873|     44|			switch(BZ2_bzDecompressEnd(&zip->bzstream)) {
 2874|     44|				case BZ_OK:
  ------------------
  |  Branch (2874:5): [True: 44, False: 0]
  ------------------
 2875|     44|					break;
 2876|      0|				default:
  ------------------
  |  Branch (2876:5): [True: 0, False: 44]
  ------------------
 2877|      0|					archive_set_error(&a->archive,
 2878|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2879|      0|					    "Failed to clean up bzip2 "
 2880|      0|					    "decompressor");
 2881|      0|					return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2882|     44|			}
 2883|       |
 2884|     44|			zip->end_of_entry = 1;
 2885|     44|			break;
 2886|    271|		case BZ_OK:
  ------------------
  |  Branch (2886:3): [True: 271, False: 113]
  ------------------
 2887|       |			/* The decompressor has successfully decoded this
 2888|       |			 * chunk of data, but more data is still in queue. */
 2889|    271|			break;
 2890|     69|		default:
  ------------------
  |  Branch (2890:3): [True: 69, False: 315]
  ------------------
 2891|     69|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     69|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2892|     69|			    "bzip2 decompression failed");
 2893|     69|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     69|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2894|    384|	}
 2895|       |
 2896|       |	/* Update the pointers so decompressor can continue decoding. */
 2897|    315|	to_consume = zip->bzstream.total_in_lo32;
 2898|    315|	__archive_read_consume(a, to_consume);
 2899|       |
 2900|    315|	total_out = ((uint64_t) zip->bzstream.total_out_hi32 << 32) |
 2901|    315|	    zip->bzstream.total_out_lo32;
 2902|       |
 2903|    315|	zip->entry_bytes_remaining -= to_consume;
 2904|    315|	zip->entry_compressed_bytes_read += to_consume;
 2905|    315|	zip->entry_uncompressed_bytes_read += total_out;
 2906|       |
 2907|    315|	zip_read_decrypt_update(zip, to_consume, sp);
 2908|       |
 2909|    315|	if (zip->end_of_entry && zip->hctx_valid) {
  ------------------
  |  Branch (2909:6): [True: 44, False: 271]
  |  Branch (2909:27): [True: 0, False: 44]
  ------------------
 2910|      0|		r = check_authentication_code(a, NULL);
 2911|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2911:7): [True: 0, False: 0]
  ------------------
 2912|      0|			return r;
 2913|      0|	}
 2914|       |
 2915|       |	/* Give libarchive its due. */
 2916|    315|	*size = (size_t)total_out;
 2917|    315|	*buff = zip->uncompressed_buffer;
 2918|       |
 2919|    315|	return ARCHIVE_OK;
  ------------------
  |  |  234|    315|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2920|    315|}
archive_read_support_format_zip.c:zipx_bzip2_init:
 2771|    121|{
 2772|    121|	int r;
 2773|       |
 2774|       |	/* Deallocate already existing BZ2 decompression context if it
 2775|       |	 * exists. */
 2776|    121|	if(zip->bzstream_valid) {
  ------------------
  |  Branch (2776:5): [True: 38, False: 83]
  ------------------
 2777|     38|		BZ2_bzDecompressEnd(&zip->bzstream);
 2778|     38|		zip->bzstream_valid = 0;
 2779|     38|	}
 2780|       |
 2781|       |	/* Allocate a new BZ2 decompression context. */
 2782|    121|	memset(&zip->bzstream, 0, sizeof(bz_stream));
 2783|    121|	r = BZ2_bzDecompressInit(&zip->bzstream, 0, 1);
 2784|    121|	if(r != BZ_OK) {
  ------------------
  |  Branch (2784:5): [True: 0, False: 121]
  ------------------
 2785|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2786|      0|		    "bzip2 initialization failed (%d)",
 2787|      0|		    r);
 2788|       |
 2789|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2790|      0|	}
 2791|       |
 2792|       |	/* Mark the bzstream field to be released in cleanup phase. */
 2793|    121|	zip->bzstream_valid = 1;
 2794|       |
 2795|       |	/* (Re)allocate the buffer that will contain decompressed bytes. */
 2796|    121|	free(zip->uncompressed_buffer);
 2797|       |
 2798|    121|	zip->uncompressed_buffer_size = 256 * 1024;
 2799|    121|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2800|    121|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2800:6): [True: 0, False: 121]
  ------------------
 2801|      0|		archive_set_error(&a->archive, ENOMEM,
 2802|      0|		    "No memory for bzip2 decompression");
 2803|      0|		    return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2804|      0|	}
 2805|       |
 2806|       |	/* Initialization done. */
 2807|    121|	zip->decompress_init = 1;
 2808|    121|	return ARCHIVE_OK;
  ------------------
  |  |  234|    121|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2809|    121|}
archive_read_support_format_zip.c:zip_read_data_zipx_xz:
 2324|     65|{
 2325|     65|	struct zip *zip = a->format->data;
 2326|     65|	int ret;
 2327|     65|	lzma_ret lz_ret;
 2328|     65|	const void* compressed_buf;
 2329|     65|	const void* sp;
 2330|     65|	ssize_t bytes_avail, to_consume = 0;
 2331|       |
 2332|     65|	(void) offset; /* UNUSED */
 2333|       |
 2334|       |	/* Initialize decompressor if not yet initialized. */
 2335|     65|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2335:6): [True: 41, False: 24]
  ------------------
 2336|     41|		ret = zipx_xz_init(a, zip);
 2337|     41|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|     41|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2337:7): [True: 0, False: 41]
  ------------------
 2338|      0|			return (ret);
 2339|     41|	}
 2340|       |
 2341|     65|	compressed_buf = sp = __archive_read_ahead(a, 1, &bytes_avail);
 2342|     65|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|     65|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2342:6): [True: 52, False: 13]
  ------------------
 2343|     52|		&& bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2343:6): [True: 16, False: 36]
  ------------------
 2344|     16|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2345|     16|	}
 2346|     65|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2346:6): [True: 0, False: 65]
  ------------------
 2347|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2348|      0|		    "Truncated xz file body");
 2349|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2350|      0|	}
 2351|       |
 2352|     65|	zip_read_decrypt(zip, compressed_buf, bytes_avail,
 2353|     65|		&compressed_buf, &bytes_avail, &sp);
 2354|       |
 2355|     65|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2356|     65|	zip->zipx_lzma_stream.avail_in = bytes_avail;
 2357|     65|	zip->zipx_lzma_stream.total_in = 0;
 2358|     65|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2359|     65|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2360|     65|	zip->zipx_lzma_stream.total_out = 0;
 2361|       |
 2362|       |	/* Perform the decompression. */
 2363|     65|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2364|     65|	switch(lz_ret) {
 2365|      1|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2365:3): [True: 1, False: 64]
  ------------------
 2366|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2367|      1|			    "xz data error (%d)", (int) lz_ret);
 2368|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2369|       |
 2370|      0|		case LZMA_NO_CHECK:
  ------------------
  |  Branch (2370:3): [True: 0, False: 65]
  ------------------
 2371|     24|		case LZMA_OK:
  ------------------
  |  Branch (2371:3): [True: 24, False: 41]
  ------------------
 2372|     24|			break;
 2373|       |
 2374|     40|		default:
  ------------------
  |  Branch (2374:3): [True: 40, False: 25]
  ------------------
 2375|     40|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     40|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2376|     40|			    "xz unknown error (%d)", (int) lz_ret);
 2377|     40|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     40|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2378|       |
 2379|      0|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2379:3): [True: 0, False: 65]
  ------------------
 2380|      0|			lzma_end(&zip->zipx_lzma_stream);
 2381|      0|			zip->zipx_lzma_valid = 0;
 2382|       |
 2383|       |			/* This assertion is only possible if the size of the compressed data
 2384|       |			 * stream is known -> !ZIP_LENGTH_AT_END */
 2385|      0|			if((int64_t) zip->zipx_lzma_stream.total_in != zip->entry_bytes_remaining
  ------------------
  |  Branch (2385:7): [True: 0, False: 0]
  ------------------
 2386|      0|				&& !(zip->entry->zip_flags & ZIP_LENGTH_AT_END))
  ------------------
  |  |  138|      0|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2386:8): [True: 0, False: 0]
  ------------------
 2387|      0|			{
 2388|      0|				archive_set_error(&a->archive,
 2389|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2390|      0|				    "xz premature end of stream");
 2391|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2392|      0|			}
 2393|       |
 2394|      0|			zip->end_of_entry = 1;
 2395|      0|			break;
 2396|     65|	}
 2397|       |
 2398|     24|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2399|       |
 2400|     24|	__archive_read_consume(a, to_consume);
 2401|     24|	zip->entry_bytes_remaining -= to_consume;
 2402|     24|	zip->entry_compressed_bytes_read += to_consume;
 2403|     24|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2404|       |
 2405|     24|	zip_read_decrypt_update(zip, to_consume, sp);
 2406|       |
 2407|     24|	if (zip->end_of_entry) {
  ------------------
  |  Branch (2407:6): [True: 0, False: 24]
  ------------------
 2408|      0|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2408:7): [True: 0, False: 0]
  ------------------
 2409|      0|			ret = check_authentication_code(a, NULL);
 2410|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2410:8): [True: 0, False: 0]
  ------------------
 2411|      0|				return ret;
 2412|      0|		}
 2413|      0|	}
 2414|       |
 2415|     24|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2416|     24|	*buff = zip->uncompressed_buffer;
 2417|       |
 2418|     24|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     24|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2419|     24|}
archive_read_support_format_zip.c:zipx_xz_init:
 2120|     41|{
 2121|     41|	lzma_ret r;
 2122|       |
 2123|     41|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (2123:5): [True: 0, False: 41]
  ------------------
 2124|      0|		lzma_end(&zip->zipx_lzma_stream);
 2125|      0|		zip->zipx_lzma_valid = 0;
 2126|      0|	}
 2127|       |
 2128|     41|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 2129|     41|	r = lzma_stream_decoder(&zip->zipx_lzma_stream, UINT64_MAX, 0);
 2130|     41|	if (r != LZMA_OK) {
  ------------------
  |  Branch (2130:6): [True: 0, False: 41]
  ------------------
 2131|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2132|      0|		    "xz initialization failed (%d)",
 2133|      0|		    r);
 2134|       |
 2135|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2136|      0|	}
 2137|       |
 2138|     41|	zip->zipx_lzma_valid = 1;
 2139|       |
 2140|     41|	free(zip->uncompressed_buffer);
 2141|       |
 2142|     41|	zip->uncompressed_buffer_size = 256 * 1024;
 2143|     41|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2144|     41|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2144:6): [True: 0, False: 41]
  ------------------
 2145|      0|		archive_set_error(&a->archive, ENOMEM,
 2146|      0|		    "No memory for xz decompression");
 2147|      0|		    return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2148|      0|	}
 2149|       |
 2150|     41|	zip->decompress_init = 1;
 2151|     41|	return (ARCHIVE_OK);
  ------------------
  |  |  234|     41|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2152|     41|}
archive_read_support_format_zip.c:zip_read_data_zipx_ppmd:
 2695|  21.3k|{
 2696|  21.3k|	struct zip *zip = a->format->data;
 2697|  21.3k|	int ret;
 2698|  21.3k|	size_t consumed_bytes = 0;
 2699|       |
 2700|  21.3k|	(void) offset; /* UNUSED */
 2701|       |
 2702|       |	/* If we're here for the first time, initialize Ppmd8 decompression
 2703|       |	 * context first. */
 2704|  21.3k|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2704:5): [True: 21.3k, False: 79]
  ------------------
 2705|  21.3k|		ret = zipx_ppmd8_init(a, zip);
 2706|  21.3k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  234|  21.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2706:6): [True: 5.97k, False: 15.3k]
  ------------------
 2707|  5.97k|			return ret;
 2708|  21.3k|	}
 2709|       |
 2710|       |	/* Fetch for more data. We're reading 1 byte here, but libarchive
 2711|       |	 * should prefetch more bytes. */
 2712|  15.4k|	if(__archive_read_ahead(a, 1, NULL) == NULL) {
  ------------------
  |  Branch (2712:5): [True: 11, False: 15.3k]
  ------------------
 2713|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     11|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2714|     11|		    "Truncated PPMd8 file body");
 2715|     11|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2716|     11|	}
 2717|       |
 2718|       |	/* This counter will be updated inside ppmd_read(), which at one
 2719|       |	 * point will be called by Ppmd8_DecodeSymbol. */
 2720|  15.3k|	zip->zipx_ppmd_read_compressed = 0;
 2721|       |
 2722|       |	/* Decompression loop. */
 2723|   103M|	do {
 2724|   103M|		int sym = __archive_ppmd8_functions.Ppmd8_DecodeSymbol(
 2725|   103M|		    &zip->ppmd8);
 2726|   103M|		if(sym < 0) {
  ------------------
  |  Branch (2726:6): [True: 14.8k, False: 103M]
  ------------------
 2727|  14.8k|			zip->end_of_entry = 1;
 2728|  14.8k|			break;
 2729|  14.8k|		}
 2730|       |
 2731|       |		/* This field is set by ppmd_read() when there was no more data
 2732|       |		 * to be read. */
 2733|   103M|		if(zip->ppmd8_stream_failed) {
  ------------------
  |  Branch (2733:6): [True: 473, False: 103M]
  ------------------
 2734|    473|			archive_set_error(&a->archive,
 2735|    473|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    473|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2736|    473|			    "Truncated PPMd8 file body");
 2737|    473|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    473|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2738|    473|		}
 2739|       |
 2740|   103M|		zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
 2741|   103M|		++consumed_bytes;
 2742|   103M|	} while(consumed_bytes < zip->uncompressed_buffer_size);
  ------------------
  |  Branch (2742:10): [True: 103M, False: 114]
  ------------------
 2743|       |
 2744|       |	/* Update pointers so we can continue decompression in another call. */
 2745|  14.9k|	zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
 2746|  14.9k|	zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
 2747|  14.9k|	zip->entry_uncompressed_bytes_read += consumed_bytes;
 2748|       |
 2749|       |	/* If we're at the end of stream, deinitialize Ppmd8 context. */
 2750|  14.9k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2750:5): [True: 14.8k, False: 114]
  ------------------
 2751|  14.8k|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2752|  14.8k|		zip->ppmd8_valid = 0;
 2753|       |
 2754|  14.8k|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2754:7): [True: 439, False: 14.3k]
  ------------------
 2755|    439|			int r = check_authentication_code(a, NULL);
 2756|    439|			if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    439|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2756:8): [True: 379, False: 60]
  ------------------
 2757|    379|				return (r);
 2758|    439|		}
 2759|  14.8k|	}
 2760|       |
 2761|       |	/* Update pointers for libarchive. */
 2762|  14.5k|	*buff = zip->uncompressed_buffer;
 2763|  14.5k|	*size = consumed_bytes;
 2764|       |
 2765|  14.5k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  14.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2766|  14.9k|}
archive_read_support_format_zip.c:zipx_ppmd8_init:
 2586|  21.3k|{
 2587|  21.3k|	const void* p;
 2588|  21.3k|	uint32_t val;
 2589|  21.3k|	uint32_t order;
 2590|  21.3k|	uint32_t mem;
 2591|  21.3k|	uint32_t restore_method;
 2592|       |
 2593|       |	/* Remove previous decompression context if it exists. */
 2594|  21.3k|	if(zip->ppmd8_valid) {
  ------------------
  |  Branch (2594:5): [True: 34, False: 21.2k]
  ------------------
 2595|     34|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2596|     34|		zip->ppmd8_valid = 0;
 2597|     34|	}
 2598|       |
 2599|       |	/* Create a new decompression context. */
 2600|  21.3k|	__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
 2601|  21.3k|	zip->ppmd8_stream_failed = 0;
 2602|       |
 2603|       |	/* Setup function pointers required by Ppmd8 decompressor. The
 2604|       |	 * 'ppmd_read' function will feed new bytes to the decompressor,
 2605|       |	 * and will increment the 'zip->zipx_ppmd_read_compressed' counter. */
 2606|  21.3k|	zip->ppmd8.Stream.In = &zip->zipx_ppmd_stream;
 2607|  21.3k|	zip->zipx_ppmd_stream.a = a;
 2608|  21.3k|	zip->zipx_ppmd_stream.Read = &ppmd_read;
 2609|       |
 2610|       |	/* Reset number of read bytes to 0. */
 2611|  21.3k|	zip->zipx_ppmd_read_compressed = 0;
 2612|       |
 2613|       |	/* Read Ppmd8 header (2 bytes). */
 2614|  21.3k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2614:6): [True: 108, False: 21.1k]
  |  Branch (2614:25): [True: 470, False: 20.7k]
  ------------------
 2615|    578|		size_t out_len;
 2616|    578|		size_t consumed;
 2617|    578|		int ret;
 2618|       |
 2619|    578|		ret = zipx_read_header_and_decrypt(a, &p, 2, &out_len, &consumed);
 2620|    578|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  234|    578|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2620:7): [True: 0, False: 578]
  ------------------
 2621|      0|			return ret;
 2622|  20.7k|	} else {
 2623|  20.7k|		p = __archive_read_ahead(a, 2, NULL);
 2624|  20.7k|		if(!p) {
  ------------------
  |  Branch (2624:6): [True: 2, False: 20.7k]
  ------------------
 2625|      2|			archive_set_error(&a->archive,
 2626|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2627|      2|			    "Truncated file data in PPMd8 stream");
 2628|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2629|      2|		}
 2630|  20.7k|	}
 2631|  21.2k|	__archive_read_consume(a, 2);
 2632|       |
 2633|       |	/* Decode the stream's compression parameters. */
 2634|  21.2k|	val = archive_le16dec(p);
 2635|  21.2k|	order = (val & 15) + 1;
 2636|  21.2k|	mem = ((val >> 4) & 0xff) + 1;
 2637|  21.2k|	restore_method = (val >> 12);
 2638|       |
 2639|  21.2k|	if(order < 2 || restore_method > 2) {
  ------------------
  |  Branch (2639:5): [True: 2.21k, False: 19.0k]
  |  Branch (2639:18): [True: 3.76k, False: 15.3k]
  ------------------
 2640|  5.97k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  5.97k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2641|  5.97k|		    "Invalid parameter set in PPMd8 stream (order=%" PRIu32 ", "
 2642|  5.97k|		    "restore=%" PRIu32 ")", order, restore_method);
 2643|  5.97k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  238|  5.97k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2644|  5.97k|	}
 2645|       |
 2646|       |	/* Allocate the memory needed to properly decompress the file. */
 2647|  15.3k|	if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) {
  ------------------
  |  Branch (2647:5): [True: 0, False: 15.3k]
  ------------------
 2648|      0|		archive_set_error(&a->archive, ENOMEM,
 2649|      0|		    "Unable to allocate memory for PPMd8 stream: %" PRIu32 " bytes",
 2650|      0|		    mem << 20);
 2651|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2652|      0|	}
 2653|       |
 2654|       |	/* Signal the cleanup function to release Ppmd8 context in the
 2655|       |	 * cleanup phase. */
 2656|  15.3k|	zip->ppmd8_valid = 1;
 2657|       |
 2658|       |	/* Perform further Ppmd8 initialization. */
 2659|  15.3k|	if(!__archive_ppmd8_functions.Ppmd8_RangeDec_Init(&zip->ppmd8)) {
  ------------------
  |  Branch (2659:5): [True: 0, False: 15.3k]
  ------------------
 2660|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2661|      0|		    "PPMd8 stream range decoder initialization error");
 2662|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2663|      0|	}
 2664|       |
 2665|  15.3k|	__archive_ppmd8_functions.Ppmd8_Init(&zip->ppmd8, order,
 2666|  15.3k|	    restore_method);
 2667|       |
 2668|       |	/* Allocate the buffer that will hold uncompressed data. */
 2669|  15.3k|	free(zip->uncompressed_buffer);
 2670|       |
 2671|  15.3k|	zip->uncompressed_buffer_size = 256 * 1024;
 2672|  15.3k|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2673|       |
 2674|  15.3k|	if(zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2674:5): [True: 0, False: 15.3k]
  ------------------
 2675|      0|		archive_set_error(&a->archive, ENOMEM,
 2676|      0|		    "No memory for PPMd8 decompression");
 2677|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2678|      0|	}
 2679|       |
 2680|       |	/* Ppmd8 initialization is done. */
 2681|  15.3k|	zip->decompress_init = 1;
 2682|       |
 2683|       |	/* We've already read 2 bytes in the output stream. Additionally,
 2684|       |	 * Ppmd8 initialization code could read some data as well. So we
 2685|       |	 * are advancing the stream by 2 bytes plus whatever number of
 2686|       |	 * bytes Ppmd8 init function used. */
 2687|  15.3k|	zip->entry_compressed_bytes_read += 2 + zip->zipx_ppmd_read_compressed;
 2688|       |
 2689|  15.3k|	return ARCHIVE_OK;
  ------------------
  |  |  234|  15.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2690|  15.3k|}
archive_read_support_format_zip.c:ppmd_read:
  305|  12.4M|ppmd_read(void* p) {
  306|       |	/* Get the handle to current decompression context. */
  307|  12.4M|	struct archive_read *a = ((IByteIn*)p)->a;
  308|  12.4M|	struct zip *zip = a->format->data;
  309|       |
  310|       |	/* Fetch next byte. */
  311|  12.4M|	const uint8_t* data = __archive_read_ahead(a, 1, NULL);
  312|  12.4M|	if(data == NULL) {
  ------------------
  |  Branch (312:5): [True: 555, False: 12.4M]
  ------------------
  313|    555|		zip->ppmd8_stream_failed = 1;
  314|    555|		return 0;
  315|    555|	}
  316|       |
  317|  12.4M|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (317:6): [True: 27.2k, False: 12.4M]
  |  Branch (317:25): [True: 205k, False: 12.2M]
  ------------------
  318|   233k|		uint8_t val;
  319|   233k|		if (zip->tctx_valid) {
  ------------------
  |  Branch (319:7): [True: 27.2k, False: 205k]
  ------------------
  320|  27.2k|			trad_enc_decrypt_update(&zip->tctx,
  321|  27.2k|			    data, 1, &val, 1);
  322|   205k|		} else {
  323|   205k|			size_t dsize = 1;
  324|   205k|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  154|   205k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  325|   205k|			    data, 1, &val, &dsize);
  326|   205k|		}
  327|   233k|		if (zip->hctx_valid)
  ------------------
  |  Branch (327:7): [True: 205k, False: 27.2k]
  ------------------
  328|   205k|			archive_hmac_sha1_update(&zip->hctx, data, 1);
  ------------------
  |  |   91|   205k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  329|       |
  330|   233k|		__archive_read_consume(a, 1);
  331|   233k|		++zip->zipx_ppmd_read_compressed;
  332|   233k|		return val;
  333|   233k|	}
  334|       |
  335|  12.2M|	__archive_read_consume(a, 1);
  336|       |
  337|       |	/* Increment the counter. */
  338|  12.2M|	++zip->zipx_ppmd_read_compressed;
  339|       |
  340|       |	/* Return the next compressed byte. */
  341|  12.2M|	return data[0];
  342|  12.4M|}
archive_read_support_format_zip.c:consume_end_of_file_marker:
 1786|  23.8k|{
 1787|  23.8k|	const char *marker;
 1788|  23.8k|	const char *p;
 1789|  23.8k|	uint64_t compressed32, uncompressed32;
 1790|  23.8k|	uint64_t compressed64, uncompressed64;
 1791|  23.8k|	uint64_t compressed_actual, uncompressed_actual;
 1792|  23.8k|	uint32_t crc32_actual;
 1793|  23.8k|	const uint32_t PK78 = 0x08074B50ULL;
 1794|  23.8k|	uint8_t crc32_ignored, crc32_may_be_zero;
 1795|       |
 1796|       |	/* If there shouldn't be a marker, don't consume it. */
 1797|  23.8k|	if ((zip->entry->zip_flags & ZIP_LENGTH_AT_END) == 0) {
  ------------------
  |  |  138|  23.8k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1797:6): [True: 5.54k, False: 18.3k]
  ------------------
 1798|  5.54k|		return;
 1799|  5.54k|	}
 1800|       |
 1801|       |	/* The longest Zip end-of-file record is 24 bytes.  Since an
 1802|       |	 * end-of-file record can never appear at the end of the
 1803|       |	 * archive, we know 24 bytes will be available unless
 1804|       |	 * the archive is severely truncated. */
 1805|  18.3k|	if (NULL == (marker = __archive_read_ahead(a, 24, NULL))) {
  ------------------
  |  Branch (1805:6): [True: 144, False: 18.1k]
  ------------------
 1806|    144|		return;
 1807|    144|	}
 1808|  18.1k|	p = marker;
 1809|       |
 1810|       |	/* The end-of-file record comprises:
 1811|       |	 * = Optional PK\007\010 marker
 1812|       |	 * = 4-byte CRC32
 1813|       |	 * = Compressed size
 1814|       |	 * = Uncompressed size
 1815|       |	 *
 1816|       |	 * The last two fields are either both 32 bits or both 64
 1817|       |	 * bits.  We check all possible layouts and accept any one
 1818|       |	 * that gives us a complete match, else we make a best-effort
 1819|       |	 * attempt to parse out the pieces.
 1820|       |	 */
 1821|       |
 1822|       |	/* CRC32 checking can be tricky:
 1823|       |	 * * Test suites sometimes ignore the CRC32
 1824|       |	 * * AES AE-2 always writes zero for the CRC32
 1825|       |	 * * AES AE-1 sometimes writes zero for the CRC32
 1826|       |	 */
 1827|  18.1k|	crc32_ignored = zip->ignore_crc32;
 1828|  18.1k|	crc32_may_be_zero = 0;
 1829|  18.1k|	crc32_actual = zip->computed_crc32;
 1830|  18.1k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1830:6): [True: 1.27k, False: 16.9k]
  ------------------
 1831|  1.27k|	  switch (zip->entry->aes_extra.vendor) {
 1832|    133|	  case AES_VENDOR_AE_2:
  ------------------
  |  |  123|    133|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1832:4): [True: 133, False: 1.14k]
  ------------------
 1833|    133|	    crc32_actual = 0;
 1834|    133|	    break;
 1835|      0|	  case AES_VENDOR_AE_1:
  ------------------
  |  |  122|      0|#define AES_VENDOR_AE_1	0x0001
  ------------------
  |  Branch (1835:4): [True: 0, False: 1.27k]
  ------------------
 1836|  1.14k|	  default:
  ------------------
  |  Branch (1836:4): [True: 1.14k, False: 133]
  ------------------
 1837|  1.14k|	    crc32_may_be_zero = 1;
 1838|  1.14k|	    break;
 1839|  1.27k|	  }
 1840|  1.27k|	}
 1841|       |
 1842|       |	/* Values computed from the actual data in the archive. */
 1843|  18.1k|	compressed_actual = (uint64_t)zip->entry_compressed_bytes_read;
 1844|  18.1k|	uncompressed_actual = (uint64_t)zip->entry_uncompressed_bytes_read;
 1845|       |
 1846|       |
 1847|       |	/* Longest: PK78 marker, all 64-bit fields (24 bytes total) */
 1848|  18.1k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1848:6): [True: 4.09k, False: 14.1k]
  ------------------
 1849|  4.09k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1849:10): [True: 790, False: 3.30k]
  ------------------
 1850|  3.30k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1850:7): [True: 109, False: 3.19k]
  |  Branch (1850:28): [True: 0, False: 109]
  ------------------
 1851|  3.30k|		|| crc32_ignored)
  ------------------
  |  Branch (1851:6): [True: 3.30k, False: 0]
  ------------------
 1852|  4.09k|	    && (archive_le64dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1852:9): [True: 877, False: 3.21k]
  ------------------
 1853|    877|	    && (archive_le64dec(p + 16) == uncompressed_actual)) {
  ------------------
  |  Branch (1853:9): [True: 274, False: 603]
  ------------------
 1854|    274|		if (!crc32_ignored) {
  ------------------
  |  Branch (1854:7): [True: 0, False: 274]
  ------------------
 1855|      0|			zip->entry->crc32 = crc32_actual;
 1856|      0|		}
 1857|    274|		zip->entry->compressed_size = compressed_actual;
 1858|    274|		zip->entry->uncompressed_size = uncompressed_actual;
 1859|    274|		zip->unconsumed += 24;
 1860|    274|		return;
 1861|    274|	}
 1862|       |
 1863|       |	/* No PK78 marker, 64-bit fields (20 bytes total) */
 1864|  17.9k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1864:7): [True: 925, False: 16.9k]
  ------------------
 1865|  16.9k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1865:11): [True: 1.14k, False: 15.8k]
  |  Branch (1865:32): [True: 1.00k, False: 132]
  ------------------
 1866|  15.9k|	     || crc32_ignored)
  ------------------
  |  Branch (1866:10): [True: 15.9k, False: 0]
  ------------------
 1867|  17.9k|	    && (archive_le64dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1867:9): [True: 1.17k, False: 16.7k]
  ------------------
 1868|  1.17k|	    && (archive_le64dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1868:9): [True: 645, False: 534]
  ------------------
 1869|    645|	        if (!crc32_ignored) {
  ------------------
  |  Branch (1869:14): [True: 0, False: 645]
  ------------------
 1870|      0|			zip->entry->crc32 = crc32_actual;
 1871|      0|		}
 1872|    645|		zip->entry->compressed_size = compressed_actual;
 1873|    645|		zip->entry->uncompressed_size = uncompressed_actual;
 1874|    645|		zip->unconsumed += 20;
 1875|    645|		return;
 1876|    645|	}
 1877|       |
 1878|       |	/* PK78 marker and 32-bit fields (16 bytes total) */
 1879|  17.2k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1879:6): [True: 3.81k, False: 13.4k]
  ------------------
 1880|  3.81k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1880:10): [True: 789, False: 3.02k]
  ------------------
 1881|  3.02k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1881:7): [True: 109, False: 2.91k]
  |  Branch (1881:28): [True: 0, False: 109]
  ------------------
 1882|  3.02k|		|| crc32_ignored)
  ------------------
  |  Branch (1882:6): [True: 3.02k, False: 0]
  ------------------
 1883|  3.81k|	    && (archive_le32dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1883:9): [True: 1.43k, False: 2.38k]
  ------------------
 1884|  1.43k|	    && (archive_le32dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1884:9): [True: 433, False: 1.00k]
  ------------------
 1885|    433|		if (!crc32_ignored) {
  ------------------
  |  Branch (1885:7): [True: 0, False: 433]
  ------------------
 1886|      0|			zip->entry->crc32 = crc32_actual;
 1887|      0|		}
 1888|    433|		zip->entry->compressed_size = compressed_actual;
 1889|    433|		zip->entry->uncompressed_size = uncompressed_actual;
 1890|    433|		zip->unconsumed += 16;
 1891|    433|		return;
 1892|    433|	}
 1893|       |
 1894|       |	/* Shortest: No PK78 marker, all 32-bit fields (12 bytes total) */
 1895|  16.8k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1895:7): [True: 925, False: 15.9k]
  ------------------
 1896|  15.9k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1896:11): [True: 1.14k, False: 14.7k]
  |  Branch (1896:32): [True: 1.00k, False: 132]
  ------------------
 1897|  14.9k|	     || crc32_ignored)
  ------------------
  |  Branch (1897:10): [True: 14.9k, False: 0]
  ------------------
 1898|  16.8k|	    && (archive_le32dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1898:9): [True: 1.06k, False: 15.7k]
  ------------------
 1899|  1.06k|	    && (archive_le32dec(p + 8) == uncompressed_actual)) {
  ------------------
  |  Branch (1899:9): [True: 498, False: 562]
  ------------------
 1900|    498|		if (!crc32_ignored) {
  ------------------
  |  Branch (1900:7): [True: 0, False: 498]
  ------------------
 1901|      0|			zip->entry->crc32 = crc32_actual;
 1902|      0|		}
 1903|    498|		zip->entry->compressed_size = compressed_actual;
 1904|    498|		zip->entry->uncompressed_size = uncompressed_actual;
 1905|    498|		zip->unconsumed += 12;
 1906|    498|		return;
 1907|    498|	}
 1908|       |
 1909|       |	/* None of the exact patterns matched. If entry size was unknown
 1910|       |	 * (ZIP_LENGTH_AT_END flag), before treating this as
 1911|       |	 * corruption, check whether the next ZIP record follows the data
 1912|       |	 * immediately: a length-at-end entry whose compression format has
 1913|       |	 * its own end-of-stream marker (e.g. PPMd) may be written with no
 1914|       |	 * data descriptor at all.  In that case the byte counts we measured
 1915|       |	 * during decompression are authoritative, so trust them and leave
 1916|       |	 * the stream untouched. */
 1917|  16.3k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  16.3k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1917:6): [True: 16.3k, False: 0]
  ------------------
 1918|  16.3k|	{
 1919|  16.3k|		const uint32_t sig = archive_le32dec(p);
 1920|  16.3k|		if (sig == 0x04034b50U     /* Local file header */
  ------------------
  |  Branch (1920:7): [True: 2.62k, False: 13.7k]
  ------------------
 1921|  13.7k|		    || sig == 0x02014b50U  /* Central directory record */
  ------------------
  |  Branch (1921:10): [True: 1, False: 13.7k]
  ------------------
 1922|  13.7k|		    || sig == 0x06054b50U) /* End of central directory */ {
  ------------------
  |  Branch (1922:10): [True: 1, False: 13.7k]
  ------------------
 1923|  2.63k|			zip->entry->compressed_size = compressed_actual;
 1924|  2.63k|			zip->entry->uncompressed_size = uncompressed_actual;
 1925|  2.63k|			return;
 1926|  2.63k|		}
 1927|  16.3k|	}
 1928|       |
 1929|       |	/* If none of the above patterns gives us a full exact match,
 1930|       |	 * then there's something definitely amiss.  The fallback code
 1931|       |	 * below will parse out some plausible values for error
 1932|       |	 * reporting purposes.  Note that this won't actually
 1933|       |	 * consume anything:
 1934|       |	 *
 1935|       |	 * = If there really is a marker here, the logic to resync to
 1936|       |	 *   the next entry will suffice to skip it.
 1937|       |	 *
 1938|       |	 * = There might not really be a marker: Corruption or bugs
 1939|       |	 *   may have set the length-at-end bit without a marker ever
 1940|       |	 *   having actually been written. In this case, we
 1941|       |	 *   explicitly should not consume any bytes, since that would
 1942|       |	 *   prevent us from correctly reading the next entry.
 1943|       |	 */
 1944|  13.7k|	if (archive_le32dec(p) == PK78) {
  ------------------
  |  Branch (1944:6): [True: 3.02k, False: 10.6k]
  ------------------
 1945|  3.02k|		p += 4; /* Ignore PK78 if it appears to be present */
 1946|  3.02k|	}
 1947|  13.7k|	zip->entry->crc32 = archive_le32dec(p);  /* Parse CRC32 */
 1948|  13.7k|	p += 4;
 1949|       |
 1950|       |	/* Consider both 32- and 64-bit interpretations */
 1951|  13.7k|	compressed32 = archive_le32dec(p);
 1952|  13.7k|	uncompressed32 = archive_le32dec(p + 4);
 1953|  13.7k|	compressed64 = archive_le64dec(p);
 1954|  13.7k|	uncompressed64 = archive_le64dec(p + 8);
 1955|       |
 1956|       |	/* The earlier patterns may have failed because of CRC32
 1957|       |	 * mismatch, so it's still possible that both sizes match.
 1958|       |	 * Try to match as many as we can...
 1959|       |	 */
 1960|  13.7k|	if (compressed32 == compressed_actual
  ------------------
  |  Branch (1960:6): [True: 891, False: 12.8k]
  ------------------
 1961|    891|	    && uncompressed32 == uncompressed_actual) {
  ------------------
  |  Branch (1961:9): [True: 0, False: 891]
  ------------------
 1962|       |		/* Both 32-bit fields match */
 1963|      0|		zip->entry->compressed_size = compressed32;
 1964|      0|		zip->entry->uncompressed_size = uncompressed32;
 1965|  13.7k|	} else if (compressed64 == compressed_actual
  ------------------
  |  Branch (1965:13): [True: 192, False: 13.5k]
  ------------------
 1966|  13.5k|		   || uncompressed64 == uncompressed_actual) {
  ------------------
  |  Branch (1966:9): [True: 1.00k, False: 12.5k]
  ------------------
 1967|       |		/* One or both 64-bit fields match */
 1968|  1.20k|		zip->entry->compressed_size = compressed64;
 1969|  1.20k|		zip->entry->uncompressed_size = uncompressed64;
 1970|  12.5k|	} else {
 1971|       |		/* Zero or one 32-bit fields match */
 1972|  12.5k|		zip->entry->compressed_size = compressed32;
 1973|  12.5k|		zip->entry->uncompressed_size = uncompressed32;
 1974|  12.5k|	}
 1975|  13.7k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_streamable:
 4012|  53.1k|{
 4013|  53.1k|	struct zip *zip = a->format->data;
 4014|  53.1k|	int64_t bytes_skipped;
 4015|       |
 4016|  53.1k|	bytes_skipped = __archive_read_consume(a, zip->unconsumed);
 4017|  53.1k|	zip->unconsumed = 0;
 4018|  53.1k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (4018:6): [True: 0, False: 53.1k]
  ------------------
 4019|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4020|       |
 4021|       |	/* If we've already read to end of data, we're done. */
 4022|  53.1k|	if (zip->end_of_entry)
  ------------------
  |  Branch (4022:6): [True: 35.5k, False: 17.5k]
  ------------------
 4023|  35.5k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  35.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4024|       |
 4025|       |	/* So we know we're streaming... */
 4026|  17.5k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  17.5k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (4026:6): [True: 5.44k, False: 12.0k]
  ------------------
 4027|  12.0k|	    || zip->entry->compressed_size > 0) {
  ------------------
  |  Branch (4027:9): [True: 2.88k, False: 9.17k]
  ------------------
 4028|       |		/* We know the compressed length, so we can just skip. */
 4029|  8.33k|		bytes_skipped = __archive_read_consume(a,
 4030|  8.33k|					zip->entry_bytes_remaining);
 4031|  8.33k|		if (bytes_skipped < 0)
  ------------------
  |  Branch (4031:7): [True: 216, False: 8.11k]
  ------------------
 4032|    216|			return (ARCHIVE_FATAL);
  ------------------
  |  |  240|    216|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4033|  8.11k|		return (ARCHIVE_OK);
  ------------------
  |  |  234|  8.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4034|  8.33k|	}
 4035|       |
 4036|       |	/* Validate the descriptor against decoded CRC and sizes. */
 4037|  9.46k|	while (!zip->end_of_entry) {
  ------------------
  |  Branch (4037:9): [True: 9.18k, False: 288]
  ------------------
 4038|  9.18k|		int64_t offset = 0;
 4039|  9.18k|		const void *buff = NULL;
 4040|  9.18k|		size_t size = 0;
 4041|  9.18k|		int r;
 4042|       |
 4043|  9.18k|		r = archive_read_format_zip_read_data(a, &buff, &size, &offset);
 4044|  9.18k|		if (r == ARCHIVE_EOF)
  ------------------
  |  |  233|  9.18k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4044:7): [True: 261, False: 8.92k]
  ------------------
 4045|    261|			return (ARCHIVE_OK);
  ------------------
  |  |  234|    261|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4046|  8.92k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|  8.92k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4046:7): [True: 8.62k, False: 291]
  ------------------
 4047|  8.62k|			return (r);
 4048|  8.92k|	}
 4049|    288|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    288|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4050|  9.17k|}
archive_read_support_format_zip.c:archive_read_format_zip_cleanup:
 3738|  40.2k|{
 3739|  40.2k|	struct zip *zip = a->format->data;
 3740|  40.2k|	struct zip_entry *zip_entry, *next_zip_entry;
 3741|       |
 3742|  40.2k|#ifdef HAVE_ZLIB_H
 3743|  40.2k|	if (zip->stream_valid)
  ------------------
  |  Branch (3743:6): [True: 316, False: 39.9k]
  ------------------
 3744|    316|		inflateEnd(&zip->stream);
 3745|  40.2k|#endif
 3746|       |
 3747|  40.2k|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3748|  40.2k|    if (zip->zipx_lzma_valid) {
  ------------------
  |  Branch (3748:9): [True: 143, False: 40.1k]
  ------------------
 3749|    143|		lzma_end(&zip->zipx_lzma_stream);
 3750|    143|	}
 3751|  40.2k|#endif
 3752|       |
 3753|  40.2k|#ifdef HAVE_BZLIB_H
 3754|  40.2k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (3754:6): [True: 83, False: 40.2k]
  ------------------
 3755|     83|		BZ2_bzDecompressEnd(&zip->bzstream);
 3756|     83|	}
 3757|  40.2k|#endif
 3758|       |
 3759|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3760|       |	if (zip->zstdstream_valid) {
 3761|       |		ZSTD_freeDStream(zip->zstdstream);
 3762|       |	}
 3763|       |#endif
 3764|       |
 3765|  40.2k|	free(zip->uncompressed_buffer);
 3766|       |
 3767|  40.2k|	if (zip->ppmd8_valid)
  ------------------
  |  Branch (3767:6): [True: 485, False: 39.8k]
  ------------------
 3768|    485|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 3769|       |
 3770|  40.2k|	if (zip->zip_entries) {
  ------------------
  |  Branch (3770:6): [True: 3.03k, False: 37.2k]
  ------------------
 3771|  3.03k|		zip_entry = zip->zip_entries;
 3772|  7.36k|		while (zip_entry != NULL) {
  ------------------
  |  Branch (3772:10): [True: 4.33k, False: 3.03k]
  ------------------
 3773|  4.33k|			next_zip_entry = zip_entry->next;
 3774|  4.33k|			archive_string_free(&zip_entry->rsrcname);
 3775|  4.33k|			free(zip_entry);
 3776|  4.33k|			zip_entry = next_zip_entry;
 3777|  4.33k|		}
 3778|  3.03k|	}
 3779|  40.2k|	free(zip->decrypted_buffer);
 3780|  40.2k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3780:6): [True: 68, False: 40.2k]
  ------------------
 3781|     68|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|     68|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3782|  40.2k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3782:6): [True: 68, False: 40.2k]
  ------------------
 3783|     68|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |   95|     68|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3784|  40.2k|	free(zip->iv);
 3785|  40.2k|	free(zip->erd);
 3786|  40.2k|	free(zip->v_data);
 3787|  40.2k|	archive_string_free(&zip->format_name);
 3788|  40.2k|	free(zip);
 3789|  40.2k|	a->format->data = NULL;
 3790|  40.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  40.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3791|  40.2k|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_streamable:
 3872|  5.73k|{
 3873|  5.73k|	(void)a; /* UNUSED */
 3874|  5.73k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  403|  5.73k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3875|  5.73k|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  404|  5.73k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 3876|  5.73k|}
archive_read_support_format_zip.c:archive_read_format_zip_has_encrypted_entries:
 3795|  3.08k|{
 3796|  3.08k|	if (_a && _a->format) {
  ------------------
  |  Branch (3796:6): [True: 3.08k, False: 0]
  |  Branch (3796:12): [True: 3.08k, False: 0]
  ------------------
 3797|  3.08k|		struct zip *zip = _a->format->data;
 3798|  3.08k|		if (zip) {
  ------------------
  |  Branch (3798:7): [True: 3.08k, False: 0]
  ------------------
 3799|  3.08k|			return zip->has_encrypted_entries;
 3800|  3.08k|		}
 3801|  3.08k|	}
 3802|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  416|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3803|  3.08k|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_bid:
 4206|  19.8k|{
 4207|  19.8k|	struct zip *zip = a->format->data;
 4208|  19.8k|	int64_t file_size, current_offset;
 4209|  19.8k|	const char *h;
 4210|  19.8k|	int i, tail;
 4211|       |
 4212|       |	/* If someone has already bid more than 32, then avoid
 4213|       |	   trashing the look-ahead buffers with a seek. */
 4214|  19.8k|	if (best_bid > 32)
  ------------------
  |  Branch (4214:6): [True: 11.2k, False: 8.57k]
  ------------------
 4215|  11.2k|		return (-1);
 4216|       |
 4217|  8.57k|	file_size = __archive_read_seek(a, 0, SEEK_END);
 4218|  8.57k|	if (file_size <= 0)
  ------------------
  |  Branch (4218:6): [True: 664, False: 7.91k]
  ------------------
 4219|    664|		return 0;
 4220|       |
 4221|       |	/* Search last 16k of file for end-of-central-directory
 4222|       |	 * record (which starts with PK\005\006) */
 4223|  7.91k|	tail = (int)zipmin(1024 * 16, file_size);
  ------------------
  |  |  274|  7.91k|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (274:22): [True: 484, False: 7.42k]
  |  |  ------------------
  ------------------
 4224|  7.91k|	current_offset = __archive_read_seek(a, -tail, SEEK_END);
 4225|  7.91k|	if (current_offset < 0)
  ------------------
  |  Branch (4225:6): [True: 0, False: 7.91k]
  ------------------
 4226|      0|		return 0;
 4227|  7.91k|	if ((h = __archive_read_ahead(a, (size_t)tail, NULL)) == NULL)
  ------------------
  |  Branch (4227:6): [True: 0, False: 7.91k]
  ------------------
 4228|      0|		return 0;
 4229|       |	/* Boyer-Moore search backwards from the end, since we want
 4230|       |	 * to match the last EOCD in the file (there can be more than
 4231|       |	 * one if there is an uncompressed Zip archive as a member
 4232|       |	 * within this Zip archive).
 4233|       |	 *
 4234|       |	 * The lower bound is inclusive (>= 0, not > 0): a minimal,
 4235|       |	 * valid, zero-entry archive is exactly 22 bytes long, putting
 4236|       |	 * the EOCD signature at index 0 of this search window. */
 4237|  3.68M|	for (i = tail - 22; i >= 0;) {
  ------------------
  |  Branch (4237:22): [True: 3.68M, False: 7.38k]
  ------------------
 4238|  3.68M|		switch (h[i]) {
 4239|  46.7k|		case 'P':
  ------------------
  |  Branch (4239:3): [True: 46.7k, False: 3.63M]
  ------------------
 4240|  46.7k|			if (memcmp(h + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4240:8): [True: 528, False: 46.1k]
  ------------------
 4241|    528|				int ret = read_eocd(zip, h + i,
 4242|    528|				    current_offset + i);
 4243|       |				/* Zip64 EOCD locator precedes
 4244|       |				 * regular EOCD if present. */
 4245|    528|				if (i >= 20 && memcmp(h + i - 20, "PK\006\007", 4) == 0) {
  ------------------
  |  Branch (4245:9): [True: 524, False: 4]
  |  Branch (4245:20): [True: 250, False: 274]
  ------------------
 4246|    250|					int ret_zip64 = read_zip64_eocd(a, zip, h + i - 20);
 4247|    250|					if (ret_zip64 > ret)
  ------------------
  |  Branch (4247:10): [True: 24, False: 226]
  ------------------
 4248|     24|						ret = ret_zip64;
 4249|    250|				}
 4250|    528|				return (ret);
 4251|    528|			}
 4252|  46.1k|			i -= 4;
 4253|  46.1k|			break;
 4254|  16.1k|		case 'K': i -= 1; break;
  ------------------
  |  Branch (4254:3): [True: 16.1k, False: 3.66M]
  ------------------
 4255|  37.2k|		case 005: i -= 2; break;
  ------------------
  |  Branch (4255:3): [True: 37.2k, False: 3.64M]
  ------------------
 4256|  9.08k|		case 006: i -= 3; break;
  ------------------
  |  Branch (4256:3): [True: 9.08k, False: 3.67M]
  ------------------
 4257|  3.57M|		default: i -= 4; break;
  ------------------
  |  Branch (4257:3): [True: 3.57M, False: 109k]
  ------------------
 4258|  3.68M|		}
 4259|  3.68M|	}
 4260|  7.38k|	return 0;
 4261|  7.91k|}
archive_read_support_format_zip.c:read_eocd:
 4121|    528|{
 4122|    528|	uint16_t disk_num;
 4123|    528|	uint32_t cd_size, cd_offset;
 4124|       |
 4125|    528|	disk_num = archive_le16dec(p + 4);
 4126|    528|	cd_size = archive_le32dec(p + 12);
 4127|    528|	cd_offset = archive_le32dec(p + 16);
 4128|       |
 4129|       |	/* Sanity-check the EOCD we've found. */
 4130|       |
 4131|       |	/* This must be the first volume. */
 4132|    528|	if (disk_num != 0)
  ------------------
  |  Branch (4132:6): [True: 267, False: 261]
  ------------------
 4133|    267|		return 0;
 4134|       |	/* Central directory must be on this volume. */
 4135|    261|	if (disk_num != archive_le16dec(p + 6))
  ------------------
  |  Branch (4135:6): [True: 17, False: 244]
  ------------------
 4136|     17|		return 0;
 4137|       |	/* All central directory entries must be on this volume. */
 4138|    244|	if (archive_le16dec(p + 10) != archive_le16dec(p + 8))
  ------------------
  |  Branch (4138:6): [True: 8, False: 236]
  ------------------
 4139|      8|		return 0;
 4140|       |	/* Central directory can't extend beyond start of EOCD record. */
 4141|    236|	if ((int64_t)cd_offset + cd_size > current_offset)
  ------------------
  |  Branch (4141:6): [True: 36, False: 200]
  ------------------
 4142|     36|		return 0;
 4143|       |
 4144|       |	/* Save the central directory location for later use. */
 4145|    200|	zip->central_directory_offset = cd_offset;
 4146|    200|	zip->central_directory_offset_adjusted = current_offset - cd_size;
 4147|       |
 4148|       |	/* This is just a tiny bit higher than the maximum
 4149|       |	   returned by the streaming Zip bidder.  This ensures
 4150|       |	   that the more accurate seeking Zip parser wins
 4151|       |	   whenever seek is available. */
 4152|    200|	return 32;
 4153|    236|}
archive_read_support_format_zip.c:read_zip64_eocd:
 4161|    250|{
 4162|    250|	int64_t eocd64_offset;
 4163|    250|	int64_t eocd64_size;
 4164|       |
 4165|       |	/* Sanity-check the locator record. */
 4166|       |
 4167|       |	/* Central dir must be on first volume. */
 4168|    250|	if (archive_le32dec(p + 4) != 0)
  ------------------
  |  Branch (4168:6): [True: 15, False: 235]
  ------------------
 4169|     15|		return 0;
 4170|       |	/* Must be only a single volume. */
 4171|    235|	if (archive_le32dec(p + 16) != 1)
  ------------------
  |  Branch (4171:6): [True: 8, False: 227]
  ------------------
 4172|      8|		return 0;
 4173|       |
 4174|       |	/* Find the Zip64 EOCD record. */
 4175|    227|	eocd64_offset = archive_le64dec(p + 8);
 4176|    227|	if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
  ------------------
  |  Branch (4176:6): [True: 36, False: 191]
  ------------------
 4177|     36|		return 0;
 4178|    191|	if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
  ------------------
  |  Branch (4178:6): [True: 1, False: 190]
  ------------------
 4179|      1|		return 0;
 4180|       |	/* Make sure we can read all of it. */
 4181|    190|	eocd64_size = archive_le64dec(p + 4) + 12;
 4182|    190|	if (eocd64_size < 56 || eocd64_size > 16384)
  ------------------
  |  Branch (4182:6): [True: 40, False: 150]
  |  Branch (4182:26): [True: 42, False: 108]
  ------------------
 4183|     82|		return 0;
 4184|    108|	if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
  ------------------
  |  Branch (4184:6): [True: 4, False: 104]
  ------------------
 4185|      4|		return 0;
 4186|       |
 4187|       |	/* Sanity-check the EOCD64 */
 4188|    104|	if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
  ------------------
  |  Branch (4188:6): [True: 27, False: 77]
  ------------------
 4189|     27|		return 0;
 4190|     77|	if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
  ------------------
  |  Branch (4190:6): [True: 13, False: 64]
  ------------------
 4191|     13|		return 0;
 4192|       |	/* CD can't be split. */
 4193|     64|	if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
  ------------------
  |  Branch (4193:6): [True: 40, False: 24]
  ------------------
 4194|     40|		return 0;
 4195|       |
 4196|       |	/* Save the central directory offset for later use. */
 4197|     24|	zip->central_directory_offset = archive_le64dec(p + 48);
 4198|       |	/* TODO: Needs scanning backwards to find the eocd64 instead of assuming */
 4199|     24|	zip->central_directory_offset_adjusted = zip->central_directory_offset;
 4200|       |
 4201|     24|	return 32;
 4202|     64|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_read_header:
 4763|    511|{
 4764|    511|	struct zip *zip = a->format->data;
 4765|    511|	struct zip_entry *rsrc;
 4766|    511|	int64_t offset;
 4767|    511|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  234|    511|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4768|       |
 4769|       |	/*
 4770|       |	 * It should be sufficient to call archive_read_next_header() for
 4771|       |	 * a reader to determine if an entry is encrypted or not. If the
 4772|       |	 * encryption of an entry is only detectable when calling
 4773|       |	 * archive_read_data(), so be it. We'll do the same check there
 4774|       |	 * as well.
 4775|       |	 */
 4776|    511|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (4776:6): [True: 223, False: 288]
  ------------------
 4777|    511|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  416|    511|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4778|    223|		zip->has_encrypted_entries = 0;
 4779|       |
 4780|    511|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  379|    511|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 4781|    511|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (4781:6): [True: 223, False: 288]
  ------------------
 4782|    223|		a->archive.archive_format_name = "ZIP";
 4783|       |
 4784|    511|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (4784:6): [True: 223, False: 288]
  ------------------
 4785|    223|		r = slurp_central_directory(a, entry, zip);
 4786|    223|		if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    223|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4786:7): [True: 77, False: 146]
  ------------------
 4787|     77|			return r;
 4788|       |		/* Get first entry whose local header offset is lower than
 4789|       |		 * other entries in the archive file. */
 4790|    146|		zip->entry =
 4791|    146|		    (struct zip_entry *)ARCHIVE_RB_TREE_MIN(&zip->tree);
  ------------------
  |  |   49|    146|    __archive_rb_tree_iterate((T), NULL, ARCHIVE_RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|    146|#define	ARCHIVE_RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
 4792|    288|	} else if (zip->entry != NULL) {
  ------------------
  |  Branch (4792:13): [True: 288, False: 0]
  ------------------
 4793|       |		/* Get next entry in local header offset order. */
 4794|    288|		zip->entry = (struct zip_entry *)__archive_rb_tree_iterate(
 4795|    288|		    &zip->tree, &zip->entry->node, ARCHIVE_RB_DIR_RIGHT);
  ------------------
  |  |   46|    288|#define	ARCHIVE_RB_DIR_RIGHT		1
  ------------------
 4796|    288|	}
 4797|       |
 4798|    434|	if (zip->entry == NULL)
  ------------------
  |  Branch (4798:6): [True: 99, False: 335]
  ------------------
 4799|     99|		return ARCHIVE_EOF;
  ------------------
  |  |  233|     99|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4800|       |
 4801|    335|	if (zip->entry->rsrcname.s)
  ------------------
  |  Branch (4801:6): [True: 0, False: 335]
  ------------------
 4802|      0|		rsrc = (struct zip_entry *)__archive_rb_tree_find_node(
 4803|      0|		    &zip->tree_rsrc, zip->entry->rsrcname.s);
 4804|    335|	else
 4805|    335|		rsrc = NULL;
 4806|       |
 4807|    335|	if (zip->cctx_valid)
  ------------------
  |  Branch (4807:6): [True: 0, False: 335]
  ------------------
 4808|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 4809|    335|	if (zip->hctx_valid)
  ------------------
  |  Branch (4809:6): [True: 0, False: 335]
  ------------------
 4810|      0|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |   95|      0|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 4811|    335|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 4812|    335|	__archive_read_reset_passphrase(a);
 4813|       |
 4814|       |	/* File entries are sorted by the header offset, we should mostly
 4815|       |	 * use __archive_read_consume to advance a read point to avoid
 4816|       |	 * redundant data reading.  */
 4817|    335|	offset = archive_filter_bytes(&a->archive, 0);
 4818|    335|	if (offset < zip->entry->local_header_offset)
  ------------------
  |  Branch (4818:6): [True: 51, False: 284]
  ------------------
 4819|     51|		__archive_read_consume(a,
 4820|     51|		    zip->entry->local_header_offset - offset);
 4821|    284|	else if (offset != zip->entry->local_header_offset) {
  ------------------
  |  Branch (4821:11): [True: 101, False: 183]
  ------------------
 4822|    101|		__archive_read_seek(a, zip->entry->local_header_offset,
 4823|    101|		    SEEK_SET);
 4824|    101|	}
 4825|    335|	zip->unconsumed = 0;
 4826|    335|	r = zip_read_local_file_header(a, entry, zip);
 4827|    335|	if (r != ARCHIVE_OK)
  ------------------
  |  |  234|    335|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4827:6): [True: 116, False: 219]
  ------------------
 4828|    116|		return r;
 4829|    219|	if (rsrc) {
  ------------------
  |  Branch (4829:6): [True: 0, False: 219]
  ------------------
 4830|      0|		int ret2 = zip_read_mac_metadata(a, entry, rsrc);
 4831|      0|		if (ret2 < ret)
  ------------------
  |  Branch (4831:7): [True: 0, False: 0]
  ------------------
 4832|      0|			ret = ret2;
 4833|      0|	}
 4834|    219|	return (ret);
 4835|    335|}
archive_read_support_format_zip.c:slurp_central_directory:
 4358|    223|{
 4359|    223|	ssize_t i;
 4360|    223|	unsigned found;
 4361|    223|	int64_t correction;
 4362|    223|	ssize_t bytes_avail;
 4363|    223|	const char *p;
 4364|       |
 4365|       |	/*
 4366|       |	 * Find the start of the central directory.  The end-of-CD
 4367|       |	 * record has our starting point, but there are lots of
 4368|       |	 * Zip archives which have had other data prepended to the
 4369|       |	 * file, which makes the recorded offsets all too small.
 4370|       |	 * So we search forward from the specified offset until we
 4371|       |	 * find the real start of the central directory.  Then we
 4372|       |	 * know the correction we need to apply to account for leading
 4373|       |	 * padding.
 4374|       |	 */
 4375|    223|	if (__archive_read_seek(a, zip->central_directory_offset_adjusted, SEEK_SET)
  ------------------
  |  Branch (4375:6): [True: 7, False: 216]
  ------------------
 4376|    223|		< 0)
 4377|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  240|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4378|       |
 4379|    216|	found = 0;
 4380|    432|	while (!found) {
  ------------------
  |  Branch (4380:9): [True: 217, False: 215]
  ------------------
 4381|    217|		if ((p = __archive_read_ahead(a, 20, &bytes_avail)) == NULL) {
  ------------------
  |  Branch (4381:7): [True: 1, False: 216]
  ------------------
 4382|      1|			archive_set_error(&a->archive,
 4383|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4384|      1|			    "Truncated ZIP central directory");
 4385|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4386|      1|		}
 4387|  44.4k|		for (found = 0, i = 0; !found && i < bytes_avail - 4;) {
  ------------------
  |  Branch (4387:26): [True: 44.2k, False: 215]
  |  Branch (4387:36): [True: 44.2k, False: 1]
  ------------------
 4388|  44.2k|			switch (p[i + 3]) {
 4389|    848|			case 'P': i += 3; break;
  ------------------
  |  Branch (4389:4): [True: 848, False: 43.3k]
  ------------------
 4390|    611|			case 'K': i += 2; break;
  ------------------
  |  Branch (4390:4): [True: 611, False: 43.6k]
  ------------------
 4391|    725|			case 001: i += 1; break;
  ------------------
  |  Branch (4391:4): [True: 725, False: 43.5k]
  ------------------
 4392|    748|			case 002:
  ------------------
  |  Branch (4392:4): [True: 748, False: 43.4k]
  ------------------
 4393|    748|				if (memcmp(p + i, "PK\001\002", 4) == 0) {
  ------------------
  |  Branch (4393:9): [True: 169, False: 579]
  ------------------
 4394|    169|					p += i;
 4395|    169|					found = 1;
 4396|    169|				} else
 4397|    579|					i += 4;
 4398|    748|				break;
 4399|    321|			case 005: i += 1; break;
  ------------------
  |  Branch (4399:4): [True: 321, False: 43.9k]
  ------------------
 4400|    397|			case 006:
  ------------------
  |  Branch (4400:4): [True: 397, False: 43.8k]
  ------------------
 4401|    397|				if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4401:9): [True: 45, False: 352]
  ------------------
 4402|     45|					p += i;
 4403|     45|					found = 1;
 4404|    352|				} else if (memcmp(p + i, "PK\006\006", 4) == 0) {
  ------------------
  |  Branch (4404:16): [True: 1, False: 351]
  ------------------
 4405|      1|					p += i;
 4406|      1|					found = 1;
 4407|      1|				} else
 4408|    351|					i += 1;
 4409|    397|				break;
 4410|  40.5k|			default: i += 4; break;
  ------------------
  |  Branch (4410:4): [True: 40.5k, False: 3.65k]
  ------------------
 4411|  44.2k|			}
 4412|  44.2k|		}
 4413|    216|		__archive_read_consume(a, i);
 4414|    216|	}
 4415|    215|	correction = archive_filter_bytes(&a->archive, 0)
 4416|    215|			- zip->central_directory_offset;
 4417|       |
 4418|    215|	__archive_rb_tree_init(&zip->tree, &rb_ops);
 4419|    215|	__archive_rb_tree_init(&zip->tree_rsrc, &rb_rsrc_ops);
 4420|       |
 4421|  1.65k|	while (1) {
  ------------------
  |  Branch (4421:9): [True: 1.65k, Folded]
  ------------------
 4422|  1.65k|		struct zip_entry *zip_entry;
 4423|  1.65k|		size_t filename_length, extra_length, comment_length;
 4424|  1.65k|		uint32_t external_attributes;
 4425|  1.65k|		const char *name, *r;
 4426|       |
 4427|  1.65k|		if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (4427:7): [True: 2, False: 1.65k]
  ------------------
 4428|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4429|  1.65k|		if (memcmp(p, "PK\006\006", 4) == 0
  ------------------
  |  Branch (4429:7): [True: 11, False: 1.63k]
  ------------------
 4430|  1.63k|		    || memcmp(p, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4430:10): [True: 135, False: 1.50k]
  ------------------
 4431|    146|			break;
 4432|  1.50k|		} else if (memcmp(p, "PK\001\002", 4) != 0) {
  ------------------
  |  Branch (4432:14): [True: 34, False: 1.47k]
  ------------------
 4433|     34|			archive_set_error(&a->archive,
 4434|     34|			    -1, "Invalid central directory signature");
 4435|     34|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     34|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4436|     34|		}
 4437|  1.47k|		if ((p = __archive_read_ahead(a, 46, NULL)) == NULL)
  ------------------
  |  Branch (4437:7): [True: 1, False: 1.46k]
  ------------------
 4438|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4439|       |
 4440|  1.46k|		zip_entry = calloc(1, sizeof(struct zip_entry));
 4441|  1.46k|		if (zip_entry == NULL) {
  ------------------
  |  Branch (4441:7): [True: 0, False: 1.46k]
  ------------------
 4442|      0|			archive_set_error(&a->archive, ENOMEM,
 4443|      0|				"Can't allocate zip entry");
 4444|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4445|      0|		}
 4446|  1.46k|		zip_entry->next = zip->zip_entries;
 4447|  1.46k|		zip_entry->flags |= LA_FROM_CENTRAL_DIRECTORY;
  ------------------
  |  |  147|  1.46k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
 4448|  1.46k|		zip->zip_entries = zip_entry;
 4449|       |
 4450|       |		/* version = p[4]; */
 4451|  1.46k|		zip_entry->system = p[5];
 4452|       |		/* version_required = archive_le16dec(p + 6); */
 4453|  1.46k|		zip_entry->zip_flags = archive_le16dec(p + 8);
 4454|  1.46k|		if (zip_entry->zip_flags
  ------------------
  |  Branch (4454:7): [True: 239, False: 1.23k]
  ------------------
 4455|  1.46k|		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  137|  1.46k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  139|  1.46k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
 4456|    239|			zip->has_encrypted_entries = 1;
 4457|    239|		}
 4458|  1.46k|		zip_entry->compression = (char)archive_le16dec(p + 10);
 4459|  1.46k|		zip_entry->mtime = __archive_dos_to_unix(archive_le32dec(p + 12));
 4460|  1.46k|		zip_entry->crc32 = archive_le32dec(p + 16);
 4461|  1.46k|		if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  138|  1.46k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (4461:7): [True: 221, False: 1.24k]
  ------------------
 4462|    221|			zip_entry->decdat = p[13];
 4463|  1.24k|		else
 4464|  1.24k|			zip_entry->decdat = p[19];
 4465|  1.46k|		zip_entry->compressed_size = archive_le32dec(p + 20);
 4466|  1.46k|		zip_entry->uncompressed_size = archive_le32dec(p + 24);
 4467|  1.46k|		filename_length = archive_le16dec(p + 28);
 4468|  1.46k|		extra_length = archive_le16dec(p + 30);
 4469|  1.46k|		comment_length = archive_le16dec(p + 32);
 4470|       |		/* disk_start = archive_le16dec(p + 34);
 4471|       |		 *   Better be zero.
 4472|       |		 * internal_attributes = archive_le16dec(p + 36);
 4473|       |		 *   text bit */
 4474|  1.46k|		external_attributes = archive_le32dec(p + 38);
 4475|  1.46k|		zip_entry->local_header_offset =
 4476|  1.46k|		    archive_le32dec(p + 42) + correction;
 4477|       |
 4478|       |		/* If we can't guess the mode, leave it zero here;
 4479|       |		   when we read the local file header we might get
 4480|       |		   more information. */
 4481|  1.46k|		if (zip_entry->system == 3) {
  ------------------
  |  Branch (4481:7): [True: 558, False: 911]
  ------------------
 4482|    558|			zip_entry->mode = external_attributes >> 16;
 4483|    911|		} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (4483:14): [True: 729, False: 182]
  ------------------
 4484|       |			// Interpret MSDOS directory bit
 4485|    729|			if (0x10 == (external_attributes & 0x10)) {
  ------------------
  |  Branch (4485:8): [True: 210, False: 519]
  ------------------
 4486|    210|				zip_entry->mode = AE_IFDIR | 0775;
  ------------------
  |  |  221|    210|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 4487|    519|			} else {
 4488|    519|				zip_entry->mode = AE_IFREG | 0664;
  ------------------
  |  |  216|    519|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 4489|    519|			}
 4490|    729|			if (0x01 == (external_attributes & 0x01)) {
  ------------------
  |  Branch (4490:8): [True: 53, False: 676]
  ------------------
 4491|       |				// Read-only bit; strip write permissions
 4492|     53|				zip_entry->mode &= 0555;
 4493|     53|			}
 4494|    729|		} else {
 4495|    182|			zip_entry->mode = 0;
 4496|    182|		}
 4497|       |
 4498|       |		/* We're done with the regular data; get the filename and
 4499|       |		 * extra data. */
 4500|  1.46k|		__archive_read_consume(a, 46);
 4501|  1.46k|		p = __archive_read_ahead(a, filename_length + extra_length,
 4502|  1.46k|			NULL);
 4503|  1.46k|		if (p == NULL) {
  ------------------
  |  Branch (4503:7): [True: 13, False: 1.45k]
  ------------------
 4504|     13|			archive_set_error(&a->archive,
 4505|     13|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4506|     13|			    "Truncated ZIP file header");
 4507|     13|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4508|     13|		}
 4509|  1.45k|		if (ARCHIVE_OK != process_extra(a, entry, p + filename_length,
  ------------------
  |  |  234|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4509:7): [True: 19, False: 1.43k]
  ------------------
 4510|  1.45k|		    extra_length, zip_entry)) {
 4511|     19|			return ARCHIVE_FATAL;
  ------------------
  |  |  240|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4512|     19|		}
 4513|       |
 4514|       |		/*
 4515|       |		 * Mac resource fork files are stored under the
 4516|       |		 * "__MACOSX/" directory, so we should check if
 4517|       |		 * it is.
 4518|       |		 */
 4519|  1.43k|		if (!zip->process_mac_extensions) {
  ------------------
  |  Branch (4519:7): [True: 1.43k, False: 0]
  ------------------
 4520|       |			/* Treat every entry as a regular entry. */
 4521|  1.43k|			__archive_rb_tree_insert_node(&zip->tree,
 4522|  1.43k|			    &zip_entry->node);
 4523|  1.43k|		} else {
 4524|      0|			name = p;
 4525|      0|			r = rsrc_basename(name, filename_length);
 4526|      0|			if (filename_length >= 9 &&
  ------------------
  |  Branch (4526:8): [True: 0, False: 0]
  ------------------
 4527|      0|			    strncmp("__MACOSX/", name, 9) == 0) {
  ------------------
  |  Branch (4527:8): [True: 0, False: 0]
  ------------------
 4528|      0|				const char *name_end;
 4529|       |
 4530|      0|				name_end = name + filename_length;
 4531|       |				/* If this file is not a resource fork nor
 4532|       |				 * a directory. We should treat it as a non
 4533|       |				 * resource fork file to expose it. */
 4534|      0|				if (name[filename_length-1] != '/' &&
  ------------------
  |  Branch (4534:9): [True: 0, False: 0]
  ------------------
 4535|      0|				    (name_end - r < 2 || r[0] != '.' || r[1] != '_')) {
  ------------------
  |  Branch (4535:10): [True: 0, False: 0]
  |  Branch (4535:30): [True: 0, False: 0]
  |  Branch (4535:45): [True: 0, False: 0]
  ------------------
 4536|      0|					__archive_rb_tree_insert_node(
 4537|      0|					    &zip->tree, &zip_entry->node);
 4538|       |					/* Expose its parent directories. */
 4539|      0|					expose_parent_dirs(zip, name,
 4540|      0|					    filename_length);
 4541|      0|				} else {
 4542|       |					/* This file is a resource fork file or
 4543|       |					 * a directory. */
 4544|      0|					archive_strncpy(&(zip_entry->rsrcname),
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4545|      0|					     name, filename_length);
 4546|      0|					__archive_rb_tree_insert_node(
 4547|      0|					    &zip->tree_rsrc, &zip_entry->node);
 4548|      0|				}
 4549|      0|			} else {
 4550|       |				/* Generate resource fork name to find its
 4551|       |				 * resource file at zip->tree_rsrc. */
 4552|       |
 4553|       |				/* If this is an entry ending with slash,
 4554|       |				 * make the resource for name slash-less
 4555|       |				 * as the actual resource fork doesn't end with '/'.
 4556|       |				 */
 4557|      0|				size_t tmp_length = filename_length;
 4558|      0|				if (tmp_length > 0 && name[tmp_length - 1] == '/') {
  ------------------
  |  Branch (4558:9): [True: 0, False: 0]
  |  Branch (4558:27): [True: 0, False: 0]
  ------------------
 4559|      0|					tmp_length--;
 4560|      0|					r = rsrc_basename(name, tmp_length);
 4561|      0|				}
 4562|       |
 4563|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4564|      0|				    "__MACOSX/");
 4565|      0|				archive_strncat(&(zip_entry->rsrcname),
 4566|      0|				    name, r - name);
 4567|      0|				archive_strcat(&(zip_entry->rsrcname), "._");
 4568|      0|				archive_strncat(&(zip_entry->rsrcname),
 4569|      0|				    name + (r - name),
 4570|      0|				    tmp_length - (r - name));
 4571|       |				/* Register an entry to RB tree to sort it by
 4572|       |				 * file offset. */
 4573|      0|				__archive_rb_tree_insert_node(&zip->tree,
 4574|      0|				    &zip_entry->node);
 4575|      0|			}
 4576|      0|		}
 4577|       |
 4578|       |		/* Skip the comment too ... */
 4579|  1.43k|		__archive_read_consume(a,
 4580|  1.43k|		    filename_length + extra_length + comment_length);
 4581|  1.43k|	}
 4582|       |
 4583|    146|	return ARCHIVE_OK;
  ------------------
  |  |  234|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4584|    215|}
archive_read_support_format_zip.c:cmp_node:
 4268|  6.37k|{
 4269|  6.37k|	const struct zip_entry *e1 = (const struct zip_entry *)n1;
 4270|  6.37k|	const struct zip_entry *e2 = (const struct zip_entry *)n2;
 4271|       |
 4272|  6.37k|	if (e1->local_header_offset > e2->local_header_offset)
  ------------------
  |  Branch (4272:6): [True: 803, False: 5.57k]
  ------------------
 4273|    803|		return -1;
 4274|  5.57k|	if (e1->local_header_offset < e2->local_header_offset)
  ------------------
  |  Branch (4274:6): [True: 5.33k, False: 243]
  ------------------
 4275|  5.33k|		return 1;
 4276|    243|	return 0;
 4277|  5.57k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_seekable:
 4843|    288|{
 4844|    288|	struct zip *zip = a->format->data;
 4845|       |
 4846|    288|	zip->unconsumed = 0;
 4847|    288|	return (ARCHIVE_OK);
  ------------------
  |  |  234|    288|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4848|    288|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_seekable:
 4104|    446|{
 4105|    446|	(void)a; /* UNUSED */
 4106|    446|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  403|    446|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 4107|    446|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  404|    446|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 4108|    446|}

archive_array_append:
  251|    362|{
  252|    362|	return archive_string_append(as, p, s);
  253|    362|}
archive_string_concat:
  257|    755|{
  258|    755|	if (archive_string_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (258:6): [True: 0, False: 755]
  ------------------
  259|      0|		__archive_errx(1, "Out of memory");
  260|    755|}
archive_wstring_concat:
  265|  8.61k|{
  266|  8.61k|	if (archive_wstring_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (266:6): [True: 0, False: 8.61k]
  ------------------
  267|      0|		__archive_errx(1, "Out of memory");
  268|  8.61k|}
archive_string_free:
  272|  33.8M|{
  273|  33.8M|	as->length = 0;
  274|  33.8M|	as->buffer_length = 0;
  275|  33.8M|	free(as->s);
  276|       |	as->s = NULL;
  277|  33.8M|}
archive_wstring_free:
  281|  10.6M|{
  282|  10.6M|	as->length = 0;
  283|  10.6M|	as->buffer_length = 0;
  284|  10.6M|	free(as->s);
  285|       |	as->s = NULL;
  286|  10.6M|}
archive_wstring_ensure:
  290|   646k|{
  291|   646k|	size_t ws;
  292|       |
  293|   646k|	if (archive_ckd_mul_size(&ws, s, sizeof(wchar_t))) {
  ------------------
  |  Branch (293:6): [True: 0, False: 646k]
  ------------------
  294|       |		/* On failure, wipe the string and return NULL. */
  295|      0|		archive_wstring_free(as);
  296|      0|		errno = ENOMEM;/* Make sure errno has ENOMEM. */
  297|      0|		return (NULL);
  298|      0|	}
  299|       |
  300|   646k|	return (struct archive_wstring *)
  301|   646k|		archive_string_ensure((struct archive_string *)as, ws);
  302|   646k|}
archive_string_ensure:
  307|  68.5M|{
  308|  68.5M|	char *p;
  309|  68.5M|	size_t new_length;
  310|       |
  311|       |	/* If buffer is already big enough, don't reallocate. */
  312|  68.5M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (312:6): [True: 66.4M, False: 2.15M]
  |  Branch (312:15): [True: 66.3M, False: 80.4k]
  ------------------
  313|  66.3M|		return (as);
  314|       |
  315|       |	/*
  316|       |	 * Growing the buffer at least exponentially ensures that
  317|       |	 * append operations are always linear in the number of
  318|       |	 * characters appended.  Using a smaller growth rate for
  319|       |	 * larger buffers reduces memory waste somewhat at the cost of
  320|       |	 * a larger constant factor.
  321|       |	 */
  322|  2.23M|	if (as->buffer_length < 32)
  ------------------
  |  Branch (322:6): [True: 2.15M, False: 80.4k]
  ------------------
  323|       |		/* Start with a minimum 32-character buffer. */
  324|  2.15M|		new_length = 32;
  325|  80.4k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (325:11): [True: 80.1k, False: 309]
  ------------------
  326|       |		/* Buffers under 8k are doubled for speed. */
  327|  80.1k|		new_length = as->buffer_length + as->buffer_length;
  328|    309|	else {
  329|       |		/* Buffers 8k and over grow by at least 25% each time. */
  330|    309|		if (archive_ckd_add_size(&new_length,
  ------------------
  |  Branch (330:7): [True: 0, False: 309]
  ------------------
  331|    309|		    as->buffer_length, as->buffer_length / 4)) {
  332|       |			/* On failure, wipe the string and return NULL. */
  333|      0|			archive_string_free(as);
  334|      0|			errno = ENOMEM;/* Make sure errno has ENOMEM. */
  335|      0|			return (NULL);
  336|      0|		}
  337|    309|	}
  338|       |	/*
  339|       |	 * The computation above is a lower limit to how much we'll
  340|       |	 * grow the buffer.  In any case, we have to grow it enough to
  341|       |	 * hold the request.
  342|       |	 */
  343|  2.23M|	if (new_length < s)
  ------------------
  |  Branch (343:6): [True: 1.45M, False: 777k]
  ------------------
  344|  1.45M|		new_length = s;
  345|       |	/* Now we can reallocate the buffer. */
  346|  2.23M|	p = realloc(as->s, new_length);
  347|  2.23M|	if (p == NULL) {
  ------------------
  |  Branch (347:6): [True: 0, False: 2.23M]
  ------------------
  348|       |		/* On failure, wipe the string and return NULL. */
  349|      0|		archive_string_free(as);
  350|      0|		errno = ENOMEM;/* Make sure errno has ENOMEM. */
  351|      0|		return (NULL);
  352|      0|	}
  353|       |
  354|  2.23M|	as->s = p;
  355|  2.23M|	as->buffer_length = new_length;
  356|  2.23M|	return (as);
  357|  2.23M|}
archive_strncat:
  368|   485k|{
  369|   485k|	size_t s;
  370|   485k|	const char *p, *pp;
  371|       |
  372|   485k|	p = (const char *)_p;
  373|       |
  374|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  375|   485k|	s = 0;
  376|   485k|	pp = p;
  377|   162M|	while (s < n && *pp) {
  ------------------
  |  Branch (377:9): [True: 162M, False: 233k]
  |  Branch (377:18): [True: 162M, False: 251k]
  ------------------
  378|   162M|		pp++;
  379|   162M|		s++;
  380|   162M|	}
  381|   485k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (381:6): [True: 0, False: 485k]
  ------------------
  382|      0|		__archive_errx(1, "Out of memory");
  383|   485k|	return (as);
  384|   485k|}
archive_wstrncat:
  388|  7.12k|{
  389|  7.12k|	size_t s;
  390|  7.12k|	const wchar_t *pp;
  391|       |
  392|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  393|  7.12k|	s = 0;
  394|  7.12k|	pp = p;
  395|  76.5k|	while (s < n && *pp) {
  ------------------
  |  Branch (395:9): [True: 69.5k, False: 7.04k]
  |  Branch (395:18): [True: 69.4k, False: 84]
  ------------------
  396|  69.4k|		pp++;
  397|  69.4k|		s++;
  398|  69.4k|	}
  399|  7.12k|	if ((as = archive_wstring_append(as, p, s)) == NULL)
  ------------------
  |  Branch (399:6): [True: 0, False: 7.12k]
  ------------------
  400|      0|		__archive_errx(1, "Out of memory");
  401|  7.12k|	return (as);
  402|  7.12k|}
archive_strcat:
  406|   226k|{
  407|       |	/* strcat is just strncat without an effective limit. 
  408|       |	 * Assert that we'll never get called with a source
  409|       |	 * string over 16MB.
  410|       |	 * TODO: Review all uses of strcat in the source
  411|       |	 * and try to replace them with strncat().
  412|       |	 */
  413|   226k|	return archive_strncat(as, p, 0x1000000);
  414|   226k|}
archive_wstrcat:
  418|     84|{
  419|       |	/* Ditto. */
  420|     84|	return archive_wstrncat(as, p, 0x1000000);
  421|     84|}
archive_strappend_char:
  425|  56.6M|{
  426|  56.6M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (426:6): [True: 0, False: 56.6M]
  ------------------
  427|      0|		__archive_errx(1, "Out of memory");
  428|  56.6M|	return (as);
  429|  56.6M|}
archive_wstrappend_wchar:
  433|     84|{
  434|     84|	if ((as = archive_wstring_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (434:6): [True: 0, False: 84]
  ------------------
  435|      0|		__archive_errx(1, "Out of memory");
  436|     84|	return (as);
  437|     84|}
archive_wstring_append_from_mbs:
  631|   610k|{
  632|   610k|	size_t r;
  633|   610k|	int ret_val = 0;
  634|       |	/*
  635|       |	 * No single byte will be more than one wide character,
  636|       |	 * so this length estimate will always be big enough.
  637|       |	 */
  638|       |	// size_t wcs_length = len;
  639|   610k|	size_t mbs_length = len;
  640|   610k|	const char *mbs = p;
  641|   610k|	wchar_t *wcs;
  642|   610k|#if HAVE_MBRTOWC
  643|   610k|	mbstate_t shift_state;
  644|       |
  645|   610k|	memset(&shift_state, 0, sizeof(shift_state));
  646|   610k|#endif
  647|       |	/*
  648|       |	 * As we decided to have wcs_length == mbs_length == len
  649|       |	 * we can use len here instead of wcs_length
  650|       |	 */
  651|   610k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (651:6): [True: 0, False: 610k]
  ------------------
  652|      0|		return (-1);
  653|   610k|	wcs = dest->s + dest->length;
  654|       |	/*
  655|       |	 * We cannot use mbsrtowcs/mbstowcs here because those may convert
  656|       |	 * extra MBS when strlen(p) > len and one wide character consists of
  657|       |	 * multi bytes.
  658|       |	 */
  659|  43.1M|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (659:9): [True: 42.5M, False: 577k]
  |  Branch (659:17): [True: 42.5M, False: 0]
  ------------------
  660|       |		/*
  661|       |		 * The buffer we allocated is always big enough.
  662|       |		 * Keep this code path in a comment if we decide to choose
  663|       |		 * smaller wcs_length in the future
  664|       |		 */
  665|       |/*
  666|       |		if (wcs_length == 0) {
  667|       |			dest->length = wcs - dest->s;
  668|       |			dest->s[dest->length] = L'\0';
  669|       |			wcs_length = mbs_length;
  670|       |			if (NULL == archive_wstring_ensure(dest,
  671|       |			    dest->length + wcs_length + 1))
  672|       |				return (-1);
  673|       |			wcs = dest->s + dest->length;
  674|       |		}
  675|       |*/
  676|  42.5M|#if HAVE_MBRTOWC
  677|  42.5M|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  678|       |#else
  679|       |		r = mbtowc(wcs, mbs, mbs_length);
  680|       |#endif
  681|  42.5M|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (681:7): [True: 33.4k, False: 42.5M]
  |  Branch (681:26): [True: 0, False: 42.5M]
  ------------------
  682|  33.4k|			ret_val = -1;
  683|  33.4k|			break;
  684|  33.4k|		}
  685|  42.5M|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (685:7): [True: 0, False: 42.5M]
  |  Branch (685:17): [True: 0, False: 42.5M]
  ------------------
  686|      0|			break;
  687|  42.5M|		wcs++;
  688|       |		// wcs_length--;
  689|  42.5M|		mbs += r;
  690|  42.5M|		mbs_length -= r;
  691|  42.5M|	}
  692|   610k|	dest->length = wcs - dest->s;
  693|   610k|	dest->s[dest->length] = L'\0';
  694|   610k|	return (ret_val);
  695|   610k|}
archive_string_append_from_wcs:
  842|  5.21k|{
  843|       |	/* We cannot use the standard wcstombs() here because it
  844|       |	 * cannot tell us how big the output buffer should be.  So
  845|       |	 * I've built a loop around wcrtomb() or wctomb() that
  846|       |	 * converts a character at a time and resizes the string as
  847|       |	 * needed.  We prefer wcrtomb() when it's available because
  848|       |	 * it's thread-safe. */
  849|  5.21k|	int n, ret_val = 0;
  850|  5.21k|	char *p;
  851|  5.21k|	char *end;
  852|  5.21k|#if HAVE_WCRTOMB
  853|  5.21k|	mbstate_t shift_state;
  854|       |
  855|  5.21k|	memset(&shift_state, 0, sizeof(shift_state));
  856|       |#else
  857|       |	/* Clear the shift state before starting. */
  858|       |	wctomb(NULL, L'\0');
  859|       |#endif
  860|       |	/*
  861|       |	 * Allocate buffer for MBS.
  862|       |	 * We need this allocation here since it is possible that
  863|       |	 * as->s is still NULL.
  864|       |	 */
  865|  5.21k|	if (archive_string_ensure(as, as->length + len + 1) == NULL)
  ------------------
  |  Branch (865:6): [True: 0, False: 5.21k]
  ------------------
  866|      0|		return (-1);
  867|       |
  868|  5.21k|	p = as->s + as->length;
  869|  5.21k|	end = as->s + as->buffer_length - MB_CUR_MAX -1;
  870|  46.4k|	while (*w != L'\0' && len > 0) {
  ------------------
  |  Branch (870:9): [True: 41.1k, False: 5.21k]
  |  Branch (870:24): [True: 41.1k, False: 0]
  ------------------
  871|  41.1k|		if (p >= end) {
  ------------------
  |  Branch (871:7): [True: 647, False: 40.5k]
  ------------------
  872|    647|			as->length = p - as->s;
  873|    647|			as->s[as->length] = '\0';
  874|       |			/* Re-allocate buffer for MBS. */
  875|    647|			if (archive_string_ensure(as,
  ------------------
  |  Branch (875:8): [True: 0, False: 647]
  ------------------
  876|    647|			    as->length + max(len * 2,
  ------------------
  |  |   79|    647|#define max(a, b)       ((a)>(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (79:26): [True: 647, False: 0]
  |  |  ------------------
  ------------------
  877|    647|			    (size_t)MB_CUR_MAX) + 1) == NULL)
  878|      0|				return (-1);
  879|    647|			p = as->s + as->length;
  880|    647|			end = as->s + as->buffer_length - MB_CUR_MAX -1;
  881|    647|		}
  882|  41.1k|#if HAVE_WCRTOMB
  883|  41.1k|		n = wcrtomb(p, *w++, &shift_state);
  884|       |#else
  885|       |		n = wctomb(p, *w++);
  886|       |#endif
  887|  41.1k|		if (n == -1) {
  ------------------
  |  Branch (887:7): [True: 0, False: 41.1k]
  ------------------
  888|      0|			if (errno == EILSEQ) {
  ------------------
  |  Branch (888:8): [True: 0, False: 0]
  ------------------
  889|       |				/* Skip an illegal wide char. */
  890|      0|				*p++ = '?';
  891|      0|				ret_val = -1;
  892|      0|			} else {
  893|      0|				ret_val = -1;
  894|      0|				break;
  895|      0|			}
  896|      0|		} else
  897|  41.1k|			p += n;
  898|  41.1k|		len--;
  899|  41.1k|	}
  900|  5.21k|	as->length = p - as->s;
  901|  5.21k|	as->s[as->length] = '\0';
  902|  5.21k|	return (ret_val);
  903|  5.21k|}
archive_string_conversion_to_charset:
 1805|   575k|{
 1806|   575k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   90|   575k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1807|       |
 1808|   575k|	if (best_effort)
  ------------------
  |  Branch (1808:6): [True: 575k, False: 0]
  ------------------
 1809|   575k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   94|   575k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1810|   575k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1811|   575k|}
archive_string_conversion_from_charset:
 1816|  68.7k|{
 1817|  68.7k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   92|  68.7k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1818|       |
 1819|  68.7k|	if (best_effort)
  ------------------
  |  Branch (1819:6): [True: 68.7k, False: 0]
  ------------------
 1820|  68.7k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   94|  68.7k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1821|  68.7k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1822|  68.7k|}
archive_string_default_conversion_for_read:
 1878|  9.17k|{
 1879|  9.17k|	(void)a; /* UNUSED */
 1880|       |	return (NULL);
 1881|  9.17k|}
archive_string_conversion_free:
 1896|  20.1k|{
 1897|  20.1k|	struct archive_string_conv *sc; 
 1898|  20.1k|	struct archive_string_conv *sc_next; 
 1899|       |
 1900|  24.6k|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1900:22): [True: 4.47k, False: 20.1k]
  ------------------
 1901|  4.47k|		sc_next = sc->next;
 1902|  4.47k|		free_sconv_object(sc);
 1903|  4.47k|	}
 1904|  20.1k|	a->sconv = NULL;
 1905|  20.1k|	free(a->current_code);
 1906|       |	a->current_code = NULL;
 1907|  20.1k|}
archive_string_conversion_charset_name:
 1914|  7.28k|{
 1915|  7.28k|	if (sc == NULL) {
  ------------------
  |  Branch (1915:6): [True: 2, False: 7.28k]
  ------------------
 1916|      2|		return "current locale";
 1917|      2|	}
 1918|  7.28k|	if (sc->flag & SCONV_TO_CHARSET)
  ------------------
  |  |   90|  7.28k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1918:6): [True: 0, False: 7.28k]
  ------------------
 1919|      0|		return (sc->to_charset);
 1920|  7.28k|	else
 1921|  7.28k|		return (sc->from_charset);
 1922|  7.28k|}
archive_strncpy_l:
 2037|  1.21M|{
 2038|  1.21M|	as->length = 0;
 2039|  1.21M|	return (archive_strncat_l(as, _p, n, sc));
 2040|  1.21M|}
archive_strncat_l:
 2045|  1.21M|{
 2046|  1.21M|	const void *s;
 2047|  1.21M|	size_t length = 0;
 2048|  1.21M|	int i, r = 0, r2;
 2049|       |
 2050|  1.21M|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2050:6): [True: 1.21M, False: 0]
  |  Branch (2050:20): [True: 1.09M, False: 119k]
  ------------------
 2051|  1.09M|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  113|   576k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   576k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  111|   576k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2051:7): [True: 576k, False: 522k]
  |  Branch (2051:21): [True: 4.69k, False: 571k]
  ------------------
 2052|  4.69k|			length = utf16nbytes(_p, n);
 2053|  1.09M|		else
 2054|  1.09M|			length = mbsnbytes(_p, n);
 2055|  1.09M|	}
 2056|       |
 2057|       |	/* We must allocate memory even if there is no data for conversion
 2058|       |	 * or copy. This simulates archive_string_append behavior. */
 2059|  1.21M|	if (length == 0) {
  ------------------
  |  Branch (2059:6): [True: 160k, False: 1.05M]
  ------------------
 2060|   160k|		size_t tn = 1;
 2061|   160k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  112|  98.6k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  98.6k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  98.6k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2061:7): [True: 98.6k, False: 61.4k]
  |  Branch (2061:21): [True: 0, False: 98.6k]
  ------------------
 2062|      0|			tn = 2;
 2063|   160k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2063:7): [True: 0, False: 160k]
  ------------------
 2064|      0|			return (-1);
 2065|   160k|		as->s[as->length] = 0;
 2066|   160k|		if (tn == 2)
  ------------------
  |  Branch (2066:7): [True: 0, False: 160k]
  ------------------
 2067|      0|			as->s[as->length+1] = 0;
 2068|   160k|		return (0);
 2069|   160k|	}
 2070|       |
 2071|       |	/*
 2072|       |	 * If sc is NULL, we just make a copy.
 2073|       |	 */
 2074|  1.05M|	if (sc == NULL) {
  ------------------
  |  Branch (2074:6): [True: 484k, False: 574k]
  ------------------
 2075|   484k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2075:7): [True: 0, False: 484k]
  ------------------
 2076|      0|			return (-1);/* No memory */
 2077|   484k|		return (0);
 2078|   484k|	}
 2079|       |
 2080|   574k|	s = _p;
 2081|   574k|	i = 0;
 2082|   574k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2082:6): [True: 70.9k, False: 503k]
  ------------------
 2083|  70.9k|		sc->utftmp.length = 0;
 2084|  70.9k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2085|  70.9k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2085:7): [True: 48.2k, False: 22.6k]
  |  Branch (2085:18): [True: 0, False: 48.2k]
  ------------------
 2086|      0|			return (r2);
 2087|  70.9k|		if (r > r2)
  ------------------
  |  Branch (2087:7): [True: 48.2k, False: 22.6k]
  ------------------
 2088|  48.2k|			r = r2;
 2089|  70.9k|		s = sc->utftmp.s;
 2090|  70.9k|		length = sc->utftmp.length;
 2091|  70.9k|		++i;
 2092|  70.9k|	}
 2093|   574k|	r2 = sc->converter[i](as, s, length, sc);
 2094|   574k|	if (r > r2)
  ------------------
  |  Branch (2094:6): [True: 22.0k, False: 551k]
  ------------------
 2095|  22.0k|		r = r2;
 2096|   574k|	return (r);
 2097|   574k|}
archive_string_dirname:
 2101|  1.08k|{
 2102|       |	/* strip trailing separators */
 2103|  1.22k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2103:9): [True: 810, False: 419]
  |  Branch (2103:27): [True: 148, False: 662]
  ------------------
 2104|    148|		as->length--;
 2105|       |	/* strip final component */
 2106|  3.50k|	while (as->length > 0 && as->s[as->length - 1] != '/')
  ------------------
  |  Branch (2106:9): [True: 2.95k, False: 545]
  |  Branch (2106:27): [True: 2.42k, False: 536]
  ------------------
 2107|  2.42k|		as->length--;
 2108|       |	/* empty path -> cwd */
 2109|  1.08k|	if (as->length == 0)
  ------------------
  |  Branch (2109:6): [True: 545, False: 536]
  ------------------
 2110|    545|		return (archive_strcat(as, "."));
 2111|       |	/* strip separator(s) */
 2112|  1.07k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2112:9): [True: 919, False: 155]
  |  Branch (2112:27): [True: 538, False: 381]
  ------------------
 2113|    538|		as->length--;
 2114|       |	/* terminate */
 2115|    536|	as->s[as->length] = '\0';
 2116|    536|	return (as);
 2117|  1.08k|}
archive_mstring_clean:
 4004|  10.6M|{
 4005|  10.6M|	archive_wstring_free(&(aes->aes_wcs));
 4006|  10.6M|	archive_string_free(&(aes->aes_mbs));
 4007|  10.6M|	archive_string_free(&(aes->aes_utf8));
 4008|  10.6M|	archive_string_free(&(aes->aes_mbs_in_locale));
 4009|  10.6M|	aes->aes_set = 0;
 4010|  10.6M|}
archive_mstring_get_utf8:
 4024|   626k|{
 4025|   626k|	struct archive_string_conv *sc;
 4026|   626k|	int r;
 4027|       |
 4028|       |	/* If we already have a UTF8 form, return that immediately. */
 4029|   626k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   626k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4029:6): [True: 42.3k, False: 583k]
  ------------------
 4030|  42.3k|		*p = aes->aes_utf8.s;
 4031|  42.3k|		return (0);
 4032|  42.3k|	}
 4033|       |
 4034|   583k|	*p = NULL;
 4035|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4036|       |	/*
 4037|       |	 * On Windows, first try converting from WCS because (1) there's no
 4038|       |	 * guarantee that the conversion to MBS will succeed, e.g. when using
 4039|       |	 * CP_ACP, and (2) that's more efficient than converting to MBS, just to
 4040|       |	 * convert back to WCS again before finally converting to UTF-8
 4041|       |	 */
 4042|       |	if ((aes->aes_set & AES_SET_WCS) != 0) {
 4043|       |		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 4044|       |		if (sc == NULL)
 4045|       |			return (-1);/* Couldn't allocate memory for sc. */
 4046|       |		archive_string_empty(&(aes->aes_utf8));
 4047|       |		r = archive_string_append_from_wcs_in_codepage(&(aes->aes_utf8),
 4048|       |			aes->aes_wcs.s, aes->aes_wcs.length, sc);
 4049|       |		if (a == NULL)
 4050|       |			free_sconv_object(sc);
 4051|       |		if (r == 0) {
 4052|       |			aes->aes_set |= AES_SET_UTF8;
 4053|       |			*p = aes->aes_utf8.s;
 4054|       |			return (0);/* success. */
 4055|       |		} else
 4056|       |			return (-1);/* failure. */
 4057|       |	}
 4058|       |#endif
 4059|       |	/* Try converting WCS to MBS first if MBS does not exist yet. */
 4060|   583k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   583k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4060:6): [True: 7.84k, False: 575k]
  ------------------
 4061|  7.84k|		const char *pm; /* unused */
 4062|  7.84k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 4063|  7.84k|	}
 4064|   583k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   583k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4064:6): [True: 575k, False: 7.84k]
  ------------------
 4065|   575k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 4066|   575k|		if (sc == NULL)
  ------------------
  |  Branch (4066:7): [True: 0, False: 575k]
  ------------------
 4067|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4068|   575k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 4069|   575k|		    aes->aes_mbs.length, sc);
 4070|   575k|		if (a == NULL)
  ------------------
  |  Branch (4070:7): [True: 575k, False: 0]
  ------------------
 4071|   575k|			free_sconv_object(sc);
 4072|   575k|		if (r == 0) {
  ------------------
  |  Branch (4072:7): [True: 556k, False: 19.1k]
  ------------------
 4073|   556k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|   556k|#define	AES_SET_UTF8 2
  ------------------
 4074|   556k|			*p = aes->aes_utf8.s;
 4075|   556k|			return (0);/* success. */
 4076|   556k|		} else
 4077|  19.1k|			return (-1);/* failure. */
 4078|   575k|	}
 4079|  7.84k|	return (0);/* success. */
 4080|   583k|}
archive_mstring_get_mbs:
 4085|  2.50M|{
 4086|  2.50M|	struct archive_string_conv *sc;
 4087|  2.50M|	int r, ret = 0;
 4088|       |
 4089|       |	/* If we already have an MBS form, return that immediately. */
 4090|  2.50M|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  2.50M|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4090:6): [True: 1.49M, False: 1.00M]
  ------------------
 4091|  1.49M|		*p = aes->aes_mbs.s;
 4092|  1.49M|		return (ret);
 4093|  1.49M|	}
 4094|       |
 4095|  1.00M|	*p = NULL;
 4096|       |	/* If there's a WCS form, try converting with the native locale. */
 4097|  1.00M|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|  1.00M|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4097:6): [True: 5.21k, False: 1.00M]
  ------------------
 4098|  5.21k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  5.21k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4099|  5.21k|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 4100|  5.21k|		    aes->aes_wcs.s, aes->aes_wcs.length);
 4101|  5.21k|		*p = aes->aes_mbs.s;
 4102|  5.21k|		if (r == 0) {
  ------------------
  |  Branch (4102:7): [True: 5.21k, False: 0]
  ------------------
 4103|  5.21k|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|  5.21k|#define	AES_SET_MBS 1
  ------------------
 4104|  5.21k|			return (ret);
 4105|  5.21k|		} else
 4106|      0|			ret = -1;
 4107|  5.21k|	}
 4108|       |
 4109|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 4110|  1.00M|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  1.00M|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4110:6): [True: 6.67k, False: 995k]
  ------------------
 4111|  6.67k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  6.67k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4112|  6.67k|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4113|  6.67k|		if (sc == NULL)
  ------------------
  |  Branch (4113:7): [True: 0, False: 6.67k]
  ------------------
 4114|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4115|  6.67k|		r = archive_strncpy_l(&(aes->aes_mbs),
 4116|  6.67k|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4117|  6.67k|		if (a == NULL)
  ------------------
  |  Branch (4117:7): [True: 6.67k, False: 0]
  ------------------
 4118|  6.67k|			free_sconv_object(sc);
 4119|  6.67k|		*p = aes->aes_mbs.s;
 4120|  6.67k|		if (r == 0) {
  ------------------
  |  Branch (4120:7): [True: 0, False: 6.67k]
  ------------------
 4121|      0|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|      0|#define	AES_SET_MBS 1
  ------------------
 4122|      0|			ret = 0;/* success; overwrite previous error. */
 4123|      0|		} else
 4124|  6.67k|			ret = -1;/* failure. */
 4125|  6.67k|	}
 4126|  1.00M|	return (ret);
 4127|  1.00M|}
archive_mstring_get_wcs:
 4132|  1.14M|{
 4133|  1.14M|	int r, ret = 0;
 4134|       |
 4135|  1.14M|	(void)a;/* UNUSED */
 4136|       |	/* Return WCS form if we already have it. */
 4137|  1.14M|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|  1.14M|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4137:6): [True: 71.5k, False: 1.07M]
  ------------------
 4138|  71.5k|		*wp = aes->aes_wcs.s;
 4139|  71.5k|		return (ret);
 4140|  71.5k|	}
 4141|       |
 4142|  1.07M|	*wp = NULL;
 4143|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4144|       |	/*
 4145|       |	 * On Windows, prefer converting from UTF-8 directly to WCS because:
 4146|       |	 * (1) there's no guarantee that the string can be represented in MBS (e.g.
 4147|       |	 * with CP_ACP), and (2) in order to convert from UTF-8 to MBS, we're going
 4148|       |	 * to need to convert from UTF-8 to WCS anyway and its wasteful to throw
 4149|       |	 * away that intermediate result
 4150|       |	 */
 4151|       |	if (aes->aes_set & AES_SET_UTF8) {
 4152|       |		struct archive_string_conv *sc;
 4153|       |
 4154|       |		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4155|       |		if (sc != NULL) {
 4156|       |			archive_wstring_empty((&aes->aes_wcs));
 4157|       |			r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4158|       |			    aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4159|       |			if (a == NULL)
 4160|       |				free_sconv_object(sc);
 4161|       |			if (r == 0) {
 4162|       |				aes->aes_set |= AES_SET_WCS;
 4163|       |				*wp = aes->aes_wcs.s;
 4164|       |				return (0);
 4165|       |			}
 4166|       |		}
 4167|       |	}
 4168|       |#endif
 4169|       |	/* Try converting UTF8 to MBS first if MBS does not exist yet. */
 4170|  1.07M|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|  1.07M|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4170:6): [True: 487k, False: 590k]
  ------------------
 4171|   487k|		const char *p; /* unused */
 4172|   487k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4173|   487k|	}
 4174|       |	/* Try converting MBS to WCS using native locale. */
 4175|  1.07M|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  1.07M|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4175:6): [True: 590k, False: 487k]
  ------------------
 4176|   590k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   590k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4177|   590k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4178|   590k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4179|   590k|		if (r == 0) {
  ------------------
  |  Branch (4179:7): [True: 556k, False: 33.4k]
  ------------------
 4180|   556k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|   556k|#define	AES_SET_WCS 4
  ------------------
 4181|   556k|			*wp = aes->aes_wcs.s;
 4182|   556k|		} else
 4183|  33.4k|			ret = -1;/* failure. */
 4184|   590k|	}
 4185|  1.07M|	return (ret);
 4186|  1.14M|}
archive_mstring_copy_mbs:
 4256|  57.3k|{
 4257|  57.3k|	if (mbs == NULL) {
  ------------------
  |  Branch (4257:6): [True: 4.38k, False: 53.0k]
  ------------------
 4258|  4.38k|		aes->aes_set = 0;
 4259|  4.38k|		return (0);
 4260|  4.38k|	}
 4261|  53.0k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4262|  57.3k|}
archive_mstring_copy_mbs_len:
 4267|  70.8k|{
 4268|  70.8k|	if (mbs == NULL) {
  ------------------
  |  Branch (4268:6): [True: 0, False: 70.8k]
  ------------------
 4269|      0|		aes->aes_set = 0;
 4270|      0|		return (0);
 4271|      0|	}
 4272|  70.8k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  70.8k|#define	AES_SET_MBS 1
  ------------------
 4273|  70.8k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  70.8k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4274|  70.8k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  70.8k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4275|  70.8k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  70.8k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4276|  70.8k|	return (0);
 4277|  70.8k|}
archive_mstring_copy_wcs:
 4281|  5.71k|{
 4282|  5.71k|	return archive_mstring_copy_wcs_len(aes, wcs,
 4283|  5.71k|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4283:5): [True: 0, False: 5.71k]
  ------------------
 4284|  5.71k|}
archive_mstring_copy_wcs_len:
 4303|  5.71k|{
 4304|  5.71k|	if (wcs == NULL) {
  ------------------
  |  Branch (4304:6): [True: 0, False: 5.71k]
  ------------------
 4305|      0|		aes->aes_set = 0;
 4306|      0|		return (0);
 4307|      0|	}
 4308|  5.71k|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  222|  5.71k|#define	AES_SET_WCS 4
  ------------------
 4309|  5.71k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  5.71k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4310|  5.71k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  5.71k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4311|  5.71k|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|  5.71k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4312|  5.71k|	return (0);
 4313|  5.71k|}
archive_mstring_copy_mbs_len_l:
 4318|   584k|{
 4319|   584k|	int r;
 4320|       |
 4321|   584k|	if (mbs == NULL) {
  ------------------
  |  Branch (4321:6): [True: 4.35k, False: 579k]
  ------------------
 4322|  4.35k|		aes->aes_set = 0;
 4323|  4.35k|		return (0);
 4324|  4.35k|	}
 4325|   579k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|   579k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4326|   579k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   579k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4327|   579k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|   579k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4328|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4329|       |	/*
 4330|       |	 * Internationalization programming on Windows must use Wide
 4331|       |	 * characters because Windows platform cannot make locale UTF-8.
 4332|       |	 */
 4333|       |	if (sc == NULL) {
 4334|       |		if (archive_string_append(&(aes->aes_mbs),
 4335|       |			mbs, mbsnbytes(mbs, len)) == NULL) {
 4336|       |			aes->aes_set = 0;
 4337|       |			r = -1;
 4338|       |		} else {
 4339|       |			aes->aes_set = AES_SET_MBS;
 4340|       |			r = 0;
 4341|       |		}
 4342|       |#if defined(HAVE_ICONV)
 4343|       |	} else if (sc != NULL && sc->cd_w != (iconv_t)-1) {
 4344|       |		/*
 4345|       |		 * This case happens only when MultiByteToWideChar() cannot
 4346|       |		 * handle sc->from_cp, and we have to iconv in order to
 4347|       |		 * translate character-set to wchar_t,UTF-16.
 4348|       |		 */
 4349|       |		iconv_t cd = sc->cd;
 4350|       |		unsigned from_cp;
 4351|       |		int flag;
 4352|       |
 4353|       |		/*
 4354|       |		 * Translate multi-bytes from some character-set to UTF-8.
 4355|       |		 */ 
 4356|       |		sc->cd = sc->cd_w;
 4357|       |		r = archive_strncpy_l(&(aes->aes_utf8), mbs, len, sc);
 4358|       |		sc->cd = cd;
 4359|       |		if (r != 0) {
 4360|       |			aes->aes_set = 0;
 4361|       |			return (r);
 4362|       |		}
 4363|       |		aes->aes_set = AES_SET_UTF8;
 4364|       |
 4365|       |		/*
 4366|       |		 * Append the UTF-8 string into wstring.
 4367|       |		 */ 
 4368|       |		flag = sc->flag;
 4369|       |		sc->flag &= ~(SCONV_NORMALIZATION_C
 4370|       |				| SCONV_TO_UTF16| SCONV_FROM_UTF16);
 4371|       |		from_cp = sc->from_cp;
 4372|       |		sc->from_cp = CP_UTF8;
 4373|       |		r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4374|       |			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4375|       |		sc->flag = flag;
 4376|       |		sc->from_cp = from_cp;
 4377|       |		if (r == 0)
 4378|       |			aes->aes_set |= AES_SET_WCS;
 4379|       |#endif
 4380|       |	} else {
 4381|       |		r = archive_wstring_append_from_mbs_in_codepage(
 4382|       |		    &(aes->aes_wcs), mbs, len, sc);
 4383|       |		if (r == 0)
 4384|       |			aes->aes_set = AES_SET_WCS;
 4385|       |		else
 4386|       |			aes->aes_set = 0;
 4387|       |	}
 4388|       |#else
 4389|   579k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4390|   579k|	if (r == 0)
  ------------------
  |  Branch (4390:6): [True: 570k, False: 8.80k]
  ------------------
 4391|   570k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|   570k|#define	AES_SET_MBS 1
  ------------------
 4392|  8.80k|	else
 4393|  8.80k|		aes->aes_set = 0;
 4394|   579k|#endif
 4395|   579k|	return (r);
 4396|   584k|}
archive_mstring_update_utf8:
 4411|  56.2k|{
 4412|  56.2k|	struct archive_string_conv *sc;
 4413|  56.2k|	int r;
 4414|       |
 4415|  56.2k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4415:6): [True: 0, False: 56.2k]
  ------------------
 4416|      0|		aes->aes_set = 0;
 4417|      0|		return (0); /* Succeeded in clearing everything. */
 4418|      0|	}
 4419|       |
 4420|       |	/* Save the UTF8 string. */
 4421|  56.2k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  56.2k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|   112k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 56.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4422|       |
 4423|       |	/* Empty the mbs and wcs strings. */
 4424|  56.2k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  56.2k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4425|  56.2k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  56.2k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4426|       |
 4427|  56.2k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  56.2k|#define	AES_SET_UTF8 2
  ------------------
 4428|       |
 4429|  56.2k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4430|  56.2k|	if (sc == NULL)
  ------------------
  |  Branch (4430:6): [True: 0, False: 56.2k]
  ------------------
 4431|      0|		return (-1);/* Couldn't allocate memory for sc. */
 4432|       |
 4433|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4434|       |	/* On Windows, there's no good way to convert from UTF8 -> MBS directly, so
 4435|       |	 * prefer to first convert to WCS as (1) it's wasteful to throw away the
 4436|       |	 * intermediate result, and (2) WCS will still be set even if we fail to
 4437|       |	 * convert to MBS (e.g. with ACP that can't represent the characters) */
 4438|       |	r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4439|       |		aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4440|       |
 4441|       |	if (a == NULL)
 4442|       |		free_sconv_object(sc);
 4443|       |	if (r != 0)
 4444|       |		return (-1); /* This will guarantee we can't convert to MBS */
 4445|       |	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS; /* Both UTF8 and WCS set. */
 4446|       |
 4447|       |	/* Try converting WCS to MBS, return false on failure. */
 4448|       |	if (archive_string_append_from_wcs(&(aes->aes_mbs), aes->aes_wcs.s,
 4449|       |	    aes->aes_wcs.length))
 4450|       |		return (-1);
 4451|       |#else
 4452|       |	/* Try converting UTF-8 to MBS, return false on failure. */
 4453|  56.2k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  56.2k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 56.2k]
  |  |  ------------------
  ------------------
 4454|       |
 4455|  56.2k|	if (a == NULL)
  ------------------
  |  Branch (4455:6): [True: 56.2k, False: 0]
  ------------------
 4456|  56.2k|		free_sconv_object(sc);
 4457|  56.2k|	if (r != 0)
  ------------------
  |  Branch (4457:6): [True: 35.6k, False: 20.5k]
  ------------------
 4458|  35.6k|		return (-1);
 4459|  20.5k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  221|  20.5k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  220|  20.5k|#define	AES_SET_MBS 1
  ------------------
 4460|       |
 4461|       |	/* Try converting MBS to WCS, return false on failure. */
 4462|  20.5k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4462:6): [True: 0, False: 20.5k]
  ------------------
 4463|  20.5k|	    aes->aes_mbs.length))
 4464|      0|		return (-1);
 4465|  20.5k|#endif
 4466|       |
 4467|       |	/* All conversions succeeded. */
 4468|  20.5k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  221|  20.5k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  222|  20.5k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  220|  20.5k|#define	AES_SET_MBS 1
  ------------------
 4469|       |
 4470|  20.5k|	return (0);
 4471|  20.5k|}
archive_string.c:archive_string_append:
  227|  57.6M|{
  228|  57.6M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (228:6): [True: 0, False: 57.6M]
  ------------------
  229|      0|		return (NULL);
  230|  57.6M|	if (s)
  ------------------
  |  Branch (230:6): [True: 57.6M, False: 28.0k]
  ------------------
  231|  57.6M|		memmove(as->s + as->length, p, s);
  232|  57.6M|	as->length += s;
  233|  57.6M|	as->s[as->length] = 0;
  234|  57.6M|	return (as);
  235|  57.6M|}
archive_string.c:archive_wstring_append:
  239|  15.8k|{
  240|  15.8k|	if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (240:6): [True: 0, False: 15.8k]
  ------------------
  241|      0|		return (NULL);
  242|  15.8k|	if (s)
  ------------------
  |  Branch (242:6): [True: 10.2k, False: 5.54k]
  ------------------
  243|  10.2k|		wmemmove(as->s + as->length, p, s);
  244|  15.8k|	as->length += s;
  245|  15.8k|	as->s[as->length] = 0;
  246|  15.8k|	return (as);
  247|  15.8k|}
archive_string.c:get_sconv_object:
 1723|   644k|{
 1724|   644k|	struct archive_string_conv *sc;
 1725|   644k|	unsigned current_codepage;
 1726|       |
 1727|       |	/* Check if we have made the sconv object. */
 1728|   644k|	sc = find_sconv_object(a, fc, tc);
 1729|   644k|	if (sc != NULL)
  ------------------
  |  Branch (1729:6): [True: 1.36k, False: 643k]
  ------------------
 1730|  1.36k|		return (sc);
 1731|       |
 1732|   643k|	if (a == NULL)
  ------------------
  |  Branch (1732:6): [True: 638k, False: 4.47k]
  ------------------
 1733|   638k|		current_codepage = get_current_codepage();
 1734|  4.47k|	else
 1735|  4.47k|		current_codepage = a->current_codepage;
 1736|       |
 1737|   643k|	sc = create_sconv_object(canonical_charset_name(fc),
 1738|   643k|	    canonical_charset_name(tc), current_codepage, flag);
 1739|   643k|	if (sc == NULL) {
  ------------------
  |  Branch (1739:6): [True: 0, False: 643k]
  ------------------
 1740|      0|		if (a != NULL)
  ------------------
  |  Branch (1740:7): [True: 0, False: 0]
  ------------------
 1741|      0|			archive_set_error(a, ENOMEM,
 1742|      0|			    "Could not allocate memory for "
 1743|      0|			    "a string conversion object");
 1744|      0|		return (NULL);
 1745|      0|	}
 1746|       |
 1747|       |	/*
 1748|       |	 * If there is no converter for current string conversion object,
 1749|       |	 * we cannot handle this conversion.
 1750|       |	 */
 1751|   643k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1751:6): [True: 0, False: 643k]
  ------------------
 1752|      0|		if (a != NULL) {
  ------------------
  |  Branch (1752:7): [True: 0, False: 0]
  ------------------
 1753|      0|#if HAVE_ICONV
 1754|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1755|      0|			    "iconv_open failed: Cannot handle ``%s''",
 1756|      0|			    (flag & SCONV_TO_CHARSET)?tc:fc);
  ------------------
  |  |   90|      0|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1756:8): [True: 0, False: 0]
  ------------------
 1757|       |#else
 1758|       |			archive_set_error(a, ARCHIVE_ERRNO_MISC,
 1759|       |			    "A character-set conversion not fully supported "
 1760|       |			    "on this platform");
 1761|       |#endif
 1762|      0|		}
 1763|       |		/* Failed; free a sconv object. */
 1764|      0|		free_sconv_object(sc);
 1765|      0|		return (NULL);
 1766|      0|	}
 1767|       |
 1768|       |	/*
 1769|       |	 * Success!
 1770|       |	 */
 1771|   643k|	if (a != NULL)
  ------------------
  |  Branch (1771:6): [True: 4.47k, False: 638k]
  ------------------
 1772|  4.47k|		add_sconv_object(a, sc);
 1773|   643k|	return (sc);
 1774|   643k|}
archive_string.c:find_sconv_object:
  933|   644k|{
  934|   644k|	struct archive_string_conv *sc; 
  935|       |
  936|   644k|	if (a == NULL)
  ------------------
  |  Branch (936:6): [True: 638k, False: 5.83k]
  ------------------
  937|   638k|		return (NULL);
  938|       |
  939|  10.0k|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (939:22): [True: 5.52k, False: 4.47k]
  ------------------
  940|  5.52k|		if (strcmp(sc->from_charset, fc) == 0 &&
  ------------------
  |  Branch (940:7): [True: 1.36k, False: 4.16k]
  ------------------
  941|  1.36k|		    strcmp(sc->to_charset, tc) == 0)
  ------------------
  |  Branch (941:7): [True: 1.36k, False: 0]
  ------------------
  942|  1.36k|			break;
  943|  5.52k|	}
  944|  5.83k|	return (sc);
  945|   644k|}
archive_string.c:get_current_codepage:
 1701|   642k|{
 1702|   642k|	return (-1);/* Unknown */
 1703|   642k|}
archive_string.c:create_sconv_object:
 1194|   643k|{
 1195|   643k|	struct archive_string_conv *sc; 
 1196|       |
 1197|   643k|	sc = calloc(1, sizeof(*sc));
 1198|   643k|	if (sc == NULL)
  ------------------
  |  Branch (1198:6): [True: 0, False: 643k]
  ------------------
 1199|      0|		return (NULL);
 1200|   643k|	sc->next = NULL;
 1201|   643k|	sc->from_charset = strdup(fc);
 1202|   643k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1202:6): [True: 0, False: 643k]
  ------------------
 1203|      0|		free(sc);
 1204|      0|		return (NULL);
 1205|      0|	}
 1206|   643k|	sc->to_charset = strdup(tc);
 1207|   643k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1207:6): [True: 0, False: 643k]
  ------------------
 1208|      0|		free(sc->from_charset);
 1209|      0|		free(sc);
 1210|      0|		return (NULL);
 1211|      0|	}
 1212|   643k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|   643k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 643k]
  |  |  ------------------
  ------------------
 1213|       |
 1214|   643k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   90|   643k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1214:6): [True: 575k, False: 67.3k]
  ------------------
 1215|       |		/*
 1216|       |		 * Convert characters from the current locale charset to
 1217|       |		 * a specified charset.
 1218|       |		 */
 1219|   575k|		sc->from_cp = current_codepage;
 1220|   575k|		sc->to_cp = make_codepage_from_charset(tc);
 1221|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1222|       |		if (IsValidCodePage(sc->to_cp))
 1223|       |			flag |= SCONV_WIN_CP;
 1224|       |#endif
 1225|   575k|	} else if (flag & SCONV_FROM_CHARSET) {
  ------------------
  |  |   92|  67.3k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1225:13): [True: 67.3k, False: 0]
  ------------------
 1226|       |		/*
 1227|       |		 * Convert characters from a specified charset to
 1228|       |		 * the current locale charset.
 1229|       |		 */
 1230|  67.3k|		sc->to_cp = current_codepage;
 1231|  67.3k|		sc->from_cp = make_codepage_from_charset(fc);
 1232|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1233|       |		if (IsValidCodePage(sc->from_cp))
 1234|       |			flag |= SCONV_WIN_CP;
 1235|       |#endif
 1236|  67.3k|	}
 1237|       |
 1238|       |	/*
 1239|       |	 * Check if "from charset" and "to charset" are the same.
 1240|       |	 */
 1241|   643k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1241:6): [True: 0, False: 643k]
  ------------------
 1242|   643k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1242:7): [True: 0, False: 643k]
  |  Branch (1242:38): [True: 0, False: 0]
  ------------------
 1243|      0|		sc->same = 1;
 1244|   643k|	else
 1245|   643k|		sc->same = 0;
 1246|       |
 1247|       |	/*
 1248|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1249|       |	 */
 1250|   643k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1250:6): [True: 575k, False: 67.3k]
  ------------------
 1251|   575k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  106|   575k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1252|  67.3k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1252:11): [True: 0, False: 67.3k]
  ------------------
 1253|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  108|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1254|  67.3k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1254:11): [True: 0, False: 67.3k]
  ------------------
 1255|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  110|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1256|   643k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1256:6): [True: 66.2k, False: 577k]
  ------------------
 1257|  66.2k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  107|  66.2k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1258|   577k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1258:11): [True: 603, False: 576k]
  ------------------
 1259|    603|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  109|    603|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1260|   576k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1260:11): [True: 285, False: 576k]
  ------------------
 1261|    285|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  111|    285|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
 1262|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1263|       |	if (sc->to_cp == CP_UTF8)
 1264|       |		flag |= SCONV_TO_UTF8;
 1265|       |	else if (sc->to_cp == CP_UTF16BE)
 1266|       |		flag |= SCONV_TO_UTF16BE | SCONV_WIN_CP;
 1267|       |	else if (sc->to_cp == CP_UTF16LE)
 1268|       |		flag |= SCONV_TO_UTF16LE | SCONV_WIN_CP;
 1269|       |	if (sc->from_cp == CP_UTF8)
 1270|       |		flag |= SCONV_FROM_UTF8;
 1271|       |	else if (sc->from_cp == CP_UTF16BE)
 1272|       |		flag |= SCONV_FROM_UTF16BE | SCONV_WIN_CP;
 1273|       |	else if (sc->from_cp == CP_UTF16LE)
 1274|       |		flag |= SCONV_FROM_UTF16LE | SCONV_WIN_CP;
 1275|       |#endif
 1276|       |
 1277|       |	/*
 1278|       |	 * Set a flag for Unicode NFD. Usually iconv cannot correctly
 1279|       |	 * handle it. So we have to translate NFD characters to NFC ones
 1280|       |	 * ourselves before iconv handles. Another reason is to prevent
 1281|       |	 * that the same sight of two filenames, one is NFC and other
 1282|       |	 * is NFD, would be in its directory.
 1283|       |	 * On Mac OS X, although its filesystem layer automatically
 1284|       |	 * convert filenames to NFD, it would be useful for filename
 1285|       |	 * comparing to find out the same filenames that we normalize
 1286|       |	 * that to be NFD ourselves.
 1287|       |	 */
 1288|   643k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   92|   643k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1288:6): [True: 67.3k, False: 575k]
  ------------------
 1289|  67.3k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  113|  67.3k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  67.3k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  111|  67.3k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  107|  67.3k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1289:6): [True: 67.1k, False: 281]
  ------------------
 1290|       |#if defined(__APPLE__)
 1291|       |		if (flag & SCONV_TO_UTF8)
 1292|       |			flag |= SCONV_NORMALIZATION_D;
 1293|       |		else
 1294|       |#endif
 1295|  67.1k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   99|  67.1k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1296|  67.1k|	}
 1297|       |#if defined(__APPLE__)
 1298|       |	/*
 1299|       |	 * In case writing an archive file, make sure that a filename
 1300|       |	 * going to be passed to iconv is a Unicode NFC string since
 1301|       |	 * a filename in HFS Plus filesystem is a Unicode NFD one and
 1302|       |	 * iconv cannot handle it with "UTF-8" charset. It is simpler
 1303|       |	 * than a use of "UTF-8-MAC" charset.
 1304|       |	 */
 1305|       |	if ((flag & SCONV_TO_CHARSET) &&
 1306|       |	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1307|       |	    !(flag & (SCONV_TO_UTF16 | SCONV_TO_UTF8)))
 1308|       |		flag |= SCONV_NORMALIZATION_C;
 1309|       |	/*
 1310|       |	 * In case reading an archive file. make sure that a filename
 1311|       |	 * will be passed to users is a Unicode NFD string in order to
 1312|       |	 * correctly compare the filename with other one which comes
 1313|       |	 * from HFS Plus filesystem.
 1314|       |	 */
 1315|       |	if ((flag & SCONV_FROM_CHARSET) &&
 1316|       |	   !(flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1317|       |	    (flag & SCONV_TO_UTF8))
 1318|       |		flag |= SCONV_NORMALIZATION_D;
 1319|       |#endif
 1320|       |
 1321|   643k|#if defined(HAVE_ICONV)
 1322|   643k|	sc->cd_w = (iconv_t)-1;
 1323|       |	/*
 1324|       |	 * Create an iconv object.
 1325|       |	 */
 1326|   643k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  106|   643k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  112|   643k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   643k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   643k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1326:7): [True: 575k, False: 67.3k]
  ------------------
 1327|   575k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  107|   575k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  113|   575k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   575k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  111|   575k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1327:6): [True: 0, False: 575k]
  ------------------
 1328|   643k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   95|   643k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1328:6): [True: 0, False: 643k]
  ------------------
 1329|       |		/* This case we won't use iconv. */
 1330|      0|		sc->cd = (iconv_t)-1;
 1331|   643k|	} else {
 1332|   643k|		sc->cd = iconv_open(tc, fc);
 1333|   643k|		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
  ------------------
  |  |   94|    281|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1333:7): [True: 281, False: 642k]
  |  Branch (1333:32): [True: 0, False: 281]
  ------------------
 1334|       |			/*
 1335|       |			 * Unfortunately, all of iconv implements do support
 1336|       |			 * "CP932" character-set, so we should use "SJIS"
 1337|       |			 * instead if iconv_open failed.
 1338|       |			 */
 1339|      0|			if (strcmp(tc, "CP932") == 0)
  ------------------
  |  Branch (1339:8): [True: 0, False: 0]
  ------------------
 1340|      0|				sc->cd = iconv_open("SJIS", fc);
 1341|      0|			else if (strcmp(fc, "CP932") == 0)
  ------------------
  |  Branch (1341:13): [True: 0, False: 0]
  ------------------
 1342|      0|				sc->cd = iconv_open(tc, "SJIS");
 1343|      0|		}
 1344|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1345|       |		/*
 1346|       |		 * archive_mstring on Windows directly convert multi-bytes
 1347|       |		 * into archive_wstring in order not to depend on locale
 1348|       |		 * so that you can do a I18N programming. This will be
 1349|       |		 * used only in archive_mstring_copy_mbs_len_l so far.
 1350|       |		 */
 1351|       |		if (flag & SCONV_FROM_CHARSET) {
 1352|       |			sc->cd_w = iconv_open("UTF-8", fc);
 1353|       |			if (sc->cd_w == (iconv_t)-1 &&
 1354|       |			    (sc->flag & SCONV_BEST_EFFORT)) {
 1355|       |				if (strcmp(fc, "CP932") == 0)
 1356|       |					sc->cd_w = iconv_open("UTF-8", "SJIS");
 1357|       |			}
 1358|       |		}
 1359|       |#endif /* _WIN32 && !__CYGWIN__ */
 1360|   643k|	}
 1361|   643k|#endif	/* HAVE_ICONV */
 1362|       |
 1363|   643k|	sc->flag = flag;
 1364|       |
 1365|       |	/*
 1366|       |	 * Set up converters.
 1367|       |	 */
 1368|   643k|	setup_converter(sc);
 1369|       |
 1370|   643k|	return (sc);
 1371|   643k|}
archive_string.c:make_codepage_from_charset:
 1706|   643k|{
 1707|   643k|	(void)charset; /* UNUSED */
 1708|   643k|	return (-1);/* Unknown */
 1709|   643k|}
archive_string.c:canonical_charset_name:
 1154|  1.28M|{
 1155|  1.28M|	char cs[16];
 1156|  1.28M|	char *p;
 1157|  1.28M|	const char *s;
 1158|       |
 1159|  1.28M|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1159:6): [True: 0, False: 1.28M]
  |  Branch (1159:25): [True: 0, False: 1.28M]
  ------------------
 1160|  1.28M|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1160:9): [True: 0, False: 1.28M]
  ------------------
 1161|      0|		return (charset);
 1162|       |
 1163|       |	/* Copy name to uppercase. */
 1164|  1.28M|	p = cs;
 1165|  1.28M|	s = charset;
 1166|  13.5M|	while (*s) {
  ------------------
  |  Branch (1166:9): [True: 12.2M, False: 1.28M]
  ------------------
 1167|  12.2M|		char c = *s++;
 1168|  12.2M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1168:7): [True: 0, False: 12.2M]
  |  Branch (1168:19): [True: 0, False: 0]
  ------------------
 1169|      0|			c -= 'a' - 'A';
 1170|  12.2M|		*p++ = c;
 1171|  12.2M|	}
 1172|  1.28M|	*p++ = '\0';
 1173|       |
 1174|  1.28M|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1174:6): [True: 642k, False: 644k]
  ------------------
 1175|   644k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1175:6): [True: 0, False: 644k]
  ------------------
 1176|   642k|		return ("UTF-8");
 1177|   644k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1177:6): [True: 603, False: 643k]
  ------------------
 1178|   643k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1178:6): [True: 0, False: 643k]
  ------------------
 1179|    603|		return ("UTF-16BE");
 1180|   643k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1180:6): [True: 285, False: 643k]
  ------------------
 1181|   643k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1181:6): [True: 0, False: 643k]
  ------------------
 1182|    285|		return ("UTF-16LE");
 1183|   643k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1183:6): [True: 0, False: 643k]
  ------------------
 1184|      0|		return ("CP932");
 1185|   643k|	return (charset);
 1186|   643k|}
archive_string.c:add_sconv_object:
  952|  4.47k|{
  953|  4.47k|	struct archive_string_conv **psc; 
  954|       |
  955|       |	/* Add a new sconv to sconv list. */
  956|  4.47k|	psc = &(a->sconv);
  957|  5.89k|	while (*psc != NULL)
  ------------------
  |  Branch (957:9): [True: 1.41k, False: 4.47k]
  ------------------
  958|  1.41k|		psc = &((*psc)->next);
  959|  4.47k|	*psc = sc;
  960|  4.47k|}
archive_string.c:get_current_charset:
 1778|   644k|{
 1779|   644k|	const char *cur_charset;
 1780|       |
 1781|   644k|	if (a == NULL)
  ------------------
  |  Branch (1781:6): [True: 638k, False: 5.83k]
  ------------------
 1782|   638k|		cur_charset = default_iconv_charset("");
 1783|  5.83k|	else {
 1784|  5.83k|		cur_charset = default_iconv_charset(a->current_code);
 1785|  5.83k|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1785:7): [True: 4.19k, False: 1.64k]
  ------------------
 1786|  4.19k|			a->current_code = strdup(cur_charset);
 1787|  4.19k|			a->current_codepage = get_current_codepage();
 1788|  4.19k|			a->current_oemcp = get_current_oemcp();
 1789|  4.19k|		}
 1790|  5.83k|	}
 1791|   644k|	return (cur_charset);
 1792|   644k|}
archive_string.c:default_iconv_charset:
  453|   644k|default_iconv_charset(const char *charset) {
  454|   644k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (454:6): [True: 640k, False: 4.19k]
  |  Branch (454:25): [True: 1.64k, False: 638k]
  ------------------
  455|  1.64k|		return charset;
  456|       |#if HAVE_LOCALE_CHARSET && HAVE_LOCALCHARSET_H && !defined(__APPLE__)
  457|       |	/* locale_charset() is broken on Mac OS */
  458|       |	return locale_charset();
  459|       |#elif HAVE_NL_LANGINFO
  460|   642k|	return nl_langinfo(CODESET);
  461|       |#elif defined(__BIONIC__)
  462|       |	return "UTF-8";
  463|       |#else
  464|       |	return "";
  465|       |#endif
  466|   644k|}
archive_string.c:get_current_oemcp:
 1712|  4.19k|{
 1713|  4.19k|	return (-1);/* Unknown */
 1714|  4.19k|}
archive_string.c:free_sconv_object:
 1378|   643k|{
 1379|   643k|	free(sc->from_charset);
 1380|   643k|	free(sc->to_charset);
 1381|   643k|	archive_string_free(&sc->utftmp);
 1382|   643k|#if HAVE_ICONV
 1383|   643k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1383:6): [True: 642k, False: 281]
  ------------------
 1384|   642k|		iconv_close(sc->cd);
 1385|   643k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1385:6): [True: 0, False: 643k]
  ------------------
 1386|      0|		iconv_close(sc->cd_w);
 1387|   643k|#endif
 1388|   643k|	free(sc);
 1389|   643k|}
archive_string.c:setup_converter:
  974|   643k|{
  975|       |
  976|       |	/* Reset. */
  977|   643k|	sc->nconverter = 0;
  978|       |
  979|       |	/*
  980|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  981|       |	 * made by libarchive2.x.
  982|       |	 */
  983|   643k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   97|   643k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (983:6): [True: 0, False: 643k]
  ------------------
  984|      0|		add_converter(sc, strncat_from_utf8_libarchive2);
  985|      0|		return;
  986|      0|	}
  987|       |
  988|       |	/*
  989|       |	 * Convert a string to UTF-16BE/LE.
  990|       |	 */
  991|   643k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  112|   643k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   643k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   643k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (991:6): [True: 0, False: 643k]
  ------------------
  992|       |		/*
  993|       |		 * If the current locale is UTF-8, we can translate
  994|       |		 * a UTF-8 string into a UTF-16BE string.
  995|       |		 */
  996|      0|		if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  107|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (996:7): [True: 0, False: 0]
  ------------------
  997|      0|			add_converter(sc, archive_string_append_unicode);
  998|      0|			return;
  999|      0|		}
 1000|       |
 1001|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1002|       |		if (sc->flag & SCONV_WIN_CP) {
 1003|       |			if (sc->flag & SCONV_TO_UTF16BE)
 1004|       |				add_converter(sc, win_strncat_to_utf16be);
 1005|       |			else
 1006|       |				add_converter(sc, win_strncat_to_utf16le);
 1007|       |			return;
 1008|       |		}
 1009|       |#endif
 1010|       |
 1011|      0|#if defined(HAVE_ICONV)
 1012|      0|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1012:7): [True: 0, False: 0]
  ------------------
 1013|      0|			add_converter(sc, iconv_strncat_in_locale);
 1014|      0|			return;
 1015|      0|		}
 1016|      0|#endif
 1017|       |
 1018|      0|		if (sc->flag & SCONV_BEST_EFFORT) {
  ------------------
  |  |   94|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1018:7): [True: 0, False: 0]
  ------------------
 1019|      0|			if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  108|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (1019:8): [True: 0, False: 0]
  ------------------
 1020|      0|				add_converter(sc,
 1021|      0|					best_effort_strncat_to_utf16be);
 1022|      0|			else
 1023|      0|				add_converter(sc,
 1024|      0|					best_effort_strncat_to_utf16le);
 1025|      0|		} else
 1026|       |			/* Make sure we have no converter. */
 1027|      0|			sc->nconverter = 0;
 1028|      0|		return;
 1029|      0|	}
 1030|       |
 1031|       |	/*
 1032|       |	 * Convert a string from UTF-16BE/LE.
 1033|       |	 */
 1034|   643k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  113|   643k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   643k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  111|   643k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1034:6): [True: 888, False: 642k]
  ------------------
 1035|       |		/*
 1036|       |		 * At least we should normalize a UTF-16BE string.
 1037|       |		 */
 1038|    888|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  102|    888|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1038:7): [True: 0, False: 888]
  ------------------
 1039|      0|			add_converter(sc,archive_string_normalize_D);
 1040|    888|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   99|    888|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1040:12): [True: 888, False: 0]
  ------------------
 1041|    888|			add_converter(sc, archive_string_normalize_C);
 1042|       |
 1043|    888|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  106|    888|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1043:7): [True: 0, False: 888]
  ------------------
 1044|       |			/*
 1045|       |			 * If the current locale is UTF-8, we can translate
 1046|       |			 * a UTF-16BE/LE string into a UTF-8 string directly.
 1047|       |			 */
 1048|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1048:8): [True: 0, False: 0]
  ------------------
 1049|      0|			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |  102|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
              			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |   99|      0|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1050|      0|				add_converter(sc,
 1051|      0|				    archive_string_append_unicode);
 1052|      0|			return;
 1053|      0|		}
 1054|       |
 1055|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1056|       |		if (sc->flag & SCONV_WIN_CP) {
 1057|       |			if (sc->flag & SCONV_FROM_UTF16BE)
 1058|       |				add_converter(sc, win_strncat_from_utf16be);
 1059|       |			else
 1060|       |				add_converter(sc, win_strncat_from_utf16le);
 1061|       |			return;
 1062|       |		}
 1063|       |#endif
 1064|       |
 1065|    888|#if defined(HAVE_ICONV)
 1066|    888|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1066:7): [True: 888, False: 0]
  ------------------
 1067|    888|			add_converter(sc, iconv_strncat_in_locale);
 1068|    888|			return;
 1069|    888|		}
 1070|      0|#endif
 1071|       |
 1072|      0|		if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |   94|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |  109|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (1072:7): [True: 0, False: 0]
  ------------------
 1073|      0|		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |   94|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
  ------------------
  |  |  109|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1074|      0|			add_converter(sc, best_effort_strncat_from_utf16be);
 1075|      0|		else if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |   94|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		else if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |  111|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (1075:12): [True: 0, False: 0]
  ------------------
 1076|      0|		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |   94|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
              		    == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
  ------------------
  |  |  111|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
 1077|      0|			add_converter(sc, best_effort_strncat_from_utf16le);
 1078|      0|		else
 1079|       |			/* Make sure we have no converter. */
 1080|      0|			sc->nconverter = 0;
 1081|      0|		return;
 1082|    888|	}
 1083|       |
 1084|   642k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  107|   642k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1084:6): [True: 66.2k, False: 576k]
  ------------------
 1085|       |		/*
 1086|       |		 * At least we should normalize a UTF-8 string.
 1087|       |		 */
 1088|  66.2k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  102|  66.2k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1088:7): [True: 0, False: 66.2k]
  ------------------
 1089|      0|			add_converter(sc,archive_string_normalize_D);
 1090|  66.2k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   99|  66.2k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1090:12): [True: 66.2k, False: 0]
  ------------------
 1091|  66.2k|			add_converter(sc, archive_string_normalize_C);
 1092|       |
 1093|       |		/*
 1094|       |		 * Copy UTF-8 string with a check of CESU-8.
 1095|       |		 * Apparently, iconv does not check surrogate pairs in UTF-8
 1096|       |		 * when both from-charset and to-charset are UTF-8, and then
 1097|       |		 * we use our UTF-8 copy code.
 1098|       |		 */
 1099|  66.2k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  106|  66.2k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1099:7): [True: 0, False: 66.2k]
  ------------------
 1100|       |			/*
 1101|       |			 * If the current locale is UTF-8, we can translate
 1102|       |			 * a UTF-16BE string into a UTF-8 string directly.
 1103|       |			 */
 1104|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1104:8): [True: 0, False: 0]
  ------------------
 1105|      0|			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |  102|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
              			    (SCONV_NORMALIZATION_D |SCONV_NORMALIZATION_C)))
  ------------------
  |  |   99|      0|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1106|      0|				add_converter(sc, strncat_from_utf8_to_utf8);
 1107|      0|			return;
 1108|      0|		}
 1109|  66.2k|	}
 1110|       |
 1111|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1112|       |	/*
 1113|       |	 * On Windows we can use Windows API for a string conversion.
 1114|       |	 */
 1115|       |	if (sc->flag & SCONV_WIN_CP) {
 1116|       |		add_converter(sc, strncat_in_codepage);
 1117|       |		return;
 1118|       |	}
 1119|       |#endif
 1120|       |
 1121|   642k|#if HAVE_ICONV
 1122|   642k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1122:6): [True: 642k, False: 281]
  ------------------
 1123|   642k|		add_converter(sc, iconv_strncat_in_locale);
 1124|       |		/*
 1125|       |		 * iconv generally does not support UTF-8-MAC and so
 1126|       |		 * we have to the output of iconv from NFC to NFD if
 1127|       |		 * need.
 1128|       |		 */
 1129|   642k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   92|   642k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1129:7): [True: 66.2k, False: 575k]
  ------------------
 1130|  66.2k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  106|  66.2k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1130:7): [True: 0, False: 66.2k]
  ------------------
 1131|      0|			if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  102|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1131:8): [True: 0, False: 0]
  ------------------
 1132|      0|				add_converter(sc, archive_string_normalize_D);
 1133|      0|		}
 1134|   642k|		return;
 1135|   642k|	}
 1136|    281|#endif
 1137|       |
 1138|       |	/*
 1139|       |	 * Try conversion in the best effort or no conversion.
 1140|       |	 */
 1141|    281|	if ((sc->flag & SCONV_BEST_EFFORT) || sc->same)
  ------------------
  |  |   94|    281|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1141:6): [True: 281, False: 0]
  |  Branch (1141:40): [True: 0, False: 0]
  ------------------
 1142|    281|		add_converter(sc, best_effort_strncat_in_locale);
 1143|      0|	else
 1144|       |		/* Make sure we have no converter. */
 1145|      0|		sc->nconverter = 0;
 1146|    281|}
archive_string.c:add_converter:
  966|   710k|{
  967|   710k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (967:6): [True: 0, False: 710k]
  |  Branch (967:20): [True: 0, False: 710k]
  ------------------
  968|      0|		__archive_errx(1, "Programming error");
  969|   710k|	sc->converter[sc->nconverter++] = converter;
  970|   710k|}
archive_string.c:_utf8_to_unicode:
 2423|  79.2M|{
 2424|  79.2M|	static const char utf8_count[256] = {
 2425|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2426|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2427|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2428|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2429|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2430|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2431|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2432|  79.2M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2433|  79.2M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2434|  79.2M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2435|  79.2M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2436|  79.2M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2437|  79.2M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2438|  79.2M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2439|  79.2M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2440|  79.2M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2441|  79.2M|	};
 2442|  79.2M|	int ch, i;
 2443|  79.2M|	int cnt;
 2444|  79.2M|	uint32_t wc;
 2445|       |
 2446|       |	/* Sanity check. */
 2447|  79.2M|	if (n == 0)
  ------------------
  |  Branch (2447:6): [True: 69.6k, False: 79.1M]
  ------------------
 2448|  69.6k|		return (0);
 2449|       |	/*
 2450|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2451|       |	 */
 2452|  79.1M|	ch = (unsigned char)*s;
 2453|  79.1M|	if (ch == 0)
  ------------------
  |  Branch (2453:6): [True: 0, False: 79.1M]
  ------------------
 2454|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2455|  79.1M|	cnt = utf8_count[ch];
 2456|       |
 2457|       |	/* Invalid sequence or there are not plenty bytes. */
 2458|  79.1M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2458:6): [True: 2.09k, False: 79.1M]
  ------------------
 2459|  2.09k|		cnt = (int)n;
 2460|  2.22k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2460:15): [True: 823, False: 1.40k]
  ------------------
 2461|    823|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2461:8): [True: 691, False: 132]
  ------------------
 2462|    691|				cnt = i;
 2463|    691|				break;
 2464|    691|			}
 2465|    823|		}
 2466|  2.09k|		goto invalid_sequence;
 2467|  2.09k|	}
 2468|       |
 2469|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2470|  79.1M|	switch (cnt) {
 2471|  78.5M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2471:2): [True: 78.5M, False: 591k]
  ------------------
 2472|  78.5M|		*pwc = ch & 0x7f;
 2473|  78.5M|		return (cnt);
 2474|   178k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2474:2): [True: 178k, False: 78.9M]
  ------------------
 2475|   178k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2475:7): [True: 66.5k, False: 111k]
  ------------------
 2476|  66.5k|			cnt = 1;
 2477|  66.5k|			goto invalid_sequence;
 2478|  66.5k|		}
 2479|   111k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2480|   111k|		return (cnt);
 2481|   144k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2481:2): [True: 144k, False: 78.9M]
  ------------------
 2482|   144k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2482:7): [True: 43.1k, False: 101k]
  ------------------
 2483|  43.1k|			cnt = 1;
 2484|  43.1k|			goto invalid_sequence;
 2485|  43.1k|		}
 2486|   101k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2486:7): [True: 43.1k, False: 58.4k]
  ------------------
 2487|  43.1k|			cnt = 2;
 2488|  43.1k|			goto invalid_sequence;
 2489|  43.1k|		}
 2490|  58.4k|		wc = ((ch & 0x0f) << 12)
 2491|  58.4k|		    | ((s[1] & 0x3f) << 6)
 2492|  58.4k|		    | (s[2] & 0x3f);
 2493|  58.4k|		if (wc < 0x800)
  ------------------
  |  Branch (2493:7): [True: 288, False: 58.1k]
  ------------------
 2494|    288|			goto invalid_sequence;/* Overlong sequence. */
 2495|  58.1k|		break;
 2496|  58.1k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2496:2): [True: 9.14k, False: 79.1M]
  ------------------
 2497|  9.14k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2497:7): [True: 1.45k, False: 7.69k]
  ------------------
 2498|  1.45k|			cnt = 1;
 2499|  1.45k|			goto invalid_sequence;
 2500|  1.45k|		}
 2501|  7.69k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2501:7): [True: 654, False: 7.04k]
  ------------------
 2502|    654|			cnt = 2;
 2503|    654|			goto invalid_sequence;
 2504|    654|		}
 2505|  7.04k|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2505:7): [True: 575, False: 6.46k]
  ------------------
 2506|    575|			cnt = 3;
 2507|    575|			goto invalid_sequence;
 2508|    575|		}
 2509|  6.46k|		wc = ((ch & 0x07) << 18)
 2510|  6.46k|		    | ((s[1] & 0x3f) << 12)
 2511|  6.46k|		    | ((s[2] & 0x3f) << 6)
 2512|  6.46k|		    | (s[3] & 0x3f);
 2513|  6.46k|		if (wc < 0x10000)
  ------------------
  |  Branch (2513:7): [True: 233, False: 6.23k]
  ------------------
 2514|    233|			goto invalid_sequence;/* Overlong sequence. */
 2515|  6.23k|		break;
 2516|   259k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2516:2): [True: 259k, False: 78.8M]
  ------------------
 2517|   259k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2517:7): [True: 985, False: 258k]
  |  Branch (2517:21): [True: 390, False: 257k]
  ------------------
 2518|  1.37k|			cnt = 2;
 2519|   257k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2519:12): [True: 21.8k, False: 236k]
  |  Branch (2519:26): [True: 4.28k, False: 17.6k]
  ------------------
 2520|  4.28k|			cnt = 4;
 2521|   253k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2521:12): [True: 17.6k, False: 236k]
  |  Branch (2521:26): [True: 2.22k, False: 15.3k]
  ------------------
 2522|  2.22k|			cnt = 5;
 2523|   251k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2523:12): [True: 1.79k, False: 249k]
  |  Branch (2523:26): [True: 1.05k, False: 248k]
  ------------------
 2524|  2.85k|			cnt = 6;
 2525|   248k|		else
 2526|   248k|			cnt = 1;
 2527|   259k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2527:7): [True: 1.64k, False: 257k]
  ------------------
 2528|  1.64k|			cnt = (int)n;
 2529|   264k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2529:15): [True: 14.3k, False: 250k]
  ------------------
 2530|  14.3k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2530:8): [True: 8.92k, False: 5.40k]
  ------------------
 2531|  8.92k|				cnt = i;
 2532|  8.92k|				break;
 2533|  8.92k|			}
 2534|  14.3k|		}
 2535|   259k|		goto invalid_sequence;
 2536|  79.1M|	}
 2537|       |
 2538|       |	/* The code point larger than 0x10FFFF is not legal
 2539|       |	 * Unicode values. */
 2540|  64.3k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  134|  64.3k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2540:6): [True: 304, False: 64.0k]
  ------------------
 2541|    304|		goto invalid_sequence;
 2542|       |	/* Correctly gets a Unicode, returns used bytes. */
 2543|  64.0k|	*pwc = wc;
 2544|  64.0k|	return (cnt);
 2545|   417k|invalid_sequence:
 2546|   417k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  135|   417k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2547|   417k|	return (cnt * -1);
 2548|  64.3k|}
archive_string.c:unicode_to_utf16be:
 2728|  19.5k|{
 2729|  19.5k|	char *utf16 = p;
 2730|       |
 2731|  19.5k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2731:6): [True: 65, False: 19.5k]
  ------------------
 2732|       |		/* We have a code point that won't fit into a
 2733|       |		 * wchar_t; convert it to a surrogate pair. */
 2734|     65|		if (remaining < 4)
  ------------------
  |  Branch (2734:7): [True: 0, False: 65]
  ------------------
 2735|      0|			return (0);
 2736|     65|		uc -= 0x10000;
 2737|     65|		archive_be16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2738|     65|		archive_be16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2739|     65|		return (4);
 2740|  19.5k|	} else {
 2741|  19.5k|		if (remaining < 2)
  ------------------
  |  Branch (2741:7): [True: 0, False: 19.5k]
  ------------------
 2742|      0|			return (0);
 2743|  19.5k|		archive_be16enc(utf16, (uint16_t)uc);
 2744|  19.5k|		return (2);
 2745|  19.5k|	}
 2746|  19.5k|}
archive_string.c:unicode_to_utf16le:
 2750|  8.43k|{
 2751|  8.43k|	char *utf16 = p;
 2752|       |
 2753|  8.43k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2753:6): [True: 277, False: 8.15k]
  ------------------
 2754|       |		/* We have a code point that won't fit into a
 2755|       |		 * wchar_t; convert it to a surrogate pair. */
 2756|    277|		if (remaining < 4)
  ------------------
  |  Branch (2756:7): [True: 0, False: 277]
  ------------------
 2757|      0|			return (0);
 2758|    277|		uc -= 0x10000;
 2759|    277|		archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2760|    277|		archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2761|    277|		return (4);
 2762|  8.15k|	} else {
 2763|  8.15k|		if (remaining < 2)
  ------------------
  |  Branch (2763:7): [True: 0, False: 8.15k]
  ------------------
 2764|      0|			return (0);
 2765|  8.15k|		archive_le16enc(utf16, (uint16_t)uc);
 2766|  8.15k|		return (2);
 2767|  8.15k|	}
 2768|  8.43k|}
archive_string.c:unicode_to_utf8:
 2622|   852k|{
 2623|   852k|	char *_p = p;
 2624|       |
 2625|       |	/* Invalid Unicode char maps to Replacement character */
 2626|   852k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  134|   852k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2626:6): [True: 0, False: 852k]
  ------------------
 2627|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  135|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2628|       |	/* Translate code point to UTF8 */
 2629|   852k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2629:6): [True: 337k, False: 514k]
  ------------------
 2630|   337k|		if (remaining == 0)
  ------------------
  |  Branch (2630:7): [True: 1.51k, False: 336k]
  ------------------
 2631|  1.51k|			return (0);
 2632|   336k|		*p++ = (char)uc;
 2633|   514k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2633:13): [True: 88.8k, False: 425k]
  ------------------
 2634|  88.8k|		if (remaining < 2)
  ------------------
  |  Branch (2634:7): [True: 435, False: 88.4k]
  ------------------
 2635|    435|			return (0);
 2636|  88.4k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2637|  88.4k|		*p++ = 0x80 | (uc & 0x3f);
 2638|   425k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2638:13): [True: 422k, False: 2.88k]
  ------------------
 2639|   422k|		if (remaining < 3)
  ------------------
  |  Branch (2639:7): [True: 7.23k, False: 415k]
  ------------------
 2640|  7.23k|			return (0);
 2641|   415k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2642|   415k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2643|   415k|		*p++ = 0x80 | (uc & 0x3f);
 2644|   415k|	} else {
 2645|  2.88k|		if (remaining < 4)
  ------------------
  |  Branch (2645:7): [True: 159, False: 2.72k]
  ------------------
 2646|    159|			return (0);
 2647|  2.72k|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2648|  2.72k|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2649|  2.72k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2650|  2.72k|		*p++ = 0x80 | (uc & 0x3f);
 2651|  2.72k|	}
 2652|   843k|	return (p - _p);
 2653|   852k|}
archive_string.c:utf16be_to_unicode:
 2657|  43.4k|{
 2658|  43.4k|	return (utf16_to_unicode(pwc, s, n, 1));
 2659|  43.4k|}
archive_string.c:utf16_to_unicode:
 2669|  84.7k|{
 2670|  84.7k|	const char *utf16 = s;
 2671|  84.7k|	unsigned uc;
 2672|       |
 2673|  84.7k|	if (n == 0)
  ------------------
  |  Branch (2673:6): [True: 2.95k, False: 81.7k]
  ------------------
 2674|  2.95k|		return (0);
 2675|  81.7k|	if (n == 1) {
  ------------------
  |  Branch (2675:6): [True: 0, False: 81.7k]
  ------------------
 2676|       |		/* set the Replacement Character instead. */
 2677|      0|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  135|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2678|      0|		return (-1);
 2679|      0|	}
 2680|       |
 2681|  81.7k|	if (be)
  ------------------
  |  Branch (2681:6): [True: 41.3k, False: 40.4k]
  ------------------
 2682|  41.3k|		uc = archive_be16dec(utf16);
 2683|  40.4k|	else
 2684|  40.4k|		uc = archive_le16dec(utf16);
 2685|  81.7k|	utf16 += 2;
 2686|       |		
 2687|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2688|  81.7k|	if (IS_HIGH_SURROGATE_LA(uc)) {
  ------------------
  |  |  131|  81.7k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 31.9k, False: 49.8k]
  |  |  |  Branch (131:53): [True: 23.7k, False: 8.24k]
  |  |  ------------------
  ------------------
 2689|  23.7k|		unsigned uc2;
 2690|       |
 2691|  23.7k|		if (n >= 4) {
  ------------------
  |  Branch (2691:7): [True: 23.7k, False: 12]
  ------------------
 2692|  23.7k|			if (be)
  ------------------
  |  Branch (2692:8): [True: 16.6k, False: 7.13k]
  ------------------
 2693|  16.6k|				uc2 = archive_be16dec(utf16);
 2694|  7.13k|			else
 2695|  7.13k|				uc2 = archive_le16dec(utf16);
 2696|  23.7k|		} else
 2697|     12|			uc2 = 0;
 2698|  23.7k|		if (IS_LOW_SURROGATE_LA(uc2)) {
  ------------------
  |  |  132|  23.7k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 1.19k, False: 22.5k]
  |  |  |  Branch (132:53): [True: 343, False: 852]
  |  |  ------------------
  ------------------
 2699|    343|			uc = combine_surrogate_pair(uc, uc2);
 2700|    343|			utf16 += 2;
 2701|  23.4k|		} else {
 2702|       |	 		/* Undescribed code point should be U+FFFD
 2703|       |		 	* (replacement character). */
 2704|  23.4k|			*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  135|  23.4k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2705|  23.4k|			return (-2);
 2706|  23.4k|		}
 2707|  23.7k|	}
 2708|       |
 2709|       |	/*
 2710|       |	 * Surrogate pair values(0xd800 through 0xdfff) are only
 2711|       |	 * used by UTF-16, so, after above calculation, the code
 2712|       |	 * must not be surrogate values, and Unicode has no codes
 2713|       |	 * larger than 0x10ffff. Thus, those are not legal Unicode
 2714|       |	 * values.
 2715|       |	 */
 2716|  58.3k|	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  133|   116k|#define IS_SURROGATE_PAIR_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (133:35): [True: 8.58k, False: 49.8k]
  |  |  |  Branch (133:53): [True: 3.36k, False: 5.22k]
  |  |  ------------------
  ------------------
              	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  134|  55.0k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2716:34): [True: 0, False: 55.0k]
  ------------------
 2717|       |	 	/* Undescribed code point should be U+FFFD
 2718|       |	 	* (replacement character). */
 2719|  3.36k|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  135|  3.36k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2720|  3.36k|		return (((int)(utf16 - s)) * -1);
 2721|  3.36k|	}
 2722|  55.0k|	*pwc = uc;
 2723|  55.0k|	return ((int)(utf16 - s));
 2724|  58.3k|}
archive_string.c:combine_surrogate_pair:
 2564|  3.81k|{
 2565|  3.81k|	uc -= 0xD800;
 2566|  3.81k|	uc *= 0x400;
 2567|  3.81k|	uc += uc2 - 0xDC00;
 2568|  3.81k|	uc += 0x10000;
 2569|  3.81k|	return (uc);
 2570|  3.81k|}
archive_string.c:utf16le_to_unicode:
 2663|  41.2k|{
 2664|  41.2k|	return (utf16_to_unicode(pwc, s, n, 0));
 2665|  41.2k|}
archive_string.c:cesu8_to_unicode:
 2583|  79.1M|{
 2584|  79.1M|	uint32_t wc = 0;
 2585|  79.1M|	int cnt;
 2586|       |
 2587|  79.1M|	cnt = _utf8_to_unicode(&wc, s, n);
 2588|  79.1M|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|  54.0k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 30.2k, False: 23.7k]
  |  |  |  Branch (131:53): [True: 25.7k, False: 4.53k]
  |  |  ------------------
  ------------------
  |  Branch (2588:6): [True: 54.0k, False: 79.1M]
  ------------------
 2589|  25.7k|		uint32_t wc2 = 0;
 2590|  25.7k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2590:7): [True: 983, False: 24.7k]
  ------------------
 2591|       |			/* Invalid byte sequence. */
 2592|    983|			goto invalid_sequence;
 2593|    983|		}
 2594|  24.7k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2595|  24.7k|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  132|  4.09k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 3.84k, False: 255]
  |  |  |  Branch (132:53): [True: 3.47k, False: 373]
  |  |  ------------------
  ------------------
  |  Branch (2595:7): [True: 20.6k, False: 4.09k]
  ------------------
 2596|       |			/* Invalid byte sequence. */
 2597|  21.3k|			goto invalid_sequence;
 2598|  21.3k|		}
 2599|  3.47k|		wc = combine_surrogate_pair(wc, wc2);
 2600|  3.47k|		cnt = 6;
 2601|  79.1M|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  132|  28.2k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 4.53k, False: 23.7k]
  |  |  |  Branch (132:53): [True: 2.40k, False: 2.13k]
  |  |  ------------------
  ------------------
  |  Branch (2601:13): [True: 28.2k, False: 79.1M]
  ------------------
 2602|       |		/* Invalid byte sequence. */
 2603|  2.40k|		goto invalid_sequence;
 2604|  2.40k|	}
 2605|  79.1M|	*pwc = wc;
 2606|  79.1M|	return (cnt);
 2607|  24.6k|invalid_sequence:
 2608|  24.6k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  135|  24.6k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2609|  24.6k|	if (cnt > 0)
  ------------------
  |  Branch (2609:6): [True: 4.88k, False: 19.8k]
  ------------------
 2610|  4.88k|		cnt *= -1;
 2611|  24.6k|	return (cnt);
 2612|  79.1M|}
archive_string.c:iconv_strncat_in_locale:
 2127|   574k|{
 2128|   574k|	ICONV_CONST char *itp;
 2129|   574k|	size_t remaining;
 2130|   574k|	iconv_t cd;
 2131|   574k|	char *outp;
 2132|   574k|	size_t avail, bs;
 2133|   574k|	int return_value = 0; /* success */
 2134|   574k|	size_t to_size, from_size;
 2135|       |
 2136|   574k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  112|   574k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   574k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   574k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2136:6): [True: 0, False: 574k]
  ------------------
 2137|      0|		to_size = 2;
 2138|   574k|	else
 2139|   574k|		to_size = 1;
 2140|   574k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  113|   574k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   574k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  111|   574k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2140:6): [True: 2.94k, False: 571k]
  ------------------
 2141|  2.94k|		from_size = 2;
 2142|   571k|	else
 2143|   571k|		from_size = 1;
 2144|       |
 2145|   574k|	{
 2146|   574k|	size_t required;
 2147|   574k|	if (archive_ckd_mul_size(&required, length, 2) ||
  ------------------
  |  Branch (2147:6): [True: 0, False: 574k]
  ------------------
 2148|   574k|	    archive_ckd_add_size(&required, required, as->length) ||
  ------------------
  |  Branch (2148:6): [True: 0, False: 574k]
  ------------------
 2149|   574k|	    archive_ckd_add_size(&required, required, to_size))
  ------------------
  |  Branch (2149:6): [True: 0, False: 574k]
  ------------------
 2150|      0|		return (-1);
 2151|   574k|	if (archive_string_ensure(as, required) == NULL)
  ------------------
  |  Branch (2151:6): [True: 0, False: 574k]
  ------------------
 2152|      0|		return (-1);
 2153|   574k|	}
 2154|       |
 2155|   574k|	cd = sc->cd;
 2156|   574k|	itp = (char *)(uintptr_t)_p;
 2157|   574k|	remaining = length;
 2158|   574k|	outp = as->s + as->length;
 2159|   574k|	avail = as->buffer_length - as->length - to_size;
 2160|  2.61M|	while (remaining >= from_size) {
  ------------------
  |  Branch (2160:9): [True: 2.59M, False: 17.8k]
  ------------------
 2161|  2.59M|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2162|       |
 2163|  2.59M|		if (result == 0)
  ------------------
  |  Branch (2163:7): [True: 556k, False: 2.04M]
  ------------------
 2164|   556k|			break; /* Conversion completed. */
 2165|  2.04M|		if (result != (size_t)-1) {
  ------------------
  |  Branch (2165:7): [True: 0, False: 2.04M]
  ------------------
 2166|       |			/*
 2167|       |			 * Conversion did not fail, but it performed
 2168|       |			 * some non-identical character substitutions.
 2169|       |			 */
 2170|      0|			return_value = -1;
 2171|      0|			break;
 2172|      0|		}
 2173|       |
 2174|  2.04M|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2174:7): [True: 2.03M, False: 179]
  |  Branch (2174:26): [True: 0, False: 179]
  ------------------
 2175|       |			/*
 2176|       |		 	 * If an output charset is UTF-8 or UTF-16BE/LE,
 2177|       |			 * unknown character should be U+FFFD
 2178|       |			 * (replacement character).
 2179|       |			 */
 2180|  2.03M|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  106|  2.03M|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  112|  2.03M|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  2.03M|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  2.03M|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2180:8): [True: 422k, False: 1.61M]
  ------------------
 2181|   422k|				size_t rbytes;
 2182|   422k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  106|   422k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2182:9): [True: 422k, False: 0]
  ------------------
 2183|   422k|					rbytes = sizeof(utf8_replacement_char);
 2184|      0|				else
 2185|      0|					rbytes = 2;
 2186|       |
 2187|   422k|				if (avail < rbytes) {
  ------------------
  |  Branch (2187:9): [True: 1.49k, False: 420k]
  ------------------
 2188|  1.49k|					as->length = outp - as->s;
 2189|  1.49k|					bs = as->buffer_length +
 2190|  1.49k|					    (remaining * to_size) + rbytes;
 2191|  1.49k|					if (NULL ==
  ------------------
  |  Branch (2191:10): [True: 0, False: 1.49k]
  ------------------
 2192|  1.49k|					    archive_string_ensure(as, bs))
 2193|      0|						return (-1);
 2194|  1.49k|					outp = as->s + as->length;
 2195|  1.49k|					avail = as->buffer_length
 2196|  1.49k|					    - as->length - to_size;
 2197|  1.49k|				}
 2198|   422k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  106|   422k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2198:9): [True: 422k, False: 0]
  ------------------
 2199|   422k|					memcpy(outp, utf8_replacement_char, sizeof(utf8_replacement_char));
 2200|      0|				else if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  108|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (2200:14): [True: 0, False: 0]
  ------------------
 2201|      0|					archive_be16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  135|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2202|      0|				else
 2203|      0|					archive_le16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  135|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2204|   422k|				outp += rbytes;
 2205|   422k|				avail -= rbytes;
 2206|  1.61M|			} else {
 2207|       |				/* Skip the illegal input bytes. */
 2208|  1.61M|				if (avail < 1) {
  ------------------
  |  Branch (2208:9): [True: 0, False: 1.61M]
  ------------------
 2209|      0|					as->length = outp - as->s;
 2210|      0|					bs = as->buffer_length +
 2211|      0|					    (remaining * to_size) + 1;
 2212|      0|					if (NULL ==
  ------------------
  |  Branch (2212:10): [True: 0, False: 0]
  ------------------
 2213|      0|					    archive_string_ensure(as, bs))
 2214|      0|						return (-1);
 2215|      0|					outp = as->s + as->length;
 2216|      0|					avail = as->buffer_length
 2217|      0|					    - as->length - to_size;
 2218|      0|				}
 2219|  1.61M|				*outp++ = '?';
 2220|  1.61M|				avail--;
 2221|  1.61M|			}
 2222|  2.03M|			itp += from_size;
 2223|  2.03M|			remaining -= from_size;
 2224|  2.03M|			return_value = -1; /* failure */
 2225|  2.03M|		} else {
 2226|       |			/* E2BIG no output buffer,
 2227|       |			 * Increase an output buffer.  */
 2228|    179|			as->length = outp - as->s;
 2229|    179|			bs = as->buffer_length + remaining * 2;
 2230|    179|			if (NULL == archive_string_ensure(as, bs))
  ------------------
  |  Branch (2230:8): [True: 0, False: 179]
  ------------------
 2231|      0|				return (-1);
 2232|    179|			outp = as->s + as->length;
 2233|    179|			avail = as->buffer_length - as->length - to_size;
 2234|    179|		}
 2235|  2.04M|	}
 2236|   574k|	as->length = outp - as->s;
 2237|   574k|	as->s[as->length] = 0;
 2238|   574k|	if (to_size == 2)
  ------------------
  |  Branch (2238:6): [True: 0, False: 574k]
  ------------------
 2239|      0|		as->s[as->length+1] = 0;
 2240|   574k|	return (return_value);
 2241|   574k|}
archive_string.c:archive_string_normalize_C:
 3062|  70.9k|{
 3063|  70.9k|	const char *s = (const char *)_p;
 3064|  70.9k|	char *p, *endp;
 3065|  70.9k|	uint32_t uc, uc2;
 3066|  70.9k|	size_t w;
 3067|  70.9k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3068|  70.9k|	int (*parse)(uint32_t *, const char *, size_t);
 3069|  70.9k|	size_t (*unparse)(char *, size_t, uint32_t);
 3070|       |
 3071|  70.9k|	always_replace = 1;
 3072|  70.9k|	ts = 1;/* text size. */
 3073|  70.9k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  108|  70.9k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3073:6): [True: 0, False: 70.9k]
  ------------------
 3074|      0|		unparse = unicode_to_utf16be;
 3075|      0|		ts = 2;
 3076|      0|		if (sc->flag & SCONV_FROM_UTF16BE)
  ------------------
  |  |  109|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3076:7): [True: 0, False: 0]
  ------------------
 3077|      0|			always_replace = 0;
 3078|  70.9k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  110|  70.9k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (3078:13): [True: 0, False: 70.9k]
  ------------------
 3079|      0|		unparse = unicode_to_utf16le;
 3080|      0|		ts = 2;
 3081|      0|		if (sc->flag & SCONV_FROM_UTF16LE)
  ------------------
  |  |  111|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3081:7): [True: 0, False: 0]
  ------------------
 3082|      0|			always_replace = 0;
 3083|  70.9k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  106|  70.9k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (3083:13): [True: 0, False: 70.9k]
  ------------------
 3084|      0|		unparse = unicode_to_utf8;
 3085|      0|		if (sc->flag & SCONV_FROM_UTF8)
  ------------------
  |  |  107|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (3085:7): [True: 0, False: 0]
  ------------------
 3086|      0|			always_replace = 0;
 3087|  70.9k|	} else {
 3088|       |		/*
 3089|       |		 * This case is going to be converted to another
 3090|       |		 * character-set through iconv.
 3091|       |		 */
 3092|  70.9k|		always_replace = 0;
 3093|  70.9k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  109|  70.9k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3093:7): [True: 2.07k, False: 68.8k]
  ------------------
 3094|  2.07k|			unparse = unicode_to_utf16be;
 3095|  2.07k|			ts = 2;
 3096|  68.8k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  111|  68.8k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3096:14): [True: 871, False: 67.9k]
  ------------------
 3097|    871|			unparse = unicode_to_utf16le;
 3098|    871|			ts = 2;
 3099|  67.9k|		} else {
 3100|  67.9k|			unparse = unicode_to_utf8;
 3101|  67.9k|		}
 3102|  70.9k|	}
 3103|       |
 3104|  70.9k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  109|  70.9k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3104:6): [True: 2.07k, False: 68.8k]
  ------------------
 3105|  2.07k|		parse = utf16be_to_unicode;
 3106|  2.07k|		tm = 1;
 3107|  2.07k|		spair = 4;/* surrogate pair size in UTF-16. */
 3108|  68.8k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  111|  68.8k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3108:13): [True: 871, False: 67.9k]
  ------------------
 3109|    871|		parse = utf16le_to_unicode;
 3110|    871|		tm = 1;
 3111|    871|		spair = 4;/* surrogate pair size in UTF-16. */
 3112|  67.9k|	} else {
 3113|  67.9k|		parse = cesu8_to_unicode;
 3114|  67.9k|		tm = ts;
 3115|  67.9k|		spair = 6;/* surrogate pair size in UTF-8. */
 3116|  67.9k|	}
 3117|       |
 3118|  70.9k|	{
 3119|  70.9k|	size_t required;
 3120|  70.9k|	if (archive_ckd_mul_size(&required, len, tm) ||
  ------------------
  |  Branch (3120:6): [True: 0, False: 70.9k]
  ------------------
 3121|  70.9k|	    archive_ckd_add_size(&required, required, as->length) ||
  ------------------
  |  Branch (3121:6): [True: 0, False: 70.9k]
  ------------------
 3122|  70.9k|	    archive_ckd_add_size(&required, required, ts))
  ------------------
  |  Branch (3122:6): [True: 0, False: 70.9k]
  ------------------
 3123|      0|		return (-1);
 3124|  70.9k|	if (archive_string_ensure(as, required) == NULL)
  ------------------
  |  Branch (3124:6): [True: 0, False: 70.9k]
  ------------------
 3125|      0|		return (-1);
 3126|  70.9k|	}
 3127|       |
 3128|  70.9k|	p = as->s + as->length;
 3129|  70.9k|	endp = as->s + as->buffer_length - ts;
 3130|   546k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3130:9): [True: 535k, False: 11.6k]
  ------------------
 3131|   535k|		const char *ucptr, *uc2ptr;
 3132|       |
 3133|   535k|		if (n < 0) {
  ------------------
  |  Branch (3133:7): [True: 329k, False: 205k]
  ------------------
 3134|       |			/* Use a replaced unicode character. */
 3135|   329k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2992|   329k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2993|   335k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2993:9): [True: 5.65k, False: 329k]
  |  |  ------------------
  |  | 2994|  5.65k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2983|  5.65k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|  5.65k|	as->length = p - as->s;			\
  |  |  |  | 2985|  5.65k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 5.65k]
  |  |  |  |  ------------------
  |  |  |  | 2986|  5.65k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|  5.65k|		return (-1);			\
  |  |  |  | 2988|  5.65k|	p = as->s + as->length;			\
  |  |  |  | 2989|  5.65k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|  5.65k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 5.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2995|  5.65k|	}					\
  |  | 2996|   329k|	p += w;					\
  |  | 2997|   329k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2997:10): [Folded, False: 329k]
  |  |  ------------------
  ------------------
 3136|   329k|			s += n*-1;
 3137|   329k|			len -= n*-1;
 3138|   329k|			ret = -1;
 3139|   329k|			continue;
 3140|   329k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3140:14): [True: 1.27k, False: 204k]
  |  Branch (3140:28): [True: 0, False: 204k]
  ------------------
 3141|       |			/* uc is converted from a surrogate pair.
 3142|       |			 * this should be treated as a changed code. */
 3143|  1.27k|			ucptr = NULL;
 3144|   204k|		else
 3145|   204k|			ucptr = s;
 3146|   205k|		s += n;
 3147|   205k|		len -= n;
 3148|       |
 3149|       |		/* Read second code point. */
 3150|  78.2M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3150:10): [True: 78.1M, False: 168k]
  ------------------
 3151|  78.1M|			uint32_t ucx[FDC_MAX];
 3152|  78.1M|			int ccx[FDC_MAX];
 3153|  78.1M|			int cl, cx, i, nx, ucx_size;
 3154|  78.1M|			int LIndex,SIndex;
 3155|  78.1M|			uint32_t nfc;
 3156|       |
 3157|  78.1M|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3157:8): [True: 1.74k, False: 78.1M]
  |  Branch (3157:23): [True: 0, False: 78.1M]
  ------------------
 3158|       |				/* uc2 is converted from a surrogate pair.
 3159|       |			 	 * this should be treated as a changed code. */
 3160|  1.74k|				uc2ptr = NULL;
 3161|  78.1M|			else
 3162|  78.1M|				uc2ptr = s;
 3163|  78.1M|			s += n2;
 3164|  78.1M|			len -= n2;
 3165|       |
 3166|       |			/*
 3167|       |			 * If current second code point is out of decomposable
 3168|       |			 * code points, finding compositions is unneeded.
 3169|       |			 */
 3170|  78.1M|			if (!IS_DECOMPOSABLE_BLOCK(uc2)) {
  ------------------
  |  | 1055|  78.1M|	(((uc)>>8) <= 0x1E9 && u_decomposable_blocks[(uc)>>8])
  |  |  ------------------
  |  |  |  Branch (1055:3): [True: 78.1M, False: 2.05k]
  |  |  |  Branch (1055:25): [True: 59.3k, False: 78.0M]
  |  |  ------------------
  ------------------
 3171|  78.0M|				WRITE_UC();
  ------------------
  |  | 3005|  78.0M|#define WRITE_UC()	do {			\
  |  | 3006|  78.0M|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (3006:6): [True: 78.0M, False: 3.33k]
  |  |  ------------------
  |  | 3007|  78.0M|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (3007:7): [True: 24.8k, False: 78.0M]
  |  |  ------------------
  |  | 3008|  78.0M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2983|  24.8k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|  24.8k|	as->length = p - as->s;			\
  |  |  |  | 2985|  24.8k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 24.8k]
  |  |  |  |  ------------------
  |  |  |  | 2986|  24.8k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|  24.8k|		return (-1);			\
  |  |  |  | 2988|  24.8k|	p = as->s + as->length;			\
  |  |  |  | 2989|  24.8k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|  24.8k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3009|  78.0M|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (3009:11): [True: 78.0M, False: 0]
  |  |  ------------------
  |  | 3010|  1.14k|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (3010:3): [True: 1.14k, False: 78.0M]
  |  |  ------------------
  |  | 3011|  1.14k|			*p++ = *ucptr++;	\
  |  | 3012|  1.14k|			/* FALL THROUGH */	\
  |  | 3013|  21.4k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (3013:3): [True: 20.3k, False: 78.0M]
  |  |  ------------------
  |  | 3014|  21.4k|			*p++ = *ucptr++;	\
  |  | 3015|  21.4k|			/* FALL THROUGH */	\
  |  | 3016|  59.2k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (3016:3): [True: 37.7k, False: 78.0M]
  |  |  ------------------
  |  | 3017|  59.2k|			*p++ = *ucptr++;	\
  |  | 3018|  59.2k|			/* FALL THROUGH */	\
  |  | 3019|  78.0M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (3019:3): [True: 77.9M, False: 59.2k]
  |  |  ------------------
  |  | 3020|  78.0M|			*p++ = *ucptr;		\
  |  | 3021|  78.0M|			break;			\
  |  | 3022|  78.0M|		}				\
  |  | 3023|  78.0M|		ucptr = NULL;			\
  |  | 3024|  78.0M|	} else {				\
  |  | 3025|  3.33k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2992|  3.33k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2993|  3.40k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2993:9): [True: 76, False: 3.33k]
  |  |  |  |  ------------------
  |  |  |  | 2994|     76|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2983|     76|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2984|     76|	as->length = p - as->s;			\
  |  |  |  |  |  | 2985|     76|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2985:6): [True: 0, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2986|     76|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2987|     76|		return (-1);			\
  |  |  |  |  |  | 2988|     76|	p = as->s + as->length;			\
  |  |  |  |  |  | 2989|     76|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2990|     76|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2990:10): [Folded, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2995|     76|	}					\
  |  |  |  | 2996|  3.33k|	p += w;					\
  |  |  |  | 2997|  3.33k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2997:10): [Folded, False: 3.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3026|  3.33k|	}					\
  |  | 3027|  78.0M|} while (0)
  |  |  ------------------
  |  |  |  Branch (3027:10): [Folded, False: 78.0M]
  |  |  ------------------
  ------------------
 3172|  78.0M|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2977|  78.0M|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2978|  78.0M|	uc = uc2;				\
  |  | 2979|  78.0M|	ucptr = uc2ptr;				\
  |  | 2980|  78.0M|	n = n2;					\
  |  | 2981|  78.0M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2981:10): [Folded, False: 78.0M]
  |  |  ------------------
  ------------------
 3173|  78.0M|				continue;
 3174|  78.0M|			}
 3175|       |
 3176|       |			/*
 3177|       |			 * Try to combine current code points.
 3178|       |			 */
 3179|       |			/*
 3180|       |			 * We have to combine Hangul characters according to
 3181|       |			 * http://uniicode.org/reports/tr15/#Hangul
 3182|       |			 */
 3183|  59.3k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2931|  59.3k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3183:8): [True: 15.8k, False: 43.5k]
  ------------------
 3184|  15.8k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2934|  15.8k|#define HC_LCOUNT	19
  ------------------
  |  Branch (3184:8): [True: 1.11k, False: 14.7k]
  ------------------
 3185|       |				/*
 3186|       |				 * Hangul Composition.
 3187|       |				 * 1. Two current code points are L and V.
 3188|       |				 */
 3189|  1.11k|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2932|  1.11k|#define HC_VBASE	0x1161
  ------------------
 3190|  1.11k|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2935|    663|#define HC_VCOUNT	21
  ------------------
  |  Branch (3190:9): [True: 663, False: 447]
  |  Branch (3190:24): [True: 387, False: 276]
  ------------------
 3191|       |					/* Make syllable of form LV. */
 3192|    387|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2969|    387|#define UPDATE_UC(new_uc)	do {		\
  |  | 2970|    387|	uc = new_uc;				\
  |  | 2971|    387|	ucptr = NULL;				\
  |  | 2972|    387|} while (0)
  |  |  ------------------
  |  |  |  Branch (2972:10): [Folded, False: 387]
  |  |  ------------------
  ------------------
 3193|    387|					    (LIndex * HC_VCOUNT + VIndex) *
 3194|    387|					     HC_TCOUNT);
 3195|    723|				} else {
 3196|    723|					WRITE_UC();
  ------------------
  |  | 3005|    723|#define WRITE_UC()	do {			\
  |  | 3006|    723|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (3006:6): [True: 723, False: 0]
  |  |  ------------------
  |  | 3007|    723|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (3007:7): [True: 26, False: 697]
  |  |  ------------------
  |  | 3008|    723|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2983|     26|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|     26|	as->length = p - as->s;			\
  |  |  |  | 2985|     26|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 26]
  |  |  |  |  ------------------
  |  |  |  | 2986|     26|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|     26|		return (-1);			\
  |  |  |  | 2988|     26|	p = as->s + as->length;			\
  |  |  |  | 2989|     26|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|     26|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3009|    723|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (3009:11): [True: 723, False: 0]
  |  |  ------------------
  |  | 3010|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (3010:3): [True: 0, False: 723]
  |  |  ------------------
  |  | 3011|      0|			*p++ = *ucptr++;	\
  |  | 3012|      0|			/* FALL THROUGH */	\
  |  | 3013|    386|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (3013:3): [True: 386, False: 337]
  |  |  ------------------
  |  | 3014|    386|			*p++ = *ucptr++;	\
  |  | 3015|    386|			/* FALL THROUGH */	\
  |  | 3016|    723|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (3016:3): [True: 337, False: 386]
  |  |  ------------------
  |  | 3017|    723|			*p++ = *ucptr++;	\
  |  | 3018|    723|			/* FALL THROUGH */	\
  |  | 3019|    723|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (3019:3): [True: 0, False: 723]
  |  |  ------------------
  |  | 3020|    723|			*p++ = *ucptr;		\
  |  | 3021|    723|			break;			\
  |  | 3022|    723|		}				\
  |  | 3023|    723|		ucptr = NULL;			\
  |  | 3024|    723|	} else {				\
  |  | 3025|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2992|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2993|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2993:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2994|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2983|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2984|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2985|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2985:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2986|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2987|      0|		return (-1);			\
  |  |  |  |  |  | 2988|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2989|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2990|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2990:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2995|      0|	}					\
  |  |  |  | 2996|      0|	p += w;					\
  |  |  |  | 2997|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2997:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3026|      0|	}					\
  |  | 3027|    723|} while (0)
  |  |  ------------------
  |  |  |  Branch (3027:10): [Folded, False: 723]
  |  |  ------------------
  ------------------
 3197|    723|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2977|    723|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2978|    723|	uc = uc2;				\
  |  | 2979|    723|	ucptr = uc2ptr;				\
  |  | 2980|    723|	n = n2;					\
  |  | 2981|    723|} while (0)
  |  |  ------------------
  |  |  |  Branch (2981:10): [Folded, False: 723]
  |  |  ------------------
  ------------------
 3198|    723|				}
 3199|  1.11k|				continue;
 3200|  58.2k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2930|  58.2k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3200:15): [True: 6.18k, False: 52.0k]
  ------------------
 3201|  6.18k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2938|  64.4k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2934|  6.18k|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2937|  6.18k|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2935|  6.18k|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2936|  6.18k|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2936|  2.44k|#define HC_TCOUNT	28
  ------------------
  |  Branch (3201:8): [True: 2.44k, False: 3.74k]
  |  Branch (3201:30): [True: 1.08k, False: 1.36k]
  ------------------
 3202|       |				/*
 3203|       |				 * Hangul Composition.
 3204|       |				 * 2. Two current code points are LV and T.
 3205|       |				 */
 3206|  1.08k|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2933|  1.08k|#define HC_TBASE	0x11A7
  ------------------
 3207|  1.08k|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2936|    691|#define HC_TCOUNT	28
  ------------------
  |  Branch (3207:9): [True: 691, False: 392]
  |  Branch (3207:23): [True: 13, False: 678]
  ------------------
 3208|       |					/* Make syllable of form LVT. */
 3209|     13|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2969|     13|#define UPDATE_UC(new_uc)	do {		\
  |  | 2970|     13|	uc = new_uc;				\
  |  | 2971|     13|	ucptr = NULL;				\
  |  | 2972|     13|} while (0)
  |  |  ------------------
  |  |  |  Branch (2972:10): [Folded, False: 13]
  |  |  ------------------
  ------------------
 3210|  1.07k|				} else {
 3211|  1.07k|					WRITE_UC();
  ------------------
  |  | 3005|  1.07k|#define WRITE_UC()	do {			\
  |  | 3006|  1.07k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (3006:6): [True: 740, False: 330]
  |  |  ------------------
  |  | 3007|    740|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (3007:7): [True: 19, False: 721]
  |  |  ------------------
  |  | 3008|    740|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2983|     19|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|     19|	as->length = p - as->s;			\
  |  |  |  | 2985|     19|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 19]
  |  |  |  |  ------------------
  |  |  |  | 2986|     19|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|     19|		return (-1);			\
  |  |  |  | 2988|     19|	p = as->s + as->length;			\
  |  |  |  | 2989|     19|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|     19|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3009|    740|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (3009:11): [True: 740, False: 0]
  |  |  ------------------
  |  | 3010|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (3010:3): [True: 0, False: 740]
  |  |  ------------------
  |  | 3011|      0|			*p++ = *ucptr++;	\
  |  | 3012|      0|			/* FALL THROUGH */	\
  |  | 3013|    400|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (3013:3): [True: 400, False: 340]
  |  |  ------------------
  |  | 3014|    400|			*p++ = *ucptr++;	\
  |  | 3015|    400|			/* FALL THROUGH */	\
  |  | 3016|    740|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (3016:3): [True: 340, False: 400]
  |  |  ------------------
  |  | 3017|    740|			*p++ = *ucptr++;	\
  |  | 3018|    740|			/* FALL THROUGH */	\
  |  | 3019|    740|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (3019:3): [True: 0, False: 740]
  |  |  ------------------
  |  | 3020|    740|			*p++ = *ucptr;		\
  |  | 3021|    740|			break;			\
  |  | 3022|    740|		}				\
  |  | 3023|    740|		ucptr = NULL;			\
  |  | 3024|    740|	} else {				\
  |  | 3025|    330|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2992|    330|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2993|    347|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2993:9): [True: 17, False: 330]
  |  |  |  |  ------------------
  |  |  |  | 2994|     17|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2983|     17|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2984|     17|	as->length = p - as->s;			\
  |  |  |  |  |  | 2985|     17|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2985:6): [True: 0, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2986|     17|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2987|     17|		return (-1);			\
  |  |  |  |  |  | 2988|     17|	p = as->s + as->length;			\
  |  |  |  |  |  | 2989|     17|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2990|     17|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2990:10): [Folded, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2995|     17|	}					\
  |  |  |  | 2996|    330|	p += w;					\
  |  |  |  | 2997|    330|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2997:10): [Folded, False: 330]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3026|    330|	}					\
  |  | 3027|  1.07k|} while (0)
  |  |  ------------------
  |  |  |  Branch (3027:10): [Folded, False: 1.07k]
  |  |  ------------------
  ------------------
 3212|  1.07k|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2977|  1.07k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2978|  1.07k|	uc = uc2;				\
  |  | 2979|  1.07k|	ucptr = uc2ptr;				\
  |  | 2980|  1.07k|	n = n2;					\
  |  | 2981|  1.07k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2981:10): [Folded, False: 1.07k]
  |  |  ------------------
  ------------------
 3213|  1.07k|				}
 3214|  1.08k|				continue;
 3215|  57.1k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3215:15): [True: 2.41k, False: 54.7k]
  ------------------
 3216|       |				/* A composition to current code points
 3217|       |				 * is found. */
 3218|  2.41k|				UPDATE_UC(nfc);
  ------------------
  |  | 2969|  2.41k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2970|  2.41k|	uc = new_uc;				\
  |  | 2971|  2.41k|	ucptr = NULL;				\
  |  | 2972|  2.41k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2972:10): [Folded, False: 2.41k]
  |  |  ------------------
  ------------------
 3219|  2.41k|				continue;
 3220|  54.7k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1077|  54.7k|	(((uc) > 0x1E94A)?0:\
  |  |  ------------------
  |  |  |  Branch (1077:3): [True: 14, False: 54.7k]
  |  |  ------------------
  |  | 1078|  54.7k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3220:15): [True: 17.8k, False: 36.9k]
  ------------------
 3221|       |				/* Clearly 'uc2' the second code point is not
 3222|       |				 * a decomposable code. */
 3223|  17.8k|				WRITE_UC();
  ------------------
  |  | 3005|  17.8k|#define WRITE_UC()	do {			\
  |  | 3006|  17.8k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (3006:6): [True: 17.4k, False: 400]
  |  |  ------------------
  |  | 3007|  17.4k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (3007:7): [True: 38, False: 17.4k]
  |  |  ------------------
  |  | 3008|  17.4k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2983|     38|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|     38|	as->length = p - as->s;			\
  |  |  |  | 2985|     38|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 38]
  |  |  |  |  ------------------
  |  |  |  | 2986|     38|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|     38|		return (-1);			\
  |  |  |  | 2988|     38|	p = as->s + as->length;			\
  |  |  |  | 2989|     38|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|     38|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 38]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3009|  17.4k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (3009:11): [True: 17.4k, False: 0]
  |  |  ------------------
  |  | 3010|    232|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (3010:3): [True: 232, False: 17.2k]
  |  |  ------------------
  |  | 3011|    232|			*p++ = *ucptr++;	\
  |  | 3012|    232|			/* FALL THROUGH */	\
  |  | 3013|    696|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (3013:3): [True: 464, False: 16.9k]
  |  |  ------------------
  |  | 3014|    696|			*p++ = *ucptr++;	\
  |  | 3015|    696|			/* FALL THROUGH */	\
  |  | 3016|  11.6k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (3016:3): [True: 10.9k, False: 6.52k]
  |  |  ------------------
  |  | 3017|  11.6k|			*p++ = *ucptr++;	\
  |  | 3018|  11.6k|			/* FALL THROUGH */	\
  |  | 3019|  17.4k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (3019:3): [True: 5.82k, False: 11.6k]
  |  |  ------------------
  |  | 3020|  17.4k|			*p++ = *ucptr;		\
  |  | 3021|  17.4k|			break;			\
  |  | 3022|  17.4k|		}				\
  |  | 3023|  17.4k|		ucptr = NULL;			\
  |  | 3024|  17.4k|	} else {				\
  |  | 3025|    400|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2992|    400|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2993|    413|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2993:9): [True: 13, False: 400]
  |  |  |  |  ------------------
  |  |  |  | 2994|     13|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2983|     13|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2984|     13|	as->length = p - as->s;			\
  |  |  |  |  |  | 2985|     13|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2985:6): [True: 0, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2986|     13|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2987|     13|		return (-1);			\
  |  |  |  |  |  | 2988|     13|	p = as->s + as->length;			\
  |  |  |  |  |  | 2989|     13|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2990|     13|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2990:10): [Folded, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2995|     13|	}					\
  |  |  |  | 2996|    400|	p += w;					\
  |  |  |  | 2997|    400|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2997:10): [Folded, False: 400]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3026|    400|	}					\
  |  | 3027|  17.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (3027:10): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
 3224|  17.8k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2977|  17.8k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2978|  17.8k|	uc = uc2;				\
  |  | 2979|  17.8k|	ucptr = uc2ptr;				\
  |  | 2980|  17.8k|	n = n2;					\
  |  | 2981|  17.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2981:10): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
 3225|  17.8k|				continue;
 3226|  17.8k|			}
 3227|       |
 3228|       |			/*
 3229|       |			 * Collect following decomposable code points.
 3230|       |			 */
 3231|  36.9k|			cx = 0;
 3232|  36.9k|			ucx[0] = uc2;
 3233|  36.9k|			ccx[0] = cl;
 3234|  36.9k|			COLLECT_CPS(1);
  ------------------
  |  | 3032|  36.9k|#define COLLECT_CPS(start)	do {		\
  |  | 3033|  36.9k|	int _i;					\
  |  | 3034|  87.1k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2963|  87.1k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (3034:19): [True: 86.3k, False: 758]
  |  |  ------------------
  |  | 3035|  86.3k|		nx = parse(&ucx[_i], s, len);	\
  |  | 3036|  86.3k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (3036:7): [True: 7.06k, False: 79.3k]
  |  |  ------------------
  |  | 3037|  86.3k|			break;			\
  |  | 3038|  86.3k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1077|  79.3k|	(((uc) > 0x1E94A)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1077:3): [True: 652, False: 78.6k]
  |  |  |  |  ------------------
  |  |  |  | 1078|  79.3k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 3039|  79.3k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (3039:7): [True: 49.7k, False: 29.5k]
  |  |  |  Branch (3039:19): [True: 31.1k, False: 18.5k]
  |  |  |  Branch (3039:32): [True: 29.0k, False: 2.09k]
  |  |  ------------------
  |  | 3040|  79.3k|			break;			\
  |  | 3041|  79.3k|		s += nx;			\
  |  | 3042|  50.2k|		len -= nx;			\
  |  | 3043|  50.2k|		cl = cx;			\
  |  | 3044|  50.2k|		ccx[_i] = cx;			\
  |  | 3045|  50.2k|	}					\
  |  | 3046|  36.9k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2963|  36.9k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (3046:6): [True: 758, False: 36.1k]
  |  |  ------------------
  |  | 3047|    758|		ret = -1;			\
  |  | 3048|    758|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2963|    758|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 3049|    758|	} else					\
  |  | 3050|  36.9k|		ucx_size = _i;			\
  |  | 3051|  36.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (3051:10): [Folded, False: 36.9k]
  |  |  ------------------
  ------------------
 3235|       |
 3236|       |			/*
 3237|       |			 * Find a composed code in the collected code points.
 3238|       |			 */
 3239|  36.9k|			i = 1;
 3240|   120k|			while (i < ucx_size) {
  ------------------
  |  Branch (3240:11): [True: 83.4k, False: 36.9k]
  ------------------
 3241|  83.4k|				int j;
 3242|       |
 3243|  83.4k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3243:9): [True: 59.5k, False: 23.8k]
  ------------------
 3244|  59.5k|					i++;
 3245|  59.5k|					continue;
 3246|  59.5k|				}
 3247|       |
 3248|       |				/*
 3249|       |				 * nfc is composed of uc and ucx[i].
 3250|       |				 */
 3251|  23.8k|				UPDATE_UC(nfc);
  ------------------
  |  | 2969|  23.8k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2970|  23.8k|	uc = new_uc;				\
  |  | 2971|  23.8k|	ucptr = NULL;				\
  |  | 2972|  23.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2972:10): [Folded, False: 23.8k]
  |  |  ------------------
  ------------------
 3252|       |
 3253|       |				/*
 3254|       |				 * Remove ucx[i] by shifting
 3255|       |				 * following code points.
 3256|       |				 */
 3257|  27.5k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3257:17): [True: 3.67k, False: 23.8k]
  ------------------
 3258|  3.67k|					ucx[j] = ucx[j+1];
 3259|  3.67k|					ccx[j] = ccx[j+1];
 3260|  3.67k|				}
 3261|  23.8k|				ucx_size --;
 3262|       |
 3263|       |				/*
 3264|       |				 * Collect following code points blocked
 3265|       |				 * by ucx[i] the removed code point.
 3266|       |				 */
 3267|  23.8k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3267:9): [True: 23.8k, False: 0]
  |  Branch (3267:25): [True: 23.0k, False: 818]
  ------------------
 3268|  23.0k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3268:9): [True: 22.6k, False: 369]
  |  Branch (3268:19): [True: 2.85k, False: 19.8k]
  ------------------
 3269|  2.85k|					cl =  ccx[ucx_size-1];
 3270|  2.85k|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 3032|  2.85k|#define COLLECT_CPS(start)	do {		\
  |  | 3033|  2.85k|	int _i;					\
  |  | 3034|  7.39k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2963|  7.39k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (3034:19): [True: 7.14k, False: 250]
  |  |  ------------------
  |  | 3035|  7.14k|		nx = parse(&ucx[_i], s, len);	\
  |  | 3036|  7.14k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (3036:7): [True: 1.85k, False: 5.28k]
  |  |  ------------------
  |  | 3037|  7.14k|			break;			\
  |  | 3038|  7.14k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1077|  5.28k|	(((uc) > 0x1E94A)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1077:3): [True: 466, False: 4.82k]
  |  |  |  |  ------------------
  |  |  |  | 1078|  5.28k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 3039|  5.28k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (3039:7): [True: 2.41k, False: 2.87k]
  |  |  |  Branch (3039:19): [True: 774, False: 1.64k]
  |  |  |  Branch (3039:32): [True: 750, False: 24]
  |  |  ------------------
  |  | 3040|  5.28k|			break;			\
  |  | 3041|  5.28k|		s += nx;			\
  |  | 3042|  4.53k|		len -= nx;			\
  |  | 3043|  4.53k|		cl = cx;			\
  |  | 3044|  4.53k|		ccx[_i] = cx;			\
  |  | 3045|  4.53k|	}					\
  |  | 3046|  2.85k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2963|  2.85k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (3046:6): [True: 250, False: 2.60k]
  |  |  ------------------
  |  | 3047|    250|		ret = -1;			\
  |  | 3048|    250|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2963|    250|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 3049|    250|	} else					\
  |  | 3050|  2.85k|		ucx_size = _i;			\
  |  | 3051|  2.85k|} while (0)
  |  |  ------------------
  |  |  |  Branch (3051:10): [Folded, False: 2.85k]
  |  |  ------------------
  ------------------
 3271|  2.85k|				}
 3272|       |				/*
 3273|       |				 * Restart finding a composed code with
 3274|       |				 * the updated uc from the top of the
 3275|       |				 * collected code points.
 3276|       |				 */
 3277|  23.8k|				i = 0;
 3278|  23.8k|			}
 3279|       |
 3280|       |			/*
 3281|       |			 * Apparently the current code points are not
 3282|       |			 * decomposed characters or already composed.
 3283|       |			 */
 3284|  36.9k|			WRITE_UC();
  ------------------
  |  | 3005|  36.9k|#define WRITE_UC()	do {			\
  |  | 3006|  36.9k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (3006:6): [True: 12.9k, False: 23.9k]
  |  |  ------------------
  |  | 3007|  12.9k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (3007:7): [True: 56, False: 12.9k]
  |  |  ------------------
  |  | 3008|  12.9k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2983|     56|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|     56|	as->length = p - as->s;			\
  |  |  |  | 2985|     56|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 56]
  |  |  |  |  ------------------
  |  |  |  | 2986|     56|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|     56|		return (-1);			\
  |  |  |  | 2988|     56|	p = as->s + as->length;			\
  |  |  |  | 2989|     56|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|     56|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3009|  12.9k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (3009:11): [True: 12.9k, False: 0]
  |  |  ------------------
  |  | 3010|  1.89k|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (3010:3): [True: 1.89k, False: 11.0k]
  |  |  ------------------
  |  | 3011|  1.89k|			*p++ = *ucptr++;	\
  |  | 3012|  1.89k|			/* FALL THROUGH */	\
  |  | 3013|  2.69k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (3013:3): [True: 799, False: 12.1k]
  |  |  ------------------
  |  | 3014|  2.69k|			*p++ = *ucptr++;	\
  |  | 3015|  2.69k|			/* FALL THROUGH */	\
  |  | 3016|  8.09k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (3016:3): [True: 5.39k, False: 7.56k]
  |  |  ------------------
  |  | 3017|  8.09k|			*p++ = *ucptr++;	\
  |  | 3018|  8.09k|			/* FALL THROUGH */	\
  |  | 3019|  12.9k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (3019:3): [True: 4.86k, False: 8.09k]
  |  |  ------------------
  |  | 3020|  12.9k|			*p++ = *ucptr;		\
  |  | 3021|  12.9k|			break;			\
  |  | 3022|  12.9k|		}				\
  |  | 3023|  12.9k|		ucptr = NULL;			\
  |  | 3024|  23.9k|	} else {				\
  |  | 3025|  23.9k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2992|  23.9k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2993|  23.9k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2993:9): [True: 13, False: 23.9k]
  |  |  |  |  ------------------
  |  |  |  | 2994|     13|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2983|     13|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2984|     13|	as->length = p - as->s;			\
  |  |  |  |  |  | 2985|     13|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2985:6): [True: 0, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2986|     13|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2987|     13|		return (-1);			\
  |  |  |  |  |  | 2988|     13|	p = as->s + as->length;			\
  |  |  |  |  |  | 2989|     13|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2990|     13|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2990:10): [Folded, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2995|     13|	}					\
  |  |  |  | 2996|  23.9k|	p += w;					\
  |  |  |  | 2997|  23.9k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2997:10): [Folded, False: 23.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3026|  23.9k|	}					\
  |  | 3027|  36.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (3027:10): [Folded, False: 36.9k]
  |  |  ------------------
  ------------------
 3285|   104k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3285:16): [True: 67.8k, False: 36.9k]
  ------------------
 3286|  67.8k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2992|   104k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2993|  68.0k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2993:9): [True: 201, False: 67.8k]
  |  |  ------------------
  |  | 2994|    201|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2983|    201|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|    201|	as->length = p - as->s;			\
  |  |  |  | 2985|    201|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 201]
  |  |  |  |  ------------------
  |  |  |  | 2986|    201|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|    201|		return (-1);			\
  |  |  |  | 2988|    201|	p = as->s + as->length;			\
  |  |  |  | 2989|    201|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|    201|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 201]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2995|    201|	}					\
  |  | 2996|  67.8k|	p += w;					\
  |  | 2997|  67.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2997:10): [Folded, False: 67.8k]
  |  |  ------------------
  ------------------
 3287|       |
 3288|       |			/*
 3289|       |			 * Flush out remaining canonical combining characters.
 3290|       |			 */
 3291|  36.9k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3291:8): [True: 28.0k, False: 8.91k]
  |  Branch (3291:18): [True: 5.47k, False: 22.5k]
  |  Branch (3291:30): [True: 5.14k, False: 330]
  ------------------
 3292|   339k|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3292:12): [True: 336k, False: 2.99k]
  ------------------
 3293|   339k|				    > 0) {
 3294|   336k|					cx = CCC(ucx[0]);
  ------------------
  |  | 1077|   336k|	(((uc) > 0x1E94A)?0:\
  |  |  ------------------
  |  |  |  Branch (1077:3): [True: 1.73k, False: 334k]
  |  |  ------------------
  |  | 1078|   336k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
 3295|   336k|					if (cl > cx)
  ------------------
  |  Branch (3295:10): [True: 2.14k, False: 334k]
  ------------------
 3296|  2.14k|						break;
 3297|   334k|					s += nx;
 3298|   334k|					len -= nx;
 3299|   334k|					cl = cx;
 3300|   334k|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2992|   334k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2993|   335k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2993:9): [True: 1.49k, False: 334k]
  |  |  ------------------
  |  | 2994|  1.49k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2983|  1.49k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|  1.49k|	as->length = p - as->s;			\
  |  |  |  | 2985|  1.49k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 1.49k]
  |  |  |  |  ------------------
  |  |  |  | 2986|  1.49k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|  1.49k|		return (-1);			\
  |  |  |  | 2988|  1.49k|	p = as->s + as->length;			\
  |  |  |  | 2989|  1.49k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|  1.49k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2995|  1.49k|	}					\
  |  | 2996|   334k|	p += w;					\
  |  | 2997|   334k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2997:10): [Folded, False: 334k]
  |  |  ------------------
  ------------------
 3301|   334k|				}
 3302|  5.14k|			}
 3303|  36.9k|			break;
 3304|  36.9k|		}
 3305|   205k|		if (n2 < 0) {
  ------------------
  |  Branch (3305:7): [True: 109k, False: 96.1k]
  ------------------
 3306|   109k|			WRITE_UC();
  ------------------
  |  | 3005|   109k|#define WRITE_UC()	do {			\
  |  | 3006|   109k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (3006:6): [True: 108k, False: 1.51k]
  |  |  ------------------
  |  | 3007|   108k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (3007:7): [True: 199, False: 107k]
  |  |  ------------------
  |  | 3008|   108k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2983|    199|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|    199|	as->length = p - as->s;			\
  |  |  |  | 2985|    199|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 199]
  |  |  |  |  ------------------
  |  |  |  | 2986|    199|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|    199|		return (-1);			\
  |  |  |  | 2988|    199|	p = as->s + as->length;			\
  |  |  |  | 2989|    199|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|    199|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3009|   108k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (3009:11): [True: 108k, False: 0]
  |  |  ------------------
  |  | 3010|    512|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (3010:3): [True: 512, False: 107k]
  |  |  ------------------
  |  | 3011|    512|			*p++ = *ucptr++;	\
  |  | 3012|    512|			/* FALL THROUGH */	\
  |  | 3013|  2.62k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (3013:3): [True: 2.11k, False: 105k]
  |  |  ------------------
  |  | 3014|  2.62k|			*p++ = *ucptr++;	\
  |  | 3015|  2.62k|			/* FALL THROUGH */	\
  |  | 3016|  12.6k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (3016:3): [True: 10.0k, False: 98.0k]
  |  |  ------------------
  |  | 3017|  12.6k|			*p++ = *ucptr++;	\
  |  | 3018|  12.6k|			/* FALL THROUGH */	\
  |  | 3019|   108k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (3019:3): [True: 95.4k, False: 12.6k]
  |  |  ------------------
  |  | 3020|   108k|			*p++ = *ucptr;		\
  |  | 3021|   108k|			break;			\
  |  | 3022|   108k|		}				\
  |  | 3023|   108k|		ucptr = NULL;			\
  |  | 3024|   108k|	} else {				\
  |  | 3025|  1.51k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2992|  1.51k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2993|  1.76k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2993:9): [True: 249, False: 1.51k]
  |  |  |  |  ------------------
  |  |  |  | 2994|    249|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2983|    249|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2984|    249|	as->length = p - as->s;			\
  |  |  |  |  |  | 2985|    249|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2985:6): [True: 0, False: 249]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2986|    249|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2987|    249|		return (-1);			\
  |  |  |  |  |  | 2988|    249|	p = as->s + as->length;			\
  |  |  |  |  |  | 2989|    249|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2990|    249|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2990:10): [Folded, False: 249]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2995|    249|	}					\
  |  |  |  | 2996|  1.51k|	p += w;					\
  |  |  |  | 2997|  1.51k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2997:10): [Folded, False: 1.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3026|  1.51k|	}					\
  |  | 3027|   109k|} while (0)
  |  |  ------------------
  |  |  |  Branch (3027:10): [Folded, False: 109k]
  |  |  ------------------
  ------------------
 3307|       |			/* Use a replaced unicode character. */
 3308|   109k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2992|   109k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2993|   111k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2993:9): [True: 1.54k, False: 109k]
  |  |  ------------------
  |  | 2994|  1.54k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2983|  1.54k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|  1.54k|	as->length = p - as->s;			\
  |  |  |  | 2985|  1.54k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 1.54k]
  |  |  |  |  ------------------
  |  |  |  | 2986|  1.54k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|  1.54k|		return (-1);			\
  |  |  |  | 2988|  1.54k|	p = as->s + as->length;			\
  |  |  |  | 2989|  1.54k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|  1.54k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 1.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2995|  1.54k|	}					\
  |  | 2996|   109k|	p += w;					\
  |  | 2997|   109k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2997:10): [Folded, False: 109k]
  |  |  ------------------
  ------------------
 3309|   109k|			s += n2*-1;
 3310|   109k|			len -= n2*-1;
 3311|   109k|			ret = -1;
 3312|   109k|			continue;
 3313|   109k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3313:14): [True: 59.2k, False: 36.9k]
  ------------------
 3314|  59.2k|			WRITE_UC();
  ------------------
  |  | 3005|  59.2k|#define WRITE_UC()	do {			\
  |  | 3006|  59.2k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (3006:6): [True: 59.0k, False: 167]
  |  |  ------------------
  |  | 3007|  59.0k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (3007:7): [True: 1.71k, False: 57.3k]
  |  |  ------------------
  |  | 3008|  59.0k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2983|  1.71k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2984|  1.71k|	as->length = p - as->s;			\
  |  |  |  | 2985|  1.71k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2985:6): [True: 0, False: 1.71k]
  |  |  |  |  ------------------
  |  |  |  | 2986|  1.71k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2987|  1.71k|		return (-1);			\
  |  |  |  | 2988|  1.71k|	p = as->s + as->length;			\
  |  |  |  | 2989|  1.71k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2990|  1.71k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2990:10): [Folded, False: 1.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3009|  59.0k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (3009:11): [True: 59.0k, False: 0]
  |  |  ------------------
  |  | 3010|     88|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (3010:3): [True: 88, False: 58.9k]
  |  |  ------------------
  |  | 3011|     88|			*p++ = *ucptr++;	\
  |  | 3012|     88|			/* FALL THROUGH */	\
  |  | 3013|    397|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (3013:3): [True: 309, False: 58.7k]
  |  |  ------------------
  |  | 3014|    397|			*p++ = *ucptr++;	\
  |  | 3015|    397|			/* FALL THROUGH */	\
  |  | 3016|  3.33k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (3016:3): [True: 2.93k, False: 56.1k]
  |  |  ------------------
  |  | 3017|  3.33k|			*p++ = *ucptr++;	\
  |  | 3018|  3.33k|			/* FALL THROUGH */	\
  |  | 3019|  59.0k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (3019:3): [True: 55.7k, False: 3.33k]
  |  |  ------------------
  |  | 3020|  59.0k|			*p++ = *ucptr;		\
  |  | 3021|  59.0k|			break;			\
  |  | 3022|  59.0k|		}				\
  |  | 3023|  59.0k|		ucptr = NULL;			\
  |  | 3024|  59.0k|	} else {				\
  |  | 3025|    167|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2992|    167|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2993|    248|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2993:9): [True: 81, False: 167]
  |  |  |  |  ------------------
  |  |  |  | 2994|     81|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2983|     81|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2984|     81|	as->length = p - as->s;			\
  |  |  |  |  |  | 2985|     81|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2985:6): [True: 0, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2986|     81|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2987|     81|		return (-1);			\
  |  |  |  |  |  | 2988|     81|	p = as->s + as->length;			\
  |  |  |  |  |  | 2989|     81|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2990|     81|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2990:10): [Folded, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2995|     81|	}					\
  |  |  |  | 2996|    167|	p += w;					\
  |  |  |  | 2997|    167|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2997:10): [Folded, False: 167]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3026|    167|	}					\
  |  | 3027|  59.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (3027:10): [Folded, False: 59.2k]
  |  |  ------------------
  ------------------
 3315|  59.2k|			break;
 3316|  59.2k|		}
 3317|   205k|	}
 3318|  70.9k|	as->length = p - as->s;
 3319|  70.9k|	as->s[as->length] = '\0';
 3320|  70.9k|	if (ts == 2)
  ------------------
  |  Branch (3320:6): [True: 2.94k, False: 67.9k]
  ------------------
 3321|  2.94k|		as->s[as->length+1] = '\0';
 3322|  70.9k|	return (ret);
 3323|  70.9k|}
archive_string.c:get_nfc:
 2942|   140k|{
 2943|   140k|	int t, b;
 2944|       |
 2945|   140k|	t = 0;
 2946|   140k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2947|  1.50M|	while (b >= t) {
  ------------------
  |  Branch (2947:9): [True: 1.39M, False: 114k]
  ------------------
 2948|  1.39M|		int m = (t + b) / 2;
 2949|  1.39M|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2949:7): [True: 612k, False: 779k]
  ------------------
 2950|   612k|			t = m + 1;
 2951|   779k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2951:12): [True: 608k, False: 171k]
  ------------------
 2952|   608k|			b = m - 1;
 2953|   171k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2953:12): [True: 94.8k, False: 76.5k]
  ------------------
 2954|  94.8k|			t = m + 1;
 2955|  76.5k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2955:12): [True: 50.2k, False: 26.2k]
  ------------------
 2956|  50.2k|			b = m - 1;
 2957|  26.2k|		else
 2958|  26.2k|			return (u_composition_table[m].nfc);
 2959|  1.39M|	}
 2960|   114k|	return (0);
 2961|   140k|}
archive_string.c:best_effort_strncat_in_locale:
 2359|     17|{
 2360|     17|	size_t remaining;
 2361|     17|	const uint8_t *itp;
 2362|     17|	int return_value = 0; /* success */
 2363|       |
 2364|       |	/*
 2365|       |	 * If both from-locale and to-locale is the same, this makes a copy.
 2366|       |	 * And then this checks all copied MBS can be WCS if so returns 0.
 2367|       |	 */
 2368|     17|	if (sc->same) {
  ------------------
  |  Branch (2368:6): [True: 0, False: 17]
  ------------------
 2369|      0|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2369:7): [True: 0, False: 0]
  ------------------
 2370|      0|			return (-1);/* No memory */
 2371|      0|		return (invalid_mbs(_p, length, sc));
 2372|      0|	}
 2373|       |
 2374|       |	/*
 2375|       |	 * If a character is ASCII, this just copies it. If not, this
 2376|       |	 * assigns '?' character instead but in UTF-8 locale this assigns
 2377|       |	 * byte sequence 0xEF 0xBD 0xBD, which are code point U+FFFD,
 2378|       |	 * a Replacement Character in Unicode.
 2379|       |	 */
 2380|       |
 2381|     17|	remaining = length;
 2382|     17|	itp = (const uint8_t *)_p;
 2383|    828|	while (remaining > 0 && *itp) {
  ------------------
  |  Branch (2383:9): [True: 811, False: 17]
  |  Branch (2383:26): [True: 811, False: 0]
  ------------------
 2384|    811|		if (*itp > 127) {
  ------------------
  |  Branch (2384:7): [True: 468, False: 343]
  ------------------
 2385|       |			// Non-ASCII: Substitute with suitable replacement
 2386|    468|			if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  106|    468|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2386:8): [True: 0, False: 468]
  ------------------
 2387|      0|				if (archive_string_append(as, utf8_replacement_char, sizeof(utf8_replacement_char)) == NULL) {
  ------------------
  |  Branch (2387:9): [True: 0, False: 0]
  ------------------
 2388|      0|					__archive_errx(1, "Out of memory");
 2389|      0|				}
 2390|    468|			} else {
 2391|    468|				archive_strappend_char(as, '?');
 2392|    468|			}
 2393|    468|			return_value = -1;
 2394|    468|		} else {
 2395|    343|			archive_strappend_char(as, *itp);
 2396|    343|		}
 2397|    811|		++itp;
 2398|    811|		--remaining;
 2399|    811|	}
 2400|     17|	return (return_value);
 2401|     17|}
archive_string.c:utf16nbytes:
 2015|  4.69k|{
 2016|  4.69k|	size_t s;
 2017|  4.69k|	const char *p, *pp;
 2018|       |
 2019|  4.69k|	if (_p == NULL)
  ------------------
  |  Branch (2019:6): [True: 0, False: 4.69k]
  ------------------
 2020|      0|		return (0);
 2021|  4.69k|	p = (const char *)_p;
 2022|       |
 2023|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 2024|  4.69k|	s = 0;
 2025|  4.69k|	pp = p;
 2026|  4.69k|	n >>= 1;
 2027|  86.2k|	while (s < n && (pp[0] || pp[1])) {
  ------------------
  |  Branch (2027:9): [True: 84.1k, False: 2.07k]
  |  Branch (2027:19): [True: 67.8k, False: 16.2k]
  |  Branch (2027:28): [True: 13.6k, False: 2.61k]
  ------------------
 2028|  81.5k|		pp += 2;
 2029|  81.5k|		s++;
 2030|  81.5k|	}
 2031|  4.69k|	return (s<<1);
 2032|  4.69k|}
archive_string.c:mbsnbytes:
 1995|  1.09M|{
 1996|  1.09M|	size_t s;
 1997|  1.09M|	const char *p, *pp;
 1998|       |
 1999|  1.09M|	if (_p == NULL)
  ------------------
  |  Branch (1999:6): [True: 0, False: 1.09M]
  ------------------
 2000|      0|		return (0);
 2001|  1.09M|	p = (const char *)_p;
 2002|       |
 2003|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 2004|  1.09M|	s = 0;
 2005|  1.09M|	pp = p;
 2006|   166M|	while (s < n && *pp) {
  ------------------
  |  Branch (2006:9): [True: 165M, False: 1.02M]
  |  Branch (2006:18): [True: 165M, False: 67.8k]
  ------------------
 2007|   165M|		pp++;
 2008|   165M|		s++;
 2009|   165M|	}
 2010|  1.09M|	return (s);
 2011|  1.09M|}

archive_string_sprintf:
   81|  85.2k|{
   82|  85.2k|	va_list ap;
   83|       |
   84|  85.2k|	va_start(ap, fmt);
   85|  85.2k|	archive_string_vsprintf(as, fmt, ap);
   86|       |	va_end(ap);
   87|  85.2k|}
archive_string_vsprintf:
   96|  1.44M|{
   97|  1.44M|	char long_flag;
   98|  1.44M|	intmax_t s; /* Signed integer temp. */
   99|  1.44M|	uintmax_t u; /* Unsigned integer temp. */
  100|  1.44M|	const char *p, *p2;
  101|  1.44M|	const wchar_t *pw;
  102|       |
  103|  1.44M|	if (archive_string_ensure(as, 64) == NULL)
  ------------------
  |  Branch (103:6): [True: 0, False: 1.44M]
  ------------------
  104|      0|		__archive_errx(1, "Out of memory");
  105|       |
  106|  1.44M|	if (fmt == NULL) {
  ------------------
  |  Branch (106:6): [True: 0, False: 1.44M]
  ------------------
  107|      0|		as->s[0] = 0;
  108|      0|		return;
  109|      0|	}
  110|       |
  111|  58.0M|	for (p = fmt; *p != '\0'; p++) {
  ------------------
  |  Branch (111:16): [True: 56.5M, False: 1.44M]
  ------------------
  112|  56.5M|		const char *saved_p = p;
  113|       |
  114|  56.5M|		if (*p != '%') {
  ------------------
  |  Branch (114:7): [True: 56.1M, False: 390k]
  ------------------
  115|  56.1M|			archive_strappend_char(as, *p);
  116|  56.1M|			continue;
  117|  56.1M|		}
  118|       |
  119|   390k|		p++;
  120|       |
  121|   390k|		long_flag = '\0';
  122|   390k|		switch(*p) {
  ------------------
  |  Branch (122:10): [True: 90.8k, False: 299k]
  ------------------
  123|    998|		case 'l':
  ------------------
  |  Branch (123:3): [True: 998, False: 389k]
  ------------------
  124|    998|			if (p[1] == 'l') {
  ------------------
  |  Branch (124:8): [True: 998, False: 0]
  ------------------
  125|    998|				long_flag = 'L';
  126|    998|				p += 2;
  127|    998|				break;
  128|    998|			}
  129|      0|			__LA_FALLTHROUGH;
  130|  60.1k|		case 'j':
  ------------------
  |  Branch (130:3): [True: 60.1k, False: 330k]
  ------------------
  131|  89.8k|		case 'z':
  ------------------
  |  Branch (131:3): [True: 29.7k, False: 360k]
  ------------------
  132|  89.8k|			long_flag = *p;
  133|  89.8k|			p++;
  134|  89.8k|			break;
  135|   390k|		}
  136|       |
  137|   390k|		switch (*p) {
  138|      0|		case '%':
  ------------------
  |  Branch (138:3): [True: 0, False: 390k]
  ------------------
  139|      0|			archive_strappend_char(as, '%');
  140|      0|			break;
  141|    792|		case 'c':
  ------------------
  |  Branch (141:3): [True: 792, False: 389k]
  ------------------
  142|    792|			s = va_arg(ap, int);
  143|    792|			archive_strappend_char(as, (char)s);
  144|    792|			break;
  145|   200k|		case 'd':
  ------------------
  |  Branch (145:3): [True: 200k, False: 189k]
  ------------------
  146|   200k|			switch(long_flag) {
  147|  52.3k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (147:4): [True: 52.3k, False: 148k]
  ------------------
  148|      0|			case 'l': s = va_arg(ap, long); break;
  ------------------
  |  Branch (148:4): [True: 0, False: 200k]
  ------------------
  149|    811|			case 'L': s = va_arg(ap, long long); break;
  ------------------
  |  Branch (149:4): [True: 811, False: 199k]
  ------------------
  150|      0|			case 'z': s = va_arg(ap, ssize_t); break;
  ------------------
  |  Branch (150:4): [True: 0, False: 200k]
  ------------------
  151|   147k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (151:4): [True: 147k, False: 53.1k]
  ------------------
  152|   200k|			}
  153|   200k|			append_int(as, s, 10);
  154|   200k|			break;
  155|   135k|		case 's':
  ------------------
  |  Branch (155:3): [True: 135k, False: 254k]
  ------------------
  156|   135k|			switch(long_flag) {
  157|      0|			case 'l':
  ------------------
  |  Branch (157:4): [True: 0, False: 135k]
  ------------------
  158|      0|			case 'L':
  ------------------
  |  Branch (158:4): [True: 0, False: 135k]
  ------------------
  159|      0|				pw = va_arg(ap, wchar_t *);
  160|      0|				if (pw == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 0]
  ------------------
  161|      0|					pw = L"(null)";
  162|      0|				if (archive_string_append_from_wcs(as, pw,
  ------------------
  |  Branch (162:9): [True: 0, False: 0]
  ------------------
  163|      0|				    wcslen(pw)) != 0 && errno == ENOMEM)
  ------------------
  |  Branch (163:29): [True: 0, False: 0]
  ------------------
  164|      0|					__archive_errx(1, "Out of memory");
  165|      0|				break;
  166|   135k|			default:
  ------------------
  |  Branch (166:4): [True: 135k, False: 0]
  ------------------
  167|   135k|				p2 = va_arg(ap, char *);
  168|   135k|				if (p2 == NULL)
  ------------------
  |  Branch (168:9): [True: 12, False: 135k]
  ------------------
  169|     12|					p2 = "(null)";
  170|   135k|				archive_strcat(as, p2);
  171|   135k|				break;
  172|   135k|			}
  173|   135k|			break;
  174|   135k|		case 'S':
  ------------------
  |  Branch (174:3): [True: 0, False: 390k]
  ------------------
  175|      0|			pw = va_arg(ap, wchar_t *);
  176|      0|			if (pw == NULL)
  ------------------
  |  Branch (176:8): [True: 0, False: 0]
  ------------------
  177|      0|				pw = L"(null)";
  178|      0|			if (archive_string_append_from_wcs(as, pw,
  ------------------
  |  Branch (178:8): [True: 0, False: 0]
  ------------------
  179|      0|			    wcslen(pw)) != 0 && errno == ENOMEM)
  ------------------
  |  Branch (179:28): [True: 0, False: 0]
  ------------------
  180|      0|				__archive_errx(1, "Out of memory");
  181|      0|			break;
  182|  53.1k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (182:3): [True: 0, False: 390k]
  |  Branch (182:13): [True: 52.7k, False: 337k]
  |  Branch (182:23): [True: 340, False: 390k]
  |  Branch (182:33): [True: 62, False: 390k]
  ------------------
  183|       |			/* Common handling for unsigned integer formats. */
  184|  53.1k|			switch(long_flag) {
  185|  7.80k|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (185:4): [True: 7.80k, False: 45.3k]
  ------------------
  186|      0|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (186:4): [True: 0, False: 53.1k]
  ------------------
  187|    187|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (187:4): [True: 187, False: 52.9k]
  ------------------
  188|  29.7k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (188:4): [True: 29.7k, False: 23.4k]
  ------------------
  189|  15.4k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (189:4): [True: 15.4k, False: 37.7k]
  ------------------
  190|  53.1k|			}
  191|       |			/* Format it in the correct base. */
  192|  53.1k|			switch (*p) {
  ------------------
  |  Branch (192:12): [True: 53.1k, False: 0]
  ------------------
  193|      0|			case 'o': append_uint(as, u, 8, 0); break;
  ------------------
  |  Branch (193:4): [True: 0, False: 53.1k]
  ------------------
  194|  52.7k|			case 'u': append_uint(as, u, 10, 0); break;
  ------------------
  |  Branch (194:4): [True: 52.7k, False: 402]
  ------------------
  195|    340|			case 'x': append_uint(as, u, 16, 0); break;
  ------------------
  |  Branch (195:4): [True: 340, False: 52.8k]
  ------------------
  196|     62|			case 'X': append_uint(as, u, 16, 1); break;
  ------------------
  |  Branch (196:4): [True: 62, False: 53.1k]
  ------------------
  197|  53.1k|			}
  198|  53.1k|			break;
  199|  53.1k|		default:
  ------------------
  |  Branch (199:3): [True: 90, False: 390k]
  ------------------
  200|       |			/* Rewind and print the initial '%' literally. */
  201|     90|			p = saved_p;
  202|     90|			archive_strappend_char(as, *p);
  203|   390k|		}
  204|   390k|	}
  205|  1.44M|}
archive_string_sprintf.c:append_int:
   67|   200k|{
   68|   200k|	uintmax_t ud;
   69|       |
   70|   200k|	if (d < 0) {
  ------------------
  |  Branch (70:6): [True: 19.1k, False: 181k]
  ------------------
   71|  19.1k|		archive_strappend_char(as, '-');
   72|  19.1k|		ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
  ------------------
  |  Branch (72:8): [True: 3, False: 19.1k]
  ------------------
   73|  19.1k|	} else
   74|   181k|		ud = d;
   75|   200k|	append_uint(as, ud, base, 0);
   76|   200k|}
archive_string_sprintf.c:append_uint:
   55|   495k|{
   56|   495k|	static const char digits_lower[] = "0123456789abcdef";
   57|   495k|	static const char digits_upper[] = "0123456789ABCDEF";
   58|   495k|	const char *digits = upper ? digits_upper : digits_lower;
  ------------------
  |  Branch (58:23): [True: 466, False: 494k]
  ------------------
   59|       |
   60|   495k|	if (d >= base)
  ------------------
  |  Branch (60:6): [True: 241k, False: 253k]
  ------------------
   61|   241k|		append_uint(as, d/base, base, upper);
   62|   495k|	archive_strappend_char(as, digits[d % base]);
   63|   495k|}

__archive_dos_to_unix:
   64|  56.8k|{
   65|  56.8k|	uint16_t msTime, msDate;
   66|  56.8k|	struct tm ts;
   67|  56.8k|	time_t t;
   68|       |
   69|  56.8k|	msTime = (0xFFFF & dos_time);
   70|  56.8k|	msDate = (dos_time >> 16);
   71|       |
   72|  56.8k|	memset(&ts, 0, sizeof(ts));
   73|  56.8k|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80; /* Years since 1900. */
   74|  56.8k|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1; /* Month number. */
   75|  56.8k|	ts.tm_mday = msDate & 0x1f; /* Day of month. */
   76|  56.8k|	ts.tm_hour = (msTime >> 11) & 0x1f;
   77|  56.8k|	ts.tm_min = (msTime >> 5) & 0x3f;
   78|  56.8k|	ts.tm_sec = (msTime << 1) & 0x3e;
   79|  56.8k|	ts.tm_isdst = -1;
   80|  56.8k|	t = mktime(&ts);
   81|  56.8k|	return (int64_t)(t == (time_t)-1 ? INT32_MAX : t);
  ------------------
  |  Branch (81:19): [True: 0, False: 56.8k]
  ------------------
   82|  56.8k|}
__archive_ntfs_to_unix:
  136|  4.84k|{
  137|  4.84k|	if (ntfs > INT64_MAX) {
  ------------------
  |  Branch (137:6): [True: 1.53k, False: 3.31k]
  ------------------
  138|  1.53k|		ntfs -= NTFS_EPOC_TICKS;
  ------------------
  |  |   44|  1.53k|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   42|  1.53k|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  1.53k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   43|  1.53k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  1.53k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|  1.53k|		*secs = ntfs / NTFS_TICKS;
  ------------------
  |  |   43|  1.53k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  208|  1.53k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  140|  1.53k|		*nsecs = 100 * (ntfs % NTFS_TICKS);
  ------------------
  |  |   43|  1.53k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  208|  1.53k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  141|  1.53k|	}
  142|  3.31k|	else {
  143|  3.31k|		lldiv_t tdiv;
  144|  3.31k|		int64_t value = (int64_t)ntfs - (int64_t)NTFS_EPOC_TICKS;
  ------------------
  |  |   44|  3.31k|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   42|  3.31k|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  3.31k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   43|  3.31k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  3.31k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|       |
  146|       |		/* lldiv() truncates toward zero, not toward -infinity, so
  147|       |		 * for a negative |value| that isn't an exact multiple of
  148|       |		 * NTFS_TICKS, tdiv.rem would itself come out negative here.
  149|       |		 * Adjust to floor division so *nsecs always ends up
  150|       |		 * non-negative, with the sign folded entirely into *secs,
  151|       |		 * as callers (e.g. struct timespec) expect. */
  152|  3.31k|		tdiv = lldiv(value, NTFS_TICKS);
  ------------------
  |  |   43|  3.31k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  208|  3.31k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  153|  3.31k|		if (tdiv.rem < 0) {
  ------------------
  |  Branch (153:7): [True: 782, False: 2.53k]
  ------------------
  154|    782|			tdiv.quot -= 1;
  155|    782|			tdiv.rem += NTFS_TICKS;
  ------------------
  |  |   43|    782|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  208|    782|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  156|    782|		}
  157|  3.31k|		*secs = tdiv.quot;
  158|  3.31k|		*nsecs = (uint32_t)(tdiv.rem * 100);
  159|  3.31k|	}
  160|  4.84k|}

__archive_clean:
   73|  20.1k|{
   74|  20.1k|	archive_string_conversion_free(a);
   75|  20.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  234|  20.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   76|  20.1k|}
archive_file_count:
  107|  19.6k|{
  108|  19.6k|	return (a->file_count);
  109|  19.6k|}
archive_clear_error:
  157|  1.75M|{
  158|  1.75M|	archive_string_empty(&a->error_string);
  ------------------
  |  |  181|  1.75M|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  159|       |	a->error = NULL;
  160|  1.75M|	a->archive_error_number = 0;
  161|  1.75M|}
archive_set_error:
  165|  1.35M|{
  166|  1.35M|	va_list ap;
  167|       |
  168|  1.35M|	a->archive_error_number = error_number;
  169|  1.35M|	if (fmt == NULL) {
  ------------------
  |  Branch (169:6): [True: 0, False: 1.35M]
  ------------------
  170|      0|		a->error = NULL;
  171|      0|		return;
  172|      0|	}
  173|       |
  174|  1.35M|	archive_string_empty(&(a->error_string));
  ------------------
  |  |  181|  1.35M|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  175|  1.35M|	va_start(ap, fmt);
  176|  1.35M|	archive_string_vsprintf(&(a->error_string), fmt, ap);
  177|       |	va_end(ap);
  178|  1.35M|	a->error = a->error_string.s;
  179|  1.35M|}

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

__archive_create_child:
   88|      2|{
   89|      2|	pid_t child = -1;
   90|      2|	int stdin_pipe[2], stdout_pipe[2], tmp;
   91|       |
   92|      2|#if !defined(POSIX_SPAWN_CLOEXEC_DEFAULT) && \
   93|      2|    (HAVE_FORK || HAVE_VFORK) && \
   94|      2|    (HAVE_CLOSEFROM || HAVE_CLOSE_RANGE || defined(_SC_OPEN_MAX))
   95|      2|#undef HAVE_POSIX_SPAWNP
   96|      2|#endif
   97|       |
   98|       |#if HAVE_POSIX_SPAWNP
   99|       |	posix_spawnattr_t attr;
  100|       |	posix_spawn_file_actions_t actions;
  101|       |	short spawn_flags = 0;
  102|       |	int r;
  103|       |#ifdef SIGPIPE
  104|       |	sigset_t sigdefault;
  105|       |#endif
  106|       |#endif
  107|      2|	struct archive_cmdline *cmdline;
  108|       |
  109|      2|	cmdline = __archive_cmdline_allocate();
  110|      2|	if (cmdline == NULL)
  ------------------
  |  Branch (110:6): [True: 0, False: 2]
  ------------------
  111|      0|		goto state_allocated;
  112|      2|	if (__archive_cmdline_parse(cmdline, cmd) != ARCHIVE_OK)
  ------------------
  |  |  234|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (112:6): [True: 0, False: 2]
  ------------------
  113|      0|		goto state_allocated;
  114|       |
  115|      2|	if (pipe(stdin_pipe) == -1)
  ------------------
  |  Branch (115:6): [True: 0, False: 2]
  ------------------
  116|      0|		goto state_allocated;
  117|      2|	if (stdin_pipe[0] == 1 /* stdout */) {
  ------------------
  |  Branch (117:6): [True: 0, False: 2]
  ------------------
  118|      0|		if ((tmp = dup(stdin_pipe[0])) == -1)
  ------------------
  |  Branch (118:7): [True: 0, False: 0]
  ------------------
  119|      0|			goto stdin_opened;
  120|      0|		close(stdin_pipe[0]);
  121|      0|		stdin_pipe[0] = tmp;
  122|      0|	}
  123|      2|	if (pipe(stdout_pipe) == -1)
  ------------------
  |  Branch (123:6): [True: 0, False: 2]
  ------------------
  124|      0|		goto stdin_opened;
  125|      2|	if (stdout_pipe[1] == 0 /* stdin */) {
  ------------------
  |  Branch (125:6): [True: 0, False: 2]
  ------------------
  126|      0|		if ((tmp = dup(stdout_pipe[1])) == -1)
  ------------------
  |  Branch (126:7): [True: 0, False: 0]
  ------------------
  127|      0|			goto stdout_opened;
  128|      0|		close(stdout_pipe[1]);
  129|      0|		stdout_pipe[1] = tmp;
  130|      0|	}
  131|       |
  132|       |#if HAVE_POSIX_SPAWNP
  133|       |
  134|       |	r = posix_spawnattr_init(&attr);
  135|       |	if (r != 0) {
  136|       |		errno = r;
  137|       |		goto stdout_opened;
  138|       |	}
  139|       |	r = posix_spawn_file_actions_init(&actions);
  140|       |	if (r != 0) {
  141|       |		errno = r;
  142|       |		goto attr_inited;
  143|       |	}
  144|       |#ifdef POSIX_SPAWN_CLOEXEC_DEFAULT
  145|       |	spawn_flags |= POSIX_SPAWN_CLOEXEC_DEFAULT;
  146|       |#endif
  147|       |#ifdef SIGPIPE
  148|       |	/*
  149|       |	 * Callers (including bsdtar and bsdcpio) commonly ignore SIGPIPE,
  150|       |	 * and an ignored signal stays ignored across exec.  Restore the
  151|       |	 * default in the child so that if we stop reading its output
  152|       |	 * early, it is killed by SIGPIPE (which the program filter
  153|       |	 * accepts) rather than failing with EPIPE and a non-zero exit
  154|       |	 * status.  See Issue #1118.
  155|       |	 */
  156|       |	sigemptyset(&sigdefault);
  157|       |	sigaddset(&sigdefault, SIGPIPE);
  158|       |	r = posix_spawnattr_setsigdefault(&attr, &sigdefault);
  159|       |	if (r != 0)
  160|       |		goto actions_inited;
  161|       |	spawn_flags |= POSIX_SPAWN_SETSIGDEF;
  162|       |#endif
  163|       |	if (spawn_flags != 0) {
  164|       |		r = posix_spawnattr_setflags(&attr, spawn_flags);
  165|       |		if (r != 0)
  166|       |			goto actions_inited;
  167|       |	}
  168|       |	r = posix_spawn_file_actions_addclose(&actions, stdin_pipe[1]);
  169|       |	if (r != 0)
  170|       |		goto actions_inited;
  171|       |	r = posix_spawn_file_actions_addclose(&actions, stdout_pipe[0]);
  172|       |	if (r != 0)
  173|       |		goto actions_inited;
  174|       |	/* Setup for stdin. */
  175|       |	r = posix_spawn_file_actions_adddup2(&actions, stdin_pipe[0], 0);
  176|       |	if (r != 0)
  177|       |		goto actions_inited;
  178|       |	if (stdin_pipe[0] != 0 /* stdin */) {
  179|       |		r = posix_spawn_file_actions_addclose(&actions, stdin_pipe[0]);
  180|       |		if (r != 0)
  181|       |			goto actions_inited;
  182|       |	}
  183|       |	/* Setup for stdout. */
  184|       |	r = posix_spawn_file_actions_adddup2(&actions, stdout_pipe[1], 1);
  185|       |	if (r != 0)
  186|       |		goto actions_inited;
  187|       |	if (stdout_pipe[1] != 1 /* stdout */) {
  188|       |		r = posix_spawn_file_actions_addclose(&actions, stdout_pipe[1]);
  189|       |		if (r != 0)
  190|       |			goto actions_inited;
  191|       |	}
  192|       |
  193|       |	/*
  194|       |	 * Pass the current environment to the filter program. Without this,
  195|       |	 * posix_spawnp() would be called with a NULL envp, which spawns the filter
  196|       |	 * program with an empty environment instead of inheriting ours, on any
  197|       |	 * platform where posix_spawnp() is actually used (see the HAVE_POSIX_SPAWNP
  198|       |	 * #undef above: most systems fall back to fork()+exec(), which inherits the
  199|       |	 * environment regardless of what we do here).
  200|       |	 */
  201|       |#ifdef __APPLE__
  202|       |	char** env = *_NSGetEnviron();
  203|       |#else
  204|       |	char** env = environ;
  205|       |#endif
  206|       |
  207|       |	r = posix_spawnp(&child, cmdline->path, &actions, &attr,
  208|       |		cmdline->argv, env);
  209|       |	if (r != 0)
  210|       |		goto actions_inited;
  211|       |	posix_spawn_file_actions_destroy(&actions);
  212|       |	posix_spawnattr_destroy(&attr);
  213|       |
  214|       |#else /* HAVE_POSIX_SPAWNP */
  215|       |
  216|      2|#if HAVE_VFORK
  217|      2|	child = vfork();
  218|       |#else
  219|       |	child = fork();
  220|       |#endif
  221|      2|	if (child == -1)
  ------------------
  |  Branch (221:6): [True: 0, False: 2]
  ------------------
  222|      0|		goto stdout_opened;
  223|      2|	if (child == 0) {
  ------------------
  |  Branch (223:6): [True: 2, False: 0]
  ------------------
  224|      2|		close(stdin_pipe[1]);
  225|      2|		close(stdout_pipe[0]);
  226|      2|		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
  ------------------
  |  Branch (226:7): [True: 0, False: 2]
  ------------------
  227|      0|			_exit(254);
  228|      2|		if (stdin_pipe[0] != 0 /* stdin */)
  ------------------
  |  Branch (228:7): [True: 2, False: 0]
  ------------------
  229|      2|			close(stdin_pipe[0]);
  230|      2|		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
  ------------------
  |  Branch (230:7): [True: 0, False: 2]
  ------------------
  231|      0|			_exit(254);
  232|      2|		if (stdout_pipe[1] != 1 /* stdout */)
  ------------------
  |  Branch (232:7): [True: 2, False: 0]
  ------------------
  233|      2|			close(stdout_pipe[1]);
  234|       |
  235|       |#if HAVE_CLOSEFROM
  236|       |		closefrom(3);
  237|       |#elif HAVE_CLOSE_RANGE
  238|       |		close_range(3, ~0U, 0);
  239|       |#elif defined(_SC_OPEN_MAX)
  240|  2.04k|		for (int i = sysconf(_SC_OPEN_MAX); i > 3;)
  ------------------
  |  Branch (240:39): [True: 2.04k, False: 2]
  ------------------
  241|  2.04k|			close(--i);
  242|      2|#endif
  243|       |
  244|      2|#ifdef SIGPIPE
  245|       |		/* See the posix_spawnattr_setsigdefault() comment above. */
  246|      2|		signal(SIGPIPE, SIG_DFL);
  247|      2|#endif
  248|      2|		execvp(cmdline->path, cmdline->argv);
  249|      2|		_exit(254);
  250|      2|	}
  251|      0|#endif /* HAVE_POSIX_SPAWNP */
  252|       |
  253|      0|	close(stdin_pipe[0]);
  254|      0|	close(stdout_pipe[1]);
  255|       |
  256|      0|	*child_stdin = stdin_pipe[1];
  257|      0|	fcntl(*child_stdin, F_SETFL, O_NONBLOCK);
  258|      0|	*child_stdout = stdout_pipe[0];
  259|      0|	fcntl(*child_stdout, F_SETFL, O_NONBLOCK);
  260|      0|	__archive_cmdline_free(cmdline);
  261|       |
  262|      0|	*out_child = child;
  263|      0|	return ARCHIVE_OK;
  ------------------
  |  |  234|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  264|       |
  265|       |#if HAVE_POSIX_SPAWNP
  266|       |actions_inited:
  267|       |	errno = r;
  268|       |	posix_spawn_file_actions_destroy(&actions);
  269|       |attr_inited:
  270|       |	posix_spawnattr_destroy(&attr);
  271|       |#endif
  272|      0|stdout_opened:
  273|      0|	close(stdout_pipe[0]);
  274|      0|	close(stdout_pipe[1]);
  275|      0|stdin_opened:
  276|      0|	close(stdin_pipe[0]);
  277|      0|	close(stdin_pipe[1]);
  278|      0|state_allocated:
  279|      0|	__archive_cmdline_free(cmdline);
  280|      0|	return ARCHIVE_FAILED;
  ------------------
  |  |  238|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  281|      0|}

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

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

