archive_acl_clear:
  129|   143k|{
  130|   143k|	struct archive_acl_entry *ap;
  131|       |
  132|   144k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 740, False: 143k]
  ------------------
  133|    740|		ap = acl->acl_head->next;
  134|    740|		archive_mstring_clean(&acl->acl_head->name);
  135|    740|		free(acl->acl_head);
  136|    740|		acl->acl_head = ap;
  137|    740|	}
  138|   143k|	free(acl->acl_text_w);
  139|   143k|	acl->acl_text_w = NULL;
  140|   143k|	free(acl->acl_text);
  141|   143k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   143k|	acl->acl_types = 0;
  144|   143k|	acl->acl_state = 0; /* Not counting. */
  145|   143k|}
archive_acl_count:
  380|    209|{
  381|    209|	int count;
  382|    209|	struct archive_acl_entry *ap;
  383|       |
  384|    209|	count = 0;
  385|    209|	ap = acl->acl_head;
  386|    949|	while (ap != NULL) {
  ------------------
  |  Branch (386:9): [True: 740, False: 209]
  ------------------
  387|    740|		if ((ap->type & want_type) != 0)
  ------------------
  |  Branch (387:7): [True: 740, False: 0]
  ------------------
  388|    740|			count++;
  389|    740|		ap = ap->next;
  390|    740|	}
  391|       |
  392|    209|	if (count > 0 && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0))
  ------------------
  |  |  534|     62|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (392:6): [True: 62, False: 147]
  |  Branch (392:19): [True: 37, False: 25]
  ------------------
  393|     37|		count += 3;
  394|    209|	return (count);
  395|    209|}
archive_acl_reset:
  413|    209|{
  414|    209|	int count, cutoff;
  415|       |
  416|    209|	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|    209|	if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
  ------------------
  |  |  534|    209|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (423:6): [True: 39, False: 170]
  ------------------
  424|     39|		cutoff = 3;
  425|    170|	else
  426|    170|		cutoff = 0;
  427|       |
  428|    209|	if (count > cutoff)
  ------------------
  |  Branch (428:6): [True: 62, False: 147]
  ------------------
  429|     62|		acl->acl_state = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|     62|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  430|    147|	else
  431|    147|		acl->acl_state = 0;
  432|    209|	acl->acl_p = acl->acl_head;
  433|    209|	return (count);
  434|    209|}
archive_acl_from_text_l:
 1506|    209|{
 1507|    209|	return archive_acl_from_text_nl(acl, text, strlen(text), want_type, sc);
 1508|    209|}
archive_acl_from_text_nl:
 1513|    209|{
 1514|    209|	struct {
 1515|    209|		const char *start;
 1516|    209|		const char *end;
 1517|    209|	} field[6], name;
 1518|       |
 1519|    209|	const char *s, *st, *text_end;
 1520|    209|	int numfields, fields, n, r, sol, ret;
 1521|    209|	int type, types, tag, permset, id;
 1522|    209|	size_t len;
 1523|    209|	char sep;
 1524|       |
 1525|    209|	switch (want_type) {
 1526|      0|	case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
  ------------------
  |  |  540|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|      0|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (1526:2): [True: 0, False: 209]
  ------------------
 1527|      0|		want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
  ------------------
  |  |  534|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 1528|      0|		__LA_FALLTHROUGH;
 1529|    101|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|    101|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (1529:2): [True: 101, False: 108]
  ------------------
 1530|    101|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|    101|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (1530:2): [True: 0, False: 209]
  ------------------
 1531|    101|		numfields = 5;
 1532|    101|		break;
 1533|    108|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  542|    108|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    108|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    108|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    108|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    108|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    108|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    108|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    108|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1533:2): [True: 108, False: 101]
  ------------------
 1534|    108|		numfields = 6;
 1535|    108|		break;
 1536|      0|	default:
  ------------------
  |  Branch (1536:2): [True: 0, False: 209]
  ------------------
 1537|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|    209|	}
 1539|       |
 1540|    209|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    209|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1541|    209|	types = 0;
 1542|    209|	text_end = (text == NULL) ? text : text + length;
  ------------------
  |  Branch (1542:13): [True: 0, False: 209]
  ------------------
 1543|       |
 1544|  20.8k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1544:9): [True: 20.8k, False: 0]
  |  Branch (1544:25): [True: 20.6k, False: 209]
  |  Branch (1544:39): [True: 20.6k, False: 0]
  ------------------
 1545|       |		/*
 1546|       |		 * Parse the fields out of the next entry,
 1547|       |		 * advance 'text' to start of next entry.
 1548|       |		 */
 1549|  20.6k|		fields = 0;
 1550|  37.1k|		do {
 1551|  37.1k|			const char *start, *end;
 1552|  37.1k|			next_field(&text, &length, &start, &end, &sep);
 1553|  37.1k|			if (fields < numfields) {
  ------------------
  |  Branch (1553:8): [True: 35.8k, False: 1.26k]
  ------------------
 1554|  35.8k|				field[fields].start = start;
 1555|  35.8k|				field[fields].end = end;
 1556|  35.8k|			}
 1557|  37.1k|			++fields;
 1558|  37.1k|		} while (sep == ':');
  ------------------
  |  Branch (1558:12): [True: 16.5k, False: 20.6k]
  ------------------
 1559|       |
 1560|       |		/* Set remaining fields to blank. */
 1561|  92.9k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1561:20): [True: 72.3k, False: 20.6k]
  ------------------
 1562|  72.3k|			field[n].start = field[n].end = NULL;
 1563|       |
 1564|  20.6k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1564:7): [True: 0, False: 20.6k]
  |  Branch (1564:33): [True: 0, False: 20.6k]
  ------------------
 1565|       |			/* This should never happen */
 1566|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1567|      0|		}
 1568|       |
 1569|  20.6k|		if (field[0].start == text_end) {
  ------------------
  |  Branch (1569:7): [True: 5, False: 20.6k]
  ------------------
 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|      5|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      5|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|      5|			continue;
 1579|      5|		}
 1580|       |
 1581|  20.6k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1581:7): [True: 179, False: 20.4k]
  ------------------
 1582|       |			/* Comment, skip entry */
 1583|    179|			continue;
 1584|    179|		}
 1585|       |
 1586|  20.4k|		n = 0;
 1587|  20.4k|		sol = 0;
 1588|  20.4k|		id = -1;
 1589|  20.4k|		permset = 0;
 1590|  20.4k|		name.start = name.end = NULL;
 1591|       |
 1592|  20.4k|		if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  20.4k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  20.4k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  20.4k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  20.4k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  20.4k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  20.4k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  20.4k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  20.4k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1592:7): [True: 15.4k, False: 4.98k]
  ------------------
 1593|       |			/* POSIX.1e ACLs */
 1594|       |			/*
 1595|       |			 * Default keyword "default:user::rwx"
 1596|       |			 * if found, we have one more field
 1597|       |			 *
 1598|       |			 * We also support old Solaris extension:
 1599|       |			 * "defaultuser::rwx" is the default ACL corresponding
 1600|       |			 * to "user::rwx", etc. valid only for first field
 1601|       |			 */
 1602|  15.4k|			s = field[0].start;
 1603|  15.4k|			len = field[0].end - field[0].start;
 1604|  15.4k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1604:8): [True: 2.41k, False: 13.0k]
  |  Branch (1604:22): [True: 1.84k, False: 564]
  |  Branch (1604:35): [True: 121, False: 443]
  ------------------
 1605|  1.90k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1605:11): [True: 58, False: 63]
  ------------------
 1606|  1.90k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  535|  1.90k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1607|  1.90k|				if (len > 7)
  ------------------
  |  Branch (1607:9): [True: 58, False: 1.84k]
  ------------------
 1608|     58|					field[0].start += 7;
 1609|  1.84k|				else
 1610|  1.84k|					n = 1;
 1611|  1.90k|			} else
 1612|  13.5k|				type = want_type;
 1613|       |
 1614|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1615|  15.4k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1615:8): [True: 90, False: 15.3k]
  ------------------
 1616|  15.4k|			    &id) < 0) {
 1617|     90|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     90|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|     90|				continue;
 1619|     90|			}
 1620|       |			/* Field n+3 is optional. */
 1621|  15.3k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1621:8): [True: 15.2k, False: 145]
  |  Branch (1621:20): [True: 1.34k, False: 13.8k]
  ------------------
 1622|  1.34k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1622:8): [True: 35, False: 1.31k]
  ------------------
 1623|  1.34k|			    &id) < 0) {
 1624|     35|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     35|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1625|     35|				continue;
 1626|     35|			}
 1627|       |
 1628|  15.3k|			tag = 0;
 1629|  15.3k|			s = field[n].start;
 1630|  15.3k|			len = field[n].end - field[n].start;
 1631|       |
 1632|  15.3k|			if (len == 0) {
  ------------------
  |  Branch (1632:8): [True: 2.71k, False: 12.6k]
  ------------------
 1633|  2.71k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  2.71k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1634|  2.71k|				continue;
 1635|  2.71k|			}
 1636|       |
 1637|  12.6k|			st = s + 1; 
 1638|       |
 1639|  12.6k|			switch (*s) {
 1640|    800|			case 'u':
  ------------------
  |  Branch (1640:4): [True: 800, False: 11.8k]
  ------------------
 1641|    800|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1641:9): [True: 594, False: 206]
  |  Branch (1641:22): [True: 30, False: 176]
  ------------------
 1642|     30|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1642:12): [True: 15, False: 15]
  ------------------
 1643|    609|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    609|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1644|    800|				break;
 1645|  1.89k|			case 'g':
  ------------------
  |  Branch (1645:4): [True: 1.89k, False: 10.7k]
  ------------------
 1646|  1.89k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1646:9): [True: 1.26k, False: 624]
  |  Branch (1646:22): [True: 260, False: 364]
  ------------------
 1647|    260|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1647:12): [True: 164, False: 96]
  ------------------
 1648|  1.43k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|  1.43k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1649|  1.89k|				break;
 1650|  1.14k|			case 'o':
  ------------------
  |  Branch (1650:4): [True: 1.14k, False: 11.4k]
  ------------------
 1651|  1.14k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1651:9): [True: 472, False: 668]
  |  Branch (1651:22): [True: 341, False: 327]
  ------------------
 1652|    341|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1652:12): [True: 296, False: 45]
  ------------------
 1653|    768|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  553|    768|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1654|  1.14k|				break;
 1655|    514|			case 'm':
  ------------------
  |  Branch (1655:4): [True: 514, False: 12.0k]
  ------------------
 1656|    514|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1656:9): [True: 174, False: 340]
  |  Branch (1656:22): [True: 185, False: 155]
  ------------------
 1657|    185|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1657:12): [True: 8, False: 177]
  ------------------
 1658|    182|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  552|    182|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1659|    514|				break;
 1660|  8.26k|			default:
  ------------------
  |  Branch (1660:4): [True: 8.26k, False: 4.34k]
  ------------------
 1661|  8.26k|					break;
 1662|  12.6k|			}
 1663|       |
 1664|  12.6k|			switch (tag) {
 1665|    768|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    768|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1665:4): [True: 768, False: 11.8k]
  ------------------
 1666|    950|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|    950|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1666:4): [True: 182, False: 12.4k]
  ------------------
 1667|    950|				if (fields == (n + 2)
  ------------------
  |  Branch (1667:9): [True: 502, False: 448]
  ------------------
 1668|    502|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1668:12): [True: 495, False: 7]
  ------------------
 1669|    495|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1669:12): [True: 180, False: 315]
  ------------------
 1670|    495|				    field[n + 1].end, &permset)) {
 1671|       |					/* This is Solaris-style "other:rwx" */
 1672|    180|					sol = 1;
 1673|    770|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1673:16): [True: 36, False: 734]
  ------------------
 1674|     36|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1674:9): [True: 27, False: 9]
  ------------------
 1675|       |					/* Invalid mask or other field */
 1676|     27|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     27|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1677|     27|					continue;
 1678|     27|				}
 1679|    923|				break;
 1680|    923|			case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    609|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1680:4): [True: 609, False: 12.0k]
  ------------------
 1681|  2.04k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  2.04k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1681:4): [True: 1.43k, False: 11.1k]
  ------------------
 1682|  2.04k|				if (id != -1 ||
  ------------------
  |  Branch (1682:9): [True: 500, False: 1.54k]
  ------------------
 1683|  1.72k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1683:9): [True: 1.22k, False: 322]
  ------------------
 1684|  1.72k|					name = field[n + 1];
 1685|  1.72k|					if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
  ------------------
  |  |  549|  1.72k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1685:10): [True: 584, False: 1.13k]
  ------------------
 1686|    584|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    584|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1687|  1.13k|					else
 1688|  1.13k|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|  1.13k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1689|  1.72k|				}
 1690|  2.04k|				break;
 1691|  9.61k|			default:
  ------------------
  |  Branch (1691:4): [True: 9.61k, False: 2.99k]
  ------------------
 1692|       |				/* Invalid tag, skip entry */
 1693|  9.61k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  9.61k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1694|  9.61k|				continue;
 1695|  12.6k|			}
 1696|       |
 1697|       |			/*
 1698|       |			 * Without "default:" we expect mode in field 3
 1699|       |			 * Exception: Solaris other and mask fields
 1700|       |			 */
 1701|  2.96k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1701:8): [True: 2.79k, False: 172]
  |  Branch (1701:24): [True: 1.59k, False: 1.19k]
  ------------------
 1702|  2.79k|			    field[n + 2 - sol].end, &permset)) {
 1703|       |				/* Invalid mode, skip entry */
 1704|  1.59k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.59k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1705|  1.59k|				continue;
 1706|  1.59k|			}
 1707|  4.98k|		} else {
 1708|       |			/* NFS4 ACLs */
 1709|  4.98k|			s = field[0].start;
 1710|  4.98k|			len = field[0].end - field[0].start;
 1711|  4.98k|			tag = 0;
 1712|       |
 1713|  4.98k|			switch (len) {
 1714|    324|			case 4:
  ------------------
  |  Branch (1714:4): [True: 324, False: 4.66k]
  ------------------
 1715|    324|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1715:9): [True: 22, False: 302]
  ------------------
 1716|     22|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|     22|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1717|    324|				break;
 1718|    816|			case 5:
  ------------------
  |  Branch (1718:4): [True: 816, False: 4.16k]
  ------------------
 1719|    816|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1719:9): [True: 306, False: 510]
  ------------------
 1720|    306|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    306|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1721|    816|				break;
 1722|    856|			case 6:
  ------------------
  |  Branch (1722:4): [True: 856, False: 4.12k]
  ------------------
 1723|    856|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1723:9): [True: 194, False: 662]
  ------------------
 1724|    194|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    194|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1725|    662|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1725:14): [True: 281, False: 381]
  ------------------
 1726|    281|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|    281|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1727|    856|				break;
 1728|    340|			case 9:
  ------------------
  |  Branch (1728:4): [True: 340, False: 4.64k]
  ------------------
 1729|    340|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1729:9): [True: 30, False: 310]
  ------------------
 1730|     30|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  554|     30|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1731|    340|				break;
 1732|  2.64k|			default:
  ------------------
  |  Branch (1732:4): [True: 2.64k, False: 2.33k]
  ------------------
 1733|  2.64k|				break;
 1734|  4.98k|			}
 1735|       |
 1736|  4.98k|			if (tag == 0) {
  ------------------
  |  Branch (1736:8): [True: 4.15k, False: 833]
  ------------------
 1737|       |				/* Invalid tag, skip entry */
 1738|  4.15k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  4.15k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1739|  4.15k|				continue;
 1740|  4.15k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  548|  1.66k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1740:15): [True: 22, False: 811]
  ------------------
 1741|    811|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  550|    811|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1741:8): [True: 306, False: 505]
  ------------------
 1742|    328|				n = 1;
 1743|    328|				name = field[1];
 1744|    328|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1744:9): [True: 1, False: 327]
  ------------------
 1745|      1|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1746|      1|					continue;
 1747|      1|				}
 1748|    328|			} else
 1749|    505|				n = 0;
 1750|       |
 1751|    832|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1751:8): [True: 42, False: 790]
  ------------------
 1752|    832|			    field[1 + n].end, &permset)) {
 1753|       |				/* Invalid NFSv4 perms, skip entry */
 1754|     42|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     42|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1755|     42|				continue;
 1756|     42|			}
 1757|    790|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1757:8): [True: 264, False: 526]
  ------------------
 1758|    790|			    field[2 + n].end, &permset)) {
 1759|       |				/* Invalid NFSv4 flags, skip entry */
 1760|    264|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    264|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1761|    264|				continue;
 1762|    264|			}
 1763|    526|			s = field[3 + n].start;
 1764|    526|			len = field[3 + n].end - field[3 + n].start;
 1765|    526|			type = 0;
 1766|    526|			if (len == 4) {
  ------------------
  |  Branch (1766:8): [True: 333, False: 193]
  ------------------
 1767|    333|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1767:9): [True: 99, False: 234]
  ------------------
 1768|     99|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  537|     99|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1769|    333|			} else if (len == 5) {
  ------------------
  |  Branch (1769:15): [True: 107, False: 86]
  ------------------
 1770|    107|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1770:9): [True: 36, False: 71]
  ------------------
 1771|     36|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  536|     36|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1772|     71|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1772:14): [True: 32, False: 39]
  ------------------
 1773|     32|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  538|     32|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1774|     39|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1774:14): [True: 25, False: 14]
  ------------------
 1775|     25|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  539|     25|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1776|    107|			}
 1777|    526|			if (type == 0) {
  ------------------
  |  Branch (1777:8): [True: 334, False: 192]
  ------------------
 1778|       |				/* Invalid entry type, skip entry */
 1779|    334|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    334|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1780|    334|				continue;
 1781|    334|			}
 1782|    192|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1782:8): [True: 1, False: 191]
  ------------------
 1783|    192|			    &id) < 0) {
 1784|      1|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1785|      1|				continue;
 1786|      1|			}
 1787|    192|		}
 1788|       |
 1789|       |		/* Add entry to the internal list. */
 1790|  1.56k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1791|  1.56k|		    tag, id, name.start, name.end - name.start, sc);
 1792|  1.56k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  1.56k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1792:7): [True: 0, False: 1.56k]
  ------------------
 1793|      0|			return (r);
 1794|  1.56k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 832, False: 728]
  ------------------
 1795|    832|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    832|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1796|  1.56k|		types |= type;
 1797|  1.56k|	}
 1798|       |
 1799|       |	/* Reset ACL */
 1800|    209|	archive_acl_reset(acl, types);
 1801|       |
 1802|    209|	return (ret);
 1803|    209|}
archive_acl.c:acl_special:
  240|  1.56k|{
  241|  1.56k|	if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
  ------------------
  |  |  534|  3.12k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (241:6): [True: 1.25k, False: 304]
  ------------------
  242|  1.25k|	    && ((permset & ~007) == 0)) {
  ------------------
  |  Branch (242:9): [True: 1.25k, False: 0]
  ------------------
  243|  1.25k|		switch (tag) {
  ------------------
  |  Branch (243:11): [True: 252, False: 1.00k]
  ------------------
  244|     20|		case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|     20|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (244:3): [True: 20, False: 1.23k]
  ------------------
  245|     20|			acl->mode &= ~0700;
  246|     20|			acl->mode |= (permset & 7) << 6;
  247|     20|			return (0);
  248|      4|		case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|      4|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (248:3): [True: 4, False: 1.25k]
  ------------------
  249|      4|			acl->mode &= ~0070;
  250|      4|			acl->mode |= (permset & 7) << 3;
  251|      4|			return (0);
  252|    228|		case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    228|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (252:3): [True: 228, False: 1.02k]
  ------------------
  253|    228|			acl->mode &= ~0007;
  254|    228|			acl->mode |= permset & 7;
  255|    228|			return (0);
  256|  1.25k|		}
  257|  1.25k|	}
  258|  1.30k|	return (1);
  259|  1.56k|}
archive_acl.c:acl_new_entry:
  268|  1.30k|{
  269|  1.30k|	struct archive_acl_entry *ap, *aq;
  270|       |
  271|       |	/* Reject an invalid type */
  272|  1.30k|	switch (type) {
  273|  1.00k|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|  1.00k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (273:2): [True: 1.00k, False: 304]
  ------------------
  274|  1.11k|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|  1.11k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (274:2): [True: 113, False: 1.19k]
  ------------------
  275|  1.15k|	case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
  ------------------
  |  |  536|  1.15k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
  |  Branch (275:2): [True: 35, False: 1.27k]
  ------------------
  276|  1.25k|	case ARCHIVE_ENTRY_ACL_TYPE_DENY:
  ------------------
  |  |  537|  1.25k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
  |  Branch (276:2): [True: 99, False: 1.20k]
  ------------------
  277|  1.28k|	case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
  ------------------
  |  |  538|  1.28k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
  |  Branch (277:2): [True: 32, False: 1.27k]
  ------------------
  278|  1.30k|	case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
  ------------------
  |  |  539|  1.30k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
  |  Branch (278:2): [True: 25, False: 1.28k]
  ------------------
  279|  1.30k|		break;
  280|      0|	default:
  ------------------
  |  Branch (280:2): [True: 0, False: 1.30k]
  ------------------
  281|      0|		return (NULL);
  282|  1.30k|	}
  283|       |
  284|       |	/* Type argument must be a valid NFS4 or POSIX.1e type.
  285|       |	 * The type must agree with anything already set and
  286|       |	 * the permset must be compatible. */
  287|  1.30k|	if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  1.30k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  1.30k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  1.30k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  1.30k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  1.30k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  1.30k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  1.30k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  1.30k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (287:6): [True: 191, False: 1.11k]
  ------------------
  288|    191|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    191|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    191|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    191|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    191|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (288:7): [True: 0, False: 191]
  ------------------
  289|      0|			return (NULL);
  290|      0|		}
  291|    191|		if (permset &
  ------------------
  |  Branch (291:7): [True: 0, False: 191]
  ------------------
  292|    191|		    ~(ARCHIVE_ENTRY_ACL_PERMS_NFS4
  ------------------
  |  |  495|    191|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|    191|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  496|    191|	    | ARCHIVE_ENTRY_ACL_READ_DATA		\
  |  |  ------------------
  |  |  |  |  472|    191|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  |  |  ------------------
  |  |  497|    191|	    | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 		\
  |  |  ------------------
  |  |  |  |  473|    191|#define	ARCHIVE_ENTRY_ACL_LIST_DIRECTORY      0x00000008
  |  |  ------------------
  |  |  498|    191|	    | ARCHIVE_ENTRY_ACL_WRITE_DATA		\
  |  |  ------------------
  |  |  |  |  474|    191|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  |  |  ------------------
  |  |  499|    191|	    | ARCHIVE_ENTRY_ACL_ADD_FILE		\
  |  |  ------------------
  |  |  |  |  475|    191|#define	ARCHIVE_ENTRY_ACL_ADD_FILE            0x00000010
  |  |  ------------------
  |  |  500|    191|	    | ARCHIVE_ENTRY_ACL_APPEND_DATA		\
  |  |  ------------------
  |  |  |  |  476|    191|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  |  |  ------------------
  |  |  501|    191|	    | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY	\
  |  |  ------------------
  |  |  |  |  477|    191|#define	ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY    0x00000020
  |  |  ------------------
  |  |  502|    191|	    | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  478|    191|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  |  |  ------------------
  |  |  503|    191|	    | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  479|    191|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  |  |  ------------------
  |  |  504|    191|	    | ARCHIVE_ENTRY_ACL_DELETE_CHILD		\
  |  |  ------------------
  |  |  |  |  480|    191|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  |  |  ------------------
  |  |  505|    191|	    | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES		\
  |  |  ------------------
  |  |  |  |  481|    191|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  |  |  ------------------
  |  |  506|    191|	    | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES	\
  |  |  ------------------
  |  |  |  |  482|    191|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  |  |  ------------------
  |  |  507|    191|	    | ARCHIVE_ENTRY_ACL_DELETE			\
  |  |  ------------------
  |  |  |  |  483|    191|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  |  |  ------------------
  |  |  508|    191|	    | ARCHIVE_ENTRY_ACL_READ_ACL		\
  |  |  ------------------
  |  |  |  |  484|    191|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  |  |  ------------------
  |  |  509|    191|	    | ARCHIVE_ENTRY_ACL_WRITE_ACL		\
  |  |  ------------------
  |  |  |  |  485|    191|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  |  |  ------------------
  |  |  510|    191|	    | ARCHIVE_ENTRY_ACL_WRITE_OWNER		\
  |  |  ------------------
  |  |  |  |  486|    191|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  |  |  ------------------
  |  |  511|    191|	    | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
  |  |  ------------------
  |  |  |  |  487|    191|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  |  |  ------------------
  ------------------
  293|    191|			| ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) {
  ------------------
  |  |  525|    191|	(ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT			\
  |  |  ------------------
  |  |  |  |  517|    191|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  |  |  ------------------
  |  |  526|    191|	    | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT		\
  |  |  ------------------
  |  |  |  |  518|    191|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  |  |  ------------------
  |  |  527|    191|	    | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT	\
  |  |  ------------------
  |  |  |  |  519|    191|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  |  |  ------------------
  |  |  528|    191|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY		\
  |  |  ------------------
  |  |  |  |  520|    191|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  |  |  ------------------
  |  |  529|    191|	    | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS		\
  |  |  ------------------
  |  |  |  |  521|    191|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  |  |  ------------------
  |  |  530|    191|	    | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS		\
  |  |  ------------------
  |  |  |  |  522|    191|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  |  |  ------------------
  |  |  531|    191|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
  |  |  ------------------
  |  |  |  |  516|    191|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  |  |  ------------------
  ------------------
  294|      0|			return (NULL);
  295|      0|		}
  296|  1.11k|	} else	if (type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.11k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.11k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.11k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.11k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (296:13): [True: 1.11k, False: 0]
  ------------------
  297|  1.11k|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.11k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.11k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.11k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.11k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (297:7): [True: 0, False: 1.11k]
  ------------------
  298|      0|			return (NULL);
  299|      0|		}
  300|  1.11k|		if (permset & ~ARCHIVE_ENTRY_ACL_PERMS_POSIX1E) {
  ------------------
  |  |  490|  1.11k|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|  1.11k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  491|  1.11k|	    | ARCHIVE_ENTRY_ACL_WRITE			\
  |  |  ------------------
  |  |  |  |  470|  1.11k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  |  |  ------------------
  |  |  492|  1.11k|	    | ARCHIVE_ENTRY_ACL_READ)
  |  |  ------------------
  |  |  |  |  471|  1.11k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  |  |  ------------------
  ------------------
  |  Branch (300:7): [True: 0, False: 1.11k]
  ------------------
  301|      0|			return (NULL);
  302|      0|		}
  303|  1.11k|	} else {
  304|      0|		return (NULL);
  305|      0|	}
  306|       |
  307|       |	/* Verify the tag is valid and compatible with NFS4 or POSIX.1e. */
  308|  1.30k|	switch (tag) {
  309|    225|	case ARCHIVE_ENTRY_ACL_USER:
  ------------------
  |  |  548|    225|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (309:2): [True: 225, False: 1.08k]
  ------------------
  310|    282|	case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    282|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (310:2): [True: 57, False: 1.25k]
  ------------------
  311|  1.14k|	case ARCHIVE_ENTRY_ACL_GROUP:
  ------------------
  |  |  550|  1.14k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (311:2): [True: 863, False: 445]
  ------------------
  312|  1.18k|	case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  1.18k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (312:2): [True: 35, False: 1.27k]
  ------------------
  313|       |		/* Tags valid in both NFS4 and POSIX.1e */
  314|  1.18k|		break;
  315|     66|	case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|     66|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (315:2): [True: 66, False: 1.24k]
  ------------------
  316|    123|	case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    123|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (316:2): [True: 57, False: 1.25k]
  ------------------
  317|       |		/* Tags valid only in POSIX.1e. */
  318|    123|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|    123|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|    123|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|    123|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|    123|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (318:7): [True: 0, False: 123]
  ------------------
  319|      0|			return (NULL);
  320|      0|		}
  321|    123|		break;
  322|    123|	case ARCHIVE_ENTRY_ACL_EVERYONE:
  ------------------
  |  |  554|      5|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
  |  Branch (322:2): [True: 5, False: 1.30k]
  ------------------
  323|       |		/* Tags valid only in NFS4. */
  324|      5|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|      5|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|      5|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|      5|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|      5|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (324:7): [True: 0, False: 5]
  ------------------
  325|      0|			return (NULL);
  326|      0|		}
  327|      5|		break;
  328|      5|	default:
  ------------------
  |  Branch (328:2): [True: 0, False: 1.30k]
  ------------------
  329|       |		/* No other values are valid. */
  330|      0|		return (NULL);
  331|  1.30k|	}
  332|       |
  333|  1.30k|	free(acl->acl_text_w);
  334|  1.30k|	acl->acl_text_w = NULL;
  335|  1.30k|	free(acl->acl_text);
  336|  1.30k|	acl->acl_text = NULL;
  337|       |
  338|       |	/*
  339|       |	 * If there's a matching entry already in the list, overwrite it.
  340|       |	 * NFSv4 entries may be repeated and are not overwritten.
  341|       |	 *
  342|       |	 * TODO: compare names of no id is provided (needs more rework)
  343|       |	 */
  344|  1.30k|	ap = acl->acl_head;
  345|  1.30k|	aq = NULL;
  346|  11.7k|	while (ap != NULL) {
  ------------------
  |  Branch (346:9): [True: 11.0k, False: 740]
  ------------------
  347|  11.0k|		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
  ------------------
  |  |  542|  11.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  11.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  11.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  11.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  11.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  11.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  11.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  11.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (347:7): [True: 9.34k, False: 1.69k]
  ------------------
  348|  9.34k|		    ap->type == type && ap->tag == tag && ap->id == id) {
  ------------------
  |  Branch (348:7): [True: 8.33k, False: 1.00k]
  |  Branch (348:27): [True: 7.09k, False: 1.23k]
  |  Branch (348:45): [True: 6.30k, False: 793]
  ------------------
  349|  6.30k|			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
  ------------------
  |  |  548|  11.6k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (349:8): [True: 468, False: 5.83k]
  |  Branch (349:21): [True: 3.93k, False: 1.90k]
  ------------------
  350|  3.93k|			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
  ------------------
  |  |  550|  3.93k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (350:8): [True: 100, False: 3.83k]
  ------------------
  351|    568|				ap->permset = permset;
  352|    568|				return (ap);
  353|    568|			}
  354|  6.30k|		}
  355|  10.4k|		aq = ap;
  356|  10.4k|		ap = ap->next;
  357|  10.4k|	}
  358|       |
  359|       |	/* Add a new entry to the end of the list. */
  360|    740|	ap = calloc(1, sizeof(*ap));
  361|    740|	if (ap == NULL)
  ------------------
  |  Branch (361:6): [True: 0, False: 740]
  ------------------
  362|      0|		return (NULL);
  363|    740|	if (aq == NULL)
  ------------------
  |  Branch (363:6): [True: 62, False: 678]
  ------------------
  364|     62|		acl->acl_head = ap;
  365|    678|	else
  366|    678|		aq->next = ap;
  367|    740|	ap->type = type;
  368|    740|	ap->tag = tag;
  369|    740|	ap->id = id;
  370|    740|	ap->permset = permset;
  371|    740|	acl->acl_types |= type;
  372|    740|	return (ap);
  373|    740|}
archive_acl.c:archive_acl_add_entry_len_l:
  209|  1.56k|{
  210|  1.56k|	struct archive_acl_entry *ap;
  211|  1.56k|	int r;
  212|       |
  213|  1.56k|	if (acl_special(acl, type, permset, tag) == 0)
  ------------------
  |  Branch (213:6): [True: 252, False: 1.30k]
  ------------------
  214|    252|		return ARCHIVE_OK;
  ------------------
  |  |  233|    252|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  215|  1.30k|	ap = acl_new_entry(acl, type, permset, tag, id);
  216|  1.30k|	if (ap == NULL) {
  ------------------
  |  Branch (216:6): [True: 0, False: 1.30k]
  ------------------
  217|       |		/* XXX Error XXX */
  218|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  219|      0|	}
  220|  1.30k|	if (name != NULL  &&  *name != '\0' && len > 0) {
  ------------------
  |  Branch (220:6): [True: 1.08k, False: 220]
  |  Branch (220:24): [True: 1.08k, False: 0]
  |  Branch (220:41): [True: 995, False: 93]
  ------------------
  221|    995|		r = archive_mstring_copy_mbs_len_l(&ap->name, name, len, sc);
  222|    995|	} else {
  223|    313|		r = 0;
  224|    313|		archive_mstring_clean(&ap->name);
  225|    313|	}
  226|  1.30k|	if (r == 0)
  ------------------
  |  Branch (226:6): [True: 476, False: 832]
  ------------------
  227|    476|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    476|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  228|    832|	else if (errno == ENOMEM)
  ------------------
  |  Branch (228:11): [True: 0, False: 832]
  ------------------
  229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|    832|	else
  231|    832|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    832|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  232|  1.30k|}
archive_acl.c:isint:
 1812|  17.3k|{
 1813|  17.3k|	int n = 0;
 1814|  17.3k|	if (start >= end)
  ------------------
  |  Branch (1814:6): [True: 11.9k, False: 5.32k]
  ------------------
 1815|  11.9k|		return (0);
 1816|  8.41k|	while (start < end) {
  ------------------
  |  Branch (1816:9): [True: 7.67k, False: 739]
  ------------------
 1817|  7.67k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1817:7): [True: 3.37k, False: 4.30k]
  |  Branch (1817:23): [True: 1.08k, False: 3.21k]
  ------------------
 1818|  4.46k|			return (0);
 1819|  3.21k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1819:7): [True: 84, False: 3.13k]
  ------------------
 1820|  3.13k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1820:8): [True: 43, False: 3.08k]
  |  Branch (1820:29): [True: 43, False: 0]
  ------------------
 1821|    127|			return (-1);
 1822|  3.08k|		} else {
 1823|  3.08k|			n *= 10;
 1824|  3.08k|			n += *start - '0';
 1825|  3.08k|		}
 1826|  3.08k|		start++;
 1827|  3.08k|	}
 1828|    739|	*result = n;
 1829|    739|	return (1);
 1830|  5.32k|}
archive_acl.c:ismode:
 1839|  3.28k|{
 1840|  3.28k|	const char *p;
 1841|       |
 1842|  3.28k|	if (start >= end)
  ------------------
  |  Branch (1842:6): [True: 1.21k, False: 2.06k]
  ------------------
 1843|  1.21k|		return (0);
 1844|  2.06k|	p = start;
 1845|  2.06k|	*permset = 0;
 1846|  6.64k|	while (p < end) {
  ------------------
  |  Branch (1846:9): [True: 5.27k, False: 1.37k]
  ------------------
 1847|  5.27k|		switch (*p++) {
 1848|    998|		case 'r': case 'R':
  ------------------
  |  Branch (1848:3): [True: 866, False: 4.40k]
  |  Branch (1848:13): [True: 132, False: 5.13k]
  ------------------
 1849|    998|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  471|    998|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1850|    998|			break;
 1851|      0|		case 'w': case 'W':
  ------------------
  |  Branch (1851:3): [True: 0, False: 5.27k]
  |  Branch (1851:13): [True: 0, False: 5.27k]
  ------------------
 1852|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  470|      0|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1853|      0|			break;
 1854|      0|		case 'x': case 'X':
  ------------------
  |  Branch (1854:3): [True: 0, False: 5.27k]
  |  Branch (1854:13): [True: 0, False: 5.27k]
  ------------------
 1855|      0|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|      0|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1856|      0|			break;
 1857|  3.58k|		case '-':
  ------------------
  |  Branch (1857:3): [True: 3.58k, False: 1.69k]
  ------------------
 1858|  3.58k|			break;
 1859|    692|		default:
  ------------------
  |  Branch (1859:3): [True: 692, False: 4.57k]
  ------------------
 1860|    692|			return (0);
 1861|  5.27k|		}
 1862|  5.27k|	}
 1863|  1.37k|	return (1);
 1864|  2.06k|}
archive_acl.c:is_nfs4_perms:
 1873|    832|{
 1874|    832|	const char *p = start;
 1875|       |
 1876|  1.32k|	while (p < end) {
  ------------------
  |  Branch (1876:9): [True: 538, False: 790]
  ------------------
 1877|    538|		switch (*p++) {
 1878|      0|		case 'r':
  ------------------
  |  Branch (1878:3): [True: 0, False: 538]
  ------------------
 1879|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  472|      0|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1880|      0|			break;
 1881|      0|		case 'w':
  ------------------
  |  Branch (1881:3): [True: 0, False: 538]
  ------------------
 1882|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  474|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1883|      0|			break;
 1884|     18|		case 'x':
  ------------------
  |  Branch (1884:3): [True: 18, False: 520]
  ------------------
 1885|     18|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|     18|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1886|     18|			break;
 1887|      0|		case 'p':
  ------------------
  |  Branch (1887:3): [True: 0, False: 538]
  ------------------
 1888|      0|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  476|      0|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1889|      0|			break;
 1890|      0|		case 'D':
  ------------------
  |  Branch (1890:3): [True: 0, False: 538]
  ------------------
 1891|      0|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  480|      0|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1892|      0|			break;
 1893|      5|		case 'd':
  ------------------
  |  Branch (1893:3): [True: 5, False: 533]
  ------------------
 1894|      5|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  483|      5|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1895|      5|			break;
 1896|     25|		case 'a':
  ------------------
  |  Branch (1896:3): [True: 25, False: 513]
  ------------------
 1897|     25|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  481|     25|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1898|     25|			break;
 1899|      8|		case 'A':
  ------------------
  |  Branch (1899:3): [True: 8, False: 530]
  ------------------
 1900|      8|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  482|      8|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1901|      8|			break;
 1902|      0|		case 'R':
  ------------------
  |  Branch (1902:3): [True: 0, False: 538]
  ------------------
 1903|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  478|      0|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1904|      0|			break;
 1905|      0|		case 'W':
  ------------------
  |  Branch (1905:3): [True: 0, False: 538]
  ------------------
 1906|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  479|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1907|      0|			break;
 1908|      7|		case 'c':
  ------------------
  |  Branch (1908:3): [True: 7, False: 531]
  ------------------
 1909|      7|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  484|      7|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1910|      7|			break;
 1911|    406|		case 'C':
  ------------------
  |  Branch (1911:3): [True: 406, False: 132]
  ------------------
 1912|    406|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  485|    406|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1913|    406|			break;
 1914|      1|		case 'o':
  ------------------
  |  Branch (1914:3): [True: 1, False: 537]
  ------------------
 1915|      1|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  486|      1|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1916|      1|			break;
 1917|      0|		case 's':
  ------------------
  |  Branch (1917:3): [True: 0, False: 538]
  ------------------
 1918|      0|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  487|      0|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1919|      0|			break;
 1920|     26|		case '-':
  ------------------
  |  Branch (1920:3): [True: 26, False: 512]
  ------------------
 1921|     26|			break;
 1922|     42|		default:
  ------------------
  |  Branch (1922:3): [True: 42, False: 496]
  ------------------
 1923|     42|			return(0);
 1924|    538|		}
 1925|    538|	}
 1926|    790|	return (1);
 1927|    832|}
archive_acl.c:is_nfs4_flags:
 1936|    790|{
 1937|    790|	const char *p = start;
 1938|       |
 1939|  1.41k|	while (p < end) {
  ------------------
  |  Branch (1939:9): [True: 888, False: 526]
  ------------------
 1940|    888|		switch(*p++) {
 1941|     26|		case 'f':
  ------------------
  |  Branch (1941:3): [True: 26, False: 862]
  ------------------
 1942|     26|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  517|     26|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1943|     26|			break;
 1944|      2|		case 'd':
  ------------------
  |  Branch (1944:3): [True: 2, False: 886]
  ------------------
 1945|      2|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  518|      2|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1946|      2|			break;
 1947|    182|		case 'i':
  ------------------
  |  Branch (1947:3): [True: 182, False: 706]
  ------------------
 1948|    182|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  520|    182|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1949|    182|			break;
 1950|      5|		case 'n':
  ------------------
  |  Branch (1950:3): [True: 5, False: 883]
  ------------------
 1951|      5|			*permset |=
 1952|      5|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  519|      5|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1953|      5|			break;
 1954|     17|		case 'S':
  ------------------
  |  Branch (1954:3): [True: 17, False: 871]
  ------------------
 1955|     17|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  521|     17|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1956|     17|			break;
 1957|    369|		case 'F':
  ------------------
  |  Branch (1957:3): [True: 369, False: 519]
  ------------------
 1958|    369|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  522|    369|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1959|    369|			break;
 1960|     13|		case 'I':
  ------------------
  |  Branch (1960:3): [True: 13, False: 875]
  ------------------
 1961|     13|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  516|     13|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1962|     13|			break;
 1963|     10|		case '-':
  ------------------
  |  Branch (1963:3): [True: 10, False: 878]
  ------------------
 1964|     10|			break;
 1965|    264|		default:
  ------------------
  |  Branch (1965:3): [True: 264, False: 624]
  ------------------
 1966|    264|			return (0);
 1967|    888|		}
 1968|    888|	}
 1969|    526|	return (1);
 1970|    790|}
archive_acl.c:next_field:
 1983|  37.1k|{
 1984|       |	/* Skip leading whitespace to find start of field. */
 1985|  76.0k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1985:9): [True: 76.0k, False: 17]
  |  Branch (1985:20): [True: 309, False: 75.7k]
  |  Branch (1985:34): [True: 421, False: 75.2k]
  |  Branch (1985:49): [True: 38.1k, False: 37.1k]
  ------------------
 1986|  38.8k|		(*p)++;
 1987|  38.8k|		(*l)--;
 1988|  38.8k|	}
 1989|  37.1k|	*start = *p;
 1990|       |
 1991|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1992|   168k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1992:9): [True: 167k, False: 188]
  |  Branch (1992:19): [True: 166k, False: 1.88k]
  |  Branch (1992:33): [True: 165k, False: 316]
  |  Branch (1992:48): [True: 147k, False: 18.2k]
  |  Branch (1992:63): [True: 147k, False: 488]
  |  Branch (1992:77): [True: 131k, False: 15.6k]
  |  Branch (1992:91): [True: 130k, False: 402]
  ------------------
 1993|   130k|		(*p)++;
 1994|   130k|		(*l)--;
 1995|   130k|	}
 1996|  37.1k|	*end = *p;
 1997|       |
 1998|       |	/* Scan for the separator. */
 1999|  60.6k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1999:9): [True: 60.4k, False: 201]
  |  Branch (1999:19): [True: 59.4k, False: 952]
  |  Branch (1999:33): [True: 42.9k, False: 16.5k]
  |  Branch (1999:47): [True: 23.8k, False: 19.0k]
  |  Branch (1999:62): [True: 23.4k, False: 402]
  ------------------
 2000|  23.4k|		(*p)++;
 2001|  23.4k|		(*l)--;
 2002|  23.4k|	}
 2003|  37.1k|	if (*l > 0)
  ------------------
  |  Branch (2003:6): [True: 36.9k, False: 201]
  ------------------
 2004|  36.9k|		*sep = **p;
 2005|    201|	else
 2006|    201|		*sep = '\0';
 2007|       |
 2008|       |	/* Handle in-field comments */
 2009|  37.1k|	if (*sep == '#') {
  ------------------
  |  Branch (2009:6): [True: 402, False: 36.7k]
  ------------------
 2010|  6.88k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (2010:10): [True: 6.87k, False: 4]
  |  Branch (2010:20): [True: 6.81k, False: 61]
  |  Branch (2010:34): [True: 6.47k, False: 337]
  ------------------
 2011|  6.47k|			(*p)++;
 2012|  6.47k|			(*l)--;
 2013|  6.47k|		}
 2014|    402|		if (*l > 0)
  ------------------
  |  Branch (2014:7): [True: 398, False: 4]
  ------------------
 2015|    398|			*sep = **p;
 2016|      4|		else
 2017|      4|			*sep = '\0';
 2018|    402|	}
 2019|       |
 2020|       |	/* Skip separator. */
 2021|  37.1k|	if (*l > 0) {
  ------------------
  |  Branch (2021:6): [True: 36.9k, False: 205]
  ------------------
 2022|  36.9k|		(*p)++;
 2023|  36.9k|		(*l)--;
 2024|  36.9k|	}
 2025|  37.1k|}

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

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

__archive_blake2sp_init:
   81|  3.34k|{
   82|  3.34k|  size_t i;
   83|       |
   84|  3.34k|  if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1;
  ------------------
  |  Branch (84:7): [True: 0, False: 3.34k]
  |  Branch (84:18): [True: 0, False: 3.34k]
  ------------------
   85|       |
   86|  3.34k|  memset( S->buf, 0, sizeof( S->buf ) );
   87|  3.34k|  S->buflen = 0;
   88|  3.34k|  S->outlen = outlen;
   89|       |
   90|  3.34k|  if( blake2sp_init_root( S->R, outlen, 0 ) < 0 )
  ------------------
  |  Branch (90:7): [True: 0, False: 3.34k]
  ------------------
   91|      0|    return -1;
   92|       |
   93|  30.0k|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  30.0k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (93:15): [True: 26.7k, False: 3.34k]
  ------------------
   94|  26.7k|    if( blake2sp_init_leaf( S->S[i], outlen, 0, (uint32_t)i ) < 0 ) return -1;
  ------------------
  |  Branch (94:9): [True: 0, False: 26.7k]
  ------------------
   95|       |
   96|  3.34k|  S->R->last_node = 1;
   97|  3.34k|  S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
  ------------------
  |  |   29|  3.34k|#define PARALLELISM_DEGREE 8
  ------------------
   98|  3.34k|  return 0;
   99|  3.34k|}
__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.64k, False: 2.40k]
  |  Branch (142:15): [True: 5.73k, False: 1.91k]
  ------------------
  143|  5.73k|  {
  144|  5.73k|    memcpy( S->buf + left, in, fill );
  145|       |
  146|  51.6k|    for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  51.6k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (146:17): [True: 45.8k, False: 5.73k]
  ------------------
  147|  45.8k|      blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES );
  ------------------
  |  |   33|  45.8k|#define blake2s_update __archive_blake2s_update
  ------------------
  148|       |
  149|  5.73k|    in += fill;
  150|  5.73k|    inlen -= fill;
  151|  5.73k|    left = 0;
  152|  5.73k|  }
  153|       |
  154|       |#if defined(_OPENMP)
  155|       |  #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE)
  156|       |#else
  157|  90.5k|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  90.5k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (157:15): [True: 80.4k, False: 10.0k]
  ------------------
  158|  80.4k|#endif
  159|  80.4k|  {
  160|       |#if defined(_OPENMP)
  161|       |    size_t      i = omp_get_thread_num();
  162|       |#endif
  163|  80.4k|    size_t inlen__ = inlen;
  164|  80.4k|    const unsigned char *in__ = ( const unsigned char * )in;
  165|  80.4k|    in__ += i * BLAKE2S_BLOCKBYTES;
  166|       |
  167|  3.03M|    while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES )
  ------------------
  |  |   29|  3.03M|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (167:12): [True: 2.95M, False: 80.4k]
  ------------------
  168|  2.95M|    {
  169|  2.95M|      blake2s_update( S->S[i], in__, BLAKE2S_BLOCKBYTES );
  ------------------
  |  |   33|  2.95M|#define blake2s_update __archive_blake2s_update
  ------------------
  170|  2.95M|      in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
  ------------------
  |  |   29|  2.95M|#define PARALLELISM_DEGREE 8
  ------------------
  171|  2.95M|      inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES;
  ------------------
  |  |   29|  2.95M|#define PARALLELISM_DEGREE 8
  ------------------
  172|  2.95M|    }
  173|  80.4k|  }
  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.61k, False: 1.44k]
  ------------------
  179|  8.61k|    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|    908|{
  188|    908|  uint8_t hash[PARALLELISM_DEGREE][BLAKE2S_OUTBYTES];
  189|    908|  size_t i;
  190|       |
  191|    908|  if(out == NULL || outlen < S->outlen) {
  ------------------
  |  Branch (191:6): [True: 0, False: 908]
  |  Branch (191:21): [True: 0, False: 908]
  ------------------
  192|      0|    return -1;
  193|      0|  }
  194|       |
  195|  8.17k|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  8.17k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (195:15): [True: 7.26k, False: 908]
  ------------------
  196|  7.26k|  {
  197|  7.26k|    if( S->buflen > i * BLAKE2S_BLOCKBYTES )
  ------------------
  |  Branch (197:9): [True: 911, False: 6.35k]
  ------------------
  198|    911|    {
  199|    911|      size_t left = S->buflen - i * BLAKE2S_BLOCKBYTES;
  200|       |
  201|    911|      if( left > BLAKE2S_BLOCKBYTES ) left = BLAKE2S_BLOCKBYTES;
  ------------------
  |  Branch (201:11): [True: 3, False: 908]
  ------------------
  202|       |
  203|    911|      blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left );
  ------------------
  |  |   33|    911|#define blake2s_update __archive_blake2s_update
  ------------------
  204|    911|    }
  205|       |
  206|  7.26k|    blake2s_final( S->S[i], hash[i], BLAKE2S_OUTBYTES );
  ------------------
  |  |   24|  7.26k|#define blake2s_final __archive_blake2s_final
  ------------------
  207|  7.26k|  }
  208|       |
  209|  8.17k|  for( i = 0; i < PARALLELISM_DEGREE; ++i )
  ------------------
  |  |   29|  8.17k|#define PARALLELISM_DEGREE 8
  ------------------
  |  Branch (209:15): [True: 7.26k, False: 908]
  ------------------
  210|  7.26k|    blake2s_update( S->R, hash[i], BLAKE2S_OUTBYTES );
  ------------------
  |  |   33|  7.26k|#define blake2s_update __archive_blake2s_update
  ------------------
  211|       |
  212|    908|  return blake2s_final( S->R, out, S->outlen );
  ------------------
  |  |   24|    908|#define blake2s_final __archive_blake2s_final
  ------------------
  213|    908|}
archive_blake2sp_ref.c:blake2sp_init_root:
   63|  3.34k|{
   64|  3.34k|  blake2s_param P[1];
   65|  3.34k|  P->digest_length = (uint8_t)outlen;
   66|  3.34k|  P->key_length = (uint8_t)keylen;
   67|  3.34k|  P->fanout = PARALLELISM_DEGREE;
  ------------------
  |  |   29|  3.34k|#define PARALLELISM_DEGREE 8
  ------------------
   68|  3.34k|  P->depth = 2;
   69|  3.34k|  store32( &P->leaf_length, 0 );
   70|  3.34k|  store32( &P->node_offset, 0 );
   71|  3.34k|  store16( &P->xof_length, 0 );
   72|  3.34k|  P->node_depth = 1;
   73|  3.34k|  P->inner_length = BLAKE2S_OUTBYTES;
   74|  3.34k|  memset( P->salt, 0, sizeof( P->salt ) );
   75|  3.34k|  memset( P->personal, 0, sizeof( P->personal ) );
   76|  3.34k|  return blake2s_init_param( S, P );
  ------------------
  |  |   27|  3.34k|#define blake2s_init_param __archive_blake2s_init_param
  ------------------
   77|  3.34k|}
archive_blake2sp_ref.c:blake2sp_init_leaf:
   46|  26.7k|{
   47|  26.7k|  blake2s_param P[1];
   48|  26.7k|  P->digest_length = (uint8_t)outlen;
   49|  26.7k|  P->key_length = (uint8_t)keylen;
   50|  26.7k|  P->fanout = PARALLELISM_DEGREE;
  ------------------
  |  |   29|  26.7k|#define PARALLELISM_DEGREE 8
  ------------------
   51|  26.7k|  P->depth = 2;
   52|  26.7k|  store32( &P->leaf_length, 0 );
   53|  26.7k|  store32( &P->node_offset, offset );
   54|  26.7k|  store16( &P->xof_length, 0 );
   55|  26.7k|  P->node_depth = 0;
   56|  26.7k|  P->inner_length = BLAKE2S_OUTBYTES;
   57|  26.7k|  memset( P->salt, 0, sizeof( P->salt ) );
   58|  26.7k|  memset( P->personal, 0, sizeof( P->personal ) );
   59|  26.7k|  return blake2sp_init_leaf_param( S, P );
   60|  26.7k|}
archive_blake2sp_ref.c:blake2sp_init_leaf_param:
   39|  26.7k|{
   40|  26.7k|  int err = blake2s_init_param(S, P);
  ------------------
  |  |   27|  26.7k|#define blake2s_init_param __archive_blake2s_init_param
  ------------------
   41|  26.7k|  S->outlen = P->inner_length;
   42|  26.7k|  return err;
   43|  26.7k|}

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

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

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

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

archive_read_support_filter_gzip.c:archive_le32dec:
  144|    209|{
  145|    209|	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|    209|	unsigned int p3 = p[3];
  151|    209|	unsigned int p2 = p[2];
  152|    209|	unsigned int p1 = p[1];
  153|    209|	unsigned int p0 = p[0];
  154|       |
  155|    209|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|    209|}
archive_read_support_filter_gzip.c:archive_le16dec:
  115|      2|{
  116|      2|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|      2|	unsigned int p1 = p[1];
  122|      2|	unsigned int p0 = p[0];
  123|       |
  124|      2|	return ((p1 << 8) | p0);
  125|      2|}
archive_read_support_filter_lz4.c:archive_le32dec:
  144|  9.14k|{
  145|  9.14k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  9.14k|	unsigned int p3 = p[3];
  151|  9.14k|	unsigned int p2 = p[2];
  152|  9.14k|	unsigned int p1 = p[1];
  153|  9.14k|	unsigned int p0 = p[0];
  154|       |
  155|  9.14k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  9.14k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   91|    220|{
   92|    220|	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|    220|	unsigned int p3 = p[3];
   98|    220|	unsigned int p2 = p[2];
   99|    220|	unsigned int p1 = p[1];
  100|    220|	unsigned int p0 = p[0];
  101|       |
  102|    220|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    220|}
archive_read_support_filter_xz.c:archive_le32enc:
  216|      3|{
  217|      3|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|      3|	p[0] = u & 0xff;
  220|      3|	p[1] = (u >> 8) & 0xff;
  221|      3|	p[2] = (u >> 16) & 0xff;
  222|      3|	p[3] = (u >> 24) & 0xff;
  223|      3|}
archive_read_support_filter_xz.c:archive_le32dec:
  144|  11.3k|{
  145|  11.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|  11.3k|	unsigned int p3 = p[3];
  151|  11.3k|	unsigned int p2 = p[2];
  152|  11.3k|	unsigned int p1 = p[1];
  153|  11.3k|	unsigned int p0 = p[0];
  154|       |
  155|  11.3k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  11.3k|}
archive_read_support_filter_xz.c:archive_le64dec:
  160|  3.77k|{
  161|  3.77k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  3.77k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  3.77k|}
archive_read_support_filter_zstd.c:archive_le32dec:
  144|  4.13k|{
  145|  4.13k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  4.13k|	unsigned int p3 = p[3];
  151|  4.13k|	unsigned int p2 = p[2];
  152|  4.13k|	unsigned int p1 = p[1];
  153|  4.13k|	unsigned int p0 = p[0];
  154|       |
  155|  4.13k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  4.13k|}
archive_read_support_format_cab.c:archive_le32dec:
  144|   100k|{
  145|   100k|	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|   100k|	unsigned int p3 = p[3];
  151|   100k|	unsigned int p2 = p[2];
  152|   100k|	unsigned int p1 = p[1];
  153|   100k|	unsigned int p0 = p[0];
  154|       |
  155|   100k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   100k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  2.96k|{
  116|  2.96k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  2.96k|	unsigned int p1 = p[1];
  122|  2.96k|	unsigned int p0 = p[0];
  123|       |
  124|  2.96k|	return ((p1 << 8) | p0);
  125|  2.96k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|    926|{
  198|    926|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|    926|	p[0] = u & 0xff;
  201|    926|	p[1] = (u >> 8) & 0xff;
  202|    926|}
archive_read_support_format_cab.c:archive_le32enc:
  216|    253|{
  217|    253|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    253|	p[0] = u & 0xff;
  220|    253|	p[1] = (u >> 8) & 0xff;
  221|    253|	p[2] = (u >> 16) & 0xff;
  222|    253|	p[3] = (u >> 24) & 0xff;
  223|    253|}
archive_read_support_format_cpio.c:archive_be16dec:
   61|  5.45k|{
   62|  5.45k|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|  5.45k|	unsigned int p1 = p[1];
   68|  5.45k|	unsigned int p0 = p[0];
   69|       |
   70|  5.45k|	return ((p0 << 8) | p1);
   71|  5.45k|}
archive_read_support_format_cpio.c:archive_le16dec:
  115|  4.88k|{
  116|  4.88k|	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|  4.88k|	unsigned int p1 = p[1];
  122|  4.88k|	unsigned int p0 = p[0];
  123|       |
  124|  4.88k|	return ((p1 << 8) | p0);
  125|  4.88k|}
archive_read_support_format_iso9660.c:archive_le32dec:
  144|  2.96k|{
  145|  2.96k|	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.96k|	unsigned int p3 = p[3];
  151|  2.96k|	unsigned int p2 = p[2];
  152|  2.96k|	unsigned int p1 = p[1];
  153|  2.96k|	unsigned int p0 = p[0];
  154|       |
  155|  2.96k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  2.96k|}
archive_read_support_format_iso9660.c:archive_le16dec:
  115|    397|{
  116|    397|	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|    397|	unsigned int p1 = p[1];
  122|    397|	unsigned int p0 = p[0];
  123|       |
  124|    397|	return ((p1 << 8) | p0);
  125|    397|}
archive_read_support_format_iso9660.c:archive_be32dec:
   91|    353|{
   92|    353|	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|    353|	unsigned int p3 = p[3];
   98|    353|	unsigned int p2 = p[2];
   99|    353|	unsigned int p1 = p[1];
  100|    353|	unsigned int p0 = p[0];
  101|       |
  102|    353|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    353|}
archive_read_support_format_lha.c:archive_le32dec:
  144|  14.0k|{
  145|  14.0k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  14.0k|	unsigned int p3 = p[3];
  151|  14.0k|	unsigned int p2 = p[2];
  152|  14.0k|	unsigned int p1 = p[1];
  153|  14.0k|	unsigned int p0 = p[0];
  154|       |
  155|  14.0k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  14.0k|}
archive_read_support_format_lha.c:archive_le16dec:
  115|  34.9k|{
  116|  34.9k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  34.9k|	unsigned int p1 = p[1];
  122|  34.9k|	unsigned int p0 = p[0];
  123|       |
  124|  34.9k|	return ((p1 << 8) | p0);
  125|  34.9k|}
archive_read_support_format_lha.c:archive_be16dec:
   61|      7|{
   62|      7|	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|      7|	unsigned int p1 = p[1];
   68|      7|	unsigned int p0 = p[0];
   69|       |
   70|      7|	return ((p0 << 8) | p1);
   71|      7|}
archive_read_support_format_lha.c:archive_le64dec:
  160|    481|{
  161|    481|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    481|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    481|}
archive_read_support_format_rar.c:archive_le16dec:
  115|  25.0k|{
  116|  25.0k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  25.0k|	unsigned int p1 = p[1];
  122|  25.0k|	unsigned int p0 = p[0];
  123|       |
  124|  25.0k|	return ((p1 << 8) | p0);
  125|  25.0k|}
archive_read_support_format_rar.c:archive_le64dec:
  160|    408|{
  161|    408|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    408|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    408|}
archive_read_support_format_rar.c:archive_le32dec:
  144|  28.4k|{
  145|  28.4k|	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|  28.4k|	unsigned int p3 = p[3];
  151|  28.4k|	unsigned int p2 = p[2];
  152|  28.4k|	unsigned int p1 = p[1];
  153|  28.4k|	unsigned int p0 = p[0];
  154|       |
  155|  28.4k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  28.4k|}
archive_read_support_format_rar.c:archive_le32enc:
  216|   100k|{
  217|   100k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|   100k|	p[0] = u & 0xff;
  220|   100k|	p[1] = (u >> 8) & 0xff;
  221|   100k|	p[2] = (u >> 16) & 0xff;
  222|   100k|	p[3] = (u >> 24) & 0xff;
  223|   100k|}
archive_read_support_format_rar5.c:archive_le32dec:
  144|  45.7k|{
  145|  45.7k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  45.7k|	unsigned int p3 = p[3];
  151|  45.7k|	unsigned int p2 = p[2];
  152|  45.7k|	unsigned int p1 = p[1];
  153|  45.7k|	unsigned int p0 = p[0];
  154|       |
  155|  45.7k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  45.7k|}
archive_read_support_format_rar5.c:archive_le64dec:
  160|    437|{
  161|    437|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    437|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    437|}
archive_read_support_format_rar5.c:archive_le16dec:
  115|    432|{
  116|    432|	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|    432|	unsigned int p1 = p[1];
  122|    432|	unsigned int p0 = p[0];
  123|       |
  124|    432|	return ((p1 << 8) | p0);
  125|    432|}
archive_read_support_format_rar5.c:archive_be24dec:
   75|   917k|{
   76|   917k|	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|   917k|	unsigned int p2 = p[2];
   82|   917k|	unsigned int p1 = p[1];
   83|   917k|	unsigned int p0 = p[0];
   84|       |
   85|   917k|	return ((p0 << 16) | (p1 << 8) | p2);
   86|   917k|}
archive_read_support_format_rar5.c:archive_be32dec:
   91|  22.0k|{
   92|  22.0k|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|  22.0k|	unsigned int p3 = p[3];
   98|  22.0k|	unsigned int p2 = p[2];
   99|  22.0k|	unsigned int p1 = p[1];
  100|  22.0k|	unsigned int p0 = p[0];
  101|       |
  102|  22.0k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  22.0k|}
archive_read_support_format_rar5.c:archive_le32enc:
  216|     36|{
  217|     36|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|     36|	p[0] = u & 0xff;
  220|     36|	p[1] = (u >> 8) & 0xff;
  221|     36|	p[2] = (u >> 16) & 0xff;
  222|     36|	p[3] = (u >> 24) & 0xff;
  223|     36|}
archive_read_support_format_xar.c:archive_be32dec:
   91|  5.98k|{
   92|  5.98k|	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|  5.98k|	unsigned int p3 = p[3];
   98|  5.98k|	unsigned int p2 = p[2];
   99|  5.98k|	unsigned int p1 = p[1];
  100|  5.98k|	unsigned int p0 = p[0];
  101|       |
  102|  5.98k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  5.98k|}
archive_read_support_format_xar.c:archive_be16dec:
   61|  1.10k|{
   62|  1.10k|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|  1.10k|	unsigned int p1 = p[1];
   68|  1.10k|	unsigned int p0 = p[0];
   69|       |
   70|  1.10k|	return ((p0 << 8) | p1);
   71|  1.10k|}
archive_read_support_format_xar.c:archive_be64dec:
  107|    736|{
  108|    736|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|    736|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|    736|}
archive_read_support_format_zip.c:archive_le16dec:
  115|   216k|{
  116|   216k|	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|   216k|	unsigned int p1 = p[1];
  122|   216k|	unsigned int p0 = p[0];
  123|       |
  124|   216k|	return ((p1 << 8) | p0);
  125|   216k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   329k|{
  145|   329k|	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|   329k|	unsigned int p3 = p[3];
  151|   329k|	unsigned int p2 = p[2];
  152|   329k|	unsigned int p1 = p[1];
  153|   329k|	unsigned int p0 = p[0];
  154|       |
  155|   329k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   329k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  31.5k|{
  161|  31.5k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  31.5k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  31.5k|}
archive_string.c:archive_be16enc:
  168|  10.6k|{
  169|  10.6k|	unsigned char *p = (unsigned char *)pp;
  170|       |
  171|  10.6k|	p[0] = (u >> 8) & 0xff;
  172|  10.6k|	p[1] = u & 0xff;
  173|  10.6k|}
archive_string.c:archive_le16enc:
  197|  3.84k|{
  198|  3.84k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  3.84k|	p[0] = u & 0xff;
  201|  3.84k|	p[1] = (u >> 8) & 0xff;
  202|  3.84k|}
archive_string.c:archive_be16dec:
   61|  40.8k|{
   62|  40.8k|	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|  40.8k|	unsigned int p1 = p[1];
   68|  40.8k|	unsigned int p0 = p[0];
   69|       |
   70|  40.8k|	return ((p0 << 8) | p1);
   71|  40.8k|}
archive_string.c:archive_le16dec:
  115|  33.2k|{
  116|  33.2k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  33.2k|	unsigned int p1 = p[1];
  122|  33.2k|	unsigned int p0 = p[0];
  123|       |
  124|  33.2k|	return ((p1 << 8) | p0);
  125|  33.2k|}
archive_read_support_format_7zip.c:archive_le32dec:
  144|  35.5k|{
  145|  35.5k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  35.5k|	unsigned int p3 = p[3];
  151|  35.5k|	unsigned int p2 = p[2];
  152|  35.5k|	unsigned int p1 = p[1];
  153|  35.5k|	unsigned int p0 = p[0];
  154|       |
  155|  35.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  35.5k|}
archive_read_support_format_7zip.c:archive_le16dec:
  115|    182|{
  116|    182|	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|    182|	unsigned int p1 = p[1];
  122|    182|	unsigned int p0 = p[0];
  123|       |
  124|    182|	return ((p1 << 8) | p0);
  125|    182|}
archive_read_support_format_7zip.c:archive_be16dec:
   61|     12|{
   62|     12|	unsigned char const *p = (unsigned char const *)pp;
   63|       |
   64|       |	/* Store into unsigned temporaries before left shifting, to avoid
   65|       |	promotion to signed int and then left shifting into the sign bit,
   66|       |	which is undefined behaviour. */
   67|     12|	unsigned int p1 = p[1];
   68|     12|	unsigned int p0 = p[0];
   69|       |
   70|     12|	return ((p0 << 8) | p1);
   71|     12|}
archive_read_support_format_7zip.c:archive_be32dec:
   91|    276|{
   92|    276|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|    276|	unsigned int p3 = p[3];
   98|    276|	unsigned int p2 = p[2];
   99|    276|	unsigned int p1 = p[1];
  100|    276|	unsigned int p0 = p[0];
  101|       |
  102|    276|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    276|}
archive_read_support_format_7zip.c:archive_be64dec:
  107|      3|{
  108|      3|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|      3|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|      3|}
archive_read_support_format_7zip.c:archive_le64dec:
  160|    640|{
  161|    640|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    640|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    640|}

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

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

archive_entry_sparse_clear:
   40|   143k|{
   41|   143k|	struct ae_sparse *sp;
   42|       |
   43|   143k|	while (entry->sparse_head != NULL) {
  ------------------
  |  Branch (43:9): [True: 19, False: 143k]
  ------------------
   44|     19|		sp = entry->sparse_head->next;
   45|     19|		free(entry->sparse_head);
   46|     19|		entry->sparse_head = sp;
   47|     19|	}
   48|   143k|	entry->sparse_tail = NULL;
   49|       |	entry->sparse_p = NULL;
   50|   143k|}
archive_entry_sparse_add_entry:
   55|     28|{
   56|     28|	struct ae_sparse *sp;
   57|       |
   58|     28|	if (offset < 0 || length < 0)
  ------------------
  |  Branch (58:6): [True: 0, False: 28]
  |  Branch (58:20): [True: 0, False: 28]
  ------------------
   59|       |		/* Invalid value */
   60|      0|		return;
   61|     28|	if (offset > INT64_MAX - length ||
  ------------------
  |  Branch (61:6): [True: 0, False: 28]
  ------------------
   62|     28|	    offset + length > archive_entry_size(entry))
  ------------------
  |  Branch (62:6): [True: 9, False: 19]
  ------------------
   63|       |		/* A value of "length" parameter is too large. */
   64|      9|		return;
   65|     19|	if ((sp = entry->sparse_tail) != NULL) {
  ------------------
  |  Branch (65:6): [True: 0, False: 19]
  ------------------
   66|      0|		if (sp->offset + sp->length > offset)
  ------------------
  |  Branch (66:7): [True: 0, False: 0]
  ------------------
   67|       |			/* Invalid value. */
   68|      0|			return;
   69|      0|		if (sp->offset + sp->length == offset) {
  ------------------
  |  Branch (69:7): [True: 0, False: 0]
  ------------------
   70|      0|			if (sp->offset + sp->length + length < 0)
  ------------------
  |  Branch (70:8): [True: 0, False: 0]
  ------------------
   71|       |				/* A value of "length" parameter is
   72|       |				 * too large. */
   73|      0|				return;
   74|       |			/* Expand existing sparse block size. */
   75|      0|			sp->length += length;
   76|      0|			return;
   77|      0|		}
   78|      0|	}
   79|       |
   80|     19|	if ((sp = malloc(sizeof(*sp))) == NULL)
  ------------------
  |  Branch (80:6): [True: 0, False: 19]
  ------------------
   81|       |		/* XXX Error XXX */
   82|      0|		return;
   83|       |
   84|     19|	sp->offset = offset;
   85|     19|	sp->length = length;
   86|     19|	sp->next = NULL;
   87|       |
   88|     19|	if (entry->sparse_head == NULL)
  ------------------
  |  Branch (88:6): [True: 19, False: 0]
  ------------------
   89|     19|		entry->sparse_head = entry->sparse_tail = sp;
   90|      0|	else {
   91|       |		/* Add a new sparse block to the tail of list. */
   92|      0|		if (entry->sparse_tail != NULL)
  ------------------
  |  Branch (92:7): [True: 0, False: 0]
  ------------------
   93|      0|			entry->sparse_tail->next = sp;
   94|      0|		entry->sparse_tail = sp;
   95|      0|	}
   96|     19|}
archive_entry_sparse_count:
  104|     35|{
  105|     35|	struct ae_sparse *sp;
  106|     35|	int count = 0;
  107|       |
  108|     54|	for (sp = entry->sparse_head; sp != NULL; sp = sp->next)
  ------------------
  |  Branch (108:32): [True: 19, False: 35]
  ------------------
  109|     19|		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|     35|	if (count == 1) {
  ------------------
  |  Branch (116:6): [True: 19, False: 16]
  ------------------
  117|     19|		sp = entry->sparse_head;
  118|     19|		if (sp->offset == 0 &&
  ------------------
  |  Branch (118:7): [True: 16, False: 3]
  ------------------
  119|     16|		    sp->length >= archive_entry_size(entry)) {
  ------------------
  |  Branch (119:7): [True: 14, False: 2]
  ------------------
  120|     14|			count = 0;
  121|     14|			archive_entry_sparse_clear(entry);
  122|     14|		}
  123|     19|	}
  124|       |
  125|     35|	return (count);
  126|     35|}

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

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

archive_read.c:archive_ckd_mul_size:
  187|    301|{
  188|    301|#if USE_STDCKDINT
  189|    301|	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|    301|}
archive_read_support_filter_lz4.c:archive_ckd_add_size:
  119|    276|{
  120|    276|#if USE_STDCKDINT
  121|    276|	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|    276|}
archive_read_support_filter_zstd.c:archive_ckd_add_size:
  119|    276|{
  120|    276|#if USE_STDCKDINT
  121|    276|	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|    276|}
archive_read_support_format_ar.c:archive_ckd_mul_u64:
  205|  14.5k|{
  206|  14.5k|#if USE_STDCKDINT
  207|  14.5k|	return ckd_mul(result, a, b);
  208|       |#elif USE_BUILTIN
  209|       |	return __builtin_mul_overflow(a, b, result);
  210|       |#elif USE_INTSAFE
  211|       |	ULONGLONG res;
  212|       |	int ret;
  213|       |
  214|       |	ret = ULongLongMult(a, b, &res);
  215|       |	*result = (uint64_t)res;
  216|       |	return ret;
  217|       |#else
  218|       |	if (b != 0 && a > UINT64_MAX / b)
  219|       |		return 1;
  220|       |	*result = a * b;
  221|       |	return 0;
  222|       |#endif
  223|  14.5k|}
archive_read_support_format_ar.c:archive_ckd_add_u64:
  137|  14.5k|{
  138|  14.5k|#if USE_STDCKDINT
  139|  14.5k|	return ckd_add(result, a, b);
  140|       |#elif USE_BUILTIN
  141|       |	return __builtin_add_overflow(a, b, result);
  142|       |#elif USE_INTSAFE
  143|       |	ULONGLONG res;
  144|       |	int ret;
  145|       |
  146|       |	ret = ULongLongAdd(a, b, &res);
  147|       |	*result = (uint64_t)res;
  148|       |	return ret;
  149|       |#else
  150|       |	if (a > UINT64_MAX - b)
  151|       |		return 1;
  152|       |	*result = a + b;
  153|       |	return 0;
  154|       |#endif
  155|  14.5k|}
archive_read_support_format_mtree.c:archive_ckd_mul_i64:
  160|  2.13k|{
  161|  2.13k|#if USE_STDCKDINT
  162|  2.13k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  2.13k|}
archive_read_support_format_mtree.c:archive_ckd_sub_i64:
  228|  1.86k|{
  229|  1.86k|#if USE_STDCKDINT
  230|  1.86k|	return ckd_sub(result, a, b);
  231|       |#elif USE_BUILTIN
  232|       |	return __builtin_sub_overflow(a, b, result);
  233|       |#elif USE_INTSAFE
  234|       |	LONGLONG res;
  235|       |	int ret;
  236|       |
  237|       |	ret = LongLongSub(a, b, &res);
  238|       |	*result = (int64_t)res;
  239|       |	return ret;
  240|       |#else
  241|       |	if ((b > 0 && a < INT64_MIN + b) ||
  242|       |	    (b < 0 && a > INT64_MAX + b))
  243|       |		return 1;
  244|       |
  245|       |	*result = a - b;
  246|       |	return 0;
  247|       |#endif
  248|  1.86k|}
archive_read_support_format_mtree.c:archive_ckd_add_i64:
   94|    262|{
   95|    262|#if USE_STDCKDINT
   96|    262|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|    262|}
archive_read_support_format_rar.c:archive_ckd_mul_size:
  187|  12.9k|{
  188|  12.9k|#if USE_STDCKDINT
  189|  12.9k|	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|  12.9k|}
archive_read_support_format_rar5.c:archive_ckd_mul_u64:
  205|   397k|{
  206|   397k|#if USE_STDCKDINT
  207|   397k|	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|   397k|}
archive_read_support_format_rar5.c:archive_ckd_add_u64:
  137|   393k|{
  138|   393k|#if USE_STDCKDINT
  139|   393k|	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|   393k|}
archive_read_support_format_raw.c:archive_ckd_add_i64:
   94|    346|{
   95|    346|#if USE_STDCKDINT
   96|    346|	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|    346|}
archive_read_support_format_tar.c:archive_ckd_mul_i64:
  160|   289k|{
  161|   289k|#if USE_STDCKDINT
  162|   289k|	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|   289k|}
archive_read_support_format_tar.c:archive_ckd_add_i64:
   94|   288k|{
   95|   288k|#if USE_STDCKDINT
   96|   288k|	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|   288k|}
archive_read_support_format_warc.c:archive_ckd_mul_i64:
  160|  25.9k|{
  161|  25.9k|#if USE_STDCKDINT
  162|  25.9k|	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|  25.9k|}
archive_read_support_format_warc.c:archive_ckd_add_i64:
   94|  25.9k|{
   95|  25.9k|#if USE_STDCKDINT
   96|  25.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|  25.9k|}
archive_read_support_format_xar.c:archive_ckd_mul_size:
  187|      8|{
  188|      8|#if USE_STDCKDINT
  189|      8|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|      8|}
archive_read_support_format_xar.c:archive_ckd_mul_u64:
  205|  93.0k|{
  206|  93.0k|#if USE_STDCKDINT
  207|  93.0k|	return ckd_mul(result, a, b);
  208|       |#elif USE_BUILTIN
  209|       |	return __builtin_mul_overflow(a, b, result);
  210|       |#elif USE_INTSAFE
  211|       |	ULONGLONG res;
  212|       |	int ret;
  213|       |
  214|       |	ret = ULongLongMult(a, b, &res);
  215|       |	*result = (uint64_t)res;
  216|       |	return ret;
  217|       |#else
  218|       |	if (b != 0 && a > UINT64_MAX / b)
  219|       |		return 1;
  220|       |	*result = a * b;
  221|       |	return 0;
  222|       |#endif
  223|  93.0k|}
archive_read_support_format_xar.c:archive_ckd_add_u64:
  137|  93.0k|{
  138|  93.0k|#if USE_STDCKDINT
  139|  93.0k|	return ckd_add(result, a, b);
  140|       |#elif USE_BUILTIN
  141|       |	return __builtin_add_overflow(a, b, result);
  142|       |#elif USE_INTSAFE
  143|       |	ULONGLONG res;
  144|       |	int ret;
  145|       |
  146|       |	ret = ULongLongAdd(a, b, &res);
  147|       |	*result = (uint64_t)res;
  148|       |	return ret;
  149|       |#else
  150|       |	if (a > UINT64_MAX - b)
  151|       |		return 1;
  152|       |	*result = a + b;
  153|       |	return 0;
  154|       |#endif
  155|  93.0k|}
archive_read_support_format_7zip.c:archive_ckd_add_i64:
   94|  9.07k|{
   95|  9.07k|#if USE_STDCKDINT
   96|  9.07k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  9.07k|}
archive_read_support_format_7zip.c:archive_ckd_add_size:
  119|  1.62k|{
  120|  1.62k|#if USE_STDCKDINT
  121|  1.62k|	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.62k|}
archive_read_support_format_7zip.c:archive_ckd_mul_i64:
  160|  2.15k|{
  161|  2.15k|#if USE_STDCKDINT
  162|  2.15k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  2.15k|}

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

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

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

archive_ppmd8.c:Ppmd8_Construct:
   65|  11.6k|{
   66|  11.6k|  unsigned i, k, m;
   67|       |
   68|  11.6k|  p->Base = 0;
   69|       |
   70|   454k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   454k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   454k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   454k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   454k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   454k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   454k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   454k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   454k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 442k, False: 11.6k]
  ------------------
   71|   442k|  {
   72|   442k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 302k, False: 139k]
  ------------------
   73|  1.49M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.04M, False: 442k]
  ------------------
   74|   442k|    p->Indx2Units[i] = (Byte)k;
   75|   442k|  }
   76|       |
   77|  11.6k|  p->NS2BSIndx[0] = (0 << 1);
   78|  11.6k|  p->NS2BSIndx[1] = (1 << 1);
   79|  11.6k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  11.6k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  69.8k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 58.2k, False: 11.6k]
  ------------------
   83|  58.2k|    p->NS2Indx[i] = (Byte)i;
   84|  2.98M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 2.96M, False: 11.6k]
  ------------------
   85|  2.96M|  {
   86|  2.96M|    p->NS2Indx[i] = (Byte)m;
   87|  2.96M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 256k, False: 2.71M]
  ------------------
   88|   256k|      k = (++m) - 4;
   89|  2.96M|  }
   90|  11.6k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  10.5k|{
  101|  10.5k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 10.5k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  10.5k|  {
  103|  10.5k|    Ppmd8_Free(p);
  104|  10.5k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  10.5k|        4 - (size & 3);
  109|  10.5k|      #endif
  110|  10.5k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 10.5k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  10.5k|    p->Size = size;
  113|  10.5k|  }
  114|  10.5k|  return True;
  ------------------
  |  |   55|  10.5k|#define True 1
  ------------------
  115|  10.5k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  21.1k|{
   94|  21.1k|  free(p->Base);
   95|  21.1k|  p->Size = 0;
   96|  21.1k|  p->Base = 0;
   97|  21.1k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  10.5k|{
  412|  10.5k|  p->MaxOrder = maxOrder;
  413|  10.5k|  p->RestoreMethod = restoreMethod;
  414|  10.5k|  RestartModel(p);
  415|  10.5k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  10.5k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  10.5k|  p->DummySee.Summ = 0; /* unused */
  417|  10.5k|  p->DummySee.Count = 64; /* unused */
  418|  10.5k|}
archive_ppmd8.c:RestartModel:
  354|  10.6k|{
  355|  10.6k|  unsigned i, k, m, r;
  356|       |
  357|  10.6k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  10.6k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  10.6k|  RESET_TEXT(0);
  ------------------
  |  |  349|  10.6k|#define RESET_TEXT(offs) do {						\
  |  |  350|  10.6k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  10.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  360|  10.6k|  p->HiUnit = p->Text + p->Size;
  361|  10.6k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  10.6k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  10.6k|#define UNIT_SIZE 12
  ------------------
  362|  10.6k|  p->GlueCount = 0;
  363|       |
  364|  10.6k|  p->OrderFall = p->MaxOrder;
  365|  10.6k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 6.73k, False: 3.89k]
  ------------------
  366|  10.6k|  p->PrevSuccess = 0;
  367|       |
  368|  10.6k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  10.6k|#define UNIT_SIZE 12
  ------------------
  369|  10.6k|  p->MinContext->Suffix = 0;
  370|  10.6k|  p->MinContext->NumStats = 255;
  371|  10.6k|  p->MinContext->Flags = 0;
  372|  10.6k|  p->MinContext->SummFreq = 256 + 1;
  373|  10.6k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  10.6k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  10.6k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  10.6k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  10.6k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  10.6k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  2.72M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 2.71M, False: 10.6k]
  ------------------
  377|  2.71M|  {
  378|  2.71M|    CPpmd_State *s = &p->FoundState[i];
  379|  2.71M|    s->Symbol = (Byte)i;
  380|  2.71M|    s->Freq = 1;
  381|  2.71M|    SetSuccessor(s, 0);
  382|  2.71M|  }
  383|       |
  384|   276k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 265k, False: 10.6k]
  ------------------
  385|   265k|  {
  386|  2.54M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 2.28M, False: 265k]
  ------------------
  387|  2.28M|      i++;
  388|  2.38M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 2.12M, False: 265k]
  ------------------
  389|  2.12M|    {
  390|  2.12M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.12M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.12M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.12M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  2.12M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  19.1M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 16.9M, False: 2.12M]
  ------------------
  393|  16.9M|        dest[r] = val;
  394|  2.12M|    }
  395|   265k|  }
  396|       |
  397|   265k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 254k, False: 10.6k]
  ------------------
  398|   254k|  {
  399|  2.96M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 2.70M, False: 254k]
  ------------------
  400|  2.70M|      i++;
  401|  8.41M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 8.15M, False: 254k]
  ------------------
  402|  8.15M|    {
  403|  8.15M|      CPpmd_See *s = &p->See[m][k];
  404|  8.15M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  8.15M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  8.15M|      s->Count = 7;
  406|  8.15M|    }
  407|   254k|  }
  408|  10.6k|}
archive_ppmd8.c:SetSuccessor:
  344|   346M|{
  345|   346M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  346|   346M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  347|   346M|}
archive_ppmd8.c:Ppmd8_RangeDec_Init:
 1131|  10.5k|{
 1132|  10.5k|  unsigned i;
 1133|  10.5k|  p->Low = 0;
 1134|  10.5k|  p->Range = 0xFFFFFFFF;
 1135|  10.5k|  p->Code = 0;
 1136|  52.7k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 42.2k, False: 10.5k]
  ------------------
 1137|  42.2k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  10.5k|  return (p->Code < 0xFFFFFFFF);
 1139|  10.5k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|   129M|{
 1166|   129M|  size_t charMask[256 / sizeof(size_t)];
 1167|   129M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 16.4M, False: 113M]
  ------------------
 1168|  16.4M|  {
 1169|  16.4M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  16.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  16.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1170|  16.4M|    unsigned i;
 1171|  16.4M|    UInt32 count, hiCnt;
 1172|  16.4M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1172:9): [True: 6.19M, False: 10.2M]
  ------------------
 1173|  6.19M|    {
 1174|  6.19M|      Byte symbol;
 1175|  6.19M|      RangeDec_Decode(p, 0, s->Freq);
 1176|  6.19M|      p->FoundState = s;
 1177|  6.19M|      symbol = s->Symbol;
 1178|  6.19M|      Ppmd8_Update1_0(p);
 1179|  6.19M|      return symbol;
 1180|  6.19M|    }
 1181|  10.2M|    p->PrevSuccess = 0;
 1182|  10.2M|    i = p->MinContext->NumStats;
 1183|  10.2M|    do
 1184|  72.4M|    {
 1185|  72.4M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 5.92M, False: 66.5M]
  ------------------
 1186|  5.92M|      {
 1187|  5.92M|        Byte symbol;
 1188|  5.92M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  5.92M|        p->FoundState = s;
 1190|  5.92M|        symbol = s->Symbol;
 1191|  5.92M|        Ppmd8_Update1(p);
 1192|  5.92M|        return symbol;
 1193|  5.92M|      }
 1194|  72.4M|    }
 1195|  66.5M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 62.1M, False: 4.31M]
  ------------------
 1196|  4.31M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 4.59k, False: 4.31M]
  ------------------
 1197|  4.59k|      return -2;
 1198|  4.31M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1199|  4.31M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  4.31M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  4.31M|	unsigned j;							\
  |  |  153|  21.5M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 17.2M, False: 4.31M]
  |  |  ------------------
  |  |  154|  17.2M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  17.2M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  17.2M|	}								\
  |  |  157|  4.31M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 4.31M]
  |  |  ------------------
  ------------------
 1200|  4.31M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1162|  4.31M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1201|  4.31M|    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.39M, False: 4.31M]
  ------------------
 1203|  4.31M|  }
 1204|   113M|  else
 1205|   113M|  {
 1206|   113M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|   113M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|   113M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|   113M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|   113M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   113M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|   113M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|   113M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 105M, False: 7.30M]
  ------------------
 1208|   105M|    {
 1209|   105M|      Byte symbol;
 1210|   105M|      RangeDec_Decode(p, 0, *prob);
 1211|   105M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|   105M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|   105M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|   105M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   105M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|   105M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|   105M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|   105M|      Ppmd8_UpdateBin(p);
 1214|   105M|      return symbol;
 1215|   105M|    }
 1216|  7.30M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1217|  7.30M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  7.30M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  7.30M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  7.30M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  7.30M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1219|  7.30M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  7.30M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  7.30M|	unsigned j;							\
  |  |  153|  36.5M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 29.2M, False: 7.30M]
  |  |  ------------------
  |  |  154|  29.2M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  29.2M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  29.2M|	}								\
  |  |  157|  7.30M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 7.30M]
  |  |  ------------------
  ------------------
 1220|  7.30M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1162|  7.30M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1221|  7.30M|    p->PrevSuccess = 0;
 1222|  7.30M|  }
 1223|  11.6M|  for (;;)
 1224|  16.4M|  {
 1225|  16.4M|    CPpmd_State *ps[256], *s;
 1226|  16.4M|    UInt32 freqSum, count, hiCnt;
 1227|  16.4M|    CPpmd_See *see;
 1228|  16.4M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1229|  16.4M|    do
 1230|  46.3M|    {
 1231|  46.3M|      p->OrderFall++;
 1232|  46.3M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1232:11): [True: 897, False: 46.3M]
  ------------------
 1233|    897|        return -1;
 1234|  46.3M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   97|  46.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   96|  46.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1235|  46.3M|    }
 1236|  46.3M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1236:12): [True: 29.9M, False: 16.4M]
  ------------------
 1237|  16.4M|    hiCnt = 0;
 1238|  16.4M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  16.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  16.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1239|  16.4M|    i = 0;
 1240|  16.4M|    num = p->MinContext->NumStats - numMasked;
 1241|  16.4M|    do
 1242|   670M|    {
 1243|   670M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1162|   670M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1244|   670M|      hiCnt += (s->Freq & k);
 1245|   670M|      ps[i] = s++;
 1246|   670M|      i -= k;
 1247|   670M|    }
 1248|   670M|    while (i != num);
  ------------------
  |  Branch (1248:12): [True: 654M, False: 16.4M]
  ------------------
 1249|       |    
 1250|  16.4M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1251|  16.4M|    freqSum += hiCnt;
 1252|  16.4M|    count = RangeDec_GetThreshold(p, freqSum);
 1253|       |    
 1254|  16.4M|    if (count < hiCnt)
  ------------------
  |  Branch (1254:9): [True: 11.6M, False: 4.82M]
  ------------------
 1255|  11.6M|    {
 1256|  11.6M|      Byte symbol;
 1257|  11.6M|      CPpmd_State **pps = ps;
 1258|   181M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1258:23): [True: 169M, False: 11.6M]
  ------------------
 1259|  11.6M|      s = *pps;
 1260|  11.6M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1261|  11.6M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  11.6M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  11.6M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  23.2M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 7.30M, False: 4.31M]
  |  |  |  Branch (113:39): [True: 226k, False: 7.07M]
  |  |  ------------------
  |  |  114|   226k|		(p)->Summ <<= 1;					\
  |  |  115|   226k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|   226k|    	}								\
  |  |  117|  11.6M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 11.6M]
  |  |  ------------------
  ------------------
 1262|  11.6M|      p->FoundState = s;
 1263|  11.6M|      symbol = s->Symbol;
 1264|  11.6M|      Ppmd8_Update2(p);
 1265|  11.6M|      return symbol;
 1266|  11.6M|    }
 1267|  4.82M|    if (count >= freqSum)
  ------------------
  |  Branch (1267:9): [True: 4.77k, False: 4.82M]
  ------------------
 1268|  4.77k|      return -2;
 1269|  4.82M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1270|  4.82M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1271|  14.6M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1162|  14.6M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1271:46): [True: 9.86M, False: 4.82M]
  ------------------
 1272|  4.82M|  }
 1273|  11.6M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1142|  32.8M|{
 1143|  32.8M|  return p->Code / (p->Range /= total);
 1144|  32.8M|}
archive_ppmd8.c:RangeDec_Decode:
 1147|   146M|{
 1148|   146M|  start *= p->Range;
 1149|   146M|  p->Low += start;
 1150|   146M|  p->Code -= start;
 1151|   146M|  p->Range *= size;
 1152|       |
 1153|   158M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   316M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 12.0M, False: 146M]
  ------------------
 1154|   146M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   292M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  10.5k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 10.5k, False: 146M]
  |  Branch (1154:27): [True: 10.5k, False: 0]
  ------------------
 1155|  12.0M|  {
 1156|  12.0M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1157|  12.0M|    p->Range <<= 8;
 1158|  12.0M|    p->Low <<= 8;
 1159|  12.0M|  }
 1160|   146M|}
archive_ppmd8.c:Ppmd8_Update1_0:
 1097|  6.19M|{
 1098|  6.19M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1099|  6.19M|  p->RunLength += p->PrevSuccess;
 1100|  6.19M|  p->MinContext->SummFreq += 4;
 1101|  6.19M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  6.19M|#define MAX_FREQ 124
  ------------------
  |  Branch (1101:7): [True: 40.4k, False: 6.15M]
  ------------------
 1102|  40.4k|    Rescale(p);
 1103|  6.19M|  NextContext(p);
 1104|  6.19M|}
archive_ppmd8.c:Rescale:
  975|  55.7k|{
  976|  55.7k|  unsigned i, adder, sumFreq, escFreq;
  977|  55.7k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|  55.7k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  55.7k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  55.7k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  55.7k|  CPpmd_State *s = p->FoundState;
  979|  55.7k|  {
  980|  55.7k|    CPpmd_State tmp = *s;
  981|   192k|    for (; s != stats; s--)
  ------------------
  |  Branch (981:12): [True: 136k, False: 55.7k]
  ------------------
  982|   136k|      s[0] = s[-1];
  983|  55.7k|    *s = tmp;
  984|  55.7k|  }
  985|  55.7k|  escFreq = p->MinContext->SummFreq - s->Freq;
  986|  55.7k|  s->Freq += 4;
  987|  55.7k|  adder = (p->OrderFall != 0
  988|       |      #ifdef PPMD8_FREEZE_SUPPORT
  989|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  990|       |      #endif
  991|  55.7k|      );
  992|  55.7k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  55.7k|  sumFreq = s->Freq;
  994|       |  
  995|  55.7k|  i = p->MinContext->NumStats;
  996|  55.7k|  do
  997|  2.55M|  {
  998|  2.55M|    escFreq -= (++s)->Freq;
  999|  2.55M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
 1000|  2.55M|    sumFreq += s->Freq;
 1001|  2.55M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1001:9): [True: 777k, False: 1.77M]
  ------------------
 1002|   777k|    {
 1003|   777k|      CPpmd_State *s1 = s;
 1004|   777k|      CPpmd_State tmp = *s1;
 1005|   777k|      do
 1006|  35.0M|        s1[0] = s1[-1];
 1007|  35.0M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1007:14): [True: 35.0M, False: 0]
  |  Branch (1007:31): [True: 34.2M, False: 777k]
  ------------------
 1008|   777k|      *s1 = tmp;
 1009|   777k|    }
 1010|  2.55M|  }
 1011|  2.55M|  while (--i);
  ------------------
  |  Branch (1011:10): [True: 2.49M, False: 55.7k]
  ------------------
 1012|       |  
 1013|  55.7k|  if (s->Freq == 0)
  ------------------
  |  Branch (1013:7): [True: 11.7k, False: 43.9k]
  ------------------
 1014|  11.7k|  {
 1015|  11.7k|    unsigned numStats = p->MinContext->NumStats;
 1016|  11.7k|    unsigned n0, n1;
 1017|  16.8k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1017:24): [True: 5.13k, False: 11.7k]
  ------------------
 1018|  11.7k|    escFreq += i;
 1019|  11.7k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1020|  11.7k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1020:9): [True: 3.89k, False: 7.85k]
  ------------------
 1021|  3.89k|    {
 1022|  3.89k|      CPpmd_State tmp = *stats;
 1023|  3.89k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  3.89k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  3.89k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 3.77k, False: 128]
  ------------------
 1025|  3.77k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  3.77k|#define MAX_FREQ 124
  ------------------
 1026|  3.89k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  3.89k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  3.89k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  3.89k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  3.89k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.89k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  3.89k|      return;
 1030|  3.89k|    }
 1031|  7.85k|    n0 = (numStats + 2) >> 1;
 1032|  7.85k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1033|  7.85k|    if (n0 != n1)
  ------------------
  |  Branch (1033:9): [True: 6.25k, False: 1.59k]
  ------------------
 1034|  6.25k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  6.25k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  6.25k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1035|  7.85k|    p->MinContext->Flags &= ~0x08;
 1036|  7.85k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  7.85k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  7.85k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  7.85k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1037|  7.85k|    i = p->MinContext->NumStats;
 1038|  44.5k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1038:73): [True: 36.6k, False: 7.85k]
  ------------------
 1039|  7.85k|  }
 1040|  51.8k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1041|  51.8k|  p->MinContext->Flags |= 0x4;
 1042|  51.8k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|  51.8k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  51.8k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  51.8k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  51.8k|}
archive_ppmd8.c:InsertNode:
  118|  88.7M|{
  119|  88.7M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|  88.7M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|  88.7M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|  88.7M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|  88.7M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|  88.7M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|  88.7M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|  88.7M|  p->Stamps[indx]++;
  124|  88.7M|}
archive_ppmd8.c:ShrinkUnits:
  255|  3.54M|{
  256|  3.54M|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  3.54M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  257|  3.54M|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  3.54M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  258|  3.54M|  if (i0 == i1)
  ------------------
  |  Branch (258:7): [True: 573k, False: 2.97M]
  ------------------
  259|   573k|    return oldPtr;
  260|  2.97M|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (260:7): [True: 2.96M, False: 5.07k]
  ------------------
  261|  2.96M|  {
  262|  2.96M|    void *ptr = RemoveNode(p, i1);
  263|  2.96M|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  245|  2.96M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  2.96M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  2.96M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  2.96M|	UInt32 n = num;							\
  |  |  249|  4.49M|	do {								\
  |  |  250|  4.49M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  4.49M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 1.52M, False: 2.96M]
  |  |  ------------------
  |  |  252|  2.96M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 2.96M]
  |  |  ------------------
  ------------------
  264|  2.96M|    InsertNode(p, oldPtr, i0);
  265|  2.96M|    return ptr;
  266|  2.96M|  }
  267|  5.07k|  SplitBlock(p, oldPtr, i0, i1);
  268|  5.07k|  return oldPtr;
  269|  2.97M|}
archive_ppmd8.c:RemoveNode:
  127|  43.3M|{
  128|  43.3M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  43.3M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  43.3M|  p->FreeList[indx] = node->Next;
  130|  43.3M|  p->Stamps[indx]--;
  131|  43.3M|  return node;
  132|  43.3M|}
archive_ppmd8.c:SplitBlock:
  135|  4.80M|{
  136|  4.80M|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.80M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.80M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|  4.80M|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|  4.80M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  4.80M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|  4.80M|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  4.80M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 354k, False: 4.44M]
  ------------------
  139|   354k|  {
  140|   354k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|   354k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|   354k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|   354k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   354k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|   354k|  }
  143|  4.80M|  InsertNode(p, ptr, i);
  144|  4.80M|}
archive_ppmd8.c:NextContext:
 1070|   118M|{
 1071|   118M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|   118M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|   118M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   118M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|   118M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 79.4M, False: 38.6M]
  |  Branch (1072:28): [True: 70.7M, False: 8.71M]
  ------------------
 1073|  70.7M|    p->MinContext = p->MaxContext = c;
 1074|  47.3M|  else
 1075|  47.3M|  {
 1076|  47.3M|    UpdateModel(p);
 1077|  47.3M|    p->MinContext = p->MaxContext;
 1078|  47.3M|  }
 1079|   118M|}
archive_ppmd8.c:UpdateModel:
  806|  58.9M|{
  807|  58.9M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  58.9M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  58.9M|  CTX_PTR c;
  809|  58.9M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  58.9M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  58.9M|  CPpmd_State *s = NULL;
  812|       |  
  813|  58.9M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  58.9M|#define MAX_FREQ 124
  ------------------
  |  Branch (813:7): [True: 55.1M, False: 3.84M]
  |  Branch (813:45): [True: 53.5M, False: 1.58M]
  ------------------
  814|  53.5M|  {
  815|  53.5M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  53.5M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  53.5M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  53.5M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  53.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|       |    
  817|  53.5M|    if (c->NumStats == 0)
  ------------------
  |  Branch (817:9): [True: 32.1M, False: 21.4M]
  ------------------
  818|  32.1M|    {
  819|  32.1M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  32.1M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  32.1M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  820|  32.1M|      if (s->Freq < 32)
  ------------------
  |  Branch (820:11): [True: 32.1M, False: 1.37k]
  ------------------
  821|  32.1M|        s->Freq++;
  822|  32.1M|    }
  823|  21.4M|    else
  824|  21.4M|    {
  825|  21.4M|      s = STATS(c);
  ------------------
  |  |   30|  21.4M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  21.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  21.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|  21.4M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (826:11): [True: 13.2M, False: 8.19M]
  ------------------
  827|  13.2M|      {
  828|   169M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (828:28): [True: 156M, False: 13.2M]
  ------------------
  829|  13.2M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (829:13): [True: 5.49M, False: 7.72M]
  ------------------
  830|  5.49M|        {
  831|  5.49M|          SwapStates(&s[0], &s[-1]);
  832|  5.49M|          s--;
  833|  5.49M|        }
  834|  13.2M|      }
  835|  21.4M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  21.4M|#define MAX_FREQ 124
  ------------------
  |  Branch (835:11): [True: 21.2M, False: 192k]
  ------------------
  836|  21.2M|      {
  837|  21.2M|        s->Freq += 2;
  838|  21.2M|        c->SummFreq += 2;
  839|  21.2M|      }
  840|  21.4M|    }
  841|  53.5M|  }
  842|       |  
  843|  58.9M|  c = p->MaxContext;
  844|  58.9M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (844:7): [True: 8.71M, False: 50.2M]
  |  Branch (844:28): [True: 8.57M, False: 142k]
  ------------------
  845|  8.57M|  {
  846|  8.57M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  8.57M|#define True 1
  ------------------
  847|  8.57M|    if (cs == 0)
  ------------------
  |  Branch (847:9): [True: 459, False: 8.57M]
  ------------------
  848|    459|    {
  849|    459|      SetSuccessor(p->FoundState, 0);
  850|    459|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    459|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  851|    459|    }
  852|  8.57M|    else
  853|  8.57M|    {
  854|  8.57M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  8.57M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  8.57M|      p->MaxContext = cs;
  856|  8.57M|    }
  857|  8.57M|    return;
  858|  8.57M|  }
  859|       |  
  860|  50.3M|  *p->Text++ = p->FoundState->Symbol;
  861|  50.3M|  successor = REF(p->Text);
  ------------------
  |  |   24|  50.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  862|  50.3M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (862:7): [True: 41, False: 50.3M]
  ------------------
  863|     41|  {
  864|     41|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  554|     41|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  865|     41|    return;
  866|     41|  }
  867|       |  
  868|  50.3M|  if (!fSuccessor)
  ------------------
  |  Branch (868:7): [True: 2.53M, False: 47.8M]
  ------------------
  869|  2.53M|  {
  870|  2.53M|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  871|  2.53M|    if (cs == NULL)
  ------------------
  |  Branch (871:9): [True: 24, False: 2.53M]
  ------------------
  872|     24|    {
  873|     24|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|     24|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  874|     24|      return;
  875|     24|    }
  876|  2.53M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  2.53M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  877|  2.53M|  }
  878|  47.8M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |   96|  47.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (878:12): [True: 17.0M, False: 30.8M]
  ------------------
  879|  17.0M|  {
  880|  17.0M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  17.0M|#define False 0
  ------------------
  881|  17.0M|    if (cs == NULL)
  ------------------
  |  Branch (881:9): [True: 250, False: 17.0M]
  ------------------
  882|    250|    {
  883|    250|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|    250|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  884|    250|      return;
  885|    250|    }
  886|  17.0M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  17.0M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  887|  17.0M|  }
  888|       |  
  889|  50.3M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (889:7): [True: 1.79M, False: 48.5M]
  ------------------
  890|  1.79M|  {
  891|  1.79M|    successor = fSuccessor;
  892|  1.79M|    p->Text -= (p->MaxContext != p->MinContext);
  893|  1.79M|  }
  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|  50.3M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  904|  50.3M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  905|       |  
  906|  96.7M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  46.3M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  46.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  46.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  46.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (906:10): [True: 46.3M, False: 50.3M]
  ------------------
  907|  46.3M|  {
  908|  46.3M|    unsigned ns1;
  909|  46.3M|    UInt32 cf, sf;
  910|  46.3M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (910:9): [True: 17.6M, False: 28.6M]
  ------------------
  911|  17.6M|    {
  912|  17.6M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (912:11): [True: 11.9M, False: 5.77M]
  ------------------
  913|  11.9M|      {
  914|       |        /* Expand for one UNIT */
  915|  11.9M|        unsigned oldNU = (ns1 + 1) >> 1;
  916|  11.9M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  11.9M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  917|  11.9M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  11.9M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (917:13): [True: 11.5M, False: 341k]
  ------------------
  918|  11.5M|        {
  919|  11.5M|          void *ptr = AllocUnits(p, i + 1);
  920|  11.5M|          void *oldPtr;
  921|  11.5M|          if (!ptr)
  ------------------
  |  Branch (921:15): [True: 374, False: 11.5M]
  ------------------
  922|    374|          {
  923|    374|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    374|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  924|    374|            return;
  925|    374|          }
  926|  11.5M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  11.5M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  11.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  11.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  11.5M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  245|  11.5M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  11.5M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  11.5M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  11.5M|	UInt32 n = num;							\
  |  |  249|  17.2M|	do {								\
  |  |  250|  17.2M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  17.2M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 5.70M, False: 11.5M]
  |  |  ------------------
  |  |  252|  11.5M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 11.5M]
  |  |  ------------------
  ------------------
  928|  11.5M|          InsertNode(p, oldPtr, i);
  929|  11.5M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  11.5M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  11.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  930|  11.5M|        }
  931|  11.9M|      }
  932|  17.6M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  933|  17.6M|    }
  934|  28.6M|    else
  935|  28.6M|    {
  936|  28.6M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  937|  28.6M|      if (!s2)
  ------------------
  |  Branch (937:11): [True: 611, False: 28.6M]
  ------------------
  938|    611|      {
  939|    611|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    611|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  940|    611|        return;
  941|    611|      }
  942|  28.6M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  28.6M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  28.6M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  943|  28.6M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  28.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  944|  28.6M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  28.6M|#define MAX_FREQ 124
  ------------------
  |  Branch (944:11): [True: 28.6M, False: 12.8k]
  ------------------
  945|  28.6M|        s2->Freq <<= 1;
  946|  12.8k|      else
  947|  12.8k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  12.8k|#define MAX_FREQ 124
  ------------------
  948|  28.6M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  949|  28.6M|    }
  950|  46.3M|    cf = 2 * fFreq * (c->SummFreq + 6);
  951|  46.3M|    sf = (UInt32)s0 + c->SummFreq;
  952|  46.3M|    if (cf < 6 * sf)
  ------------------
  |  Branch (952:9): [True: 23.3M, False: 22.9M]
  ------------------
  953|  23.3M|    {
  954|  23.3M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  955|  23.3M|      c->SummFreq += 4;
  956|  23.3M|    }
  957|  22.9M|    else
  958|  22.9M|    {
  959|  22.9M|      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);
  960|  22.9M|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  961|  22.9M|    }
  962|  46.3M|    {
  963|  46.3M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  46.3M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  46.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  46.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  46.3M|      SetSuccessor(s2, successor);
  965|  46.3M|      s2->Symbol = fSymbol;
  966|  46.3M|      s2->Freq = (Byte)cf;
  967|  46.3M|      c->Flags |= flag;
  968|  46.3M|      c->NumStats = (Byte)(ns1 + 1);
  969|  46.3M|    }
  970|  46.3M|  }
  971|  50.3M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  50.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  50.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  50.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  50.3M|}
archive_ppmd8.c:SwapStates:
  444|  38.8M|{
  445|  38.8M|  CPpmd_State tmp = *t1;
  446|  38.8M|  *t1 = *t2;
  447|  38.8M|  *t2 = tmp;
  448|  38.8M|}
archive_ppmd8.c:CreateSuccessors:
  619|  25.6M|{
  620|  25.6M|  CPpmd_State upState;
  621|  25.6M|  Byte flags;
  622|  25.6M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  25.6M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  623|       |  /* fixed over Shkarin's code. Maybe it could work without + 1 too. */
  624|  25.6M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  625|  25.6M|  unsigned numPs = 0;
  626|       |  
  627|  25.6M|  if (!skip)
  ------------------
  |  Branch (627:7): [True: 17.0M, False: 8.57M]
  ------------------
  628|  17.0M|    ps[numPs++] = p->FoundState;
  629|       |  
  630|   122M|  while (c->Suffix)
  ------------------
  |  Branch (630:10): [True: 122M, False: 351k]
  ------------------
  631|   122M|  {
  632|   122M|    CPpmd_Void_Ref successor;
  633|   122M|    CPpmd_State *s;
  634|   122M|    c = SUFFIX(c);
  ------------------
  |  |   32|   122M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|   122M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|   122M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   122M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  635|   122M|    if (s1)
  ------------------
  |  Branch (635:9): [True: 25.4M, False: 96.9M]
  ------------------
  636|  25.4M|    {
  637|  25.4M|      s = s1;
  638|  25.4M|      s1 = NULL;
  639|  25.4M|    }
  640|  96.9M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (640:14): [True: 25.0M, False: 71.9M]
  ------------------
  641|  25.0M|    {
  642|   131M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  25.0M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  25.0M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  25.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (642:26): [True: 106M, False: 25.0M]
  ------------------
  643|  25.0M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  25.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (643:11): [True: 24.9M, False: 43.1k]
  ------------------
  644|  24.9M|      {
  645|  24.9M|        s->Freq++;
  646|  24.9M|        c->SummFreq++;
  647|  24.9M|      }
  648|  25.0M|    }
  649|  71.9M|    else
  650|  71.9M|    {
  651|  71.9M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  71.9M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  71.9M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  652|  71.9M|      s->Freq = (Byte)(s->Freq + (!SUFFIX(c)->NumStats & (s->Freq < 24)));
  ------------------
  |  |   32|  71.9M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  71.9M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  71.9M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  71.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  653|  71.9M|    }
  654|   122M|    successor = SUCCESSOR(s);
  ------------------
  |  |  341|   122M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  655|   122M|    if (successor != upBranch)
  ------------------
  |  Branch (655:9): [True: 25.2M, False: 97.1M]
  ------------------
  656|  25.2M|    {
  657|  25.2M|      c = CTX(successor);
  ------------------
  |  |   29|  25.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  25.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  25.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|  25.2M|      if (numPs == 0)
  ------------------
  |  Branch (658:11): [True: 620k, False: 24.6M]
  ------------------
  659|   620k|        return c;
  660|  24.6M|      break;
  661|  25.2M|    }
  662|  97.1M|    ps[numPs++] = s;
  663|  97.1M|  }
  664|       |  
  665|  24.9M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |   96|  24.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  666|  24.9M|  SetSuccessor(&upState, upBranch + 1);
  667|  24.9M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  668|       |
  669|  24.9M|  if (c->NumStats == 0)
  ------------------
  |  Branch (669:7): [True: 13.0M, False: 11.9M]
  ------------------
  670|  13.0M|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   31|  13.0M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  13.0M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  671|  11.9M|  else
  672|  11.9M|  {
  673|  11.9M|    UInt32 cf, s0;
  674|  11.9M|    CPpmd_State *s;
  675|  57.8M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  11.9M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  11.9M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  11.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:24): [True: 45.9M, False: 11.9M]
  ------------------
  676|  11.9M|    cf = s->Freq - 1;
  677|  11.9M|    s0 = c->SummFreq - c->NumStats - cf;
  678|  11.9M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (678:32): [True: 7.57M, False: 4.34M]
  ------------------
  679|  11.9M|  }
  680|       |
  681|   139M|  while (numPs != 0)
  ------------------
  |  Branch (681:10): [True: 114M, False: 24.9M]
  ------------------
  682|   114M|  {
  683|       |    /* Create Child */
  684|   114M|    CTX_PTR c1; /* = AllocContext(p); */
  685|   114M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (685:9): [True: 84.0M, False: 30.1M]
  ------------------
  686|  84.0M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  84.0M|#define UNIT_SIZE 12
  ------------------
  687|  30.1M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (687:14): [True: 18.8M, False: 11.2M]
  ------------------
  688|  18.8M|      c1 = (CTX_PTR)RemoveNode(p, 0);
  689|  11.2M|    else
  690|  11.2M|    {
  691|  11.2M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  692|  11.2M|      if (!c1)
  ------------------
  |  Branch (692:11): [True: 733, False: 11.2M]
  ------------------
  693|    733|        return NULL;
  694|  11.2M|    }
  695|   114M|    c1->NumStats = 0;
  696|   114M|    c1->Flags = flags;
  697|   114M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|   114M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   114M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  698|   114M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|   114M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  699|   114M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|   114M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  700|   114M|    c = c1;
  701|   114M|  }
  702|       |
  703|  24.9M|  return c;
  704|  24.9M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  14.6M|{
  206|  14.6M|  unsigned i;
  207|  14.6M|  void *retVal;
  208|  14.6M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 2.57k, False: 14.6M]
  ------------------
  209|  2.57k|  {
  210|  2.57k|    GlueFreeBlocks(p);
  211|  2.57k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 1.16k, False: 1.41k]
  ------------------
  212|  1.16k|      return RemoveNode(p, indx);
  213|  2.57k|  }
  214|  14.6M|  i = indx;
  215|  14.6M|  do
  216|   381M|  {
  217|   381M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   381M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   381M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   381M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   381M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   381M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   381M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   381M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   381M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 9.82M, False: 371M]
  ------------------
  218|  9.82M|    {
  219|  9.82M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  9.82M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  9.82M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  9.82M|      p->GlueCount--;
  221|  9.82M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 9.82M, False: 1.71k]
  ------------------
  222|  9.82M|    }
  223|   381M|  }
  224|   371M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 366M, False: 4.79M]
  ------------------
  225|  4.79M|  retVal = RemoveNode(p, i);
  226|  4.79M|  SplitBlock(p, retVal, i, indx);
  227|  4.79M|  return retVal;
  228|  14.6M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|  2.57k|{
  148|  2.57k|  CPpmd8_Node_Ref head = 0;
  149|  2.57k|  CPpmd8_Node_Ref *prev = &head;
  150|  2.57k|  unsigned i;
  151|       |
  152|  2.57k|  p->GlueCount = 1 << 13;
  153|  2.57k|  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.57k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 150, False: 2.42k]
  ------------------
  158|    150|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|   100k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   100k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   100k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   100k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   100k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   100k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   100k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   100k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   100k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 97.9k, False: 2.57k]
  ------------------
  162|  97.9k|  {
  163|  97.9k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|  97.9k|    p->FreeList[i] = 0;
  165|  21.7M|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 21.6M, False: 97.9k]
  ------------------
  166|  21.6M|    {
  167|  21.6M|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  21.6M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  21.6M|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 13.2M, False: 8.36M]
  ------------------
  169|  13.2M|      {
  170|  13.2M|        CPpmd8_Node *node2;
  171|  13.2M|        *prev = next;
  172|  13.2M|        prev = &(node->Next);
  173|  25.6M|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  25.6M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 12.3M, False: 13.2M]
  ------------------
  174|  12.3M|        {
  175|  12.3M|          node->NU += node2->NU;
  176|  12.3M|          node2->NU = 0;
  177|  12.3M|        }
  178|  13.2M|      }
  179|  21.6M|      next = node->Next;
  180|  21.6M|    }
  181|  97.9k|  }
  182|  2.57k|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  13.2M|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 13.2M, False: 2.57k]
  ------------------
  186|  13.2M|  {
  187|  13.2M|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  13.2M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  13.2M|    unsigned nu;
  189|  13.2M|    head = node->Next;
  190|  13.2M|    nu = node->NU;
  191|  13.2M|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 3.97M, False: 9.29M]
  ------------------
  192|  3.97M|      continue;
  193|  9.29M|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 260, False: 9.29M]
  ------------------
  194|    260|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|    260|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|    260|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|    260|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|    260|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|    260|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    260|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    260|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    260|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  9.29M|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  9.29M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 553k, False: 8.74M]
  ------------------
  196|   553k|    {
  197|   553k|      unsigned k = I2U(--i);
  ------------------
  |  |   19|   553k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|   553k|      InsertNode(p, node + k, nu - k - 1);
  199|   553k|    }
  200|  9.29M|    InsertNode(p, node, i);
  201|  9.29M|  }
  202|  2.57k|}
archive_ppmd8.c:RestoreModel:
  562|  1.75k|{
  563|  1.75k|  CTX_PTR c;
  564|  1.75k|  CPpmd_State *s;
  565|  1.75k|  RESET_TEXT(0);
  ------------------
  |  |  349|  1.75k|#define RESET_TEXT(offs) do {						\
  |  |  350|  1.75k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  1.75k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 1.75k]
  |  |  ------------------
  ------------------
  566|  5.90k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|  4.14k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  4.14k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  4.14k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.14k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:27): [True: 4.14k, False: 1.75k]
  ------------------
  567|  4.14k|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (567:9): [True: 2.80k, False: 1.33k]
  ------------------
  568|  2.80k|    {
  569|  2.80k|      s = STATS(c);
  ------------------
  |  |   30|  2.80k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  2.80k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.80k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  2.80k|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  571|  2.80k|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|  2.80k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.80k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  572|  2.80k|      SpecialFreeUnit(p, s);
  573|  2.80k|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  2.80k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.80k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  2.80k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.80k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|  2.80k|    }
  575|  1.33k|    else
  576|  1.33k|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  577|       | 
  578|  8.30k|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  6.54k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  6.54k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  6.54k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  6.54k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:10): [True: 6.54k, False: 1.75k]
  ------------------
  579|  6.54k|    if (!c->NumStats)
  ------------------
  |  Branch (579:9): [True: 4.24k, False: 2.29k]
  ------------------
  580|  4.24k|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  4.24k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.24k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  4.24k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.24k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  4.24k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.24k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  581|  2.29k|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (581:14): [True: 53, False: 2.24k]
  ------------------
  582|     53|      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.75k|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (601:7): [True: 71, False: 1.68k]
  |  Branch (601:59): [True: 0, False: 1.68k]
  ------------------
  602|     71|    RestartModel(p);
  603|  1.68k|  else
  604|  1.68k|  {
  605|  23.6k|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (605:12): [True: 21.9k, False: 1.68k]
  ------------------
  606|  21.9k|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|  21.9k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  21.9k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  21.9k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  21.9k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.68k|    do
  608|  1.68k|    {
  609|  1.68k|      CutOff(p, p->MaxContext, 0);
  610|  1.68k|      ExpandTextArea(p);
  611|  1.68k|    }
  612|  1.68k|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (612:12): [True: 0, False: 1.68k]
  ------------------
  613|  1.68k|    p->GlueCount = 0;
  614|  1.68k|    p->OrderFall = p->MaxOrder;
  615|  1.68k|  }
  616|  1.75k|}
archive_ppmd8.c:SpecialFreeUnit:
  277|  43.5M|{
  278|  43.5M|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (278:7): [True: 43.5M, False: 2.26k]
  ------------------
  279|  43.5M|    InsertNode(p, ptr, 0);
  280|  2.26k|  else
  281|  2.26k|  {
  282|       |    #ifdef PPMD8_FREEZE_SUPPORT
  283|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  284|       |    #endif
  285|  2.26k|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|  2.26k|#define UNIT_SIZE 12
  ------------------
  286|  2.26k|  }
  287|  43.5M|}
archive_ppmd8.c:Refresh:
  421|  3.53M|{
  422|  3.53M|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  423|  3.53M|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|  3.53M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  3.53M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  3.53M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  3.53M|  ctx->Stats = REF(s);
  ------------------
  |  |   24|  3.53M|  #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.53M|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  430|  3.53M|  escFreq = ctx->SummFreq - s->Freq;
  431|  3.53M|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  432|  3.53M|  do
  433|  7.63M|  {
  434|  7.63M|    escFreq -= (++s)->Freq;
  435|  7.63M|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  436|  7.63M|    flags |= 0x08 * (s->Symbol >= 0x40);
  437|  7.63M|  }
  438|  7.63M|  while (--i);
  ------------------
  |  Branch (438:10): [True: 4.09M, False: 3.53M]
  ------------------
  439|  3.53M|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  440|  3.53M|  ctx->Flags = (Byte)flags;
  441|  3.53M|}
archive_ppmd8.c:GetUsedMemory:
  543|  3.37k|{
  544|  3.37k|  UInt32 v = 0;
  545|  3.37k|  unsigned i;
  546|   131k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   131k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   131k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   131k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   131k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   131k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   131k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   131k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   131k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (546:15): [True: 128k, False: 3.37k]
  ------------------
  547|   128k|    v += p->Stamps[i] * I2U(i);
  ------------------
  |  |   19|   128k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  548|  3.37k|  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
  ------------------
  |  |   17|  3.37k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  3.37k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  549|  3.37k|}
archive_ppmd8.c:CutOff:
  451|   110M|{
  452|   110M|  int i;
  453|   110M|  unsigned tmp;
  454|   110M|  CPpmd_State *s;
  455|       |  
  456|   110M|  if (!ctx->NumStats)
  ------------------
  |  Branch (456:7): [True: 85.9M, False: 24.0M]
  ------------------
  457|  85.9M|  {
  458|  85.9M|    s = ONE_STATE(ctx);
  ------------------
  |  |   31|  85.9M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  85.9M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  459|  85.9M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
  ------------------
  |  |   96|  85.9M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (459:9): [True: 82.6M, False: 3.32M]
  ------------------
  460|  82.6M|    {
  461|  82.6M|      if (order < p->MaxOrder)
  ------------------
  |  Branch (461:11): [True: 76.6M, False: 6.04M]
  ------------------
  462|  76.6M|        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  76.6M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  76.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  76.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  6.04M|      else
  464|  6.04M|        SetSuccessor(s, 0);
  465|  82.6M|      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
  ------------------
  |  |  341|   165M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 39.6M, False: 42.9M]
  |  |  ------------------
  ------------------
  |  Branch (465:27): [True: 8.47M, False: 34.5M]
  ------------------
  466|  48.1M|        return REF(ctx);
  ------------------
  |  |   24|  48.1M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  467|  82.6M|    }
  468|  37.8M|    SpecialFreeUnit(p, ctx);
  469|  37.8M|    return 0;
  470|  85.9M|  }
  471|       |
  472|  24.0M|  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
  ------------------
  |  |   27|  24.0M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  24.0M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  473|       |
  474|  87.4M|  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  24.0M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  24.0M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  24.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  87.4M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  87.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  87.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:46): [True: 63.4M, False: 24.0M]
  ------------------
  475|  63.4M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
  ------------------
  |  |   96|  63.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (475:9): [True: 29.4M, False: 34.0M]
  ------------------
  476|  29.4M|    {
  477|  29.4M|      CPpmd_State *s2 = STATS(ctx) + (i--);
  ------------------
  |  |   30|  29.4M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  29.4M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  29.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  29.4M|      SetSuccessor(s, 0);
  479|  29.4M|      SwapStates(s, s2);
  480|  29.4M|    }
  481|  34.0M|    else if (order < p->MaxOrder)
  ------------------
  |  Branch (481:14): [True: 33.4M, False: 626k]
  ------------------
  482|  33.4M|      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  33.4M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  33.4M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  33.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   626k|    else
  484|   626k|      SetSuccessor(s, 0);
  485|       |    
  486|  24.0M|  if (i != ctx->NumStats && order)
  ------------------
  |  Branch (486:7): [True: 18.6M, False: 5.34M]
  |  Branch (486:29): [True: 18.6M, False: 1.68k]
  ------------------
  487|  18.6M|  {
  488|  18.6M|    ctx->NumStats = (Byte)i;
  489|  18.6M|    s = STATS(ctx);
  ------------------
  |  |   30|  18.6M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  18.6M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  18.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  18.6M|    if (i < 0)
  ------------------
  |  Branch (490:9): [True: 5.77M, False: 12.9M]
  ------------------
  491|  5.77M|    {
  492|  5.77M|      FreeUnits(p, s, tmp);
  493|  5.77M|      SpecialFreeUnit(p, ctx);
  494|  5.77M|      return 0;
  495|  5.77M|    }
  496|  12.9M|    if (i == 0)
  ------------------
  |  Branch (496:9): [True: 9.38M, False: 3.53M]
  ------------------
  497|  9.38M|    {
  498|  9.38M|      ctx->Flags = (Byte)((ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  499|  9.38M|      *ONE_STATE(ctx) = *s;
  ------------------
  |  |   31|  9.38M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  9.38M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  500|  9.38M|      FreeUnits(p, s, tmp);
  501|       |      /* 9.31: the code was fixed. It's was not BUG, if Freq <= MAX_FREQ = 124 */
  502|  9.38M|      ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  9.38M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  9.38M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  9.38M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  9.38M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  503|  9.38M|    }
  504|  3.53M|    else
  505|  3.53M|      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
  506|  12.9M|  }
  507|  18.2M|  return REF(ctx);
  ------------------
  |  |   24|  18.2M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  508|  24.0M|}
archive_ppmd8.c:MoveUnitsUp:
  290|  24.0M|{
  291|  24.0M|  unsigned indx = U2I(nu);
  ------------------
  |  |   18|  24.0M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  292|  24.0M|  void *ptr;
  293|  24.0M|  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
  ------------------
  |  |   24|   418k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  |  Branch (293:7): [True: 23.6M, False: 418k]
  |  Branch (293:53): [True: 4.18k, False: 414k]
  ------------------
  294|  23.6M|    return oldPtr;
  295|   414k|  ptr = RemoveNode(p, indx);
  296|   414k|  MyMem12Cpy(ptr, oldPtr, nu);
  ------------------
  |  |  245|   414k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|   414k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|   414k|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|   414k|	UInt32 n = num;							\
  |  |  249|   582k|	do {								\
  |  |  250|   582k|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|   582k|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 168k, False: 414k]
  |  |  ------------------
  |  |  252|   414k|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 414k]
  |  |  ------------------
  ------------------
  297|   414k|  if ((Byte*)oldPtr != p->UnitsStart)
  ------------------
  |  Branch (297:7): [True: 414k, False: 254]
  ------------------
  298|   414k|    InsertNode(p, oldPtr, indx);
  299|    254|  else
  300|    254|    p->UnitsStart += U2B(I2U(indx));
  ------------------
  |  |   17|    254|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|    254|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  301|   414k|  return ptr;
  302|  24.0M|}
archive_ppmd8.c:FreeUnits:
  272|  15.1M|{
  273|  15.1M|  InsertNode(p, ptr, U2I(nu));
  ------------------
  |  |   18|  15.1M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  274|  15.1M|}
archive_ppmd8.c:ExpandTextArea:
  305|  1.68k|{
  306|  1.68k|  UInt32 count[PPMD_NUM_INDEXES];
  307|  1.68k|  unsigned i;
  308|  1.68k|  memset(count, 0, sizeof(count));
  309|  1.68k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (309:7): [True: 0, False: 1.68k]
  ------------------
  310|      0|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  311|       |  
  312|  1.68k|  {
  313|  1.68k|    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
  314|  43.2k|    for (; node->Stamp == EMPTY_NODE; node += node->NU)
  ------------------
  |  |   62|  43.2k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (314:12): [True: 41.5k, False: 1.68k]
  ------------------
  315|  41.5k|    {
  316|  41.5k|      node->Stamp = 0;
  317|  41.5k|      count[U2I(node->NU)]++;
  ------------------
  |  |   18|  41.5k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  318|  41.5k|    }
  319|  1.68k|    p->UnitsStart = (Byte *)node;
  320|  1.68k|  }
  321|       |  
  322|  65.8k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  65.8k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  65.8k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  65.8k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  65.8k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  65.8k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  65.8k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  65.8k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  65.8k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:15): [True: 64.1k, False: 1.68k]
  ------------------
  323|  64.1k|  {
  324|  64.1k|    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
  325|  45.9M|    while (count[i] != 0)
  ------------------
  |  Branch (325:12): [True: 45.9M, False: 64.1k]
  ------------------
  326|  45.9M|    {
  327|  45.9M|      CPpmd8_Node *node = NODE(*next);
  ------------------
  |  |   59|  45.9M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  328|  45.9M|      while (node->Stamp == 0)
  ------------------
  |  Branch (328:14): [True: 41.5k, False: 45.9M]
  ------------------
  329|  41.5k|      {
  330|  41.5k|        *next = node->Next;
  331|  41.5k|        node = NODE(*next);
  ------------------
  |  |   59|  41.5k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  332|  41.5k|        p->Stamps[i]--;
  333|  41.5k|        if (--count[i] == 0)
  ------------------
  |  Branch (333:13): [True: 2.34k, False: 39.1k]
  ------------------
  334|  2.34k|          break;
  335|  41.5k|      }
  336|  45.9M|      next = &node->Next;
  337|  45.9M|    }
  338|  64.1k|  }
  339|  1.68k|}
archive_ppmd8.c:ReduceOrder:
  707|  2.53M|{
  708|  2.53M|  CPpmd_State *s = NULL;
  709|  2.53M|  CTX_PTR c1 = c;
  710|  2.53M|  CPpmd_Void_Ref upBranch = REF(p->Text);
  ------------------
  |  |   24|  2.53M|  #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.53M|  SetSuccessor(p->FoundState, upBranch);
  720|  2.53M|  p->OrderFall++;
  721|       |
  722|  2.53M|  for (;;)
  723|  3.97M|  {
  724|  3.97M|    if (s1)
  ------------------
  |  Branch (724:9): [True: 2.07M, False: 1.89M]
  ------------------
  725|  2.07M|    {
  726|  2.07M|      c = SUFFIX(c);
  ------------------
  |  |   32|  2.07M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  2.07M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  2.07M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.07M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  727|  2.07M|      s = s1;
  728|  2.07M|      s1 = NULL;
  729|  2.07M|    }
  730|  1.89M|    else
  731|  1.89M|    {
  732|  1.89M|      if (!c->Suffix)
  ------------------
  |  Branch (732:11): [True: 451k, False: 1.44M]
  ------------------
  733|   451k|      {
  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|   451k|        return c;
  743|   451k|      }
  744|  1.44M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.44M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.44M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.44M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.44M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  1.44M|      if (c->NumStats)
  ------------------
  |  Branch (745:11): [True: 691k, False: 756k]
  ------------------
  746|   691k|      {
  747|   691k|        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
  ------------------
  |  |   30|   691k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|   691k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   691k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (747:13): [True: 417k, False: 273k]
  ------------------
  748|  1.18M|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (748:30): [True: 770k, False: 417k]
  ------------------
  749|   691k|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|   691k|#define MAX_FREQ 124
  ------------------
  |  Branch (749:13): [True: 690k, False: 1.16k]
  ------------------
  750|   690k|        {
  751|   690k|          s->Freq += 2;
  752|   690k|          c->SummFreq += 2;
  753|   690k|        }
  754|   691k|      }
  755|   756k|      else
  756|   756k|      {
  757|   756k|        s = ONE_STATE(c);
  ------------------
  |  |   31|   756k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   756k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  758|   756k|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  759|   756k|      }
  760|  1.44M|    }
  761|  3.52M|    if (SUCCESSOR(s))
  ------------------
  |  |  341|  3.52M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 2.08M, False: 1.44M]
  |  |  ------------------
  ------------------
  762|  2.08M|      break;
  763|       |    #ifdef PPMD8_FREEZE_SUPPORT
  764|       |    ps[numPs++] = s;
  765|       |    #endif
  766|  1.44M|    SetSuccessor(s, upBranch);
  767|  1.44M|    p->OrderFall++;
  768|  1.44M|  }
  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.08M|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  341|  2.08M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (781:7): [True: 30.8k, False: 2.05M]
  ------------------
  782|  30.8k|  {
  783|  30.8k|    CTX_PTR successor;
  784|  30.8k|    CPpmd_State *s2 = p->FoundState;
  785|  30.8k|    p->FoundState = s;
  786|       |
  787|  30.8k|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|  30.8k|#define False 0
  ------------------
  788|  30.8k|    if (successor == NULL)
  ------------------
  |  Branch (788:9): [True: 24, False: 30.8k]
  ------------------
  789|     24|      SetSuccessor(s, 0);
  790|  30.8k|    else
  791|  30.8k|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|  30.8k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  792|  30.8k|    p->FoundState = s2;
  793|  30.8k|  }
  794|       |  
  795|  2.08M|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (795:7): [True: 26.7k, False: 2.05M]
  |  Branch (795:28): [True: 26.7k, False: 0]
  ------------------
  796|  26.7k|  {
  797|  26.7k|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  341|  26.7k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  798|  26.7k|    p->Text--;
  799|  26.7k|  }
  800|  2.08M|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  341|  2.08M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (800:7): [True: 24, False: 2.08M]
  ------------------
  801|     24|    return NULL;
  802|  2.08M|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|  2.08M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  2.08M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.08M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  2.08M|}
archive_ppmd8.c:AllocUnits:
  231|  40.2M|{
  232|  40.2M|  UInt32 numBytes;
  233|  40.2M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 16.3M, False: 23.8M]
  ------------------
  234|  16.3M|    return RemoveNode(p, indx);
  235|  23.8M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  23.8M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  23.8M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  23.8M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 20.5M, False: 3.34M]
  ------------------
  237|  20.5M|  {
  238|  20.5M|    void *retVal = p->LoUnit;
  239|  20.5M|    p->LoUnit += numBytes;
  240|  20.5M|    return retVal;
  241|  20.5M|  }
  242|  3.34M|  return AllocUnitsRare(p, indx);
  243|  23.8M|}
archive_ppmd8.c:Ppmd8_Update1:
 1082|  5.92M|{
 1083|  5.92M|  CPpmd_State *s = p->FoundState;
 1084|  5.92M|  s->Freq += 4;
 1085|  5.92M|  p->MinContext->SummFreq += 4;
 1086|  5.92M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1086:7): [True: 3.89M, False: 2.03M]
  ------------------
 1087|  3.89M|  {
 1088|  3.89M|    SwapStates(&s[0], &s[-1]);
 1089|  3.89M|    p->FoundState = --s;
 1090|  3.89M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  3.89M|#define MAX_FREQ 124
  ------------------
  |  Branch (1090:9): [True: 442, False: 3.89M]
  ------------------
 1091|    442|      Rescale(p);
 1092|  3.89M|  }
 1093|  5.92M|  NextContext(p);
 1094|  5.92M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|   105M|{
 1108|   105M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|   105M|  p->PrevSuccess = 1;
 1110|   105M|  p->RunLength++;
 1111|   105M|  NextContext(p);
 1112|   105M|}
archive_ppmd8.c:Ppmd8_MakeEscFreq:
 1046|  16.4M|{
 1047|  16.4M|  CPpmd_See *see;
 1048|  16.4M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1048:7): [True: 14.2M, False: 2.20M]
  ------------------
 1049|  14.2M|  {
 1050|  14.2M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1051|  14.2M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1052|  14.2M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1053|  14.2M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  14.2M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  14.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  14.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  14.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  14.2M|        p->MinContext->Flags;
 1055|  14.2M|    {
 1056|  14.2M|      unsigned r = (see->Summ >> see->Shift);
 1057|  14.2M|      see->Summ = (UInt16)(see->Summ - r);
 1058|  14.2M|      *escFreq = r + (r == 0);
 1059|  14.2M|    }
 1060|  14.2M|  }
 1061|  2.20M|  else
 1062|  2.20M|  {
 1063|  2.20M|    see = &p->DummySee;
 1064|  2.20M|    *escFreq = 1;
 1065|  2.20M|  }
 1066|  16.4M|  return see;
 1067|  16.4M|}
archive_ppmd8.c:Ppmd8_Update2:
 1115|  11.6M|{
 1116|  11.6M|  p->MinContext->SummFreq += 4;
 1117|  11.6M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  11.6M|#define MAX_FREQ 124
  ------------------
  |  Branch (1117:7): [True: 14.8k, False: 11.5M]
  ------------------
 1118|  14.8k|    Rescale(p);
 1119|  11.6M|  p->RunLength = p->InitRL;
 1120|  11.6M|  UpdateModel(p);
 1121|  11.6M|  p->MinContext = p->MaxContext;
 1122|  11.6M|}

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

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

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

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

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

archive_read_support_filter_all:
   42|  3.49k|{
   43|  3.49k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  3.49k|	do { \
  |  |  180|  3.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  3.49k|			(allowed_states), (function_name)); \
  |  |  182|  3.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  3.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 3.49k]
  |  |  ------------------
  |  |  183|  3.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  3.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 3.49k]
  |  |  ------------------
  ------------------
   44|  3.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_filter_all");
   45|       |
   46|       |	/* Bzip falls back to "bzip2 -d" command-line */
   47|  3.49k|	archive_read_support_filter_bzip2(a);
   48|       |	/* The decompress code doesn't use an outside library. */
   49|  3.49k|	archive_read_support_filter_compress(a);
   50|       |	/* Gzip decompress falls back to "gzip -d" command-line. */
   51|  3.49k|	archive_read_support_filter_gzip(a);
   52|       |	/* Lzip falls back to "lzip -d -q" command-line. */
   53|  3.49k|	archive_read_support_filter_lzip(a);
   54|       |	/* The LZMA file format has a very weak signature, so it
   55|       |	 * may not be feasible to keep this here, but we'll try.
   56|       |	 * This will come back out if there are problems. */
   57|       |	/* Lzma falls back to "lzma -d -qq" command-line. */
   58|  3.49k|	archive_read_support_filter_lzma(a);
   59|       |	/* Xz falls back to "xz -d -qq" command-line. */
   60|  3.49k|	archive_read_support_filter_xz(a);
   61|       |	/* The decode code doesn't use an outside library. */
   62|  3.49k|	archive_read_support_filter_uu(a);
   63|       |	/* The decode code doesn't use an outside library. */
   64|  3.49k|	archive_read_support_filter_rpm(a);
   65|       |	/* The decode code always uses "lrzip -d -q" command-line. */
   66|  3.49k|	archive_read_support_filter_lrzip(a);
   67|       |	/* Lzop decompress falls back to "lzop -d" command-line. */
   68|  3.49k|	archive_read_support_filter_lzop(a);
   69|       |	/* The decode code always uses "grzip -d" command-line. */
   70|  3.49k|	archive_read_support_filter_grzip(a);
   71|       |	/* Lz4 falls back to "lz4 -d -q" command-line. */
   72|  3.49k|	archive_read_support_filter_lz4(a);
   73|       |	/* Zstd falls back to "zstd -d -qq" command-line. */
   74|  3.49k|	archive_read_support_filter_zstd(a);
   75|       |
   76|       |	/* Note: We always return ARCHIVE_OK here, even if some of the
   77|       |	 * above return ARCHIVE_WARN.  The intent here is to enable
   78|       |	 * "as much as possible."  Clients who need specific
   79|       |	 * compression should enable those individually so they can
   80|       |	 * verify the level of support. */
   81|       |	/* Clear any warning messages set by the above functions. */
   82|  3.49k|	archive_clear_error(a);
   83|  3.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   84|  3.49k|}

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

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

archive_read_support_filter_grzip:
   62|  3.49k|{
   63|  3.49k|	struct archive_read *a = (struct archive_read *)_a;
   64|       |
   65|  3.49k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (65:6): [True: 0, False: 3.49k]
  ------------------
   66|  3.49k|				&grzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  3.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   67|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   68|       |
   69|       |	/* This filter always uses an external program. */
   70|  3.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   71|  3.49k|	    "Using external grzip program for grzip decompression");
   72|  3.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  3.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   73|  3.49k|}
archive_read_support_filter_grzip.c:grzip_bidder_bid:
   81|  3.93k|{
   82|  3.93k|	const unsigned char *p;
   83|       |
   84|  3.93k|	(void)b; /* UNUSED */
   85|       |
   86|  3.93k|	p = __archive_read_filter_ahead(f, sizeof(grzip_magic), NULL);
   87|  3.93k|	if (p == NULL)
  ------------------
  |  Branch (87:6): [True: 77, False: 3.86k]
  ------------------
   88|     77|		return (0);
   89|       |
   90|  3.86k|	if (memcmp(p, grzip_magic, sizeof(grzip_magic)))
  ------------------
  |  Branch (90:6): [True: 3.86k, False: 0]
  ------------------
   91|  3.86k|		return (0);
   92|       |
   93|      0|	return (sizeof(grzip_magic) * 8);
   94|  3.86k|}

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

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

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

archive_read_support_filter_lzop:
  109|  3.49k|{
  110|  3.49k|	struct archive_read *a = (struct archive_read *)_a;
  111|       |
  112|  3.49k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (112:6): [True: 0, False: 3.49k]
  ------------------
  113|  3.49k|				&lzop_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  3.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  114|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  115|       |
  116|       |	/* Signal the extent of lzop support with the return value here. */
  117|       |#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H)
  118|       |	return (ARCHIVE_OK);
  119|       |#else
  120|  3.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  121|  3.49k|	    "Using external lzop program for lzop decompression");
  122|  3.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  3.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  123|  3.49k|#endif
  124|  3.49k|}
archive_read_support_filter_lzop.c:lzop_bidder_bid:
  132|  3.93k|{
  133|  3.93k|	const unsigned char *p;
  134|       |
  135|  3.93k|	(void)b; /* UNUSED */
  136|       |
  137|  3.93k|	p = __archive_read_filter_ahead(f, LZOP_HEADER_MAGIC_LEN, NULL);
  ------------------
  |  |   68|  3.93k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  138|  3.93k|	if (p == NULL)
  ------------------
  |  Branch (138:6): [True: 77, False: 3.86k]
  ------------------
  139|     77|		return (0);
  140|       |
  141|  3.86k|	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   67|  3.86k|#define LZOP_HEADER_MAGIC "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a"
  ------------------
              	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   68|  3.86k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  |  Branch (141:6): [True: 3.86k, False: 0]
  ------------------
  142|  3.86k|		return (0);
  143|       |
  144|      0|	return (LZOP_HEADER_MAGIC_LEN * 8);
  ------------------
  |  |   68|      0|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  145|  3.86k|}

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

archive_read_support_filter_uu:
   92|  3.49k|{
   93|  3.49k|	struct archive_read *a = (struct archive_read *)_a;
   94|       |
   95|       |	return __archive_read_register_bidder(a, NULL,
   96|  3.49k|			&uudecode_bidder_vtable);
   97|  3.49k|}
archive_read_support_filter_uu.c:uudecode_bidder_bid:
  263|  3.93k|{
  264|  3.93k|	const unsigned char *p;
  265|  3.93k|	ssize_t avail, ravail;
  266|  3.93k|	ssize_t len, nl;
  267|  3.93k|	int l;
  268|  3.93k|	int firstline;
  269|  3.93k|	size_t nbytes_read;
  270|       |
  271|  3.93k|	(void)b; /* UNUSED */
  272|       |
  273|  3.93k|	p = __archive_read_filter_ahead(f, 1, &avail);
  274|  3.93k|	if (p == NULL)
  ------------------
  |  Branch (274:6): [True: 67, False: 3.87k]
  ------------------
  275|     67|		return (0);
  276|       |
  277|  3.87k|	firstline = 20;
  278|  3.87k|	ravail = avail;
  279|  3.87k|	nbytes_read = avail;
  280|   162k|	for (;;) {
  281|   162k|		len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  282|   162k|		if (len < 0 || nl == 0)
  ------------------
  |  Branch (282:7): [True: 3.75k, False: 158k]
  |  Branch (282:18): [True: 20, False: 158k]
  ------------------
  283|  3.77k|			return (0); /* No match found. */
  284|   158k|		if (len - nl >= 11 && memcmp(p, "begin ", 6) == 0)
  ------------------
  |  Branch (284:7): [True: 3.40k, False: 155k]
  |  Branch (284:25): [True: 1.24k, False: 2.16k]
  ------------------
  285|  1.24k|			l = 6;
  286|   157k|		else if (len -nl >= 18 && memcmp(p, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (286:12): [True: 580, False: 156k]
  |  Branch (286:29): [True: 53, False: 527]
  ------------------
  287|     53|			l = 13;
  288|   157k|		else
  289|   157k|			l = 0;
  290|       |
  291|   158k|		if (l > 0 && (p[l] < '0' || p[l] > '7' ||
  ------------------
  |  Branch (291:7): [True: 1.29k, False: 157k]
  |  Branch (291:17): [True: 138, False: 1.16k]
  |  Branch (291:31): [True: 203, False: 958]
  ------------------
  292|    958|		    p[l+1] < '0' || p[l+1] > '7' ||
  ------------------
  |  Branch (292:7): [True: 177, False: 781]
  |  Branch (292:23): [True: 170, False: 611]
  ------------------
  293|    611|		    p[l+2] < '0' || p[l+2] > '7' || p[l+3] != ' '))
  ------------------
  |  Branch (293:7): [True: 57, False: 554]
  |  Branch (293:23): [True: 248, False: 306]
  |  Branch (293:39): [True: 229, False: 77]
  ------------------
  294|  1.22k|			l = 0;
  295|       |
  296|   158k|		p += len;
  297|   158k|		avail -= len;
  298|   158k|		if (l)
  ------------------
  |  Branch (298:7): [True: 77, False: 158k]
  ------------------
  299|     77|			break;
  300|   158k|		firstline = 0;
  301|       |
  302|       |		/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  303|   158k|		if (nbytes_read >= UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|   158k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (303:7): [True: 15, False: 158k]
  ------------------
  304|     15|			return (0);
  305|   158k|	}
  306|     77|	if (!avail)
  ------------------
  |  Branch (306:6): [True: 0, False: 77]
  ------------------
  307|      0|		return (0);
  308|     77|	len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  309|     77|	if (len < 0 || nl == 0)
  ------------------
  |  Branch (309:6): [True: 1, False: 76]
  |  Branch (309:17): [True: 0, False: 76]
  ------------------
  310|      1|		return (0);/* There are non-ascii characters. */
  311|     76|	avail -= len;
  312|       |
  313|     76|	if (l == 6) {
  ------------------
  |  Branch (313:6): [True: 46, False: 30]
  ------------------
  314|       |		/* "begin " */
  315|     46|		if (!uuchar[*p])
  ------------------
  |  Branch (315:7): [True: 0, False: 46]
  ------------------
  316|      0|			return (0);
  317|       |		/* Get a length of decoded bytes. */
  318|     46|		l = UUDECODE(*p++); len--;
  ------------------
  |  |  258|     46|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  319|     46|		if (l > 45)
  ------------------
  |  Branch (319:7): [True: 0, False: 46]
  ------------------
  320|       |			/* Normally, maximum length is 45(character 'M'). */
  321|      0|			return (0);
  322|     46|		if (l > len - nl)
  ------------------
  |  Branch (322:7): [True: 0, False: 46]
  ------------------
  323|      0|			return (0); /* Line too short. */
  324|     89|		while (l) {
  ------------------
  |  Branch (324:10): [True: 43, False: 46]
  ------------------
  325|     43|			if (!uuchar[*p++])
  ------------------
  |  Branch (325:8): [True: 0, False: 43]
  ------------------
  326|      0|				return (0);
  327|     43|			--len;
  328|     43|			--l;
  329|     43|		}
  330|     46|		if (len-nl == 1 &&
  ------------------
  |  Branch (330:7): [True: 10, False: 36]
  ------------------
  331|     10|		    (uuchar[*p] ||		 /* Check sum. */
  ------------------
  |  Branch (331:8): [True: 10, False: 0]
  ------------------
  332|     10|		     (*p >= 'a' && *p <= 'z'))) {/* Padding data(MINIX). */
  ------------------
  |  Branch (332:9): [True: 0, False: 0]
  |  Branch (332:22): [True: 0, False: 0]
  ------------------
  333|     10|			++p;
  334|     10|			--len;
  335|     10|		}
  336|     46|		p += nl;
  337|     46|		if (avail && uuchar[*p])
  ------------------
  |  Branch (337:7): [True: 46, False: 0]
  |  Branch (337:16): [True: 46, False: 0]
  ------------------
  338|     46|			return (firstline+30);
  339|     46|	} else if (l == 13) {
  ------------------
  |  Branch (339:13): [True: 30, False: 0]
  ------------------
  340|       |		/* "begin-base64 " */
  341|    104|		while (len-nl > 0) {
  ------------------
  |  Branch (341:10): [True: 74, False: 30]
  ------------------
  342|     74|			if (!base64[*p++])
  ------------------
  |  Branch (342:8): [True: 0, False: 74]
  ------------------
  343|      0|				return (0);
  344|     74|			--len;
  345|     74|		}
  346|     30|		p += nl;
  347|       |
  348|     30|		if (avail >= 5 && memcmp(p, "====\n", 5) == 0)
  ------------------
  |  Branch (348:7): [True: 25, False: 5]
  |  Branch (348:21): [True: 0, False: 25]
  ------------------
  349|      0|			return (firstline+40);
  350|     30|		if (avail >= 6 && memcmp(p, "====\r\n", 6) == 0)
  ------------------
  |  Branch (350:7): [True: 25, False: 5]
  |  Branch (350:21): [True: 0, False: 25]
  ------------------
  351|      0|			return (firstline+40);
  352|     30|		if (avail > 0 && base64[*p])
  ------------------
  |  Branch (352:7): [True: 30, False: 0]
  |  Branch (352:20): [True: 30, False: 0]
  ------------------
  353|     30|			return (firstline+30);
  354|     30|	}
  355|       |
  356|      0|	return (0);
  357|     76|}
archive_read_support_filter_uu.c:bid_get_line:
  213|   162k|{
  214|   162k|	ssize_t len;
  215|   162k|	int quit;
  216|       |	
  217|   162k|	quit = 0;
  218|   162k|	if (*avail == 0) {
  ------------------
  |  Branch (218:6): [True: 7, False: 162k]
  ------------------
  219|      7|		*nl = 0;
  220|      7|		len = 0;
  221|      7|	} else
  222|   162k|		len = get_line(*b, *avail, nl);
  223|       |
  224|       |	/*
  225|       |	 * Read more bytes while it does not reach the end of line.
  226|       |	 */
  227|   162k|	while (*nl == 0 && len == *avail && !quit &&
  ------------------
  |  Branch (227:9): [True: 3.78k, False: 158k]
  |  Branch (227:21): [True: 26, False: 3.75k]
  |  Branch (227:38): [True: 26, False: 0]
  ------------------
  228|     26|	    *nbytes_read < UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|     26|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (228:6): [True: 25, False: 1]
  ------------------
  229|     25|		ssize_t diff = *ravail - *avail;
  230|     25|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  231|     25|		ssize_t tested;
  232|       |
  233|       |		/* Increase reading bytes if it is not enough for at least
  234|       |		 * two new lines. */
  235|     25|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (235:7): [True: 4, False: 21]
  ------------------
  236|      4|			nbytes_req <<= 1;
  237|       |
  238|     25|		*b = __archive_read_filter_ahead(f, nbytes_req, avail);
  239|     25|		if (*b == NULL) {
  ------------------
  |  Branch (239:7): [True: 19, False: 6]
  ------------------
  240|     19|			if (*ravail >= *avail)
  ------------------
  |  Branch (240:8): [True: 19, False: 0]
  ------------------
  241|     19|				return (0);
  242|       |			/* Reading bytes reaches the end of a stream. */
  243|      0|			*b = __archive_read_filter_ahead(f, *avail, avail);
  244|      0|			quit = 1;
  245|      0|		}
  246|      6|		*nbytes_read = *avail;
  247|      6|		*ravail = *avail;
  248|      6|		*b += diff;
  249|      6|		*avail -= diff;
  250|      6|		tested = len;/* Skip some bytes we already determined. */
  251|      6|		len = get_line(*b + tested, *avail - tested, nl);
  252|      6|		if (len >= 0)
  ------------------
  |  Branch (252:7): [True: 5, False: 1]
  ------------------
  253|      5|			len += tested;
  254|      6|	}
  255|   162k|	return (len);
  256|   162k|}
archive_read_support_filter_uu.c:get_line:
  177|   677k|{
  178|   677k|	ssize_t len;
  179|       |
  180|   677k|	len = 0;
  181|  6.92M|	while (len < avail) {
  ------------------
  |  Branch (181:9): [True: 6.91M, False: 1.57k]
  ------------------
  182|  6.91M|		switch (ascii[*b]) {
  ------------------
  |  Branch (182:11): [True: 6.91M, False: 0]
  ------------------
  183|  3.78k|		case 0:	/* Non-ascii character or control character. */
  ------------------
  |  Branch (183:3): [True: 3.78k, False: 6.91M]
  ------------------
  184|  3.78k|			if (nlsize != NULL)
  ------------------
  |  Branch (184:8): [True: 3.78k, False: 0]
  ------------------
  185|  3.78k|				*nlsize = 0;
  186|  3.78k|			return (-1);
  187|   578k|		case '\r':
  ------------------
  |  Branch (187:3): [True: 578k, False: 6.34M]
  ------------------
  188|   578k|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (188:8): [True: 577k, False: 171]
  |  Branch (188:25): [True: 636, False: 577k]
  ------------------
  189|    636|				if (nlsize != NULL)
  ------------------
  |  Branch (189:9): [True: 636, False: 0]
  ------------------
  190|    636|					*nlsize = 2;
  191|    636|				return (len+2);
  192|    636|			}
  193|       |			/* FALL THROUGH */
  194|   671k|		case '\n':
  ------------------
  |  Branch (194:3): [True: 93.9k, False: 6.82M]
  ------------------
  195|   671k|			if (nlsize != NULL)
  ------------------
  |  Branch (195:8): [True: 671k, False: 0]
  ------------------
  196|   671k|				*nlsize = 1;
  197|   671k|			return (len+1);
  198|  6.24M|		case 1:
  ------------------
  |  Branch (198:3): [True: 6.24M, False: 675k]
  ------------------
  199|  6.24M|			b++;
  200|  6.24M|			len++;
  201|  6.24M|			break;
  202|  6.91M|		}
  203|  6.91M|	}
  204|  1.57k|	if (nlsize != NULL)
  ------------------
  |  Branch (204:6): [True: 1.57k, False: 0]
  ------------------
  205|  1.57k|		*nlsize = 0;
  206|  1.57k|	return (avail);
  207|   677k|}
archive_read_support_filter_uu.c:uudecode_bidder_init:
  368|     76|{
  369|     76|	struct uu   *uu;
  370|     76|	void *out_buff;
  371|     76|	void *in_buff;
  372|       |
  373|     76|	f->code = ARCHIVE_FILTER_UU;
  ------------------
  |  |  316|     76|#define	ARCHIVE_FILTER_UU	7
  ------------------
  374|     76|	f->name = "uu";
  375|       |
  376|     76|	uu = calloc(1, sizeof(*uu));
  377|     76|	out_buff = malloc(OUT_BUFF_SIZE);
  ------------------
  |  |   53|     76|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  378|     76|	in_buff = malloc(IN_BUFF_SIZE);
  ------------------
  |  |   49|     76|#define IN_BUFF_SIZE	(1024)
  ------------------
  379|     76|	if (uu == NULL || out_buff == NULL || in_buff == NULL) {
  ------------------
  |  Branch (379:6): [True: 0, False: 76]
  |  Branch (379:20): [True: 0, False: 76]
  |  Branch (379:40): [True: 0, False: 76]
  ------------------
  380|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  381|      0|		    "Can't allocate data for uudecode");
  382|      0|		free(uu);
  383|      0|		free(out_buff);
  384|      0|		free(in_buff);
  385|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  386|      0|	}
  387|       |
  388|     76|	f->data = uu;
  389|     76|	uu->in_buff = in_buff;
  390|     76|	uu->in_cnt = 0;
  391|     76|	uu->in_allocated = IN_BUFF_SIZE;
  ------------------
  |  |   49|     76|#define IN_BUFF_SIZE	(1024)
  ------------------
  392|     76|	uu->out_buff = out_buff;
  393|     76|	uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     76|#define ST_FIND_HEAD	0
  ------------------
  394|     76|	uu->mode_set = 0;
  395|     76|	uu->name = NULL;
  396|     76|	f->vtable = &uudecode_reader_vtable;
  397|       |
  398|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  399|     76|}
archive_read_support_filter_uu.c:uudecode_filter_read:
  456|  1.12k|{
  457|  1.12k|	struct uu *uu = f->data;
  458|  1.12k|	const unsigned char *b, *d;
  459|  1.12k|	unsigned char *out;
  460|  1.12k|	ssize_t avail_in, ravail;
  461|  1.12k|	ssize_t used;
  462|  1.12k|	ssize_t total;
  463|  1.12k|	ssize_t len, llen, nl, namelen;
  464|       |
  465|  1.77k|read_more:
  466|  1.77k|	d = __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  467|  1.77k|	if (d == NULL && avail_in < 0)
  ------------------
  |  Branch (467:6): [True: 41, False: 1.73k]
  |  Branch (467:19): [True: 4, False: 37]
  ------------------
  468|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|       |	/* Quiet a code analyzer; make sure avail_in must be zero
  470|       |	 * when d is NULL. */
  471|  1.77k|	if (d == NULL)
  ------------------
  |  Branch (471:6): [True: 37, False: 1.73k]
  ------------------
  472|     37|		avail_in = 0;
  473|  1.77k|	used = 0;
  474|  1.77k|	total = 0;
  475|  1.77k|	out = uu->out_buff;
  476|  1.77k|	if (avail_in > 2 * UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|  1.77k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (476:6): [True: 9, False: 1.76k]
  ------------------
  477|      9|		avail_in = 2 * UUENCODE_BID_MAX_READ;
  ------------------
  |  |   44|      9|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  478|  1.77k|	ravail = avail_in;
  479|  1.77k|	if (uu->state == ST_IGNORE) {
  ------------------
  |  |   59|  1.77k|#define ST_IGNORE	4
  ------------------
  |  Branch (479:6): [True: 3, False: 1.77k]
  ------------------
  480|      3|		used = avail_in;
  481|      3|		goto finish;
  482|      3|	}
  483|  1.77k|	if (uu->in_cnt) {
  ------------------
  |  Branch (483:6): [True: 1.50k, False: 265]
  ------------------
  484|  1.50k|		if (uu->in_cnt > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  1.50k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (484:7): [True: 0, False: 1.50k]
  ------------------
  485|      0|			archive_set_error(&f->archive->archive,
  486|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  487|      0|			    "Invalid format data");
  488|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  489|      0|		}
  490|       |		/*
  491|       |		 * If there is remaining data which is saved by
  492|       |		 * a previous call, use it first.
  493|       |		 */
  494|  1.50k|		if (ensure_in_buff_size(f, uu,
  ------------------
  |  Branch (494:7): [True: 0, False: 1.50k]
  ------------------
  495|  1.50k|		    avail_in + uu->in_cnt) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.50k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  496|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|  1.50k|		if (avail_in > 0)
  ------------------
  |  Branch (497:7): [True: 1.47k, False: 28]
  ------------------
  498|  1.47k|			memcpy(uu->in_buff + uu->in_cnt,
  499|  1.47k|			    d, avail_in);
  500|  1.50k|		d = uu->in_buff;
  501|  1.50k|		avail_in += uu->in_cnt;
  502|  1.50k|		uu->in_cnt = 0;
  503|  1.50k|	}
  504|   515k|	for (;used < avail_in; d += llen, used += llen) {
  ------------------
  |  Branch (504:8): [True: 515k, False: 192]
  ------------------
  505|   515k|		ssize_t l, body;
  506|       |
  507|   515k|		b = d;
  508|   515k|		len = get_line(b, avail_in - used, &nl);
  509|   515k|		if (len < 0) {
  ------------------
  |  Branch (509:7): [True: 23, False: 514k]
  ------------------
  510|       |			/* Non-ascii character is found. */
  511|     23|			if (uu->state == ST_FIND_HEAD &&
  ------------------
  |  |   55|     46|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (511:8): [True: 10, False: 13]
  ------------------
  512|     10|			    (uu->total > 0 || total > 0)) {
  ------------------
  |  Branch (512:9): [True: 7, False: 3]
  |  Branch (512:26): [True: 3, False: 0]
  ------------------
  513|     10|				uu->state = ST_IGNORE;
  ------------------
  |  |   59|     10|#define ST_IGNORE	4
  ------------------
  514|     10|				used = avail_in;
  515|     10|				goto finish;
  516|     10|			}
  517|     13|			archive_set_error(&f->archive->archive,
  518|     13|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     13|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  519|     13|			    "Insufficient compressed data");
  520|     13|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  521|     23|		}
  522|   514k|		if (len > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|   514k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (522:7): [True: 1, False: 514k]
  ------------------
  523|      1|			archive_set_error(&f->archive->archive,
  524|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  525|      1|			    "Invalid format data");
  526|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  527|      1|		}
  528|   514k|		llen = len;
  529|   514k|		if ((nl == 0) && (uu->state != ST_UUEND)) {
  ------------------
  |  |   57|  1.55k|#define ST_UUEND	2
  ------------------
  |  Branch (529:7): [True: 1.55k, False: 513k]
  |  Branch (529:20): [True: 1.53k, False: 19]
  ------------------
  530|  1.53k|			if (total == 0 && ravail <= 0) {
  ------------------
  |  Branch (530:8): [True: 681, False: 856]
  |  Branch (530:22): [True: 28, False: 653]
  ------------------
  531|       |				/* There is nothing more to read, fail */
  532|     28|				archive_set_error(&f->archive->archive,
  533|     28|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     28|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  534|     28|				    "Missing format data");
  535|     28|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     28|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  536|     28|			}
  537|       |			/*
  538|       |			 * Save remaining data which does not contain
  539|       |			 * NL('\n','\r').
  540|       |			 */
  541|  1.50k|			if (ensure_in_buff_size(f, uu, len)
  ------------------
  |  Branch (541:8): [True: 0, False: 1.50k]
  ------------------
  542|  1.50k|			    != ARCHIVE_OK)
  ------------------
  |  |  233|  1.50k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  543|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  544|  1.50k|			if (uu->in_buff != b)
  ------------------
  |  Branch (544:8): [True: 1.03k, False: 475]
  ------------------
  545|  1.03k|				memmove(uu->in_buff, b, len);
  546|  1.50k|			uu->in_cnt = len;
  547|  1.50k|			if (total == 0) {
  ------------------
  |  Branch (547:8): [True: 653, False: 856]
  ------------------
  548|       |				/* Do not return 0; it means end-of-file.
  549|       |				 * We should try to read more bytes. */
  550|    653|				__archive_read_filter_consume(
  551|    653|				    f->upstream, ravail);
  552|    653|				goto read_more;
  553|    653|			}
  554|    856|			used += len;
  555|    856|			break;
  556|  1.50k|		}
  557|   513k|		switch (uu->state) {
  558|      0|		default:
  ------------------
  |  Branch (558:3): [True: 0, False: 513k]
  ------------------
  559|  35.9k|		case ST_FIND_HEAD:
  ------------------
  |  |   55|  35.9k|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (559:3): [True: 35.9k, False: 477k]
  ------------------
  560|       |			/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  561|  35.9k|			if (total + len >= UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  35.9k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (561:8): [True: 0, False: 35.9k]
  ------------------
  562|      0|				archive_set_error(&f->archive->archive,
  563|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  564|      0|				    "Invalid format data");
  565|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  566|      0|			}
  567|  35.9k|			if (len - nl >= 11 && memcmp(b, "begin ", 6) == 0)
  ------------------
  |  Branch (567:8): [True: 4.86k, False: 31.1k]
  |  Branch (567:26): [True: 2.29k, False: 2.56k]
  ------------------
  568|  2.29k|				l = 6;
  569|  33.6k|			else if (len - nl >= 18 &&
  ------------------
  |  Branch (569:13): [True: 708, False: 32.9k]
  ------------------
  570|    708|			    memcmp(b, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (570:8): [True: 142, False: 566]
  ------------------
  571|    142|				l = 13;
  572|  33.5k|			else
  573|  33.5k|				l = 0;
  574|  35.9k|			if (l != 0 && b[l] >= '0' && b[l] <= '7' &&
  ------------------
  |  Branch (574:8): [True: 2.43k, False: 33.5k]
  |  Branch (574:18): [True: 2.43k, False: 1]
  |  Branch (574:33): [True: 2.13k, False: 301]
  ------------------
  575|  2.13k|			    b[l+1] >= '0' && b[l+1] <= '7' &&
  ------------------
  |  Branch (575:8): [True: 1.95k, False: 177]
  |  Branch (575:25): [True: 1.21k, False: 746]
  ------------------
  576|  1.21k|			    b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') {
  ------------------
  |  Branch (576:8): [True: 1.15k, False: 56]
  |  Branch (576:25): [True: 592, False: 565]
  |  Branch (576:42): [True: 90, False: 502]
  ------------------
  577|     90|				if (l == 6)
  ------------------
  |  Branch (577:9): [True: 57, False: 33]
  ------------------
  578|     57|					uu->state = ST_READ_UU;
  ------------------
  |  |   56|     57|#define ST_READ_UU	1
  ------------------
  579|     33|				else
  580|     33|					uu->state = ST_READ_BASE64;
  ------------------
  |  |   58|     33|#define ST_READ_BASE64	3
  ------------------
  581|     90|				uu->mode = (mode_t)(
  582|     90|				    ((int)(b[l] - '0') * 64) +
  583|     90|				    ((int)(b[l+1] - '0') * 8) +
  584|     90|				     (int)(b[l+2] - '0'));
  585|     90|				uu->mode_set = 1;
  586|     90|				namelen = len - nl - 4 - l;
  587|     90|				if (namelen > 1) {
  ------------------
  |  Branch (587:9): [True: 16, False: 74]
  ------------------
  588|     16|					if (uu->name != NULL)
  ------------------
  |  Branch (588:10): [True: 3, False: 13]
  ------------------
  589|      3|						free(uu->name);
  590|     16|					uu->name = malloc(namelen + 1);
  591|     16|					if (uu->name == NULL) {
  ------------------
  |  Branch (591:10): [True: 0, False: 16]
  ------------------
  592|      0|						archive_set_error(
  593|      0|						    &f->archive->archive,
  594|      0|						    ENOMEM,
  595|      0|						    "Can't allocate data for uudecode");
  596|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  597|      0|					}
  598|     16|					strncpy(uu->name,
  599|     16|					    (const char *)(b + l + 4),
  600|     16|					    namelen);
  601|     16|					uu->name[namelen] = '\0';
  602|     16|				}
  603|     90|			}
  604|  35.9k|			break;
  605|  35.9k|		case ST_READ_UU:
  ------------------
  |  |   56|     84|#define ST_READ_UU	1
  ------------------
  |  Branch (605:3): [True: 84, False: 513k]
  ------------------
  606|     84|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|     84|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (606:8): [True: 3, False: 81]
  ------------------
  607|      3|				goto finish;
  608|     81|			body = len - nl;
  609|     81|			if (!uuchar[*b] || body <= 0) {
  ------------------
  |  Branch (609:8): [True: 0, False: 81]
  |  Branch (609:23): [True: 0, False: 81]
  ------------------
  610|      0|				archive_set_error(&f->archive->archive,
  611|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  612|      0|				    "Insufficient compressed data");
  613|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  614|      0|			}
  615|       |			/* Get length of undecoded bytes of current line. */
  616|     81|			l = UUDECODE(*b++);
  ------------------
  |  |  258|     81|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  617|     81|			body--;
  618|     81|			if (l > body) {
  ------------------
  |  Branch (618:8): [True: 0, False: 81]
  ------------------
  619|      0|				archive_set_error(&f->archive->archive,
  620|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  621|      0|				    "Insufficient compressed data");
  622|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  623|      0|			}
  624|     81|			if (l == 0) {
  ------------------
  |  Branch (624:8): [True: 19, False: 62]
  ------------------
  625|     19|				uu->state = ST_UUEND;
  ------------------
  |  |   57|     19|#define ST_UUEND	2
  ------------------
  626|     19|				break;
  627|     19|			}
  628|    139|			while (l > 0) {
  ------------------
  |  Branch (628:11): [True: 82, False: 57]
  ------------------
  629|     82|				int n = 0;
  630|       |
  631|     82|				if (!uuchar[b[0]] || !uuchar[b[1]])
  ------------------
  |  Branch (631:9): [True: 0, False: 82]
  |  Branch (631:26): [True: 1, False: 81]
  ------------------
  632|      1|					break;
  633|     81|				n = UUDECODE(*b++) << 18;
  ------------------
  |  |  258|     81|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  634|     81|				n |= UUDECODE(*b++) << 12;
  ------------------
  |  |  258|     81|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  635|     81|				*out++ = n >> 16; total++;
  636|     81|				--l;
  637|       |
  638|     81|				if (l > 0) {
  ------------------
  |  Branch (638:9): [True: 27, False: 54]
  ------------------
  639|     27|					if (!uuchar[b[0]])
  ------------------
  |  Branch (639:10): [True: 3, False: 24]
  ------------------
  640|      3|						break;
  641|     24|					n |= UUDECODE(*b++) << 6;
  ------------------
  |  |  258|     24|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  642|     24|					*out++ = (n >> 8) & 0xFF; total++;
  643|     24|					--l;
  644|     24|				}
  645|     78|				if (l > 0) {
  ------------------
  |  Branch (645:9): [True: 21, False: 57]
  ------------------
  646|     21|					if (!uuchar[b[0]])
  ------------------
  |  Branch (646:10): [True: 1, False: 20]
  ------------------
  647|      1|						break;
  648|     20|					n |= UUDECODE(*b++);
  ------------------
  |  |  258|     20|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  649|     20|					*out++ = n & 0xFF; total++;
  650|     20|					--l;
  651|     20|				}
  652|     78|			}
  653|     62|			if (l) {
  ------------------
  |  Branch (653:8): [True: 5, False: 57]
  ------------------
  654|      5|				archive_set_error(&f->archive->archive,
  655|      5|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  656|      5|				    "Insufficient compressed data");
  657|      5|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  658|      5|			}
  659|     57|			break;
  660|     57|		case ST_UUEND:
  ------------------
  |  |   57|     19|#define ST_UUEND	2
  ------------------
  |  Branch (660:3): [True: 19, False: 513k]
  ------------------
  661|     19|			if (len - nl == 3 && memcmp(b, "end ", 3) == 0)
  ------------------
  |  Branch (661:8): [True: 16, False: 3]
  |  Branch (661:25): [True: 16, False: 0]
  ------------------
  662|     16|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     16|#define ST_FIND_HEAD	0
  ------------------
  663|      3|			else {
  664|      3|				archive_set_error(&f->archive->archive,
  665|      3|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  666|      3|				    "Insufficient compressed data");
  667|      3|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  668|      3|			}
  669|     16|			break;
  670|   477k|		case ST_READ_BASE64:
  ------------------
  |  |   58|   477k|#define ST_READ_BASE64	3
  ------------------
  |  Branch (670:3): [True: 477k, False: 36.0k]
  ------------------
  671|   477k|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|   477k|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (671:8): [True: 3, False: 477k]
  ------------------
  672|      3|				goto finish;
  673|   477k|			l = len - nl;
  674|   477k|			if (l >= 3 && b[0] == '=' && b[1] == '=' &&
  ------------------
  |  Branch (674:8): [True: 358k, False: 118k]
  |  Branch (674:18): [True: 322k, False: 35.9k]
  |  Branch (674:33): [True: 93.5k, False: 229k]
  ------------------
  675|  93.5k|			    b[2] == '=') {
  ------------------
  |  Branch (675:8): [True: 12, False: 93.5k]
  ------------------
  676|     12|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     12|#define ST_FIND_HEAD	0
  ------------------
  677|     12|				break;
  678|     12|			}
  679|   517k|			while (l > 0) {
  ------------------
  |  Branch (679:11): [True: 498k, False: 19.3k]
  ------------------
  680|   498k|				int n = 0;
  681|       |
  682|   498k|				if (!base64[b[0]] || !base64[b[1]])
  ------------------
  |  Branch (682:9): [True: 1, False: 498k]
  |  Branch (682:26): [True: 133k, False: 364k]
  ------------------
  683|   133k|					break;
  684|   364k|				n = base64num[*b++] << 18;
  685|   364k|				n |= base64num[*b++] << 12;
  686|   364k|				*out++ = n >> 16; total++;
  687|   364k|				l -= 2;
  688|       |
  689|   364k|				if (l > 0) {
  ------------------
  |  Branch (689:9): [True: 349k, False: 14.8k]
  ------------------
  690|   349k|					if (*b == '=')
  ------------------
  |  Branch (690:10): [True: 178k, False: 170k]
  ------------------
  691|   178k|						break;
  692|   170k|					if (!base64[*b])
  ------------------
  |  Branch (692:10): [True: 1, False: 170k]
  ------------------
  693|      1|						break;
  694|   170k|					n |= base64num[*b++] << 6;
  695|   170k|					*out++ = (n >> 8) & 0xFF; total++;
  696|   170k|					--l;
  697|   170k|				}
  698|   185k|				if (l > 0) {
  ------------------
  |  Branch (698:9): [True: 170k, False: 14.9k]
  ------------------
  699|   170k|					if (*b == '=')
  ------------------
  |  Branch (699:10): [True: 145k, False: 25.1k]
  ------------------
  700|   145k|						break;
  701|  25.1k|					if (!base64[*b])
  ------------------
  |  Branch (701:10): [True: 0, False: 25.1k]
  ------------------
  702|      0|						break;
  703|  25.1k|					n |= base64num[*b++];
  704|  25.1k|					*out++ = n & 0xFF; total++;
  705|  25.1k|					--l;
  706|  25.1k|				}
  707|   185k|			}
  708|   477k|			if (l && *b != '=') {
  ------------------
  |  Branch (708:8): [True: 457k, False: 19.3k]
  |  Branch (708:13): [True: 4, False: 457k]
  ------------------
  709|      4|				archive_set_error(&f->archive->archive,
  710|      4|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  711|      4|				    "Insufficient compressed data");
  712|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  713|      4|			}
  714|   477k|			break;
  715|   513k|		}
  716|   513k|	}
  717|  1.06k|finish:
  718|  1.06k|	if (ravail < avail_in)
  ------------------
  |  Branch (718:6): [True: 991, False: 76]
  ------------------
  719|    991|		used -= avail_in - ravail;
  720|  1.06k|	__archive_read_filter_consume(f->upstream, used);
  721|       |
  722|  1.06k|	*buff = uu->out_buff;
  723|  1.06k|	uu->total += total;
  724|  1.06k|	return (total);
  725|  1.77k|}
archive_read_support_filter_uu.c:ensure_in_buff_size:
  404|  3.01k|{
  405|       |
  406|  3.01k|	if (size > uu->in_allocated) {
  ------------------
  |  Branch (406:6): [True: 35, False: 2.98k]
  ------------------
  407|     35|		unsigned char *ptr;
  408|     35|		size_t newsize;
  409|       |
  410|       |		/*
  411|       |		 * Calculate a new buffer size for in_buff.
  412|       |		 * Increase its value until it is enough for our needs.
  413|       |		 */
  414|     35|		newsize = uu->in_allocated;
  415|  1.21k|		do {
  416|  1.21k|			if (newsize < IN_BUFF_SIZE*32)
  ------------------
  |  |   49|  1.21k|#define IN_BUFF_SIZE	(1024)
  ------------------
  |  Branch (416:8): [True: 151, False: 1.06k]
  ------------------
  417|    151|				newsize <<= 1;
  418|  1.06k|			else
  419|  1.06k|				newsize += IN_BUFF_SIZE;
  ------------------
  |  |   49|  1.06k|#define IN_BUFF_SIZE	(1024)
  ------------------
  420|  1.21k|		} while (size > newsize);
  ------------------
  |  Branch (420:12): [True: 1.17k, False: 35]
  ------------------
  421|       |		/* Allocate the new buffer. */
  422|     35|		ptr = malloc(newsize);
  423|     35|		if (ptr == NULL) {
  ------------------
  |  Branch (423:7): [True: 0, False: 35]
  ------------------
  424|      0|			archive_set_error(&f->archive->archive,
  425|      0|			    ENOMEM,
  426|      0|    			    "Can't allocate data for uudecode");
  427|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  428|      0|		}
  429|       |		/* Move the remaining data in in_buff into the new buffer. */
  430|     35|		if (uu->in_cnt)
  ------------------
  |  Branch (430:7): [True: 12, False: 23]
  ------------------
  431|     12|			memcpy(ptr, uu->in_buff, uu->in_cnt);
  432|       |		/* Replace in_buff with the new buffer. */
  433|     35|		free(uu->in_buff);
  434|     35|		uu->in_buff = ptr;
  435|     35|		uu->in_allocated = newsize;
  436|     35|	}
  437|  3.01k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  438|  3.01k|}
archive_read_support_filter_uu.c:uudecode_filter_close:
  729|     76|{
  730|     76|	struct uu *uu = f->data;
  731|       |
  732|     76|	free(uu->in_buff);
  733|     76|	free(uu->out_buff);
  734|     76|	free(uu->name);
  735|     76|	free(uu);
  736|       |
  737|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  738|     76|}
archive_read_support_filter_uu.c:uudecode_read_header:
  442|     22|{
  443|     22|	struct uu *uu = f->data;
  444|       |
  445|     22|	if (uu->mode_set != 0)
  ------------------
  |  Branch (445:6): [True: 22, False: 0]
  ------------------
  446|     22|		archive_entry_set_mode(entry, S_IFREG | uu->mode);
  447|       |
  448|     22|	if (uu->name != NULL)
  ------------------
  |  Branch (448:6): [True: 3, False: 19]
  ------------------
  449|      3|		archive_entry_set_pathname(entry, uu->name);
  450|       |
  451|     22|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  452|     22|}

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

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

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

archive_read_support_format_all:
   33|  3.49k|{
   34|  3.49k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  3.49k|	do { \
  |  |  180|  3.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  3.49k|			(allowed_states), (function_name)); \
  |  |  182|  3.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  3.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 3.49k]
  |  |  ------------------
  |  |  183|  3.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  3.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 3.49k]
  |  |  ------------------
  ------------------
   35|  3.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_all");
   36|       |
   37|       |	/* TODO: It would be nice to compute the ordering
   38|       |	 * here automatically so that people who enable just
   39|       |	 * a few formats can still get the benefits.  That
   40|       |	 * may just require the format registration to include
   41|       |	 * a "maximum read-ahead" value (anything that uses seek
   42|       |	 * would be essentially infinite read-ahead).  The core
   43|       |	 * bid management can then sort the bidders before calling
   44|       |	 * them.
   45|       |	 *
   46|       |	 * If you implement the above, please return the list below
   47|       |	 * to alphabetic order.
   48|       |	 */
   49|       |
   50|       |	/*
   51|       |	 * These bidders are all pretty cheap; they just examine a
   52|       |	 * small initial part of the archive.  If one of these bids
   53|       |	 * high, we can maybe avoid running any of the more expensive
   54|       |	 * bidders below.
   55|       |	 */
   56|  3.49k|	archive_read_support_format_ar(a);
   57|  3.49k|	archive_read_support_format_cpio(a);
   58|  3.49k|	archive_read_support_format_empty(a);
   59|  3.49k|	archive_read_support_format_lha(a);
   60|  3.49k|	archive_read_support_format_mtree(a);
   61|  3.49k|	archive_read_support_format_tar(a);
   62|  3.49k|	archive_read_support_format_xar(a);
   63|  3.49k|	archive_read_support_format_warc(a);
   64|       |
   65|       |	/*
   66|       |	 * Install expensive bidders last.  By doing them last, we
   67|       |	 * increase the chance that a high bid from someone else will
   68|       |	 * make it unnecessary for these to do anything at all.
   69|       |	 */
   70|       |	/* These have potentially large look-ahead. */
   71|  3.49k|	archive_read_support_format_7zip(a);
   72|  3.49k|	archive_read_support_format_cab(a);
   73|  3.49k|	archive_read_support_format_rar(a);
   74|  3.49k|	archive_read_support_format_rar5(a);
   75|  3.49k|	archive_read_support_format_iso9660(a);
   76|       |	/* Seek is really bad, since it forces the read-ahead
   77|       |	 * logic to discard buffered data. */
   78|  3.49k|	archive_read_support_format_zip(a);
   79|       |
   80|       |	/* Note: We always return ARCHIVE_OK here, even if some of the
   81|       |	 * above return ARCHIVE_WARN.  The intent here is to enable
   82|       |	 * "as much as possible."  Clients who need specific
   83|       |	 * formats should enable those individually so they can
   84|       |	 * verify the level of support. */
   85|       |	/* Clear any warning messages set by the above functions. */
   86|  3.49k|	archive_clear_error(a);
   87|  3.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   88|  3.49k|}

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

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

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

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

archive_read_support_format_iso9660:
  457|  3.49k|{
  458|  3.49k|	struct archive_read *a = (struct archive_read *)_a;
  459|  3.49k|	struct iso9660 *iso9660;
  460|  3.49k|	int r;
  461|       |
  462|  3.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  3.49k|	do { \
  |  |  180|  3.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  3.49k|			(allowed_states), (function_name)); \
  |  |  182|  3.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  3.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 3.49k]
  |  |  ------------------
  |  |  183|  3.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  3.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 3.49k]
  |  |  ------------------
  ------------------
  463|  3.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  464|       |
  465|  3.49k|	iso9660 = calloc(1, sizeof(*iso9660));
  466|  3.49k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (466:6): [True: 0, False: 3.49k]
  ------------------
  467|      0|		archive_set_error(_a, ENOMEM, "Can't allocate iso9660 data");
  468|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|      0|	}
  470|  3.49k|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  324|  3.49k|#define ISO9660_MAGIC   0x96609660
  ------------------
  471|  3.49k|	iso9660->cache_files.first = NULL;
  472|  3.49k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  473|  3.49k|	iso9660->re_files.first = NULL;
  474|  3.49k|	iso9660->re_files.last = &(iso9660->re_files.first);
  475|       |	/* Enable to support Joliet extensions by default.	*/
  476|  3.49k|	iso9660->opt_support_joliet = 1;
  477|       |	/* Enable to support Rock Ridge extensions by default.	*/
  478|  3.49k|	iso9660->opt_support_rockridge = 1;
  479|       |
  480|  3.49k|	r = __archive_read_register_format(a,
  481|  3.49k|	    iso9660,
  482|  3.49k|	    "iso9660",
  483|  3.49k|	    archive_read_format_iso9660_bid,
  484|  3.49k|	    archive_read_format_iso9660_options,
  485|  3.49k|	    archive_read_format_iso9660_read_header,
  486|  3.49k|	    archive_read_format_iso9660_read_data,
  487|  3.49k|	    archive_read_format_iso9660_read_data_skip,
  488|  3.49k|	    NULL,
  489|  3.49k|	    archive_read_format_iso9660_cleanup,
  490|  3.49k|	    NULL,
  491|  3.49k|	    NULL);
  492|       |
  493|  3.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  3.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (493:6): [True: 0, False: 3.49k]
  ------------------
  494|      0|		free(iso9660);
  495|  3.49k|	return (r);
  496|  3.49k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  501|  3.43k|{
  502|  3.43k|	struct iso9660 *iso9660 = a->format->data;
  503|  3.43k|	ssize_t bytes_read;
  504|  3.43k|	const unsigned char *h;
  505|  3.43k|	int seenTerminator;
  506|       |
  507|       |	/* If there's already a better bid than we can ever
  508|       |	   make, don't bother testing. */
  509|  3.43k|	if (best_bid > 48)
  ------------------
  |  Branch (509:6): [True: 1.56k, False: 1.86k]
  ------------------
  510|  1.56k|		return (-1);
  511|       |
  512|       |	/*
  513|       |	 * Skip the first 32k (reserved area) and get the first
  514|       |	 * 8 sectors of the volume descriptor table.  Of course,
  515|       |	 * if the I/O layer gives us more, we'll take it.
  516|       |	 */
  517|  1.86k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  518|  1.86k|	h = __archive_read_ahead(a,
  519|  1.86k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  517|  1.86k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|  1.86k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  1.86k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   82|  1.86k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  520|  1.86k|	    &bytes_read);
  521|  1.86k|	if (h == NULL)
  ------------------
  |  Branch (521:6): [True: 1.39k, False: 466]
  ------------------
  522|  1.39k|	    return (-1);
  523|       |
  524|       |	/* Skip the reserved area. */
  525|    466|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  517|    466|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    466|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    466|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  526|    466|	h += RESERVED_AREA;
  ------------------
  |  |  517|    466|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    466|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    466|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  527|       |
  528|       |	/* Check each volume descriptor. */
  529|    466|	seenTerminator = 0;
  530|    736|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   82|    736|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (530:9): [True: 736, False: 0]
  ------------------
  531|    736|	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    270|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    270|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  532|       |		/* Do not handle undefined Volume Descriptor Type. */
  533|    736|		if (h[0] >= 4 && h[0] <= 254)
  ------------------
  |  Branch (533:7): [True: 361, False: 375]
  |  Branch (533:20): [True: 206, False: 155]
  ------------------
  534|    206|			return (0);
  535|       |		/* Standard Identifier must be "CD001" */
  536|    530|		if (memcmp(h + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (536:7): [True: 76, False: 454]
  ------------------
  537|     76|			return (0);
  538|    454|		if (isPVD(iso9660, h))
  ------------------
  |  Branch (538:7): [True: 160, False: 294]
  ------------------
  539|    160|			continue;
  540|    294|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (540:7): [True: 264, False: 30]
  ------------------
  541|    264|			if (isJolietSVD(iso9660, h))
  ------------------
  |  Branch (541:8): [True: 33, False: 231]
  ------------------
  542|     33|				continue;
  543|    264|		}
  544|    261|		if (isBootRecord(h))
  ------------------
  |  Branch (544:7): [True: 8, False: 253]
  ------------------
  545|      8|			continue;
  546|    253|		if (isEVD(h))
  ------------------
  |  Branch (546:7): [True: 0, False: 253]
  ------------------
  547|      0|			continue;
  548|    253|		if (isSVD(h))
  ------------------
  |  Branch (548:7): [True: 69, False: 184]
  ------------------
  549|     69|			continue;
  550|    184|		if (isVolumePartition(iso9660, h))
  ------------------
  |  Branch (550:7): [True: 0, False: 184]
  ------------------
  551|      0|			continue;
  552|    184|		if (isVDSetTerminator(h)) {
  ------------------
  |  Branch (552:7): [True: 134, False: 50]
  ------------------
  553|    134|			seenTerminator = 1;
  554|    134|			break;
  555|    134|		}
  556|     50|		return (0);
  557|    184|	}
  558|       |	/*
  559|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  560|       |	 * Volume Descriptor Set Terminator.
  561|       |	 */
  562|    134|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (562:6): [True: 134, False: 0]
  |  Branch (562:24): [True: 133, False: 1]
  ------------------
  563|    133|		return (48);
  564|       |
  565|       |	/* We didn't find a valid PVD; return a bid of zero. */
  566|      1|	return (0);
  567|    134|}
archive_read_support_format_iso9660.c:isPVD:
  860|    454|{
  861|    454|	const unsigned char *p;
  862|    454|	ssize_t logical_block_size;
  863|    454|	int32_t volume_block;
  864|    454|	int32_t location;
  865|    454|	int i;
  866|       |
  867|       |	/* Type of the Primary Volume Descriptor must be 1. */
  868|    454|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   86|    454|#define PVD_type_offset 0
  ------------------
  |  Branch (868:6): [True: 270, False: 184]
  ------------------
  869|    270|		return (0);
  870|       |
  871|       |	/* PVD version must be 1. */
  872|    184|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   90|    184|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    184|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    184|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    184|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    184|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (872:6): [True: 0, False: 184]
  ------------------
  873|      0|		return (0);
  874|       |
  875|       |	/* Reserved field must be 0. */
  876|    184|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|    184|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    184|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    184|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    184|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    184|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|    184|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|    184|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (876:6): [True: 0, False: 184]
  ------------------
  877|      0|		return (0);
  878|       |
  879|       |	/* Reserved field must be 0. */
  880|    184|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    184|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    184|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    184|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    184|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    184|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    184|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    184|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    184|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    184|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    184|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    184|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    184|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|    184|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|    184|#define PVD_reserved2_size 8
  ------------------
  |  Branch (880:6): [True: 1, False: 183]
  ------------------
  881|      1|		return (0);
  882|       |
  883|       |	/* Volume space size must be encoded according to 7.3.3 */
  884|    183|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |  100|    183|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    183|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    183|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    183|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    183|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    183|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    183|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    183|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    183|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    183|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    183|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    183|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    183|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    183|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    183|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (884:6): [True: 3, False: 180]
  ------------------
  885|      3|		return (0);
  886|      3|	}
  887|    180|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|    180|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    180|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    180|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    180|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    180|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    180|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    180|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    180|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    180|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    180|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    180|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    180|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    180|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    180|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    180|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  888|    180|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    180|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (888:6): [True: 1, False: 179]
  ------------------
  889|      1|		return (0);
  890|       |
  891|       |	/* Reserved field must be 0. */
  892|    179|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    179|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    179|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    179|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    179|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    179|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    179|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    179|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    179|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    179|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    179|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    179|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    179|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    179|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    179|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    179|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    179|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|    179|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|    179|#define PVD_reserved3_size 32
  ------------------
  |  Branch (892:6): [True: 1, False: 178]
  ------------------
  893|      1|		return (0);
  894|       |
  895|       |	/* Volume set size must be encoded according to 7.2.3 */
  896|    178|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  104|    178|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    178|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    178|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    178|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    178|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    178|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    178|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    178|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    178|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    178|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    178|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    178|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    178|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    178|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    178|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    178|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    178|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    178|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  103|    178|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (896:6): [True: 2, False: 176]
  ------------------
  897|      2|		return (0);
  898|      2|	}
  899|       |
  900|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  901|    176|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  106|    176|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    176|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    176|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|    176|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|    176|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|    176|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    176|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    176|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    176|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    176|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    176|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    176|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    176|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    176|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    176|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    176|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    176|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    176|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    176|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    176|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  105|    176|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (901:6): [True: 1, False: 175]
  ------------------
  902|      1|		return (0);
  903|      1|	}
  904|       |
  905|       |	/* Logical block size must be > 0. */
  906|       |	/* I've looked at Ecma 119 and can't find any stronger
  907|       |	 * restriction on this field. */
  908|    175|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  108|    175|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    175|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    175|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    175|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    175|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    175|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    175|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    175|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    175|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    175|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    175|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    175|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    175|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    175|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    175|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    175|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    175|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    175|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    175|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    175|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    175|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    175|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    175|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (908:6): [True: 1, False: 174]
  ------------------
  909|      1|		return (0);
  910|      1|	}
  911|    174|	logical_block_size =
  912|    174|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|    174|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    174|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    174|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    174|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    174|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    174|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    174|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    174|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    174|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    174|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    174|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    174|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    174|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    174|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    174|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    174|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    174|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    174|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    174|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    174|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    174|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    174|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    174|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  913|    174|	if (logical_block_size <= 0)
  ------------------
  |  Branch (913:6): [True: 0, False: 174]
  ------------------
  914|      0|		return (0);
  915|       |
  916|       |	/* Path Table size must be encoded according to 7.3.3 */
  917|    174|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  110|    174|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    174|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    174|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    174|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    174|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    174|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    174|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    174|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    174|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    174|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    174|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    174|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    174|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    174|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    174|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    174|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    174|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    174|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    174|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    174|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    174|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    174|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    174|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    174|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  109|    174|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (917:6): [True: 2, False: 172]
  ------------------
  918|      2|		return (0);
  919|      2|	}
  920|       |
  921|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  922|    172|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  144|    172|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    172|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    172|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    172|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    172|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    172|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    172|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    172|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    172|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    172|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    172|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    172|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    172|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    172|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    172|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    172|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    172|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    172|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    172|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    172|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    172|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    172|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    172|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    172|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    172|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    172|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    172|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    172|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    172|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    172|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    172|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    172|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    172|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    172|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    172|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    172|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    172|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    172|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    172|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    172|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    172|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    172|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    172|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    172|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    172|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    172|#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|    172|#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|    172|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    172|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    172|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    172|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    172|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    172|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    172|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    172|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    172|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    172|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    172|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|    172|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (922:6): [True: 1, False: 171]
  ------------------
  923|      1|		return (0);
  924|       |
  925|       |	/* Location of Occurrence of Type L Path Table must be
  926|       |	 * available location,
  927|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  928|    171|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|    171|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    171|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    171|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    171|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    171|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    171|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    171|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    171|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    171|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    171|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    171|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    171|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    171|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    171|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    171|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    171|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    171|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    171|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    171|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    171|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    171|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    171|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|    171|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|    171|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    171|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    171|#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|    171|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  929|    171|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    171|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (929:6): [True: 1, False: 170]
  |  Branch (929:40): [True: 1, False: 169]
  ------------------
  930|      2|		return (0);
  931|       |
  932|       |	/* The Type M Path Table must also be at a valid location
  933|       |	 * (although ECMA 119 requires a Type M Path Table, WinISO and
  934|       |	 * probably other programs omit it, so we permit a zero here)
  935|       |	 *
  936|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  937|    169|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|    169|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|    169|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    169|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    169|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    169|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    169|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    169|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    169|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    169|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    169|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    169|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    169|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    169|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    169|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    169|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    169|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    169|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    169|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    169|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    169|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    169|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    169|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    169|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    169|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    169|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    169|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|    169|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|    169|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|    169|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    169|#define PVD_type_1_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  115|    169|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  938|    169|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    168|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (938:7): [True: 168, False: 1]
  |  Branch (938:23): [True: 1, False: 167]
  ------------------
  939|    168|	    || location >= volume_block)
  ------------------
  |  Branch (939:9): [True: 0, False: 168]
  ------------------
  940|      1|		return (0);
  941|       |
  942|       |	/* Reserved field must be 0. */
  943|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  944|    335|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  147|    335|#define PVD_reserved4_size 1
  ------------------
  |  Branch (944:14): [True: 168, False: 167]
  ------------------
  945|    168|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  146|    168|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    168|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    168|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    168|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    168|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    168|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    168|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    168|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    168|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    168|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    168|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    168|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    168|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    168|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    168|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    168|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    168|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    168|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    168|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    168|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    168|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    168|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    168|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    168|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    168|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    168|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    168|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    168|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    168|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    168|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    168|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    168|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    168|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    168|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    168|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    168|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    168|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    168|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    168|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    168|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    168|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    168|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    168|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    168|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    168|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    168|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    168|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    168|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    168|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    168|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    168|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    168|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    168|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    168|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    168|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    168|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|    168|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|    168|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|    168|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|    168|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|    168|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (945:7): [True: 66, False: 102]
  ------------------
  946|     66|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  146|     66|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     66|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     66|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     66|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     66|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     66|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     66|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     66|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     66|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     66|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     66|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     66|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     66|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     66|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     66|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     66|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     66|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     66|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     66|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     66|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     66|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     66|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     66|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     66|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     66|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     66|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     66|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     66|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     66|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     66|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     66|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     66|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     66|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     66|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     66|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     66|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     66|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     66|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     66|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     66|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     66|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     66|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     66|#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|     66|#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|     66|#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|     66|#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|     66|#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|     66|#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|     66|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     66|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     66|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     66|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     66|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     66|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     66|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     66|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     66|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     66|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     66|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     66|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     66|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (946:10): [True: 1, False: 65]
  ------------------
  947|      1|			return (0);
  948|       |
  949|       |	/* Reserved field must be 0. */
  950|    167|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    167|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    167|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    167|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    167|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    167|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    167|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    167|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    167|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    167|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    167|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    167|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    167|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    167|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    167|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    167|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    167|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    167|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    167|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    167|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    167|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    167|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    167|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    167|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    167|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    167|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    167|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    167|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    167|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    167|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    167|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    167|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    167|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    167|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    167|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    167|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    167|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    167|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    167|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    167|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    167|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    167|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    167|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    167|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    167|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    167|#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|    167|#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|    167|#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|    167|#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|    167|#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|    167|#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|    167|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    167|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    167|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    167|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    167|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    167|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    167|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    167|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    167|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    167|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    167|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    167|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    167|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    167|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|    167|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|    167|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|    167|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    167|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    167|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    167|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    167|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    167|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    167|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    167|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    167|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    167|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    167|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    167|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    167|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    167|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    167|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    167|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    167|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    167|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    167|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    167|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    167|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    167|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    167|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    167|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    167|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    167|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    167|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    167|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    167|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    167|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    167|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    167|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    167|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    167|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    167|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    167|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    167|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    167|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    167|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    167|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    167|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    167|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    167|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    167|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    167|#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|    167|#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|    167|#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|    167|#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|    167|#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|    167|#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|    167|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    167|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    167|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    167|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    167|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    167|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    167|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    167|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    167|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    167|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|    167|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|    167|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|    167|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|    167|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|    167|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (950:6): [True: 1, False: 166]
  ------------------
  951|      1|		return (0);
  952|       |
  953|       |	/* XXX TODO: Check other values for sanity; reject more
  954|       |	 * malformed PVDs. XXX */
  955|       |
  956|       |	/* Read Root Directory Record in Volume Descriptor. */
  957|    166|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|    166|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|    166|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    166|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|    166|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    166|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    166|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    166|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    166|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    166|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    166|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    166|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    166|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    166|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    166|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    166|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    166|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    166|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    166|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    166|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    166|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    166|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    166|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    166|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    166|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    166|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    166|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    166|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    166|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    166|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    166|#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|    166|#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|    166|#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|    166|#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|    166|#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|    166|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  958|    166|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (958:6): [True: 6, False: 160]
  ------------------
  959|      6|		return (0);
  960|      6|	}
  961|       |
  962|    160|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (962:6): [True: 159, False: 1]
  ------------------
  963|    159|		iso9660->logical_block_size = logical_block_size;
  964|    159|		iso9660->volume_block = volume_block;
  965|    159|		iso9660->volume_size =
  966|    159|		    logical_block_size * (uint64_t)volume_block;
  967|    159|		iso9660->primary.location =
  968|    159|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|    159|#define DR_extent_offset 2
  ------------------
  969|    159|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|    159|#define DR_size_offset 10
  ------------------
  970|    159|	}
  971|       |
  972|    160|	return (48);
  973|    166|}
archive_read_support_format_iso9660.c:isNull:
  599|  1.26k|{
  600|  1.26k|	if (bytes == 0)
  ------------------
  |  Branch (600:6): [True: 0, False: 1.26k]
  ------------------
  601|      0|		return (1);
  602|       |
  603|       |	/*
  604|       |	 * If the first byte is zero and every byte equals the following
  605|       |	 * byte, the entire range is zero.
  606|       |	 */
  607|  1.26k|	return (h[offset] == 0 &&
  ------------------
  |  Branch (607:10): [True: 1.26k, False: 5]
  ------------------
  608|  1.26k|	    (bytes == 1 ||
  ------------------
  |  Branch (608:7): [True: 197, False: 1.06k]
  ------------------
  609|  1.06k|	    memcmp(h + offset, h + offset + 1, bytes - 1) == 0));
  ------------------
  |  Branch (609:6): [True: 1.05k, False: 13]
  ------------------
  610|  1.26k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3242|  1.05k|{
 3243|  1.05k|	return (p[0] == p[7]
  ------------------
  |  Branch (3243:10): [True: 1.04k, False: 5]
  ------------------
 3244|  1.04k|		&& p[1] == p[6]
  ------------------
  |  Branch (3244:6): [True: 1.04k, False: 4]
  ------------------
 3245|  1.04k|		&& p[2] == p[5]
  ------------------
  |  Branch (3245:6): [True: 1.03k, False: 6]
  ------------------
 3246|  1.03k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3246:6): [True: 1.03k, False: 2]
  ------------------
 3247|  1.05k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3236|    866|isValid723Integer(const unsigned char *p) {
 3237|    866|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3237:10): [True: 864, False: 2]
  |  Branch (3237:26): [True: 860, False: 4]
  ------------------
 3238|    866|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  976|    349|isRootDirectoryRecord(const unsigned char *p) {
  977|    349|	int flags;
  978|       |
  979|       |	/* ECMA119/ISO9660 requires that the root directory record be _exactly_ 34 bytes.
  980|       |	 * However, we've seen images that have root directory records up to 68 bytes. */
  981|    349|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    349|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    349|#define DR_length_offset 0
  ------------------
  |  Branch (981:6): [True: 0, False: 349]
  |  Branch (981:34): [True: 0, False: 349]
  ------------------
  982|      0|		return (0);
  983|      0|	}
  984|       |
  985|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
  986|    349|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  200|    349|#define DR_extent_offset 2
  ------------------
  |  Branch (986:6): [True: 1, False: 348]
  ------------------
  987|      1|		return (0);
  988|      1|	}
  989|       |
  990|       |	/* The root directory size must be a 7.3.3 integer. */
  991|    348|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  202|    348|#define DR_size_offset 10
  ------------------
  |  Branch (991:6): [True: 11, False: 337]
  ------------------
  992|     11|		return (0);
  993|     11|	}
  994|       |
  995|       |	/* According to the standard, certain bits must be one or zero:
  996|       |	 * Bit 1: must be 1 (this is a directory)
  997|       |	 * Bit 2: must be 0 (not an associated file)
  998|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
  999|       |	 * Bit 7: must be 0 (final directory record for this file)
 1000|       |	 */
 1001|    337|	flags = p[DR_flags_offset];
  ------------------
  |  |  206|    337|#define DR_flags_offset 25
  ------------------
 1002|    337|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1002:6): [True: 0, False: 337]
  ------------------
 1003|      0|		return (0);
 1004|      0|	}
 1005|       |
 1006|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1007|    337|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  212|    337|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1007:6): [True: 2, False: 335]
  ------------------
 1008|      2|		return (0);
 1009|      2|	}
 1010|       |
 1011|       |	/* Root directory name is a single zero byte... */
 1012|    335|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  214|    335|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  216|    335|#define DR_name_offset 33
  ------------------
  |  Branch (1012:6): [True: 0, False: 335]
  |  Branch (1012:36): [True: 4, False: 331]
  ------------------
 1013|      4|		return (0);
 1014|      4|	}
 1015|       |
 1016|       |	/* Nothing looked wrong, so let's accept it. */
 1017|    331|	return (1);
 1018|    335|}
archive_read_support_format_iso9660.c:isJolietSVD:
  674|    264|{
  675|    264|	const unsigned char *p;
  676|    264|	ssize_t logical_block_size;
  677|    264|	int32_t volume_block;
  678|       |
  679|       |	/* Check if current sector is a kind of Supplementary Volume
  680|       |	 * Descriptor. */
  681|    264|	if (!isSVD(h))
  ------------------
  |  Branch (681:6): [True: 162, False: 102]
  ------------------
  682|    162|		return (0);
  683|       |
  684|       |	/* FIXME: do more validations according to joliet spec. */
  685|       |
  686|       |	/* check if this SVD contains joliet extension! */
  687|    102|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  173|    102|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|    102|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  172|    102|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  688|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  689|    102|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (689:6): [True: 94, False: 8]
  |  Branch (689:21): [True: 42, False: 52]
  ------------------
  690|     42|		int level = 0;
  691|       |
  692|     42|		if (p[2] == '@')
  ------------------
  |  Branch (692:7): [True: 12, False: 30]
  ------------------
  693|     12|			level = 1;
  694|     30|		else if (p[2] == 'C')
  ------------------
  |  Branch (694:12): [True: 1, False: 29]
  ------------------
  695|      1|			level = 2;
  696|     29|		else if (p[2] == 'E')
  ------------------
  |  Branch (696:12): [True: 20, False: 9]
  ------------------
  697|     20|			level = 3;
  698|      9|		else /* not joliet */
  699|      9|			return (0);
  700|       |
  701|     33|		iso9660->seenJoliet = level;
  702|       |
  703|     33|	} else /* not joliet */
  704|     60|		return (0);
  705|       |
  706|     33|	logical_block_size =
  707|     33|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|     33|#define SVD_logical_block_size_offset 128
  ------------------
  708|     33|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|     33|#define SVD_volume_space_size_offset 80
  ------------------
  709|       |
  710|     33|	iso9660->logical_block_size = logical_block_size;
  711|     33|	iso9660->volume_block = volume_block;
  712|     33|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  713|       |	/* Read Root Directory Record in Volume Descriptor. */
  714|     33|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|     33|#define SVD_root_directory_record_offset 156
  ------------------
  715|     33|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|     33|#define DR_extent_offset 2
  ------------------
  716|     33|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|     33|#define DR_size_offset 10
  ------------------
  717|       |
  718|     33|	return (48);
  719|    102|}
archive_read_support_format_iso9660.c:isBootRecord:
  614|    261|{
  615|       |
  616|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  617|    261|	if (h[0] != 0)
  ------------------
  |  Branch (617:6): [True: 253, False: 8]
  ------------------
  618|    253|		return (0);
  619|       |
  620|       |	/* Volume Descriptor Version must be 1. */
  621|      8|	if (h[6] != 1)
  ------------------
  |  Branch (621:6): [True: 0, False: 8]
  ------------------
  622|      0|		return (0);
  623|       |
  624|      8|	return (1);
  625|      8|}
archive_read_support_format_iso9660.c:isEVD:
  782|    253|{
  783|    253|	const unsigned char *p;
  784|    253|	ssize_t logical_block_size;
  785|    253|	int32_t volume_block;
  786|    253|	int32_t location;
  787|       |
  788|       |
  789|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  790|    253|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   86|    253|#define PVD_type_offset 0
  ------------------
  |  Branch (790:6): [True: 164, False: 89]
  ------------------
  791|    164|		return (0);
  792|       |
  793|       |	/* EVD version must be 2. */
  794|     89|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   90|     89|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|     89|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|     89|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|     89|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|     89|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (794:6): [True: 89, False: 0]
  ------------------
  795|     89|		return (0);
  796|       |
  797|       |	/* Reserved field must be 0. */
  798|      0|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (798:6): [True: 0, False: 0]
  ------------------
  799|      0|		return (0);
  800|       |
  801|       |	/* Reserved field must be 0. */
  802|      0|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|      0|#define PVD_reserved2_size 8
  ------------------
  |  Branch (802:6): [True: 0, False: 0]
  ------------------
  803|      0|		return (0);
  804|       |
  805|       |	/* Reserved field must be 0. */
  806|      0|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|      0|#define PVD_reserved3_size 32
  ------------------
  |  Branch (806:6): [True: 0, False: 0]
  ------------------
  807|      0|		return (0);
  808|       |
  809|       |	/* Logical block size must be > 0. */
  810|       |	/* I've looked at Ecma 119 and can't find any stronger
  811|       |	 * restriction on this field. */
  812|      0|	logical_block_size =
  813|      0|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  814|      0|	if (logical_block_size <= 0)
  ------------------
  |  Branch (814:6): [True: 0, False: 0]
  ------------------
  815|      0|		return (0);
  816|       |
  817|      0|	volume_block =
  818|      0|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  819|      0|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (819:6): [True: 0, False: 0]
  ------------------
  820|      0|		return (0);
  821|       |
  822|       |	/* File structure version must be 2 for ISO9660:1999. */
  823|      0|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (823:6): [True: 0, False: 0]
  ------------------
  824|      0|		return (0);
  825|       |
  826|       |	/* Location of Occurrence of Type L Path Table must be
  827|       |	 * available location,
  828|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  829|      0|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  830|      0|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (830:6): [True: 0, False: 0]
  |  Branch (830:40): [True: 0, False: 0]
  ------------------
  831|      0|		return (0);
  832|       |
  833|       |	/* Location of Occurrence of Type M Path Table must be
  834|       |	 * available location,
  835|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  836|      0|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  837|      0|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (837:7): [True: 0, False: 0]
  |  Branch (837:23): [True: 0, False: 0]
  ------------------
  838|      0|	    || location >= volume_block)
  ------------------
  |  Branch (838:9): [True: 0, False: 0]
  ------------------
  839|      0|		return (0);
  840|       |
  841|       |	/* Reserved field must be 0. */
  842|      0|	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  147|      0|#define PVD_reserved4_size 1
  ------------------
  |  Branch (842:6): [True: 0, False: 0]
  ------------------
  843|      0|		return (0);
  844|       |
  845|       |	/* Reserved field must be 0. */
  846|      0|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|      0|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (846:6): [True: 0, False: 0]
  ------------------
  847|      0|		return (0);
  848|       |
  849|       |	/* Read Root Directory Record in Volume Descriptor. */
  850|      0|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|      0|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|      0|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|      0|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      0|#define PVD_logical_block_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  113|      0|#define PVD_type_1_path_table_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      0|#define PVD_type_m_path_table_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  851|      0|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (851:6): [True: 0, False: 0]
  ------------------
  852|      0|		return (0);
  853|      0|	}
  854|       |
  855|      0|	return (48);
  856|      0|}
archive_read_support_format_iso9660.c:isSVD:
  723|    517|{
  724|    517|	const unsigned char *p;
  725|    517|	ssize_t logical_block_size;
  726|    517|	int32_t volume_block;
  727|    517|	int32_t location;
  728|       |
  729|       |
  730|       |	/* Type 2 means it's a SVD. */
  731|    517|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  162|    517|#define SVD_type_offset 0
  ------------------
  |  Branch (731:6): [True: 317, False: 200]
  ------------------
  732|    317|		return (0);
  733|       |
  734|       |	/* Reserved field must be 0. */
  735|    200|	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    200|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  170|    200|#define SVD_reserved1_size	8
  ------------------
  |  Branch (735:6): [True: 2, False: 198]
  ------------------
  736|      2|		return (0);
  737|    198|	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    198|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  185|    198|#define SVD_reserved2_size	1
  ------------------
  |  Branch (737:6): [True: 1, False: 197]
  ------------------
  738|      1|		return (0);
  739|    197|	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    197|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  187|    197|#define SVD_reserved3_size	653
  ------------------
  |  Branch (739:6): [True: 6, False: 191]
  ------------------
  740|      6|		return (0);
  741|       |
  742|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  743|    191|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  183|    191|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (743:6): [True: 1, False: 190]
  ------------------
  744|      1|		return (0);
  745|       |
  746|    190|	logical_block_size =
  747|    190|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|    190|#define SVD_logical_block_size_offset 128
  ------------------
  748|    190|	if (logical_block_size <= 0)
  ------------------
  |  Branch (748:6): [True: 1, False: 189]
  ------------------
  749|      1|		return (0);
  750|       |
  751|    189|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|    189|#define SVD_volume_space_size_offset 80
  ------------------
  752|    189|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    189|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (752:6): [True: 1, False: 188]
  ------------------
  753|      1|		return (0);
  754|       |
  755|       |	/* Location of Occurrence of Type L Path Table must be
  756|       |	 * available location,
  757|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  758|    188|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  178|    188|#define SVD_type_L_path_table_offset 140
  ------------------
  759|    188|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    188|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (759:6): [True: 3, False: 185]
  |  Branch (759:40): [True: 1, False: 184]
  ------------------
  760|      4|		return (0);
  761|       |
  762|       |	/* The Type M Path Table must be at a valid location (WinISO
  763|       |	 * and probably other programs omit this, so we allow zero)
  764|       |	 *
  765|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  766|    184|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  179|    184|#define SVD_type_M_path_table_offset 148
  ------------------
  767|    184|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    183|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (767:7): [True: 183, False: 1]
  |  Branch (767:23): [True: 0, False: 183]
  ------------------
  768|    184|	    || location >= volume_block)
  ------------------
  |  Branch (768:9): [True: 1, False: 183]
  ------------------
  769|      1|		return (0);
  770|       |
  771|       |	/* Read Root Directory Record in Volume Descriptor. */
  772|    183|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|    183|#define SVD_root_directory_record_offset 156
  ------------------
  773|    183|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (773:6): [True: 12, False: 171]
  ------------------
  774|     12|		return (0);
  775|     12|	}
  776|       |
  777|    171|	return (48);
  778|    183|}
archive_read_support_format_iso9660.c:isVolumePartition:
  629|    184|{
  630|    184|	int32_t location;
  631|       |
  632|       |	/* Type of the Volume Partition Descriptor must be 3. */
  633|    184|	if (h[0] != 3)
  ------------------
  |  Branch (633:6): [True: 184, False: 0]
  ------------------
  634|    184|		return (0);
  635|       |
  636|       |	/* Volume Descriptor Version must be 1. */
  637|      0|	if (h[6] != 1)
  ------------------
  |  Branch (637:6): [True: 0, False: 0]
  ------------------
  638|      0|		return (0);
  639|       |	/* Unused Field */
  640|      0|	if (h[7] != 0)
  ------------------
  |  Branch (640:6): [True: 0, False: 0]
  ------------------
  641|      0|		return (0);
  642|       |
  643|      0|	location = archive_le32dec(h + 72);
  644|      0|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (644:6): [True: 0, False: 0]
  ------------------
  645|      0|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (645:6): [True: 0, False: 0]
  ------------------
  646|      0|		return (0);
  647|      0|	if ((uint32_t)location != archive_be32dec(h + 76))
  ------------------
  |  Branch (647:6): [True: 0, False: 0]
  ------------------
  648|      0|		return (0);
  649|       |
  650|      0|	return (1);
  651|      0|}
archive_read_support_format_iso9660.c:isVDSetTerminator:
  655|    184|{
  656|       |
  657|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  658|    184|	if (h[0] != 255)
  ------------------
  |  Branch (658:6): [True: 44, False: 140]
  ------------------
  659|     44|		return (0);
  660|       |
  661|       |	/* Volume Descriptor Version must be 1. */
  662|    140|	if (h[6] != 1)
  ------------------
  |  Branch (662:6): [True: 0, False: 140]
  ------------------
  663|      0|		return (0);
  664|       |
  665|       |	/* Reserved field must be 0. */
  666|    140|	if (!isNull(h, 7, 2048-7))
  ------------------
  |  Branch (666:6): [True: 6, False: 134]
  ------------------
  667|      6|		return (0);
  668|       |
  669|    134|	return (1);
  670|    140|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1234|    744|{
 1235|    744|	struct iso9660 *iso9660 = a->format->data;
 1236|    744|	struct file_info *file;
 1237|    744|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  233|    744|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1238|       |
 1239|    744|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1239:6): [True: 133, False: 611]
  ------------------
 1240|    133|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  372|    133|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1241|    133|		a->archive.archive_format_name = "ISO9660";
 1242|    133|	}
 1243|       |
 1244|    744|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1244:6): [True: 133, False: 611]
  ------------------
 1245|    133|		r = choose_volume(a, iso9660);
 1246|    133|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    133|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1246:7): [True: 14, False: 119]
  ------------------
 1247|     14|			return (r);
 1248|    133|	}
 1249|       |
 1250|    730|	file = NULL;/* Eliminate a warning. */
 1251|       |	/* Get the next entry that appears after the current offset. */
 1252|    730|	r = next_entry_seek(a, iso9660, &file);
 1253|    730|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    730|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1253:6): [True: 165, False: 565]
  ------------------
 1254|    165|		return (r);
 1255|       |
 1256|    565|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1256:6): [True: 11, False: 554]
  ------------------
 1257|       |		/*
 1258|       |		 * Convert UTF-16BE of a filename to local locale MBS
 1259|       |		 * and store the result into a filename field.
 1260|       |		 */
 1261|     11|		if (iso9660->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1261:7): [True: 7, False: 4]
  ------------------
 1262|      7|			iso9660->sconv_utf16be =
 1263|      7|			    archive_string_conversion_from_charset(
 1264|      7|				&(a->archive), "UTF-16BE", 1);
 1265|      7|			if (iso9660->sconv_utf16be == NULL)
  ------------------
  |  Branch (1265:8): [True: 0, False: 7]
  ------------------
 1266|       |				/* Couldn't allocate memory */
 1267|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1268|      7|		}
 1269|     11|		if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1269:7): [True: 7, False: 4]
  ------------------
 1270|      7|			iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
  ------------------
  |  |  378|      7|#define UTF16_NAME_MAX	1024
  ------------------
 1271|      7|			if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1271:8): [True: 0, False: 7]
  ------------------
 1272|      0|				archive_set_error(&a->archive, ENOMEM,
 1273|      0|				    "No memory");
 1274|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1275|      0|			}
 1276|      7|		}
 1277|     11|		if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1277:7): [True: 7, False: 4]
  ------------------
 1278|      7|			iso9660->utf16be_previous_path = calloc(1, UTF16_NAME_MAX);
  ------------------
  |  |  378|      7|#define UTF16_NAME_MAX	1024
  ------------------
 1279|      7|			if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1279:8): [True: 0, False: 7]
  ------------------
 1280|      0|				archive_set_error(&a->archive, ENOMEM,
 1281|      0|				    "No memory");
 1282|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1283|      0|			}
 1284|      7|		}
 1285|       |
 1286|     11|		iso9660->utf16be_path_len = 0;
 1287|     11|		if (build_pathname_utf16be(iso9660->utf16be_path,
  ------------------
  |  Branch (1287:7): [True: 0, False: 11]
  ------------------
 1288|     11|		    UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file) != 0) {
  ------------------
  |  |  378|     11|#define UTF16_NAME_MAX	1024
  ------------------
 1289|      0|			archive_set_error(&a->archive,
 1290|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1291|      0|			    "Pathname is too long");
 1292|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1293|      0|		}
 1294|       |
 1295|     11|		r = archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     11|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
 1296|     11|		    (const char *)iso9660->utf16be_path,
 1297|     11|		    iso9660->utf16be_path_len,
 1298|     11|		    iso9660->sconv_utf16be);
 1299|     11|		if (r != 0) {
  ------------------
  |  Branch (1299:7): [True: 3, False: 8]
  ------------------
 1300|      3|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1300:8): [True: 0, False: 3]
  ------------------
 1301|      0|				archive_set_error(&a->archive, ENOMEM,
 1302|      0|				    "No memory for Pathname");
 1303|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1304|      0|			}
 1305|      3|			archive_set_error(&a->archive,
 1306|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1307|      3|			    "Pathname cannot be converted "
 1308|      3|			    "from %s to current locale",
 1309|      3|			    archive_string_conversion_charset_name(
 1310|      3|			      iso9660->sconv_utf16be));
 1311|       |
 1312|      3|			rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1313|      3|		}
 1314|    554|	} else {
 1315|    554|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1316|    554|		if (path == NULL) {
  ------------------
  |  Branch (1316:7): [True: 0, False: 554]
  ------------------
 1317|      0|			archive_set_error(&a->archive,
 1318|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1319|      0|			    "Pathname is too long");
 1320|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1321|    554|		} else {
 1322|    554|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    554|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1323|    554|			archive_entry_set_pathname(entry, path);
 1324|    554|		}
 1325|    554|	}
 1326|       |
 1327|    565|	iso9660->entry_bytes_remaining = file->size;
 1328|       |	/* Offset for sparse-file-aware clients. */
 1329|    565|	iso9660->entry_sparse_offset = 0;
 1330|       |
 1331|    565|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1331:6): [True: 78, False: 487]
  ------------------
 1332|     78|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     78|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1333|     78|		    "File is beyond end-of-media: %s",
 1334|     78|		    archive_entry_pathname(entry));
 1335|     78|		iso9660->entry_bytes_remaining = 0;
 1336|     78|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     78|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1337|     78|	}
 1338|       |
 1339|       |	/* Set up the entry structure with information about this entry. */
 1340|    487|	archive_entry_set_mode(entry, file->mode);
 1341|    487|	archive_entry_set_uid(entry, file->uid);
 1342|    487|	archive_entry_set_gid(entry, file->gid);
 1343|    487|	archive_entry_set_nlink(entry, file->nlinks);
 1344|    487|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  311|    487|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1344:6): [True: 1, False: 486]
  ------------------
 1345|      1|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1346|    486|	else
 1347|    486|		archive_entry_unset_birthtime(entry);
 1348|    487|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  312|    487|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1348:6): [True: 219, False: 268]
  ------------------
 1349|    219|		archive_entry_set_mtime(entry, file->mtime, 0);
 1350|    268|	else
 1351|    268|		archive_entry_unset_mtime(entry);
 1352|    487|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  314|    487|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1352:6): [True: 220, False: 267]
  ------------------
 1353|    220|		archive_entry_set_ctime(entry, file->ctime, 0);
 1354|    267|	else
 1355|    267|		archive_entry_unset_ctime(entry);
 1356|    487|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  313|    487|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1356:6): [True: 219, False: 268]
  ------------------
 1357|    219|		archive_entry_set_atime(entry, file->atime, 0);
 1358|    268|	else
 1359|    268|		archive_entry_unset_atime(entry);
 1360|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1361|    487|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1362|    487|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1363|    487|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1363:6): [True: 0, False: 487]
  ------------------
 1364|      0|		archive_entry_copy_symlink(entry, file->symlink.s);
 1365|       |
 1366|       |	/* Note: If the input isn't seekable, we can't rewind to
 1367|       |	 * return the same body again, so if the next entry refers to
 1368|       |	 * the same data, we have to return it as a hardlink to the
 1369|       |	 * original entry. */
 1370|    487|	if (file->number != -1 &&
  ------------------
  |  Branch (1370:6): [True: 356, False: 131]
  ------------------
 1371|    356|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1371:6): [True: 61, False: 295]
  ------------------
 1372|     61|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1372:7): [True: 1, False: 60]
  ------------------
 1373|      1|			r = archive_entry_copy_hardlink_l(entry,
  ------------------
  |  |   74|      1|#define archive_entry_copy_hardlink_l	__archive_entry_copy_hardlink_l
  ------------------
 1374|      1|			    (const char *)iso9660->utf16be_previous_path,
 1375|      1|			    iso9660->utf16be_previous_path_len,
 1376|      1|			    iso9660->sconv_utf16be);
 1377|      1|			if (r != 0) {
  ------------------
  |  Branch (1377:8): [True: 0, False: 1]
  ------------------
 1378|      0|				if (errno == ENOMEM) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 0]
  ------------------
 1379|      0|					archive_set_error(&a->archive, ENOMEM,
 1380|      0|					    "No memory for Linkname");
 1381|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1382|      0|				}
 1383|      0|				archive_set_error(&a->archive,
 1384|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1385|      0|				    "Linkname cannot be converted "
 1386|      0|				    "from %s to current locale",
 1387|      0|				    archive_string_conversion_charset_name(
 1388|      0|				      iso9660->sconv_utf16be));
 1389|      0|				rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1390|      0|			}
 1391|      1|		} else
 1392|     60|			archive_entry_set_hardlink(entry,
 1393|     60|			    iso9660->previous_pathname.s);
 1394|     61|		archive_entry_unset_size(entry);
 1395|     61|		iso9660->entry_bytes_remaining = 0;
 1396|     61|		return (rd_r);
 1397|     61|	}
 1398|       |
 1399|    426|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  215|    426|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  221|    852|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1399:6): [True: 275, False: 151]
  ------------------
 1400|    275|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1400:6): [True: 80, False: 195]
  ------------------
 1401|     80|		int64_t r64;
 1402|       |
 1403|     80|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1404|     80|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1404:7): [True: 0, False: 80]
  ------------------
 1405|       |			/* We can't seek backwards to extract it, so issue
 1406|       |			 * a warning.  Note that this can only happen if
 1407|       |			 * this entry was added to the heap after we passed
 1408|       |			 * this offset, that is, only if the directory
 1409|       |			 * mentioning this entry is later than the body of
 1410|       |			 * the entry. Such layouts are very unusual; most
 1411|       |			 * ISO9660 writers lay out and record all directory
 1412|       |			 * information first, then store all file bodies. */
 1413|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1414|      0|			    "Ignoring out-of-order file @%jx (%s) %jd < %jd",
 1415|      0|			    (uintmax_t)file->number,
 1416|      0|			    iso9660->pathname.s,
 1417|      0|			    (intmax_t)file->offset,
 1418|      0|			    (intmax_t)iso9660->current_position);
 1419|      0|			iso9660->entry_bytes_remaining = 0;
 1420|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1421|      0|		}
 1422|     80|		iso9660->current_position = (uint64_t)r64;
 1423|     80|	}
 1424|       |
 1425|       |	/* Initialize zisofs variables. */
 1426|    426|	iso9660->entry_zisofs.pz = file->pz;
 1427|    426|	if (file->pz) {
  ------------------
  |  Branch (1427:6): [True: 0, False: 426]
  ------------------
 1428|      0|#ifdef HAVE_ZLIB_H
 1429|      0|		struct zisofs  *zisofs;
 1430|       |
 1431|      0|		zisofs = &iso9660->entry_zisofs;
 1432|      0|		zisofs->initialized = 0;
 1433|      0|		zisofs->pz_log2_bs = file->pz_log2_bs;
 1434|      0|		zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
 1435|      0|		zisofs->pz_offset = 0;
 1436|      0|		zisofs->header_avail = 0;
 1437|      0|		zisofs->header_passed = 0;
 1438|      0|		zisofs->block_pointers_avail = 0;
 1439|      0|#endif
 1440|      0|		archive_entry_set_size(entry, file->pz_uncompressed_size);
 1441|      0|	}
 1442|       |
 1443|    426|	iso9660->previous_number = file->number;
 1444|    426|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1444:6): [True: 10, False: 416]
  ------------------
 1445|     10|		memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
 1446|     10|		    iso9660->utf16be_path_len);
 1447|     10|		iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
 1448|     10|	} else
 1449|    426|		archive_strcpy(
  ------------------
  |  |  165|    416|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    832|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 416]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1450|    426|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1451|       |
 1452|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1453|    426|	iso9660->entry_content = file->contents.first;
 1454|    426|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1454:6): [True: 26, False: 400]
  ------------------
 1455|     26|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1456|       |
 1457|    426|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    426|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1457:6): [True: 151, False: 275]
  ------------------
 1458|       |		/* Overwrite nlinks by proper link number which is
 1459|       |		 * calculated from number of sub directories. */
 1460|    151|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1461|       |		/* Directory data has been read completely. */
 1462|    151|		iso9660->entry_bytes_remaining = 0;
 1463|    151|	}
 1464|       |
 1465|    426|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  233|    426|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1465:6): [True: 3, False: 423]
  ------------------
 1466|      3|		return (rd_r);
 1467|    423|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    423|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1468|    426|}
archive_read_support_format_iso9660.c:choose_volume:
 1145|    133|{
 1146|    133|	struct file_info *file;
 1147|    133|	int64_t skipsize;
 1148|    133|	struct vd *vd;
 1149|    133|	const void *block;
 1150|    133|	char seenJoliet;
 1151|       |
 1152|    133|	vd = &(iso9660->primary);
 1153|    133|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1153:6): [True: 0, False: 133]
  ------------------
 1154|      0|		iso9660->seenJoliet = 0;
 1155|    133|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1155:6): [True: 19, False: 114]
  ------------------
 1156|     19|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1156:3): [True: 2, False: 17]
  ------------------
 1157|       |		/* This condition is unlikely; by way of caution. */
 1158|      2|		vd = &(iso9660->joliet);
 1159|       |
 1160|    133|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|    133|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1161|    133|	skipsize = __archive_read_consume(a, skipsize);
 1162|    133|	if (skipsize < 0)
  ------------------
  |  Branch (1162:6): [True: 2, False: 131]
  ------------------
 1163|      2|		return ((int)skipsize);
 1164|    131|	iso9660->current_position = skipsize;
 1165|       |
 1166|    131|	block = __archive_read_ahead(a, vd->size, NULL);
 1167|    131|	if (block == NULL) {
  ------------------
  |  Branch (1167:6): [True: 0, False: 131]
  ------------------
 1168|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1169|      0|		    "Failed to read full block when scanning "
 1170|      0|		    "ISO9660 directory list");
 1171|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1172|      0|	}
 1173|       |
 1174|       |	/*
 1175|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1176|       |	 * avoid converting special name 0x00(Current Directory) and
 1177|       |	 * next byte to UCS2.
 1178|       |	 */
 1179|    131|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1180|    131|	iso9660->seenJoliet = 0;
 1181|    131|	file = parse_file_info(a, NULL, block, vd->size);
 1182|    131|	if (file == NULL)
  ------------------
  |  Branch (1182:6): [True: 8, False: 123]
  ------------------
 1183|      8|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1184|    123|	iso9660->seenJoliet = seenJoliet;
 1185|       |
 1186|       |	/*
 1187|       |	 * If the iso image has both RockRidge and Joliet, we preferentially
 1188|       |	 * use RockRidge Extensions rather than Joliet ones.
 1189|       |	 */
 1190|    123|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1190:6): [True: 122, False: 1]
  |  Branch (1190:35): [True: 28, False: 94]
  ------------------
 1191|     28|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1191:9): [True: 0, False: 28]
  ------------------
 1192|      0|		iso9660->seenJoliet = 0;
 1193|       |
 1194|    123|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1194:6): [True: 122, False: 1]
  |  Branch (1194:35): [True: 94, False: 28]
  ------------------
 1195|     94|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1195:9): [True: 17, False: 77]
  ------------------
 1196|       |		/* Switch reading data from primary to joliet. */
 1197|     17|		vd = &(iso9660->joliet);
 1198|     17|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|     17|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1199|     17|		skipsize -= iso9660->current_position;
 1200|     17|		skipsize = __archive_read_consume(a, skipsize);
 1201|     17|		if (skipsize < 0)
  ------------------
  |  Branch (1201:7): [True: 2, False: 15]
  ------------------
 1202|      2|			return ((int)skipsize);
 1203|     15|		iso9660->current_position += skipsize;
 1204|       |
 1205|     15|		block = __archive_read_ahead(a, vd->size, NULL);
 1206|     15|		if (block == NULL) {
  ------------------
  |  Branch (1206:7): [True: 1, False: 14]
  ------------------
 1207|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1208|      1|			    "Failed to read full block when scanning "
 1209|      1|			    "ISO9660 directory list");
 1210|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1211|      1|		}
 1212|     14|		iso9660->seenJoliet = 0;
 1213|     14|		file = parse_file_info(a, NULL, block, vd->size);
 1214|     14|		if (file == NULL)
  ------------------
  |  Branch (1214:7): [True: 1, False: 13]
  ------------------
 1215|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1216|     13|		iso9660->seenJoliet = seenJoliet;
 1217|     13|	}
 1218|       |
 1219|       |	/* Store the root directory in the pending list. */
 1220|    119|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  451|    119|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  233|    119|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1220:6): [True: 0, False: 119]
  ------------------
 1221|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1222|    119|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1222:6): [True: 28, False: 91]
  ------------------
 1223|     28|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  373|     28|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  372|     28|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1224|     28|		a->archive.archive_format_name =
 1225|     28|		    "ISO9660 with Rockridge extensions";
 1226|     28|	}
 1227|       |
 1228|    119|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    119|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1229|    119|}
archive_read_support_format_iso9660.c:parse_file_info:
 1821|    920|{
 1822|    920|	struct iso9660 *iso9660 = a->format->data;
 1823|    920|	struct file_info *file, *filep;
 1824|    920|	size_t name_len;
 1825|    920|	const unsigned char *rr_start, *rr_end;
 1826|    920|	const unsigned char *p;
 1827|    920|	size_t dr_len = 0;
 1828|    920|	uint64_t fsize, offset;
 1829|    920|	int32_t location;
 1830|    920|	int flags;
 1831|       |
 1832|    920|	if (reclen != 0)
  ------------------
  |  Branch (1832:6): [True: 919, False: 1]
  ------------------
 1833|    919|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  196|    919|#define DR_length_offset 0
  ------------------
 1834|       |	/*
 1835|       |	 * Sanity check that reclen is not zero and dr_len is greater than
 1836|       |	 * reclen but at least 34
 1837|       |	 */
 1838|    920|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1838:6): [True: 1, False: 919]
  |  Branch (1838:21): [True: 0, False: 919]
  |  Branch (1838:40): [True: 8, False: 911]
  ------------------
 1839|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      9|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1840|      9|			"Invalid length of directory record");
 1841|      9|		return (NULL);
 1842|      9|	}
 1843|    911|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  214|    911|#define DR_name_len_offset 32
  ------------------
 1844|    911|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  200|    911|#define DR_extent_offset 2
  ------------------
 1845|    911|	fsize = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  202|    911|#define DR_size_offset 10
  ------------------
 1846|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1847|    911|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1847:6): [True: 4, False: 907]
  |  Branch (1847:32): [True: 5, False: 902]
  ------------------
 1848|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      9|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1849|      9|		    "Invalid length of file identifier");
 1850|      9|		return (NULL);
 1851|      9|	}
 1852|       |	/* Sanity check that location doesn't exceed volume block.
 1853|       |	 * Don't check lower limit of location; it's possibility
 1854|       |	 * the location has negative value when file type is symbolic
 1855|       |	 * link or file size is zero. As far as I know latest mkisofs
 1856|       |	 * do that.
 1857|       |	 */
 1858|    902|	if (location > 0 &&
  ------------------
  |  Branch (1858:6): [True: 441, False: 461]
  ------------------
 1859|    441|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1859:6): [True: 2, False: 439]
  ------------------
 1860|    441|	       / iso9660->logical_block_size))
 1861|    441|			> (uint32_t)iso9660->volume_block) {
 1862|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1863|      2|		    "Invalid location of extent of file");
 1864|      2|		return (NULL);
 1865|      2|	}
 1866|       |	/* Sanity check that location doesn't have a negative value
 1867|       |	 * when the file is not empty. it's too large. */
 1868|    900|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1868:6): [True: 567, False: 333]
  |  Branch (1868:20): [True: 2, False: 565]
  ------------------
 1869|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1870|      2|		    "Invalid location of extent of file");
 1871|      2|		return (NULL);
 1872|      2|	}
 1873|       |
 1874|       |	/* Sanity check that this entry does not create a cycle. */
 1875|    898|	offset = iso9660->logical_block_size * (uint64_t)location;
 1876|  1.85k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1876:23): [True: 955, False: 896]
  ------------------
 1877|    955|		if (filep->offset == offset) {
  ------------------
  |  Branch (1877:7): [True: 2, False: 953]
  ------------------
 1878|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1879|      2|			    "Directory structure contains loop");
 1880|      2|			return (NULL);
 1881|      2|		}
 1882|    955|	}
 1883|       |
 1884|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1885|    896|	file = calloc(1, sizeof(*file));
 1886|    896|	if (file == NULL) {
  ------------------
  |  Branch (1886:6): [True: 0, False: 896]
  ------------------
 1887|      0|		archive_set_error(&a->archive, ENOMEM,
 1888|      0|		    "No memory for file entry");
 1889|      0|		return (NULL);
 1890|      0|	}
 1891|    896|	file->parent = parent;
 1892|    896|	file->offset = offset;
 1893|    896|	file->size = fsize;
 1894|    896|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  204|    896|#define DR_date_offset 18
  ------------------
  |  Branch (1894:6): [True: 381, False: 515]
  ------------------
 1895|    381|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    381|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    381|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  314|    381|#define CTIME_IS_SET 8
  ------------------
 1896|    381|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  204|    381|#define DR_date_offset 18
  ------------------
 1897|    381|		file->ctime = file->atime = file->mtime;
 1898|    381|	}
 1899|    896|	file->rede_files.first = NULL;
 1900|    896|	file->rede_files.last = &(file->rede_files.first);
 1901|       |
 1902|    896|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  216|    896|#define DR_name_offset 33
  ------------------
 1903|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1904|       |	 * before fidgeting the name_len below. */
 1905|    896|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1905:29): [True: 237, False: 659]
  ------------------
 1906|    896|	rr_end = isodirrec + dr_len;
 1907|       |
 1908|    896|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1908:6): [True: 21, False: 875]
  ------------------
 1909|       |		/* Joliet names are max 64 chars (128 bytes) according to spec,
 1910|       |		 * but genisoimage/mkisofs allows recording longer Joliet
 1911|       |		 * names which are 103 UCS2 characters(206 bytes) by their
 1912|       |		 * option '-joliet-long'.
 1913|       |		 */
 1914|     21|		if (name_len > 206)
  ------------------
  |  Branch (1914:7): [True: 0, False: 21]
  ------------------
 1915|      0|			name_len = 206;
 1916|     21|		name_len &= ~1;
 1917|       |
 1918|       |		/* trim trailing first version and dot from filename.
 1919|       |		 *
 1920|       |		 * Remember we were in UTF-16BE land!
 1921|       |		 * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
 1922|       |		 * 16 bits big endian characters on Joliet.
 1923|       |		 *
 1924|       |		 * TODO: sanitize filename?
 1925|       |		 *       Joliet allows any UCS-2 char except:
 1926|       |		 *       *, /, :, ;, ? and \.
 1927|       |		 */
 1928|       |		/* Chop off trailing ';1' from files. */
 1929|     21|		if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
  ------------------
  |  Branch (1929:7): [True: 19, False: 2]
  |  Branch (1929:23): [True: 9, False: 10]
  |  Branch (1929:45): [True: 2, False: 7]
  ------------------
 1930|      2|		    && p[name_len-2] == 0 && p[name_len-1] == '1')
  ------------------
  |  Branch (1930:10): [True: 1, False: 1]
  |  Branch (1930:32): [True: 0, False: 1]
  ------------------
 1931|      0|			name_len -= 4;
 1932|       |#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
 1933|       |		/* Chop off trailing '.' from filenames. */
 1934|       |		if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
 1935|       |			name_len -= 2;
 1936|       |#endif
 1937|     21|		if ((file->utf16be_name = malloc(name_len)) == NULL) {
  ------------------
  |  Branch (1937:7): [True: 0, False: 21]
  ------------------
 1938|      0|			archive_set_error(&a->archive, ENOMEM,
 1939|      0|			    "No memory for file name");
 1940|      0|			goto fail;
 1941|      0|		}
 1942|     21|		memcpy(file->utf16be_name, p, name_len);
 1943|     21|		file->utf16be_bytes = name_len;
 1944|    875|	} else {
 1945|       |		/* Chop off trailing ';1' from files. */
 1946|    875|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1946:7): [True: 693, False: 182]
  |  Branch (1946:23): [True: 351, False: 342]
  ------------------
 1947|    351|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1947:5): [True: 309, False: 42]
  ------------------
 1948|    309|			name_len -= 2;
 1949|       |		/* Chop off trailing '.' from filenames. */
 1950|    875|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1950:7): [True: 693, False: 182]
  |  Branch (1950:23): [True: 8, False: 685]
  ------------------
 1951|      8|			--name_len;
 1952|       |
 1953|    875|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    875|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1954|    875|	}
 1955|       |
 1956|    896|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  206|    896|#define DR_flags_offset 25
  ------------------
 1957|    896|	if (flags & 0x02)
  ------------------
  |  Branch (1957:6): [True: 395, False: 501]
  ------------------
 1958|    395|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    395|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1959|    501|	else
 1960|    501|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    501|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1961|    896|	if (flags & 0x80)
  ------------------
  |  Branch (1961:6): [True: 103, False: 793]
  ------------------
 1962|    103|		file->multi_extent = 1;
 1963|    793|	else
 1964|    793|		file->multi_extent = 0;
 1965|       |	/*
 1966|       |	 * Use a location for the file number, which is treated as an inode
 1967|       |	 * number to find out hardlink target. If Rockridge extensions is
 1968|       |	 * being used, the file number will be overwritten by FILE SERIAL
 1969|       |	 * NUMBER of RRIP "PX" extension.
 1970|       |	 * Note: Old mkisofs did not record that FILE SERIAL NUMBER
 1971|       |	 * in ISO images.
 1972|       |	 * Note2: xorriso set 0 to the location of a symlink file.
 1973|       |	 */
 1974|    896|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1974:6): [True: 333, False: 563]
  |  Branch (1974:25): [True: 229, False: 104]
  ------------------
 1975|       |		/* If file->size is zero, its location points wrong place,
 1976|       |		 * and so we should not use it for the file number.
 1977|       |		 * When the location has negative value, it can be used
 1978|       |		 * for the file number.
 1979|       |		 */
 1980|    229|		file->number = -1;
 1981|       |		/* Do not appear before any directory entries. */
 1982|    229|		file->offset = -1;
 1983|    229|	} else
 1984|    667|		file->number = (int64_t)(uint32_t)location;
 1985|       |
 1986|       |	/* Rockridge extensions overwrite information from above. */
 1987|    896|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (1987:6): [True: 126, False: 770]
  ------------------
 1988|    126|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (1988:7): [True: 126, False: 0]
  |  Branch (1988:25): [True: 41, False: 85]
  ------------------
 1989|     41|			p = rr_start;
 1990|     41|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (1990:8): [True: 38, False: 3]
  ------------------
 1991|       |				/*
 1992|       |				 * SP extension stores the suspOffset
 1993|       |				 * (Number of bytes to skip between
 1994|       |				 * filename and SUSP records.)
 1995|       |				 * It is mandatory by the SUSP standard
 1996|       |				 * (IEEE 1281).
 1997|       |				 *
 1998|       |				 * It allows SUSP to coexist with
 1999|       |				 * non-SUSP uses of the System
 2000|       |				 * Use Area by placing non-SUSP data
 2001|       |				 * before SUSP data.
 2002|       |				 *
 2003|       |				 * SP extension must be in the root
 2004|       |				 * directory entry, disable all SUSP
 2005|       |				 * processing if not found.
 2006|       |				 */
 2007|     38|				iso9660->suspOffset = p[6];
 2008|     38|				iso9660->seenSUSP = 1;
 2009|     38|				rr_start += 7;
 2010|     38|			}
 2011|     41|		}
 2012|    126|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2012:7): [True: 38, False: 88]
  ------------------
 2013|     38|			int r;
 2014|       |
 2015|     38|			file->name_continues = 0;
 2016|     38|			file->symlink_continues = 0;
 2017|     38|			rr_start += iso9660->suspOffset;
 2018|     38|			r = parse_rockridge(a, file, rr_start, rr_end);
 2019|     38|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2019:8): [True: 3, False: 35]
  ------------------
 2020|      3|				goto fail;
 2021|       |			/*
 2022|       |			 * A file size of symbolic link files in ISO images
 2023|       |			 * made by makefs is not zero and its location is
 2024|       |			 * the same as those of next regular file. That is
 2025|       |			 * the same as hard like file and it causes unexpected
 2026|       |			 * error.
 2027|       |			 */
 2028|     35|			if (file->size > 0 &&
  ------------------
  |  Branch (2028:8): [True: 1, False: 34]
  ------------------
 2029|      1|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|      1|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|      1|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2029:8): [True: 0, False: 1]
  ------------------
 2030|      0|				file->size = 0;
 2031|      0|				file->number = -1;
 2032|      0|				file->offset = -1;
 2033|      0|			}
 2034|     35|		} else
 2035|       |			/* If there isn't SUSP, disable parsing
 2036|       |			 * rock ridge extensions. */
 2037|     88|			iso9660->opt_support_rockridge = 0;
 2038|    126|	}
 2039|       |
 2040|    893|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2041|       |	/* Tell file's parent how many children that parent has. */
 2042|    893|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2042:6): [True: 757, False: 136]
  |  Branch (2042:24): [True: 298, False: 459]
  ------------------
 2043|    298|		parent->subdirs++;
 2044|       |
 2045|    893|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2045:6): [True: 28, False: 865]
  ------------------
 2046|     28|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2046:7): [True: 0, False: 28]
  |  Branch (2046:25): [True: 0, False: 0]
  ------------------
 2047|      0|		    (flags & 0x02) && iso9660->rr_moved == NULL &&
  ------------------
  |  Branch (2047:7): [True: 0, False: 0]
  |  Branch (2047:25): [True: 0, False: 0]
  ------------------
 2048|      0|		    file->name.s &&
  ------------------
  |  Branch (2048:7): [True: 0, False: 0]
  ------------------
 2049|      0|		    (strcmp(file->name.s, "rr_moved") == 0 ||
  ------------------
  |  Branch (2049:8): [True: 0, False: 0]
  ------------------
 2050|      0|		     strcmp(file->name.s, ".rr_moved") == 0)) {
  ------------------
  |  Branch (2050:8): [True: 0, False: 0]
  ------------------
 2051|      0|			iso9660->rr_moved = file;
 2052|      0|			file->rr_moved = 1;
 2053|      0|			file->rr_moved_has_re_only = 1;
 2054|      0|			file->re = 0;
 2055|      0|			parent->subdirs--;
 2056|     28|		} else if (file->re) {
  ------------------
  |  Branch (2056:14): [True: 0, False: 28]
  ------------------
 2057|       |			/*
 2058|       |			 * Sanity check: file's parent is rr_moved.
 2059|       |			 */
 2060|      0|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2060:8): [True: 0, False: 0]
  |  Branch (2060:26): [True: 0, False: 0]
  ------------------
 2061|      0|				archive_set_error(&a->archive,
 2062|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2063|      0|				    "Invalid Rockridge RE");
 2064|      0|				goto fail;
 2065|      0|			}
 2066|       |			/*
 2067|       |			 * Sanity check: file does not have "CL" extension.
 2068|       |			 */
 2069|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2069:8): [True: 0, False: 0]
  ------------------
 2070|      0|				archive_set_error(&a->archive,
 2071|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2072|      0|				    "Invalid Rockridge RE and CL");
 2073|      0|				goto fail;
 2074|      0|			}
 2075|       |			/*
 2076|       |			 * Sanity check: The file type must be a directory.
 2077|       |			 */
 2078|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2078:8): [True: 0, False: 0]
  ------------------
 2079|      0|				archive_set_error(&a->archive,
 2080|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2081|      0|				    "Invalid Rockridge RE");
 2082|      0|				goto fail;
 2083|      0|			}
 2084|     28|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2084:14): [True: 0, False: 28]
  |  Branch (2084:32): [True: 0, False: 0]
  ------------------
 2085|      0|			file->rr_moved_has_re_only = 0;
 2086|     28|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2086:12): [True: 0, False: 28]
  |  Branch (2086:30): [True: 0, False: 0]
  ------------------
 2087|      0|		    (parent->re || parent->re_descendant))
  ------------------
  |  Branch (2087:8): [True: 0, False: 0]
  |  Branch (2087:22): [True: 0, False: 0]
  ------------------
 2088|      0|			file->re_descendant = 1;
 2089|     28|		if (file->cl_offset) {
  ------------------
  |  Branch (2089:7): [True: 0, False: 28]
  ------------------
 2090|      0|			struct file_info *r;
 2091|       |
 2092|      0|			if (parent == NULL || parent->parent == NULL) {
  ------------------
  |  Branch (2092:8): [True: 0, False: 0]
  |  Branch (2092:26): [True: 0, False: 0]
  ------------------
 2093|      0|				archive_set_error(&a->archive,
 2094|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2095|      0|				    "Invalid Rockridge CL");
 2096|      0|				goto fail;
 2097|      0|			}
 2098|       |			/*
 2099|       |			 * Sanity check: The file type must be a regular file.
 2100|       |			 */
 2101|      0|			if ((flags & 0x02) != 0) {
  ------------------
  |  Branch (2101:8): [True: 0, False: 0]
  ------------------
 2102|      0|				archive_set_error(&a->archive,
 2103|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2104|      0|				    "Invalid Rockridge CL");
 2105|      0|				goto fail;
 2106|      0|			}
 2107|      0|			parent->subdirs++;
 2108|       |			/* Overwrite an offset and a number of this "CL" entry
 2109|       |			 * to appear before other dirs. "+1" to those is to
 2110|       |			 * make sure to appear after "RE" entry which this
 2111|       |			 * "CL" entry should be connected with. */
 2112|      0|			file->offset = file->number = file->cl_offset + 1;
 2113|       |
 2114|       |			/*
 2115|       |			 * Sanity check: cl_offset does not point at its
 2116|       |			 * the parents or itself.
 2117|       |			 */
 2118|      0|			for (r = parent; r; r = r->parent) {
  ------------------
  |  Branch (2118:21): [True: 0, False: 0]
  ------------------
 2119|      0|				if (r->offset == file->cl_offset) {
  ------------------
  |  Branch (2119:9): [True: 0, False: 0]
  ------------------
 2120|      0|					archive_set_error(&a->archive,
 2121|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2122|      0|					    "Invalid Rockridge CL");
 2123|      0|					goto fail;
 2124|      0|				}
 2125|      0|			}
 2126|      0|			if (file->cl_offset == file->offset ||
  ------------------
  |  Branch (2126:8): [True: 0, False: 0]
  ------------------
 2127|      0|			    parent->rr_moved) {
  ------------------
  |  Branch (2127:8): [True: 0, False: 0]
  ------------------
 2128|      0|				archive_set_error(&a->archive,
 2129|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2130|      0|				    "Invalid Rockridge CL");
 2131|      0|				goto fail;
 2132|      0|			}
 2133|      0|		}
 2134|     28|	}
 2135|       |
 2136|       |#if DEBUG
 2137|       |	/* DEBUGGING: Warn about attributes I don't yet fully support. */
 2138|       |	if ((flags & ~0x02) != 0) {
 2139|       |		fprintf(stderr, "\n ** Unrecognized flag: ");
 2140|       |		dump_isodirrec(stderr, isodirrec);
 2141|       |		fprintf(stderr, "\n");
 2142|       |	} else if (archive_le16dec(isodirrec + DR_volume_sequence_number_offset) != 1) {
 2143|       |		fprintf(stderr, "\n ** Unrecognized sequence number: ");
 2144|       |		dump_isodirrec(stderr, isodirrec);
 2145|       |		fprintf(stderr, "\n");
 2146|       |	} else if (*(isodirrec + DR_file_unit_size_offset) != 0) {
 2147|       |		fprintf(stderr, "\n ** Unexpected file unit size: ");
 2148|       |		dump_isodirrec(stderr, isodirrec);
 2149|       |		fprintf(stderr, "\n");
 2150|       |	} else if (*(isodirrec + DR_interleave_offset) != 0) {
 2151|       |		fprintf(stderr, "\n ** Unexpected interleave: ");
 2152|       |		dump_isodirrec(stderr, isodirrec);
 2153|       |		fprintf(stderr, "\n");
 2154|       |	} else if (*(isodirrec + DR_ext_attr_length_offset) != 0) {
 2155|       |		fprintf(stderr, "\n ** Unexpected extended attribute length: ");
 2156|       |		dump_isodirrec(stderr, isodirrec);
 2157|       |		fprintf(stderr, "\n");
 2158|       |	}
 2159|       |#endif
 2160|    893|	register_file(iso9660, file);
 2161|    893|	return (file);
 2162|      3|fail:
 2163|      3|	archive_string_free(&file->name);
 2164|      3|	free(file);
 2165|       |	return (NULL);
 2166|    893|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3251|    925|{
 3252|    925|	int year = v[0];
 3253|    925|	int month = v[1];
 3254|    925|	int day = v[2];
 3255|    925|	int hour = v[3];
 3256|    925|	int minute = v[4];
 3257|    925|	int second = v[5];
 3258|    925|	int gmt_off = (signed char)v[6];
 3259|       |
 3260|       |	/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
 3261|       |	 * that the date is unspecified" */
 3262|    925|	if (year == 0
  ------------------
  |  Branch (3262:6): [True: 347, False: 578]
  ------------------
 3263|    347|	    && month == 0
  ------------------
  |  Branch (3263:9): [True: 303, False: 44]
  ------------------
 3264|    303|	    && day == 0
  ------------------
  |  Branch (3264:9): [True: 286, False: 17]
  ------------------
 3265|    286|	    && hour == 0
  ------------------
  |  Branch (3265:9): [True: 281, False: 5]
  ------------------
 3266|    281|	    && minute == 0
  ------------------
  |  Branch (3266:9): [True: 271, False: 10]
  ------------------
 3267|    271|	    && second == 0
  ------------------
  |  Branch (3267:9): [True: 256, False: 15]
  ------------------
 3268|    256|	    && gmt_off == 0)
  ------------------
  |  Branch (3268:9): [True: 220, False: 36]
  ------------------
 3269|    220|		return 0;
 3270|       |	/*
 3271|       |	 * Sanity-test each individual field
 3272|       |	 */
 3273|       |	/* Year can have any value */
 3274|       |	/* Month must be 1-12 */
 3275|    705|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3275:6): [True: 98, False: 607]
  |  Branch (3275:19): [True: 59, False: 548]
  ------------------
 3276|    157|		return 0;
 3277|       |	/* Day must be 1-31 */
 3278|    548|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3278:6): [True: 65, False: 483]
  |  Branch (3278:17): [True: 45, False: 438]
  ------------------
 3279|    110|		return 0;
 3280|       |	/* Hour must be 0-23 */
 3281|    438|	if (hour > 23)
  ------------------
  |  Branch (3281:6): [True: 9, False: 429]
  ------------------
 3282|      9|		return 0;
 3283|       |	/* Minute must be 0-59 */
 3284|    429|	if (minute > 59)
  ------------------
  |  Branch (3284:6): [True: 17, False: 412]
  ------------------
 3285|     17|		return 0;
 3286|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3287|       |	/* BUT: we should probably allow for the time being in UTC, which
 3288|       |	   allows up to 61 seconds in a minute in certain cases */
 3289|    412|	if (second > 61)
  ------------------
  |  Branch (3289:6): [True: 14, False: 398]
  ------------------
 3290|     14|		return 0;
 3291|       |	/* Offset from GMT must be -48 to +52 */
 3292|    398|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3292:6): [True: 3, False: 395]
  |  Branch (3292:23): [True: 9, False: 386]
  ------------------
 3293|     12|		return 0;
 3294|       |
 3295|       |	/* All tests pass, this is OK */
 3296|    386|	return 1;
 3297|    398|}
archive_read_support_format_iso9660.c:isodate7:
 3301|    386|{
 3302|    386|	struct tm tm;
 3303|    386|	int offset;
 3304|    386|	time_t t;
 3305|       |
 3306|    386|	memset(&tm, 0, sizeof(tm));
 3307|    386|	tm.tm_year = v[0];
 3308|    386|	tm.tm_mon = v[1] - 1;
 3309|    386|	tm.tm_mday = v[2];
 3310|    386|	tm.tm_hour = v[3];
 3311|    386|	tm.tm_min = v[4];
 3312|    386|	tm.tm_sec = v[5];
 3313|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3314|    386|	offset = ((const signed char *)v)[6];
 3315|    386|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3315:6): [True: 386, False: 0]
  |  Branch (3315:22): [True: 383, False: 3]
  ------------------
 3316|    383|		tm.tm_hour -= offset / 4;
 3317|    383|		tm.tm_min -= (offset % 4) * 15;
 3318|    383|	}
 3319|    386|	t = time_from_tm(&tm);
 3320|    386|	if (t == (time_t)-1)
  ------------------
  |  Branch (3320:6): [True: 0, False: 386]
  ------------------
 3321|      0|		return ((time_t)0);
 3322|    386|	return (t);
 3323|    386|}
archive_read_support_format_iso9660.c:time_from_tm:
 3416|    386|{
 3417|       |#if HAVE__MKGMTIME
 3418|       |        return _mkgmtime(t);
 3419|       |#elif HAVE_TIMEGM
 3420|       |        /* Use platform timegm() if available. */
 3421|    386|        return (timegm(t));
 3422|       |#else
 3423|       |        /* Else use direct calculation using POSIX assumptions. */
 3424|       |        /* First, fix up tm_yday based on the year/month/day. */
 3425|       |        if (mktime(t) == (time_t)-1)
 3426|       |                return ((time_t)-1);
 3427|       |        /* Then we can compute timegm() from first principles. */
 3428|       |        return (t->tm_sec
 3429|       |            + t->tm_min * 60
 3430|       |            + t->tm_hour * 3600
 3431|       |            + t->tm_yday * 86400
 3432|       |            + (t->tm_year - 70) * 31536000
 3433|       |            + ((t->tm_year - 69) / 4) * 86400
 3434|       |            - ((t->tm_year - 1) / 100) * 86400
 3435|       |            + ((t->tm_year + 299) / 400) * 86400);
 3436|       |#endif
 3437|    386|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2171|     38|{
 2172|     38|	struct iso9660 *iso9660 = a->format->data;
 2173|     38|	int entry_seen = 0;
 2174|       |
 2175|     76|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2175:9): [True: 75, False: 1]
  ------------------
 2176|     75|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2176:9): [True: 49, False: 26]
  |  Branch (2176:24): [True: 45, False: 4]
  ------------------
 2177|     45|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2177:9): [True: 43, False: 2]
  |  Branch (2177:24): [True: 40, False: 3]
  ------------------
 2178|     40|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2178:9): [True: 40, False: 0]
  ------------------
 2179|     40|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2179:9): [True: 38, False: 2]
  ------------------
 2180|     38|		const unsigned char *data = p + 4;
 2181|     38|		int data_length = p[2] - 4;
 2182|     38|		int version = p[3];
 2183|       |
 2184|     38|		switch(p[0]) {
 2185|      3|		case 'C':
  ------------------
  |  Branch (2185:3): [True: 3, False: 35]
  ------------------
 2186|      3|			if (p[1] == 'E') {
  ------------------
  |  Branch (2186:8): [True: 0, False: 3]
  ------------------
 2187|      0|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 0]
  |  Branch (2187:25): [True: 0, False: 0]
  ------------------
 2188|       |					/*
 2189|       |					 * CE extension comprises:
 2190|       |					 *   8 byte sector containing extension
 2191|       |					 *   8 byte offset w/in above sector
 2192|       |					 *   8 byte length of continuation
 2193|       |					 */
 2194|      0|					int32_t location =
 2195|      0|					    archive_le32dec(data);
 2196|      0|					file->ce_offset =
 2197|      0|					    archive_le32dec(data+8);
 2198|      0|					file->ce_size =
 2199|      0|					    archive_le32dec(data+16);
 2200|      0|					if (register_CE(a, location, file)
  ------------------
  |  Branch (2200:10): [True: 0, False: 0]
  ------------------
 2201|      0|					    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2202|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2203|      0|				}
 2204|      0|			}
 2205|      3|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2205:13): [True: 0, False: 3]
  ------------------
 2206|      0|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2206:9): [True: 0, False: 0]
  |  Branch (2206:25): [True: 0, False: 0]
  ------------------
 2207|      0|					file->cl_offset = (uint64_t)
 2208|      0|					    iso9660->logical_block_size *
 2209|      0|					    (uint64_t)archive_le32dec(data);
 2210|      0|					iso9660->seenRockridge = 1;
 2211|      0|				}
 2212|      0|			}
 2213|      3|			break;
 2214|      3|		case 'N':
  ------------------
  |  Branch (2214:3): [True: 1, False: 37]
  ------------------
 2215|      1|			if (p[1] == 'M') {
  ------------------
  |  Branch (2215:8): [True: 0, False: 1]
  ------------------
 2216|      0|				if (version == 1) {
  ------------------
  |  Branch (2216:9): [True: 0, False: 0]
  ------------------
 2217|      0|					parse_rockridge_NM1(file,
 2218|      0|					    data, data_length);
 2219|      0|					iso9660->seenRockridge = 1;
 2220|      0|				}
 2221|      0|			}
 2222|      1|			break;
 2223|      1|		case 'P':
  ------------------
  |  Branch (2223:3): [True: 1, False: 37]
  ------------------
 2224|       |			/*
 2225|       |			 * PD extension is padding;
 2226|       |			 * contents are always ignored.
 2227|       |			 *
 2228|       |			 * PL extension won't appear;
 2229|       |			 * contents are always ignored.
 2230|       |			 */
 2231|      1|			if (p[1] == 'N') {
  ------------------
  |  Branch (2231:8): [True: 0, False: 1]
  ------------------
 2232|      0|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2232:9): [True: 0, False: 0]
  |  Branch (2232:25): [True: 0, False: 0]
  ------------------
 2233|      0|					file->rdev = archive_le32dec(data);
 2234|      0|					file->rdev <<= 32;
 2235|      0|					file->rdev |=
 2236|      0|					    archive_le32dec(data + 8);
 2237|      0|					iso9660->seenRockridge = 1;
 2238|      0|				}
 2239|      0|			}
 2240|      1|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2240:13): [True: 0, False: 1]
  ------------------
 2241|       |				/*
 2242|       |				 * PX extension comprises:
 2243|       |				 *   8 bytes for mode,
 2244|       |				 *   8 bytes for nlinks,
 2245|       |				 *   8 bytes for uid,
 2246|       |				 *   8 bytes for gid,
 2247|       |				 *   8 bytes for inode.
 2248|       |				 */
 2249|      0|				if (version == 1) {
  ------------------
  |  Branch (2249:9): [True: 0, False: 0]
  ------------------
 2250|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2250:10): [True: 0, False: 0]
  ------------------
 2251|      0|						file->mode = (__LA_MODE_T)
 2252|      0|						    archive_le32dec(data);
 2253|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2253:10): [True: 0, False: 0]
  ------------------
 2254|      0|						file->nlinks =
 2255|      0|						    archive_le32dec(data + 8);
 2256|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2256:10): [True: 0, False: 0]
  ------------------
 2257|      0|						file->uid =
 2258|      0|						    archive_le32dec(data + 16);
 2259|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2259:10): [True: 0, False: 0]
  ------------------
 2260|      0|						file->gid =
 2261|      0|						    archive_le32dec(data + 24);
 2262|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2262:10): [True: 0, False: 0]
  ------------------
 2263|      0|						file->number =
 2264|      0|						    archive_le32dec(data + 32);
 2265|      0|					iso9660->seenRockridge = 1;
 2266|      0|				}
 2267|      0|			}
 2268|      1|			break;
 2269|      1|		case 'R':
  ------------------
  |  Branch (2269:3): [True: 1, False: 37]
  ------------------
 2270|      1|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2270:8): [True: 0, False: 1]
  |  Branch (2270:23): [True: 0, False: 0]
  ------------------
 2271|      0|				file->re = 1;
 2272|      0|				iso9660->seenRockridge = 1;
 2273|      0|			}
 2274|      1|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2274:13): [True: 0, False: 1]
  |  Branch (2274:28): [True: 0, False: 0]
  ------------------
 2275|       |				/*
 2276|       |				 * RR extension comprises:
 2277|       |				 *    one byte flag value
 2278|       |				 * This extension is obsolete,
 2279|       |				 * so contents are always ignored.
 2280|       |				 */
 2281|      0|			}
 2282|      1|			break;
 2283|      0|		case 'S':
  ------------------
  |  Branch (2283:3): [True: 0, False: 38]
  ------------------
 2284|      0|			if (p[1] == 'L') {
  ------------------
  |  Branch (2284:8): [True: 0, False: 0]
  ------------------
 2285|      0|				if (version == 1) {
  ------------------
  |  Branch (2285:9): [True: 0, False: 0]
  ------------------
 2286|      0|					parse_rockridge_SL1(file,
 2287|      0|					    data, data_length);
 2288|      0|					iso9660->seenRockridge = 1;
 2289|      0|				}
 2290|      0|			}
 2291|      0|			else if (p[1] == 'T'
  ------------------
  |  Branch (2291:13): [True: 0, False: 0]
  ------------------
 2292|      0|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2292:11): [True: 0, False: 0]
  |  Branch (2292:31): [True: 0, False: 0]
  ------------------
 2293|       |				/*
 2294|       |				 * ST extension marks end of this
 2295|       |				 * block of SUSP entries.
 2296|       |				 *
 2297|       |				 * It allows SUSP to coexist with
 2298|       |				 * non-SUSP uses of the System
 2299|       |				 * Use Area by placing non-SUSP data
 2300|       |				 * after SUSP data.
 2301|       |				 */
 2302|      0|				iso9660->seenSUSP = 0;
 2303|      0|				iso9660->seenRockridge = 0;
 2304|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2305|      0|			}
 2306|      0|			break;
 2307|     29|		case 'T':
  ------------------
  |  Branch (2307:3): [True: 29, False: 9]
  ------------------
 2308|     29|			if (p[1] == 'F') {
  ------------------
  |  Branch (2308:8): [True: 29, False: 0]
  ------------------
 2309|     29|				if (version == 1) {
  ------------------
  |  Branch (2309:9): [True: 28, False: 1]
  ------------------
 2310|     28|					parse_rockridge_TF1(file,
 2311|     28|					    data, data_length);
 2312|     28|					iso9660->seenRockridge = 1;
 2313|     28|				}
 2314|     29|			}
 2315|     29|			break;
 2316|      2|		case 'Z':
  ------------------
  |  Branch (2316:3): [True: 2, False: 36]
  ------------------
 2317|      2|			if (p[1] == 'F') {
  ------------------
  |  Branch (2317:8): [True: 1, False: 1]
  ------------------
 2318|      1|				if (version == 1)
  ------------------
  |  Branch (2318:9): [True: 1, False: 0]
  ------------------
 2319|      1|					parse_rockridge_ZF1(file,
 2320|      1|					    data, data_length);
 2321|      1|			}
 2322|      2|			break;
 2323|      1|		default:
  ------------------
  |  Branch (2323:3): [True: 1, False: 37]
  ------------------
 2324|      1|			break;
 2325|     38|		}
 2326|       |
 2327|     38|		p += p[2];
 2328|     38|		entry_seen = 1;
 2329|     38|	}
 2330|       |
 2331|     38|	if (entry_seen)
  ------------------
  |  Branch (2331:6): [True: 35, False: 3]
  ------------------
 2332|     35|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     35|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2333|      3|	else {
 2334|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2335|      3|				  "Tried to parse Rockridge extensions, but none found");
 2336|      3|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2337|      3|	}
 2338|     38|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2556|     28|{
 2557|     28|	char flag;
 2558|       |	/*
 2559|       |	 * TF extension comprises:
 2560|       |	 *   one byte flag
 2561|       |	 *   create time (optional)
 2562|       |	 *   modify time (optional)
 2563|       |	 *   access time (optional)
 2564|       |	 *   attribute time (optional)
 2565|       |	 *  Time format and presence of fields
 2566|       |	 *  is controlled by flag bits.
 2567|       |	 */
 2568|     28|	if (data_length < 1)
  ------------------
  |  Branch (2568:6): [True: 1, False: 27]
  ------------------
 2569|      1|		return;
 2570|     27|	flag = data[0];
 2571|     27|	++data;
 2572|     27|	--data_length;
 2573|     27|	if (flag & 0x80) {
  ------------------
  |  Branch (2573:6): [True: 16, False: 11]
  ------------------
 2574|       |		/* Use 17-byte time format. */
 2575|     16|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2575:7): [True: 15, False: 1]
  |  Branch (2575:21): [True: 15, False: 0]
  ------------------
 2576|       |			/* Create time. */
 2577|     15|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2577:8): [True: 0, False: 15]
  ------------------
 2578|      0|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      0|#define BIRTHTIME_IS_SET 1
  ------------------
 2579|      0|				file->birthtime = isodate17(data);
 2580|      0|			}
 2581|     15|			data += 17;
 2582|     15|			data_length -= 17;
 2583|     15|		}
 2584|     16|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2584:7): [True: 15, False: 1]
  |  Branch (2584:21): [True: 14, False: 1]
  ------------------
 2585|       |			/* Modify time. */
 2586|     14|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2586:8): [True: 0, False: 14]
  ------------------
 2587|      0|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      0|#define MTIME_IS_SET 2
  ------------------
 2588|      0|				file->mtime = isodate17(data);
 2589|      0|			}
 2590|     14|			data += 17;
 2591|     14|			data_length -= 17;
 2592|     14|		}
 2593|     16|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2593:7): [True: 16, False: 0]
  |  Branch (2593:21): [True: 14, False: 2]
  ------------------
 2594|       |			/* Access time. */
 2595|     14|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2595:8): [True: 0, False: 14]
  ------------------
 2596|      0|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      0|#define ATIME_IS_SET 4
  ------------------
 2597|      0|				file->atime = isodate17(data);
 2598|      0|			}
 2599|     14|			data += 17;
 2600|     14|			data_length -= 17;
 2601|     14|		}
 2602|     16|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2602:7): [True: 16, False: 0]
  |  Branch (2602:21): [True: 13, False: 3]
  ------------------
 2603|       |			/* Attribute change time. */
 2604|     13|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2604:8): [True: 0, False: 13]
  ------------------
 2605|      0|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      0|#define CTIME_IS_SET 8
  ------------------
 2606|      0|				file->ctime = isodate17(data);
 2607|      0|			}
 2608|     13|		}
 2609|     16|	} else {
 2610|       |		/* Use 7-byte time format. */
 2611|     11|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2611:7): [True: 7, False: 4]
  |  Branch (2611:21): [True: 7, False: 0]
  ------------------
 2612|       |			/* Create time. */
 2613|      7|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2613:8): [True: 1, False: 6]
  ------------------
 2614|      1|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      1|#define BIRTHTIME_IS_SET 1
  ------------------
 2615|      1|				file->birthtime = isodate7(data);
 2616|      1|			}
 2617|      7|			data += 7;
 2618|      7|			data_length -= 7;
 2619|      7|		}
 2620|     11|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2620:7): [True: 7, False: 4]
  |  Branch (2620:21): [True: 6, False: 1]
  ------------------
 2621|       |			/* Modify time. */
 2622|      6|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2622:8): [True: 1, False: 5]
  ------------------
 2623|      1|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      1|#define MTIME_IS_SET 2
  ------------------
 2624|      1|				file->mtime = isodate7(data);
 2625|      1|			}
 2626|      6|			data += 7;
 2627|      6|			data_length -= 7;
 2628|      6|		}
 2629|     11|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2629:7): [True: 9, False: 2]
  |  Branch (2629:21): [True: 8, False: 1]
  ------------------
 2630|       |			/* Access time. */
 2631|      8|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2631:8): [True: 1, False: 7]
  ------------------
 2632|      1|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      1|#define ATIME_IS_SET 4
  ------------------
 2633|      1|				file->atime = isodate7(data);
 2634|      1|			}
 2635|      8|			data += 7;
 2636|      8|			data_length -= 7;
 2637|      8|		}
 2638|     11|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2638:7): [True: 9, False: 2]
  |  Branch (2638:21): [True: 8, False: 1]
  ------------------
 2639|       |			/* Attribute change time. */
 2640|      8|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2640:8): [True: 2, False: 6]
  ------------------
 2641|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      2|#define CTIME_IS_SET 8
  ------------------
 2642|      2|				file->ctime = isodate7(data);
 2643|      2|			}
 2644|      8|		}
 2645|     11|	}
 2646|     27|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3327|     56|{
 3328|       |	/* First 16 bytes are all ASCII digits */
 3329|    301|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3329:18): [True: 294, False: 7]
  ------------------
 3330|    294|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3330:7): [True: 11, False: 283]
  |  Branch (3330:21): [True: 38, False: 245]
  ------------------
 3331|     49|			return 0;
 3332|    294|	}
 3333|       |
 3334|      7|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3335|      7|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3336|      7|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3337|      7|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3338|      7|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3339|      7|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3340|      7|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3341|      7|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3342|      7|	int gmt_off = (signed char)v[16];
 3343|       |
 3344|      7|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3344:6): [True: 2, False: 5]
  |  Branch (3344:19): [True: 2, False: 0]
  |  Branch (3344:33): [True: 2, False: 0]
  ------------------
 3345|      2|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3345:9): [True: 2, False: 0]
  |  Branch (3345:22): [True: 2, False: 0]
  |  Branch (3345:37): [True: 2, False: 0]
  ------------------
 3346|      2|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3346:9): [True: 2, False: 0]
  |  Branch (3346:28): [True: 0, False: 2]
  ------------------
 3347|      0|		return 0;
 3348|       |	/*
 3349|       |	 * Sanity-test each individual field
 3350|       |	 */
 3351|       |
 3352|       |	/* Year must be 1900-2300 */
 3353|       |	/* (Not specified in ECMA-119, but these seem
 3354|       |	   like reasonable limits. */
 3355|      7|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3355:6): [True: 2, False: 5]
  |  Branch (3355:21): [True: 3, False: 2]
  ------------------
 3356|      5|		return 0;
 3357|       |	/* Month must be 1-12 */
 3358|      2|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3358:6): [True: 0, False: 2]
  |  Branch (3358:19): [True: 1, False: 1]
  ------------------
 3359|      1|		return 0;
 3360|       |	/* Day must be 1-31 */
 3361|      1|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3361:6): [True: 0, False: 1]
  |  Branch (3361:17): [True: 0, False: 1]
  ------------------
 3362|      0|		return 0;
 3363|       |	/* Hour must be 0-23 */
 3364|      1|	if (hour > 23)
  ------------------
  |  Branch (3364:6): [True: 0, False: 1]
  ------------------
 3365|      0|		return 0;
 3366|       |	/* Minute must be 0-59 */
 3367|      1|	if (minute > 59)
  ------------------
  |  Branch (3367:6): [True: 0, False: 1]
  ------------------
 3368|      0|		return 0;
 3369|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3370|       |	/* BUT: we should probably allow for the time being in UTC, which
 3371|       |	   allows up to 61 seconds in a minute in certain cases */
 3372|      1|	if (second > 61)
  ------------------
  |  Branch (3372:6): [True: 0, False: 1]
  ------------------
 3373|      0|		return 0;
 3374|       |	/* Hundredths must be 0-99 */
 3375|      1|	if (hundredths > 99)
  ------------------
  |  Branch (3375:6): [True: 0, False: 1]
  ------------------
 3376|      0|		return 0;
 3377|       |	/* Offset from GMT must be -48 to +52 */
 3378|      1|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3378:6): [True: 1, False: 0]
  |  Branch (3378:23): [True: 0, False: 0]
  ------------------
 3379|      1|		return 0;
 3380|       |
 3381|       |	/* All tests pass, this is OK */
 3382|      0|	return 1;
 3383|       |
 3384|      1|}
archive_read_support_format_iso9660.c:parse_rockridge_ZF1:
 2738|      1|{
 2739|       |
 2740|      1|	if (data_length == 12 && data[0] == 0x70 && data[1] == 0x7a) {
  ------------------
  |  Branch (2740:6): [True: 0, False: 1]
  |  Branch (2740:27): [True: 0, False: 0]
  |  Branch (2740:46): [True: 0, False: 0]
  ------------------
 2741|       |        /* paged zlib */
 2742|      0|        file->pz = 1;
 2743|      0|        file->pz_log2_bs = data[3];
 2744|      0|        if (file->pz_log2_bs < 15 || file->pz_log2_bs > 17) {
  ------------------
  |  Branch (2744:13): [True: 0, False: 0]
  |  Branch (2744:38): [True: 0, False: 0]
  ------------------
 2745|       |            /* TODO: Return an error here instead of silently
 2746|       |             * disabling zisofs. That requires propagating an
 2747|       |             * error return through parse_rockridge() and its
 2748|       |             * callers. */
 2749|      0|            file->pz = 0;
 2750|      0|            return;
 2751|      0|        }
 2752|      0|        file->pz_uncompressed_size = archive_le32dec(&data[4]);
 2753|      0|    }
 2754|      1|}
archive_read_support_format_iso9660.c:register_file:
 2758|    893|{
 2759|       |
 2760|    893|	file->use_next = iso9660->use_files;
 2761|    893|	iso9660->use_files = file;
 2762|    893|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3117|    799|{
 3118|    799|	uint64_t file_key, parent_key;
 3119|    799|	size_t hole, parent;
 3120|       |
 3121|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3122|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3123|    799|	key <<= 16;
 3124|    799|	key += heap->used & 0xFFFF;
 3125|       |
 3126|       |	/* Expand our pending files list as necessary. */
 3127|    799|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3127:6): [True: 119, False: 680]
  ------------------
 3128|    119|		struct file_info **new_pending_files;
 3129|    119|		size_t new_size;
 3130|       |
 3131|    119|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3131:7): [True: 119, False: 0]
  ------------------
 3132|    119|			new_size = 1024;
 3133|      0|		else if (archive_ckd_mul_size(&new_size, heap->allocated, 2)) {
  ------------------
  |  Branch (3133:12): [True: 0, False: 0]
  ------------------
 3134|       |			/* Overflow keeps us from growing the list. */
 3135|      0|			archive_set_error(&a->archive,
 3136|      0|			    ENOMEM, "Out of memory");
 3137|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3138|      0|		}
 3139|    119|		new_pending_files = (struct file_info **)
 3140|    119|		    calloc(new_size, sizeof(new_pending_files[0]));
 3141|    119|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3141:7): [True: 0, False: 119]
  ------------------
 3142|      0|			archive_set_error(&a->archive,
 3143|      0|			    ENOMEM, "Out of memory");
 3144|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3145|      0|		}
 3146|    119|		if (heap->allocated)
  ------------------
  |  Branch (3146:7): [True: 0, False: 119]
  ------------------
 3147|      0|			memcpy(new_pending_files, heap->files,
 3148|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3149|    119|		free(heap->files);
 3150|    119|		heap->files = new_pending_files;
 3151|    119|		heap->allocated = new_size;
 3152|    119|	}
 3153|       |
 3154|    799|	file_key = file->key = key;
 3155|       |
 3156|       |	/*
 3157|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3158|       |	 */
 3159|    799|	hole = heap->used++;
 3160|  1.17k|	while (hole > 0) {
  ------------------
  |  Branch (3160:9): [True: 883, False: 295]
  ------------------
 3161|    883|		parent = (hole - 1) / 2;
 3162|    883|		parent_key = heap->files[parent]->key;
 3163|    883|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3163:7): [True: 504, False: 379]
  ------------------
 3164|    504|			heap->files[hole] = file;
 3165|    504|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    504|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3166|    504|		}
 3167|       |		/* Move parent into hole <==> move hole up tree. */
 3168|    379|		heap->files[hole] = heap->files[parent];
 3169|    379|		hole = parent;
 3170|    379|	}
 3171|    295|	heap->files[0] = file;
 3172|       |
 3173|    295|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    295|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3174|    799|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2791|    730|{
 2792|    730|	struct file_info *file;
 2793|    730|	int r;
 2794|       |
 2795|    730|	r = next_cache_entry(a, iso9660, pfile);
 2796|    730|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    730|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2796:6): [True: 148, False: 582]
  ------------------
 2797|    148|		return (r);
 2798|    582|	file = *pfile;
 2799|       |
 2800|       |	/* Don't waste time seeking for zero-length bodies. */
 2801|    582|	if (file->size == 0)
  ------------------
  |  Branch (2801:6): [True: 190, False: 392]
  ------------------
 2802|    190|		file->offset = iso9660->current_position;
 2803|       |
 2804|       |	/* flush any remaining bytes from the last round to ensure
 2805|       |	 * we're positioned */
 2806|    582|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2806:6): [True: 0, False: 582]
  ------------------
 2807|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2808|      0|		iso9660->entry_bytes_unconsumed = 0;
 2809|      0|	}
 2810|       |
 2811|       |	/* Seek forward to the start of the entry. */
 2812|    582|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2812:6): [True: 36, False: 546]
  ------------------
 2813|     36|		int64_t step;
 2814|       |
 2815|     36|		step = file->offset - iso9660->current_position;
 2816|     36|		step = __archive_read_consume(a, step);
 2817|     36|		if (step < 0)
  ------------------
  |  Branch (2817:7): [True: 17, False: 19]
  ------------------
 2818|     17|			return ((int)step);
 2819|     19|		iso9660->current_position = file->offset;
 2820|     19|	}
 2821|       |
 2822|       |	/* We found body of file; handle it now. */
 2823|    565|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    565|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2824|    582|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2829|    730|{
 2830|    730|	struct file_info *file;
 2831|    730|	struct {
 2832|    730|		struct file_info	*first;
 2833|    730|		struct file_info	**last;
 2834|    730|	}	empty_files;
 2835|    730|	int64_t number;
 2836|    730|	int count;
 2837|       |
 2838|    730|	file = cache_get_entry(iso9660);
 2839|    730|	if (file != NULL) {
  ------------------
  |  Branch (2839:6): [True: 232, False: 498]
  ------------------
 2840|    232|		*pfile = file;
 2841|    232|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    232|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2842|    232|	}
 2843|       |
 2844|    498|	for (;;) {
 2845|    498|		struct file_info *re, *d;
 2846|       |
 2847|    498|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  453|    498|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2848|    498|		if (file == NULL) {
  ------------------
  |  Branch (2848:7): [True: 68, False: 430]
  ------------------
 2849|       |			/*
 2850|       |			 * If directory entries all which are descendant of
 2851|       |			 * rr_moved are still remaining, expose their.
 2852|       |			 */
 2853|     68|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2853:8): [True: 0, False: 68]
  ------------------
 2854|      0|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2854:8): [True: 0, False: 0]
  ------------------
 2855|      0|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2855:8): [True: 0, False: 0]
  ------------------
 2856|       |				/* Expose "rr_moved" entry. */
 2857|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2858|     68|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2858:11): [True: 0, False: 68]
  ------------------
 2859|       |				/* Expose its descendant dirs. */
 2860|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2860:12): [True: 0, False: 0]
  ------------------
 2861|      0|					cache_add_entry(iso9660, d);
 2862|      0|			}
 2863|     68|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2863:8): [True: 0, False: 68]
  ------------------
 2864|      0|				return (next_cache_entry(a, iso9660, pfile));
 2865|     68|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     68|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2866|     68|		}
 2867|       |
 2868|    430|		if (file->cl_offset) {
  ------------------
  |  Branch (2868:7): [True: 0, False: 430]
  ------------------
 2869|      0|			struct file_info *first_re = NULL;
 2870|      0|			int nexted_re = 0;
 2871|       |
 2872|       |			/*
 2873|       |			 * Find "RE" dir for the current file, which
 2874|       |			 * has "CL" flag.
 2875|       |			 */
 2876|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2876:11): [True: 0, False: 0]
  ------------------
 2877|      0|			    != first_re) {
 2878|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2878:9): [True: 0, False: 0]
  ------------------
 2879|      0|					first_re = re;
 2880|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2880:9): [True: 0, False: 0]
  ------------------
 2881|      0|					re->parent->subdirs--;
 2882|      0|					re->parent = file->parent;
 2883|      0|					re->re = 0;
 2884|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2884:10): [True: 0, False: 0]
  ------------------
 2885|      0|						nexted_re = 1;
 2886|      0|						re->re_descendant = 1;
 2887|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2887:11): [True: 0, False: 0]
  ------------------
 2888|      0|							goto fatal_rr;
 2889|       |						/* Move a list of descendants
 2890|       |						 * to a new ancestor. */
 2891|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2891:14): [True: 0, False: 0]
  ------------------
 2892|      0|						    re)) != NULL)
 2893|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2893:12): [True: 0, False: 0]
  ------------------
 2894|      0|							    < 0)
 2895|      0|								goto fatal_rr;
 2896|      0|						break;
 2897|      0|					}
 2898|       |					/* Replace the current file
 2899|       |					 * with "RE" dir */
 2900|      0|					*pfile = file = re;
 2901|       |					/* Expose its descendant */
 2902|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2902:13): [True: 0, False: 0]
  ------------------
 2903|      0|					    file)) != NULL)
 2904|      0|						cache_add_entry(
 2905|      0|						    iso9660, d);
 2906|      0|					break;
 2907|      0|				} else
 2908|      0|					re_add_entry(iso9660, re);
 2909|      0|			}
 2910|      0|			if (nexted_re) {
  ------------------
  |  Branch (2910:8): [True: 0, False: 0]
  ------------------
 2911|       |				/*
 2912|       |				 * Do not expose this at this time
 2913|       |				 * because we have not gotten its full-path
 2914|       |				 * name yet.
 2915|       |				 */
 2916|      0|				continue;
 2917|      0|			}
 2918|    430|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|    430|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|    430|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2918:14): [True: 218, False: 212]
  ------------------
 2919|    218|			int r;
 2920|       |
 2921|       |			/* Read file entries in this dir. */
 2922|    218|			r = read_children(a, file);
 2923|    218|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    218|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2923:8): [True: 80, False: 138]
  ------------------
 2924|     80|				return (r);
 2925|       |
 2926|       |			/*
 2927|       |			 * Handle a special dir of Rockridge extensions,
 2928|       |			 * "rr_moved".
 2929|       |			 */
 2930|    138|			if (file->rr_moved) {
  ------------------
  |  Branch (2930:8): [True: 0, False: 138]
  ------------------
 2931|       |				/*
 2932|       |				 * If this has only the subdirectories which
 2933|       |				 * have "RE" flags, do not expose at this time.
 2934|       |				 */
 2935|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2935:9): [True: 0, False: 0]
  ------------------
 2936|      0|					continue;
 2937|       |				/* Otherwise expose "rr_moved" entry. */
 2938|    138|			} else if (file->re) {
  ------------------
  |  Branch (2938:15): [True: 0, False: 138]
  ------------------
 2939|       |				/*
 2940|       |				 * Do not expose this at this time
 2941|       |				 * because we have not gotten its full-path
 2942|       |				 * name yet.
 2943|       |				 */
 2944|      0|				re_add_entry(iso9660, file);
 2945|      0|				continue;
 2946|    138|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2946:15): [True: 0, False: 138]
  ------------------
 2947|       |				/*
 2948|       |				 * If the top level "RE" entry of this entry
 2949|       |				 * is not exposed, we, accordingly, should not
 2950|       |				 * expose this entry at this time because
 2951|       |				 * we cannot make its proper full-path name.
 2952|       |				 */
 2953|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2953:9): [True: 0, False: 0]
  ------------------
 2954|      0|					continue;
 2955|       |				/* Otherwise we can expose this entry because
 2956|       |				 * it seems its top level "RE" has already been
 2957|       |				 * exposed. */
 2958|      0|			}
 2959|    138|		}
 2960|    350|		break;
 2961|    430|	}
 2962|       |
 2963|    350|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  215|    350|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  216|    700|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2963:6): [True: 138, False: 212]
  |  Branch (2963:44): [True: 27, False: 185]
  ------------------
 2964|    165|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    165|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2965|       |
 2966|    185|	count = 0;
 2967|    185|	number = file->number;
 2968|    185|	iso9660->cache_files.first = NULL;
 2969|    185|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2970|    185|	empty_files.first = NULL;
 2971|    185|	empty_files.last = &empty_files.first;
 2972|       |	/* Collect files which has the same file serial number.
 2973|       |	 * Peek pending_files so that file which number is different
 2974|       |	 * is not put back. */
 2975|    451|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2975:9): [True: 379, False: 72]
  ------------------
 2976|    379|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2976:7): [True: 118, False: 261]
  ------------------
 2977|    266|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2977:7): [True: 148, False: 113]
  ------------------
 2978|    266|		if (file->number == -1) {
  ------------------
  |  Branch (2978:7): [True: 89, False: 177]
  ------------------
 2979|       |			/* This file has the same offset
 2980|       |			 * but it's wrong offset which empty files
 2981|       |			 * and symlink files have.
 2982|       |			 * NOTE: This wrong offset was recorded by
 2983|       |			 * old mkisofs utility. If ISO images is
 2984|       |			 * created by latest mkisofs, this does not
 2985|       |			 * happen.
 2986|       |			 */
 2987|     89|			file->next = NULL;
 2988|     89|			*empty_files.last = file;
 2989|     89|			empty_files.last = &(file->next);
 2990|    177|		} else {
 2991|    177|			count++;
 2992|    177|			cache_add_entry(iso9660, file);
 2993|    177|		}
 2994|    266|		file = next_entry(iso9660);
  ------------------
  |  |  453|    266|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2995|    266|	}
 2996|       |
 2997|    185|	if (count == 0) {
  ------------------
  |  Branch (2997:6): [True: 98, False: 87]
  ------------------
 2998|     98|		*pfile = file;
 2999|     98|		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  233|     98|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2999:11): [True: 0, False: 98]
  ------------------
 3000|     98|	}
 3001|     87|	if (file->number == -1) {
  ------------------
  |  Branch (3001:6): [True: 29, False: 58]
  ------------------
 3002|     29|		file->next = NULL;
 3003|     29|		*empty_files.last = file;
 3004|     29|		empty_files.last = &(file->next);
 3005|     58|	} else {
 3006|     58|		count++;
 3007|     58|		cache_add_entry(iso9660, file);
 3008|     58|	}
 3009|       |
 3010|     87|	if (count > 1) {
  ------------------
  |  Branch (3010:6): [True: 68, False: 19]
  ------------------
 3011|       |		/* The count is the same as number of hardlink,
 3012|       |		 * so much so that each nlinks of files in cache_file
 3013|       |		 * is overwritten by value of the count.
 3014|       |		 */
 3015|     68|		for (file = iso9660->cache_files.first;
 3016|    284|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3016:7): [True: 216, False: 68]
  ------------------
 3017|    216|			file->nlinks = count;
 3018|     68|	}
 3019|       |	/* If there are empty files, that files are added
 3020|       |	 * to the tail of the cache_files. */
 3021|     87|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3021:6): [True: 29, False: 58]
  ------------------
 3022|     29|		*iso9660->cache_files.last = empty_files.first;
 3023|     29|		iso9660->cache_files.last = empty_files.last;
 3024|     29|	}
 3025|     87|	*pfile = cache_get_entry(iso9660);
 3026|     87|	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              	return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
  ------------------
  |  |  233|     87|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3026:10): [True: 0, False: 87]
  ------------------
 3027|       |
 3028|      0|fatal_rr:
 3029|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3030|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3031|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3032|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3033|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3034|    185|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3102|    817|{
 3103|    817|	struct file_info *file;
 3104|       |
 3105|    817|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3105:6): [True: 319, False: 498]
  ------------------
 3106|    319|		iso9660->cache_files.first = file->next;
 3107|    319|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3107:7): [True: 68, False: 251]
  ------------------
 3108|     68|			iso9660->cache_files.last =
 3109|     68|			    &(iso9660->cache_files.first);
 3110|    319|	}
 3111|    817|	return (file);
 3112|    817|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3178|    764|{
 3179|    764|	uint64_t a_key, b_key, c_key;
 3180|    764|	size_t a, b, c;
 3181|    764|	struct file_info *r, *tmp;
 3182|       |
 3183|    764|	if (heap->used < 1)
  ------------------
  |  Branch (3183:6): [True: 68, False: 696]
  ------------------
 3184|     68|		return (NULL);
 3185|       |
 3186|       |	/*
 3187|       |	 * The first file in the list is the earliest; we'll return this.
 3188|       |	 */
 3189|    696|	r = heap->files[0];
 3190|       |
 3191|       |	/*
 3192|       |	 * Move the last item in the heap to the root of the tree
 3193|       |	 */
 3194|    696|	heap->files[0] = heap->files[--(heap->used)];
 3195|       |
 3196|       |	/*
 3197|       |	 * Rebalance the heap.
 3198|       |	 */
 3199|    696|	a = 0; /* Starting element and its heap key */
 3200|    696|	a_key = heap->files[a]->key;
 3201|  1.47k|	for (;;) {
 3202|  1.47k|		b = a + a + 1; /* First child */
 3203|  1.47k|		if (b >= heap->used)
  ------------------
  |  Branch (3203:7): [True: 580, False: 898]
  ------------------
 3204|    580|			return (r);
 3205|    898|		b_key = heap->files[b]->key;
 3206|    898|		c = b + 1; /* Use second child if it is smaller. */
 3207|    898|		if (c < heap->used) {
  ------------------
  |  Branch (3207:7): [True: 746, False: 152]
  ------------------
 3208|    746|			c_key = heap->files[c]->key;
 3209|    746|			if (c_key < b_key) {
  ------------------
  |  Branch (3209:8): [True: 301, False: 445]
  ------------------
 3210|    301|				b = c;
 3211|    301|				b_key = c_key;
 3212|    301|			}
 3213|    746|		}
 3214|    898|		if (a_key <= b_key)
  ------------------
  |  Branch (3214:7): [True: 116, False: 782]
  ------------------
 3215|    116|			return (r);
 3216|    782|		tmp = heap->files[a];
 3217|    782|		heap->files[a] = heap->files[b];
 3218|    782|		heap->files[b] = tmp;
 3219|    782|		a = b;
 3220|    782|	}
 3221|    696|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3094|    235|{
 3095|       |	file->next = NULL;
 3096|    235|	*iso9660->cache_files.last = file;
 3097|    235|	iso9660->cache_files.last = &(file->next);
 3098|    235|}
archive_read_support_format_iso9660.c:re_get_entry:
 3046|     68|{
 3047|     68|	struct file_info *file;
 3048|       |
 3049|     68|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3049:6): [True: 0, False: 68]
  ------------------
 3050|      0|		iso9660->re_files.first = file->re_next;
 3051|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3051:7): [True: 0, False: 0]
  ------------------
 3052|      0|			iso9660->re_files.last =
 3053|      0|			    &(iso9660->re_files.first);
 3054|      0|	}
 3055|     68|	return (file);
 3056|     68|}
archive_read_support_format_iso9660.c:read_children:
 1022|    218|{
 1023|    218|	struct iso9660 *iso9660 = a->format->data;
 1024|    218|	const unsigned char *b, *p;
 1025|    218|	struct file_info *multi;
 1026|    218|	size_t step, skip_size;
 1027|       |
 1028|       |	/* flush any remaining bytes from the last round to ensure
 1029|       |	 * we're positioned */
 1030|    218|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1030:6): [True: 0, False: 218]
  ------------------
 1031|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1032|      0|		iso9660->entry_bytes_unconsumed = 0;
 1033|      0|	}
 1034|    218|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1034:6): [True: 19, False: 199]
  ------------------
 1035|     19|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     19|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1036|     19|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1037|     19|		    parent->name.s,
 1038|     19|		    (intmax_t)iso9660->current_position,
 1039|     19|		    (intmax_t)parent->offset);
 1040|     19|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     19|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1041|     19|	}
 1042|    199|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1042:6): [True: 35, False: 164]
  ------------------
 1043|     35|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     35|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1044|     35|		    "Directory is beyond end-of-media: %s",
 1045|     35|		    parent->name.s);
 1046|     35|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     35|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1047|     35|	}
 1048|    164|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1048:6): [True: 78, False: 86]
  ------------------
 1049|     78|		int64_t skipsize;
 1050|       |
 1051|     78|		skipsize = parent->offset - iso9660->current_position;
 1052|     78|		skipsize = __archive_read_consume(a, skipsize);
 1053|     78|		if (skipsize < 0)
  ------------------
  |  Branch (1053:7): [True: 6, False: 72]
  ------------------
 1054|      6|			return ((int)skipsize);
 1055|     72|		iso9660->current_position = parent->offset;
 1056|     72|	}
 1057|       |
 1058|    158|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1059|    158|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1060|    158|	b = __archive_read_ahead(a, step, NULL);
 1061|    158|	if (b == NULL) {
  ------------------
  |  Branch (1061:6): [True: 2, False: 156]
  ------------------
 1062|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1063|      2|		    "Failed to read full block when scanning "
 1064|      2|		    "ISO9660 directory list");
 1065|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1066|      2|	}
 1067|    156|	iso9660->current_position += step;
 1068|    156|	multi = NULL;
 1069|    156|	skip_size = step;
 1070|    517|	while (step) {
  ------------------
  |  Branch (1070:9): [True: 379, False: 138]
  ------------------
 1071|    379|		p = b;
 1072|    379|		b += iso9660->logical_block_size;
 1073|    379|		step -= iso9660->logical_block_size;
 1074|   210k|		for (; p < b && b - p > DR_name_offset && *p != 0 && *p <= b - p;
  ------------------
  |  |  216|   421k|#define DR_name_offset 33
  ------------------
  |  Branch (1074:10): [True: 210k, False: 0]
  |  Branch (1074:19): [True: 210k, False: 102]
  |  Branch (1074:45): [True: 210k, False: 259]
  |  Branch (1074:56): [True: 210k, False: 0]
  ------------------
 1075|   210k|			p += *p) {
 1076|   210k|			struct file_info *child;
 1077|       |
 1078|       |			/* N.B.: these special directory identifiers
 1079|       |			 * are 8 bit "values" even on a
 1080|       |			 * Joliet CD with UCS-2 (16bit) encoding.
 1081|       |			 */
 1082|       |
 1083|       |			/* Skip '.' entry. */
 1084|   210k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   210k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1084:8): [True: 209k, False: 683]
  ------------------
 1085|   209k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  216|   209k|#define DR_name_offset 33
  ------------------
  |  Branch (1085:11): [True: 83, False: 209k]
  ------------------
 1086|     83|				continue;
 1087|       |			/* Skip '..' entry. */
 1088|   210k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   210k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1088:8): [True: 209k, False: 683]
  ------------------
 1089|   209k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  216|   209k|#define DR_name_offset 33
  ------------------
  |  Branch (1089:11): [True: 209k, False: 92]
  ------------------
 1090|   209k|				continue;
 1091|    775|			child = parse_file_info(a, parent, p, b - p);
 1092|    775|			if (child == NULL) {
  ------------------
  |  Branch (1092:8): [True: 18, False: 757]
  ------------------
 1093|     18|				__archive_read_consume(a, skip_size);
 1094|     18|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1095|     18|			}
 1096|    757|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1096:8): [True: 757, False: 0]
  ------------------
 1097|    757|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1097:9): [True: 103, False: 654]
  |  Branch (1097:32): [True: 44, False: 610]
  ------------------
 1098|    147|				struct content *con;
 1099|       |
 1100|    147|				if (multi == NULL) {
  ------------------
  |  Branch (1100:9): [True: 70, False: 77]
  ------------------
 1101|     70|					multi = child;
 1102|     70|					multi->contents.first = NULL;
 1103|     70|					multi->contents.last =
 1104|     70|					    &(multi->contents.first);
 1105|     70|				}
 1106|    147|				con = malloc(sizeof(struct content));
 1107|    147|				if (con == NULL) {
  ------------------
  |  Branch (1107:9): [True: 0, False: 147]
  ------------------
 1108|      0|					archive_set_error(
 1109|      0|					    &a->archive, ENOMEM,
 1110|      0|					    "No memory for multi extent");
 1111|      0|					__archive_read_consume(a, skip_size);
 1112|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1113|      0|				}
 1114|    147|				con->offset = child->offset;
 1115|    147|				con->size = child->size;
 1116|    147|				con->next = NULL;
 1117|    147|				*multi->contents.last = con;
 1118|    147|				multi->contents.last = &(con->next);
 1119|    147|				if (multi == child) {
  ------------------
  |  Branch (1119:9): [True: 70, False: 77]
  ------------------
 1120|     70|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  451|     70|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1120:10): [True: 0, False: 70]
  ------------------
 1121|     70|					    != ARCHIVE_OK)
  ------------------
  |  |  233|     70|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1122|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1123|     77|				} else {
 1124|     77|					multi->size += child->size;
 1125|     77|					if (!child->multi_extent)
  ------------------
  |  Branch (1125:10): [True: 44, False: 33]
  ------------------
 1126|     44|						multi = NULL;
 1127|     77|				}
 1128|    147|			} else
 1129|    610|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  451|    610|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  233|    610|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1129:9): [True: 0, False: 610]
  ------------------
 1130|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1131|    757|		}
 1132|    379|	}
 1133|       |
 1134|    138|	__archive_read_consume(a, skip_size);
 1135|       |
 1136|       |	/* Read data which recorded by RRIP "CE" extension. */
 1137|    138|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  233|    138|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1137:6): [True: 0, False: 138]
  ------------------
 1138|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1139|       |
 1140|    138|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    138|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1141|    138|}
archive_read_support_format_iso9660.c:read_CE:
 2454|    138|{
 2455|    138|	struct read_ce_queue *heap;
 2456|    138|	const unsigned char *b, *p, *end;
 2457|    138|	struct file_info *file;
 2458|    138|	size_t step;
 2459|    138|	uint64_t ce_start, ce_end;
 2460|    138|	int r;
 2461|       |
 2462|       |	/* Read data which RRIP "CE" extension points. */
 2463|    138|	heap = &(iso9660->read_ce_req);
 2464|    138|	step = iso9660->logical_block_size;
 2465|    138|	while (heap->cnt &&
  ------------------
  |  Branch (2465:9): [True: 0, False: 138]
  ------------------
 2466|      0|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2466:6): [True: 0, False: 0]
  ------------------
 2467|      0|		b = __archive_read_ahead(a, step, NULL);
 2468|      0|		if (b == NULL) {
  ------------------
  |  Branch (2468:7): [True: 0, False: 0]
  ------------------
 2469|      0|			archive_set_error(&a->archive,
 2470|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2471|      0|			    "Failed to read full block when scanning "
 2472|      0|			    "ISO9660 directory list");
 2473|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2474|      0|		}
 2475|      0|		do {
 2476|      0|			file = heap->reqs[0].file;
 2477|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2477:8): [True: 0, False: 0]
  ------------------
 2478|      0|				archive_set_error(&a->archive,
 2479|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2480|      0|				    "Malformed CE information");
 2481|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2482|      0|			}
 2483|      0|			ce_start = heap->reqs[0].offset + file->ce_offset;
 2484|      0|			ce_end = ce_start + file->ce_size;
 2485|      0|			if (ce_start < file->ce_processed_end) {
  ------------------
  |  Branch (2485:8): [True: 0, False: 0]
  ------------------
 2486|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2487|      0|				    "Invalid parameter in SUSP \"CE\" extension");
 2488|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2489|      0|			}
 2490|      0|			p = b + file->ce_offset;
 2491|      0|			end = p + file->ce_size;
 2492|      0|			file->ce_processed_end = ce_end;
 2493|      0|			next_CE(heap);
 2494|      0|			r = parse_rockridge(a, file, p, end);
 2495|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2495:8): [True: 0, False: 0]
  ------------------
 2496|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2497|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2497:12): [True: 0, False: 0]
  ------------------
 2498|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2498:7): [True: 0, False: 0]
  ------------------
 2499|       |		/* NOTE: Do not move this consume's code to front of
 2500|       |		 * do-while loop. Registration of nested CE extension
 2501|       |		 * might cause error because of current position. */
 2502|      0|		__archive_read_consume(a, step);
 2503|      0|		iso9660->current_position += step;
 2504|      0|	}
 2505|    138|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    138|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2506|    138|}
archive_read_support_format_iso9660.c:build_pathname_utf16be:
 3463|     11|{
 3464|     11|	if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
  ------------------
  |  Branch (3464:6): [True: 4, False: 7]
  |  Branch (3464:30): [True: 0, False: 4]
  ------------------
 3465|      0|		if (build_pathname_utf16be(p, max, len, file->parent) != 0)
  ------------------
  |  Branch (3465:7): [True: 0, False: 0]
  ------------------
 3466|      0|			return (-1);
 3467|      0|		if (*len + 2 > max)
  ------------------
  |  Branch (3467:7): [True: 0, False: 0]
  ------------------
 3468|      0|			return (-1);/* Path is too long! */
 3469|      0|		p[*len] = 0;
 3470|      0|		p[*len + 1] = '/';
 3471|      0|		*len += 2;
 3472|      0|	}
 3473|     11|	if (file->utf16be_bytes == 0) {
  ------------------
  |  Branch (3473:6): [True: 8, False: 3]
  ------------------
 3474|      8|		if (*len + 2 > max)
  ------------------
  |  Branch (3474:7): [True: 0, False: 8]
  ------------------
 3475|      0|			return (-1);/* Path is too long! */
 3476|      8|		p[*len] = 0;
 3477|      8|		p[*len + 1] = '.';
 3478|      8|		*len += 2;
 3479|      8|	} else {
 3480|      3|		if (*len + file->utf16be_bytes > max)
  ------------------
  |  Branch (3480:7): [True: 0, False: 3]
  ------------------
 3481|      0|			return (-1);/* Path is too long! */
 3482|      3|		memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
 3483|      3|		*len += file->utf16be_bytes;
 3484|      3|	}
 3485|     11|	return (0);
 3486|     11|}
archive_read_support_format_iso9660.c:build_pathname:
 3441|    714|{
 3442|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3443|       |	// to 1000, then something is very, very wrong.
 3444|    714|	if (depth > 1000) {
  ------------------
  |  Branch (3444:6): [True: 0, False: 714]
  ------------------
 3445|      0|		return NULL;
 3446|      0|	}
 3447|    714|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    579|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3447:6): [True: 579, False: 135]
  |  Branch (3447:30): [True: 160, False: 419]
  ------------------
 3448|    160|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3448:7): [True: 0, False: 160]
  ------------------
 3449|      0|			return NULL;
 3450|      0|		}
 3451|    160|		archive_strcat(as, "/");
 3452|    160|	}
 3453|    714|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    714|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3453:6): [True: 64, False: 650]
  ------------------
 3454|     64|		archive_strcat(as, ".");
 3455|    650|	else
 3456|    650|		archive_string_concat(as, &file->name);
 3457|    714|	return (as->s);
 3458|    714|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1472|    611|{
 1473|       |	/* Because read_next_header always does an explicit skip
 1474|       |	 * to the next entry, we don't need to do anything here. */
 1475|    611|	(void)a; /* UNUSED */
 1476|    611|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    611|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1477|    611|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1722|    838|{
 1723|    838|	struct iso9660 *iso9660 = a->format->data;
 1724|    838|	ssize_t bytes_read;
 1725|       |
 1726|    838|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1726:6): [True: 110, False: 728]
  ------------------
 1727|    110|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1728|    110|		iso9660->entry_bytes_unconsumed = 0;
 1729|    110|	}
 1730|       |
 1731|    838|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1731:6): [True: 731, False: 107]
  ------------------
 1732|    731|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1732:7): [True: 34, False: 697]
  ------------------
 1733|     34|			iso9660->entry_content = iso9660->entry_content->next;
 1734|    731|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1734:7): [True: 713, False: 18]
  ------------------
 1735|    713|			*buff = NULL;
 1736|    713|			*size = 0;
 1737|    713|			*offset = iso9660->entry_sparse_offset;
 1738|    713|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    713|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1739|    713|		}
 1740|       |		/* Seek forward to the start of the entry. */
 1741|     18|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1741:7): [True: 11, False: 7]
  ------------------
 1742|     11|			int64_t step;
 1743|       |
 1744|     11|			step = iso9660->entry_content->offset -
 1745|     11|			    iso9660->current_position;
 1746|     11|			step = __archive_read_consume(a, step);
 1747|     11|			if (step < 0)
  ------------------
  |  Branch (1747:8): [True: 1, False: 10]
  ------------------
 1748|      1|				return ((int)step);
 1749|     10|			iso9660->current_position =
 1750|     10|			    iso9660->entry_content->offset;
 1751|     10|		}
 1752|     17|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1752:7): [True: 7, False: 10]
  ------------------
 1753|      7|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1754|      7|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1755|      7|			    iso9660->pathname.s,
 1756|      7|			    (intmax_t)iso9660->entry_content->offset,
 1757|      7|			    (intmax_t)iso9660->current_position);
 1758|      7|			*buff = NULL;
 1759|      7|			*size = 0;
 1760|      7|			*offset = iso9660->entry_sparse_offset;
 1761|      7|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      7|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1762|      7|		}
 1763|     10|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1764|     10|	}
 1765|    117|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1765:6): [True: 0, False: 117]
  ------------------
 1766|      0|		return (zisofs_read_data(a, buff, size, offset));
 1767|       |
 1768|    117|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1769|    117|	if (bytes_read == 0)
  ------------------
  |  Branch (1769:6): [True: 7, False: 110]
  ------------------
 1770|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1771|      7|		    "Truncated input file");
 1772|    117|	if (*buff == NULL)
  ------------------
  |  Branch (1772:6): [True: 7, False: 110]
  ------------------
 1773|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1774|    110|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1774:6): [True: 103, False: 7]
  ------------------
 1775|    103|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1776|    110|	*size = bytes_read;
 1777|    110|	*offset = iso9660->entry_sparse_offset;
 1778|    110|	iso9660->entry_sparse_offset += bytes_read;
 1779|    110|	iso9660->entry_bytes_remaining -= bytes_read;
 1780|    110|	iso9660->entry_bytes_unconsumed = bytes_read;
 1781|    110|	iso9660->current_position += bytes_read;
 1782|    110|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    110|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1783|    117|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1787|  3.49k|{
 1788|  3.49k|	struct iso9660 *iso9660 = a->format->data;
 1789|  3.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  3.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1790|       |
 1791|  3.49k|	release_files(iso9660);
 1792|  3.49k|	free(iso9660->read_ce_req.reqs);
 1793|  3.49k|	archive_string_free(&iso9660->pathname);
 1794|  3.49k|	archive_string_free(&iso9660->previous_pathname);
 1795|  3.49k|	free(iso9660->pending_files.files);
 1796|  3.49k|#ifdef HAVE_ZLIB_H
 1797|  3.49k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1798|  3.49k|	free(iso9660->entry_zisofs.block_pointers);
 1799|  3.49k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1799:6): [True: 0, False: 3.49k]
  ------------------
 1800|      0|		if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
  ------------------
  |  Branch (1800:7): [True: 0, False: 0]
  ------------------
 1801|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1802|      0|			    "Failed to clean up zlib decompressor");
 1803|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1804|      0|		}
 1805|      0|	}
 1806|  3.49k|#endif
 1807|  3.49k|	free(iso9660->utf16be_path);
 1808|  3.49k|	free(iso9660->utf16be_previous_path);
 1809|  3.49k|	free(iso9660);
 1810|       |	a->format->data = NULL;
 1811|  3.49k|	return (r);
 1812|  3.49k|}
archive_read_support_format_iso9660.c:release_files:
 2766|  3.49k|{
 2767|  3.49k|	struct content *con, *connext;
 2768|  3.49k|	struct file_info *file;
 2769|       |
 2770|  3.49k|	file = iso9660->use_files;
 2771|  4.39k|	while (file != NULL) {
  ------------------
  |  Branch (2771:9): [True: 893, False: 3.49k]
  ------------------
 2772|    893|		struct file_info *next = file->use_next;
 2773|       |
 2774|    893|		archive_string_free(&file->name);
 2775|    893|		archive_string_free(&file->symlink);
 2776|    893|		free(file->utf16be_name);
 2777|    893|		con = file->contents.first;
 2778|  1.04k|		while (con != NULL) {
  ------------------
  |  Branch (2778:10): [True: 147, False: 893]
  ------------------
 2779|    147|			connext = con->next;
 2780|    147|			free(con);
 2781|    147|			con = connext;
 2782|    147|		}
 2783|    893|		free(file);
 2784|    893|		file = next;
 2785|    893|	}
 2786|  3.49k|}

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

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

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

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

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

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

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

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

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

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

archive_string_sprintf:
   77|  56.2k|{
   78|  56.2k|	va_list ap;
   79|       |
   80|  56.2k|	va_start(ap, fmt);
   81|  56.2k|	archive_string_vsprintf(as, fmt, ap);
   82|       |	va_end(ap);
   83|  56.2k|}
archive_string_vsprintf:
   92|   156k|{
   93|   156k|	char long_flag;
   94|   156k|	intmax_t s; /* Signed integer temp. */
   95|   156k|	uintmax_t u; /* Unsigned integer temp. */
   96|   156k|	const char *p, *p2;
   97|   156k|	const wchar_t *pw;
   98|       |
   99|   156k|	if (archive_string_ensure(as, 64) == NULL)
  ------------------
  |  Branch (99:6): [True: 0, False: 156k]
  ------------------
  100|      0|		__archive_errx(1, "Out of memory");
  101|       |
  102|   156k|	if (fmt == NULL) {
  ------------------
  |  Branch (102:6): [True: 0, False: 156k]
  ------------------
  103|      0|		as->s[0] = 0;
  104|      0|		return;
  105|      0|	}
  106|       |
  107|  4.70M|	for (p = fmt; *p != '\0'; p++) {
  ------------------
  |  Branch (107:16): [True: 4.54M, False: 156k]
  ------------------
  108|  4.54M|		const char *saved_p = p;
  109|       |
  110|  4.54M|		if (*p != '%') {
  ------------------
  |  Branch (110:7): [True: 4.35M, False: 197k]
  ------------------
  111|  4.35M|			archive_strappend_char(as, *p);
  112|  4.35M|			continue;
  113|  4.35M|		}
  114|       |
  115|   197k|		p++;
  116|       |
  117|   197k|		long_flag = '\0';
  118|   197k|		switch(*p) {
  ------------------
  |  Branch (118:10): [True: 55.6k, False: 141k]
  ------------------
  119|    551|		case 'l':
  ------------------
  |  Branch (119:3): [True: 551, False: 196k]
  ------------------
  120|    551|			if (p[1] == 'l') {
  ------------------
  |  Branch (120:8): [True: 549, False: 2]
  ------------------
  121|    549|				long_flag = 'L';
  122|    549|				p += 2;
  123|    549|				break;
  124|    549|			}
  125|      2|			__LA_FALLTHROUGH;
  126|  32.9k|		case 'j':
  ------------------
  |  Branch (126:3): [True: 32.9k, False: 164k]
  ------------------
  127|  55.0k|		case 'z':
  ------------------
  |  Branch (127:3): [True: 22.1k, False: 175k]
  ------------------
  128|  55.0k|			long_flag = *p;
  129|  55.0k|			p++;
  130|  55.0k|			break;
  131|   197k|		}
  132|       |
  133|   197k|		switch (*p) {
  134|      0|		case '%':
  ------------------
  |  Branch (134:3): [True: 0, False: 197k]
  ------------------
  135|      0|			archive_strappend_char(as, '%');
  136|      0|			break;
  137|    708|		case 'c':
  ------------------
  |  Branch (137:3): [True: 708, False: 196k]
  ------------------
  138|    708|			s = va_arg(ap, int);
  139|    708|			archive_strappend_char(as, (char)s);
  140|    708|			break;
  141|   107k|		case 'd':
  ------------------
  |  Branch (141:3): [True: 107k, False: 90.0k]
  ------------------
  142|   107k|			switch(long_flag) {
  143|  26.3k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (143:4): [True: 26.3k, False: 80.9k]
  ------------------
  144|      0|			case 'l': s = va_arg(ap, long); break;
  ------------------
  |  Branch (144:4): [True: 0, False: 107k]
  ------------------
  145|    545|			case 'L': s = va_arg(ap, long long); break;
  ------------------
  |  Branch (145:4): [True: 545, False: 106k]
  ------------------
  146|      0|			case 'z': s = va_arg(ap, ssize_t); break;
  ------------------
  |  Branch (146:4): [True: 0, False: 107k]
  ------------------
  147|  80.4k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (147:4): [True: 80.4k, False: 26.8k]
  ------------------
  148|   107k|			}
  149|   107k|			append_int(as, s, 10);
  150|   107k|			break;
  151|  55.8k|		case 's':
  ------------------
  |  Branch (151:3): [True: 55.8k, False: 141k]
  ------------------
  152|  55.8k|			switch(long_flag) {
  153|      0|			case 'l':
  ------------------
  |  Branch (153:4): [True: 0, False: 55.8k]
  ------------------
  154|      0|			case 'L':
  ------------------
  |  Branch (154:4): [True: 0, False: 55.8k]
  ------------------
  155|      0|				pw = va_arg(ap, wchar_t *);
  156|      0|				if (pw == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 0]
  ------------------
  157|      0|					pw = L"(null)";
  158|      0|				if (archive_string_append_from_wcs(as, pw,
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|				    wcslen(pw)) != 0 && errno == ENOMEM)
  ------------------
  |  Branch (159:29): [True: 0, False: 0]
  ------------------
  160|      0|					__archive_errx(1, "Out of memory");
  161|      0|				break;
  162|  55.8k|			default:
  ------------------
  |  Branch (162:4): [True: 55.8k, False: 0]
  ------------------
  163|  55.8k|				p2 = va_arg(ap, char *);
  164|  55.8k|				if (p2 == NULL)
  ------------------
  |  Branch (164:9): [True: 2, False: 55.8k]
  ------------------
  165|      2|					p2 = "(null)";
  166|  55.8k|				archive_strcat(as, p2);
  167|  55.8k|				break;
  168|  55.8k|			}
  169|  55.8k|			break;
  170|  55.8k|		case 'S':
  ------------------
  |  Branch (170:3): [True: 0, False: 197k]
  ------------------
  171|      0|			pw = va_arg(ap, wchar_t *);
  172|      0|			if (pw == NULL)
  ------------------
  |  Branch (172:8): [True: 0, False: 0]
  ------------------
  173|      0|				pw = L"(null)";
  174|      0|			if (archive_string_append_from_wcs(as, pw,
  ------------------
  |  Branch (174:8): [True: 0, False: 0]
  ------------------
  175|      0|			    wcslen(pw)) != 0 && errno == ENOMEM)
  ------------------
  |  Branch (175:28): [True: 0, False: 0]
  ------------------
  176|      0|				__archive_errx(1, "Out of memory");
  177|      0|			break;
  178|  33.4k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (178:3): [True: 0, False: 197k]
  |  Branch (178:13): [True: 33.4k, False: 163k]
  |  Branch (178:23): [True: 15, False: 197k]
  |  Branch (178:33): [True: 5, False: 197k]
  ------------------
  179|       |			/* Common handling for unsigned integer formats. */
  180|  33.4k|			switch(long_flag) {
  181|  6.60k|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (181:4): [True: 6.60k, False: 26.8k]
  ------------------
  182|      2|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (182:4): [True: 2, False: 33.4k]
  ------------------
  183|      4|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (183:4): [True: 4, False: 33.4k]
  ------------------
  184|  22.1k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (184:4): [True: 22.1k, False: 11.3k]
  ------------------
  185|  4.73k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (185:4): [True: 4.73k, False: 28.7k]
  ------------------
  186|  33.4k|			}
  187|       |			/* Format it in the correct base. */
  188|  33.4k|			switch (*p) {
  189|      0|			case 'o': append_uint(as, u, 8); break;
  ------------------
  |  Branch (189:4): [True: 0, False: 33.4k]
  ------------------
  190|  33.4k|			case 'u': append_uint(as, u, 10); break;
  ------------------
  |  Branch (190:4): [True: 33.4k, False: 20]
  ------------------
  191|     20|			default: append_uint(as, u, 16); break;
  ------------------
  |  Branch (191:4): [True: 20, False: 33.4k]
  ------------------
  192|  33.4k|			}
  193|  33.4k|			break;
  194|  33.4k|		default:
  ------------------
  |  Branch (194:3): [True: 8, False: 197k]
  ------------------
  195|       |			/* Rewind and print the initial '%' literally. */
  196|      8|			p = saved_p;
  197|      8|			archive_strappend_char(as, *p);
  198|   197k|		}
  199|   197k|	}
  200|   156k|}
archive_string_sprintf.c:append_int:
   63|   107k|{
   64|   107k|	uintmax_t ud;
   65|       |
   66|   107k|	if (d < 0) {
  ------------------
  |  Branch (66:6): [True: 8.58k, False: 98.7k]
  ------------------
   67|  8.58k|		archive_strappend_char(as, '-');
   68|  8.58k|		ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
  ------------------
  |  Branch (68:8): [True: 21, False: 8.56k]
  ------------------
   69|  8.58k|	} else
   70|  98.7k|		ud = d;
   71|   107k|	append_uint(as, ud, base);
   72|   107k|}
archive_string_sprintf.c:append_uint:
   54|   258k|{
   55|   258k|	static const char digits[] = "0123456789abcdef";
   56|   258k|	if (d >= base)
  ------------------
  |  Branch (56:6): [True: 118k, False: 140k]
  ------------------
   57|   118k|		append_uint(as, d/base, base);
   58|   258k|	archive_strappend_char(as, digits[d % base]);
   59|   258k|}

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

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

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

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

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

